From 06e5221e81aa9c70753125f345beddd3fbf90f9c Mon Sep 17 00:00:00 2001 From: Siddharth Vaghasia Date: Fri, 18 Jul 2025 19:06:00 +0530 Subject: [PATCH 1/5] Added New command Get-PnPPowerAppPermissionList --- src/ALC/PnP.PowerShell.ALC.csproj | 1 + .../PowerApp/PowerAppPermissions.cs | 13 ++++ .../PowerApp/PowerAppPermissionsPrincipal.cs | 14 +++++ .../PowerApp/PowerAppPermissionsProperties.cs | 16 +++++ .../PowerApp/PowerAppPermissionsValue.cs | 12 ++++ src/Commands/PnP.PowerShell.csproj | 2 +- .../PowerApps/GetPowerAppPermissionList.cs | 59 +++++++++++++++++++ 7 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs create mode 100644 src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs create mode 100644 src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs create mode 100644 src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs create mode 100644 src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs diff --git a/src/ALC/PnP.PowerShell.ALC.csproj b/src/ALC/PnP.PowerShell.ALC.csproj index a6f03847b..947720665 100644 --- a/src/ALC/PnP.PowerShell.ALC.csproj +++ b/src/ALC/PnP.PowerShell.ALC.csproj @@ -8,6 +8,7 @@ + diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs new file mode 100644 index 000000000..33e145004 --- /dev/null +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs @@ -0,0 +1,13 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp +{ + public class PowerAppPermissions + { + public List value { get; set; } + } +} + diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs new file mode 100644 index 000000000..c3d71f722 --- /dev/null +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs @@ -0,0 +1,14 @@ + +namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp +{ + public class PowerAppPermissionsPrincipal + { + public string id { get; set; } + public string displayName { get; set; } + public string email { get; set; } + public string type { get; set; } + public string tenantId { get; set; } + public string preferredLanguage { get; set; } + } + +} \ No newline at end of file diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs new file mode 100644 index 000000000..e5270496a --- /dev/null +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs @@ -0,0 +1,16 @@ +using System; + +namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp +{ + public class PowerAppPermissionsProperties + { + public string roleName { get; set; } + public PowerAppPermissionsPrincipal principal { get; set; } + public string scope { get; set; } + public string notifyShareTargetOption { get; set; } + public bool inviteGuestToTenant { get; set; } + public DateTime createdOn { get; set; } + public string createdBy { get; set; } + } + +} \ No newline at end of file diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs new file mode 100644 index 000000000..eac5eb4ed --- /dev/null +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs @@ -0,0 +1,12 @@ + +namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp +{ + public class PowerAppPermissionsValue + { + public string name { get; set; } + public string id { get; set; } + public string type { get; set; } + public PowerAppPermissionsProperties properties { get; set; } + } + +} \ No newline at end of file diff --git a/src/Commands/PnP.PowerShell.csproj b/src/Commands/PnP.PowerShell.csproj index 8af4f2f51..a8b5d0663 100644 --- a/src/Commands/PnP.PowerShell.csproj +++ b/src/Commands/PnP.PowerShell.csproj @@ -65,7 +65,7 @@ - + diff --git a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs new file mode 100644 index 000000000..da045dbf7 --- /dev/null +++ b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs @@ -0,0 +1,59 @@ +using PnP.PowerShell.Commands.Base; +using PnP.PowerShell.Commands.Base.PipeBinds; +using PnP.PowerShell.Commands.Utilities; +using System; +using System.Linq; +using System.Management.Automation; +using System.Text.Json; + +namespace PnP.PowerShell.Commands.PowerPlatform.PowerApps +{ + [Cmdlet(VerbsCommon.Get, "PnPPowerAppPermissionList")] + [OutputType(typeof(Model.PowerPlatform.PowerApp.PowerApp))] + public class GetPowerAppPermissionList : PnPAzureManagementApiCmdlet + { + [Parameter(Mandatory = false, ValueFromPipeline = true)] + public PowerPlatformEnvironmentPipeBind Environment; + + [Parameter(Mandatory = false)] + public SwitchParameter AsAdmin; + + [Parameter(Mandatory = true)] + public PowerAppPipeBind Identity; + + protected override void ExecuteCmdlet() + { + string environmentName = null; + string powerAppsUrl = PowerPlatformUtility.GetPowerAppsEndpoint(Connection.AzureEnvironment); + if (ParameterSpecified(nameof(Environment))) + { + environmentName = Environment.GetName(); + + WriteVerbose($"Using environment as provided '{environmentName}'"); + } + else + { + environmentName = ParameterSpecified(nameof(Environment)) ? Environment.GetName() : PowerPlatformUtility.GetDefaultEnvironment(ArmRequestHelper, Connection.AzureEnvironment)?.Name; + + if (string.IsNullOrEmpty(environmentName)) + { + throw new Exception($"No default environment found, please pass in a specific environment name using the {nameof(Environment)} parameter"); + } + + WriteVerbose($"Using default environment as retrieved '{environmentName}'"); + } + + if (ParameterSpecified(nameof(Identity))) + { + var appName = Identity.GetName(); + + WriteVerbose($"Retrieving specific PowerApp permissions with the provided name '{appName}' within the environment '{environmentName}'"); + + var result = PowerAppsRequestHelper.GetResultCollection($"{powerAppsUrl}/providers/Microsoft.PowerApps{(AsAdmin ? "/scopes/admin/environments/" + environmentName : "")}/apps/{appName}/permissions?api-version=2022-11-01"); + + WriteObject(result, true); + } + + } + } +} \ No newline at end of file From b82e2a84a347543e49b9919ac087f43bf6db3ae5 Mon Sep 17 00:00:00 2001 From: Siddharth Vaghasia Date: Fri, 18 Jul 2025 22:11:03 +0530 Subject: [PATCH 2/5] updated command name and add documentation --- .../Get-PnPPowerAppPermissionList.md | 134 ++++++++++++++++++ ...ssionList.cs => GetPowerAppPermissions.cs} | 4 +- 2 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 documentation/Get-PnPPowerAppPermissionList.md rename src/Commands/PowerPlatform/PowerApps/{GetPowerAppPermissionList.cs => GetPowerAppPermissions.cs} (94%) diff --git a/documentation/Get-PnPPowerAppPermissionList.md b/documentation/Get-PnPPowerAppPermissionList.md new file mode 100644 index 000000000..2f5f59747 --- /dev/null +++ b/documentation/Get-PnPPowerAppPermissionList.md @@ -0,0 +1,134 @@ +--- +Module Name: PnP.PowerShell +schema: 2.0.0 +applicable: SharePoint Online +online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerAppPermissions.html +external help file: PnP.PowerShell.dll-Help.xml +title: Get-PnPPowerAppPermissions +--- + +# Get-PnPPowerAppPermissions + +## SYNOPSIS + +**Required Permissions** + +* Azure: management.azure.com +* PowerApps: service.powerapps.com + +Returns the list of permissions assigned to a specified Power App. + +## SYNTAX + +```powershell +Get-PnPPowerAppPermissions [-Environment ] [-AsAdmin] -Identity +[-Connection ] [-Verbose] +``` + +## DESCRIPTION + +This cmdlet returns the list of user or group permissions granted to a specific Power App. + +## EXAMPLES + +### Example 1 + +```powershell +Get-PnPPowerAppPermissions -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" +``` + +Returns the list of permissions for the specified Power App in the default environment. + +### Example 2 + +```powershell +Get-PnPPowerAppPermissions -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" -AsAdmin +``` + +Returns the list of permissions for the specified Power App in the given environment using admin context. + +## PARAMETERS + +### -Environment + +The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used. + +```yaml +Type: PowerPlatformEnvironmentPipeBind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: The default environment +Accept pipeline input: True +Accept wildcard characters: False +``` + +### -AsAdmin + +If specified, returns permissions using admin privileges. If not specified, only permissions for the current user will be returned. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Identity + +The ID of the Power App to retrieve permissions for. + +```yaml +Type: PowerAppPipeBind +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Connection + +Optional connection to be used by the cmdlet. +Retrieve the value for this parameter by either specifying `-ReturnConnection` on `Connect-PnPOnline` or by executing `Get-PnPConnection`. + +```yaml +Type: PnPConnection +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Verbose + +When provided, additional debug statements will be shown while executing the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +## RELATED LINKS + +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) diff --git a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs similarity index 94% rename from src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs rename to src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs index da045dbf7..5b9276c90 100644 --- a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissionList.cs +++ b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs @@ -8,9 +8,9 @@ namespace PnP.PowerShell.Commands.PowerPlatform.PowerApps { - [Cmdlet(VerbsCommon.Get, "PnPPowerAppPermissionList")] + [Cmdlet(VerbsCommon.Get, "PnPPowerAppPermissions")] [OutputType(typeof(Model.PowerPlatform.PowerApp.PowerApp))] - public class GetPowerAppPermissionList : PnPAzureManagementApiCmdlet + public class GetPowerAppPermissions : PnPAzureManagementApiCmdlet { [Parameter(Mandatory = false, ValueFromPipeline = true)] public PowerPlatformEnvironmentPipeBind Environment; From ddb855d61d81d10a0db8715abfdc0af5fbdb94ce Mon Sep 17 00:00:00 2001 From: KoenZomers Date: Thu, 21 Aug 2025 01:53:34 +0200 Subject: [PATCH 3/5] Code cleanup and some small adjustments --- ...ssionList.md => Get-PnPPowerAppPermission.md} | 16 ++++++++-------- resources/PnP.PowerShell.Format.ps1xml | 2 +- src/ALC/PnP.PowerShell.ALC.csproj | 1 - .../PowerApp/PowerAppPermissionsPrincipal.cs | 13 ++++++------- .../PowerApp/PowerAppPermissionsProperties.cs | 15 +++++++-------- .../PowerApp/PowerAppPermissionsValue.cs | 9 ++++----- ...ppPermissions.cs => GetPowerAppPermission.cs} | 12 +++++------- 7 files changed, 31 insertions(+), 37 deletions(-) rename documentation/{Get-PnPPowerAppPermissionList.md => Get-PnPPowerAppPermission.md} (81%) rename src/Commands/PowerPlatform/PowerApps/{GetPowerAppPermissions.cs => GetPowerAppPermission.cs} (88%) diff --git a/documentation/Get-PnPPowerAppPermissionList.md b/documentation/Get-PnPPowerAppPermission.md similarity index 81% rename from documentation/Get-PnPPowerAppPermissionList.md rename to documentation/Get-PnPPowerAppPermission.md index 2f5f59747..26427cb04 100644 --- a/documentation/Get-PnPPowerAppPermissionList.md +++ b/documentation/Get-PnPPowerAppPermission.md @@ -2,12 +2,12 @@ Module Name: PnP.PowerShell schema: 2.0.0 applicable: SharePoint Online -online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerAppPermissions.html +online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPowerAppPermission.html external help file: PnP.PowerShell.dll-Help.xml -title: Get-PnPPowerAppPermissions +title: Get-PnPPowerAppPermission --- -# Get-PnPPowerAppPermissions +# Get-PnPPowerAppPermission ## SYNOPSIS @@ -21,7 +21,7 @@ Returns the list of permissions assigned to a specified Power App. ## SYNTAX ```powershell -Get-PnPPowerAppPermissions [-Environment ] [-AsAdmin] -Identity +Get-PnPPowerAppPermission [-Environment ] [-AsAdmin] -Identity [-Connection ] [-Verbose] ``` @@ -34,7 +34,7 @@ This cmdlet returns the list of user or group permissions granted to a specific ### Example 1 ```powershell -Get-PnPPowerAppPermissions -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" +Get-PnPPowerAppPermission -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" ``` Returns the list of permissions for the specified Power App in the default environment. @@ -42,7 +42,7 @@ Returns the list of permissions for the specified Power App in the default envir ### Example 2 ```powershell -Get-PnPPowerAppPermissions -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" -AsAdmin +Get-PnPPowerAppPermission -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity "bde2239e-fabc-42ad-9c9e-72323413b1b0" -AsAdmin ``` Returns the list of permissions for the specified Power App in the given environment using admin context. @@ -83,7 +83,7 @@ Accept wildcard characters: False ### -Identity -The ID of the Power App to retrieve permissions for. +The ID or instance of the Power App to retrieve permissions for. ```yaml Type: PowerAppPipeBind @@ -131,4 +131,4 @@ Accept wildcard characters: False ## RELATED LINKS -[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) \ No newline at end of file diff --git a/resources/PnP.PowerShell.Format.ps1xml b/resources/PnP.PowerShell.Format.ps1xml index 4f1f4ce5c..3c6583549 100644 --- a/resources/PnP.PowerShell.Format.ps1xml +++ b/resources/PnP.PowerShell.Format.ps1xml @@ -3252,6 +3252,6 @@ - + \ No newline at end of file diff --git a/src/ALC/PnP.PowerShell.ALC.csproj b/src/ALC/PnP.PowerShell.ALC.csproj index 947720665..a6f03847b 100644 --- a/src/ALC/PnP.PowerShell.ALC.csproj +++ b/src/ALC/PnP.PowerShell.ALC.csproj @@ -8,7 +8,6 @@ - diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs index c3d71f722..29241529c 100644 --- a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsPrincipal.cs @@ -3,12 +3,11 @@ namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp { public class PowerAppPermissionsPrincipal { - public string id { get; set; } - public string displayName { get; set; } - public string email { get; set; } - public string type { get; set; } - public string tenantId { get; set; } - public string preferredLanguage { get; set; } + public string Id { get; set; } + public string DisplayName { get; set; } + public string Email { get; set; } + public string Type { get; set; } + public string TenantId { get; set; } + public string PreferredLanguage { get; set; } } - } \ No newline at end of file diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs index e5270496a..b10eb9caf 100644 --- a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsProperties.cs @@ -4,13 +4,12 @@ namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp { public class PowerAppPermissionsProperties { - public string roleName { get; set; } - public PowerAppPermissionsPrincipal principal { get; set; } - public string scope { get; set; } - public string notifyShareTargetOption { get; set; } - public bool inviteGuestToTenant { get; set; } - public DateTime createdOn { get; set; } - public string createdBy { get; set; } + public string RoleName { get; set; } + public PowerAppPermissionsPrincipal Principal { get; set; } + public string Scope { get; set; } + public string NotifyShareTargetOption { get; set; } + public bool InviteGuestToTenant { get; set; } + public DateTime CreatedOn { get; set; } + public string CreatedBy { get; set; } } - } \ No newline at end of file diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs index eac5eb4ed..cc90ada01 100644 --- a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs @@ -3,10 +3,9 @@ namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp { public class PowerAppPermissionsValue { - public string name { get; set; } - public string id { get; set; } - public string type { get; set; } - public PowerAppPermissionsProperties properties { get; set; } + public string Name { get; set; } + public string Id { get; set; } + public string Type { get; set; } + public PowerAppPermissionsProperties Properties { get; set; } } - } \ No newline at end of file diff --git a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs similarity index 88% rename from src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs rename to src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs index 5b9276c90..ad6c538a7 100644 --- a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermissions.cs +++ b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs @@ -4,13 +4,12 @@ using System; using System.Linq; using System.Management.Automation; -using System.Text.Json; namespace PnP.PowerShell.Commands.PowerPlatform.PowerApps { - [Cmdlet(VerbsCommon.Get, "PnPPowerAppPermissions")] + [Cmdlet(VerbsCommon.Get, "PnPPowerAppPermission")] [OutputType(typeof(Model.PowerPlatform.PowerApp.PowerApp))] - public class GetPowerAppPermissions : PnPAzureManagementApiCmdlet + public class GetPowerAppPermission : PnPAzureManagementApiCmdlet { [Parameter(Mandatory = false, ValueFromPipeline = true)] public PowerPlatformEnvironmentPipeBind Environment; @@ -18,12 +17,12 @@ public class GetPowerAppPermissions : PnPAzureManagementApiCmdlet [Parameter(Mandatory = false)] public SwitchParameter AsAdmin; - [Parameter(Mandatory = true)] + [Parameter(Mandatory = true, ValueFromPipeline = true)] public PowerAppPipeBind Identity; protected override void ExecuteCmdlet() { - string environmentName = null; + string environmentName; string powerAppsUrl = PowerPlatformUtility.GetPowerAppsEndpoint(Connection.AzureEnvironment); if (ParameterSpecified(nameof(Environment))) { @@ -51,9 +50,8 @@ protected override void ExecuteCmdlet() var result = PowerAppsRequestHelper.GetResultCollection($"{powerAppsUrl}/providers/Microsoft.PowerApps{(AsAdmin ? "/scopes/admin/environments/" + environmentName : "")}/apps/{appName}/permissions?api-version=2022-11-01"); - WriteObject(result, true); + WriteObject(result.Select(p => p.Properties), true); } - } } } \ No newline at end of file From cc8473998efa78047db63ae8402bf284c4bd6012 Mon Sep 17 00:00:00 2001 From: KoenZomers Date: Thu, 21 Aug 2025 01:54:47 +0200 Subject: [PATCH 4/5] Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe3fb2c51..963ff89f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Added `Add-PnPBrandCenterFontPackage` cmdlet to allow creating a font package in the Brand Center [#4970](https://github.com/pnp/powershell/pull/4970) - Added support for `-FederatedIdentity` in `Connect-PnPOnline` to support Federated Identity. - Added support for SSO in WSL (Windows Subsystem for Linux) and Linux distributions. You can now use `Connect-PnPOnline` with `-OSLogin` which helps with more secure auth such as FIDO, Conditional Access policies etc. +- Added `Get-PnPPowerAppPermission` cmdlet to retrieve the permissions for a specific Power App [#5030](https://github.com/pnp/powershell/pull/5030) ### Changed - Improved `Get-PnPTerm` cmdlet to show a better error message. [#4933](https://github.com/pnp/powershell/pull/4933) From 5f9e9d862a070fcc5b8bf8ed6d35e49dfd3479cd Mon Sep 17 00:00:00 2001 From: KoenZomers Date: Thu, 21 Aug 2025 01:58:07 +0200 Subject: [PATCH 5/5] Further cleanup --- ...AppPermissionsValue.cs => PowerAppPermission.cs} | 5 ++++- .../PowerPlatform/PowerApp/PowerAppPermissions.cs | 13 ------------- .../PowerApps/GetPowerAppPermission.cs | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) rename src/Commands/Model/PowerPlatform/PowerApp/{PowerAppPermissionsValue.cs => PowerAppPermission.cs} (68%) delete mode 100644 src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermission.cs similarity index 68% rename from src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs rename to src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermission.cs index cc90ada01..61946f615 100644 --- a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissionsValue.cs +++ b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermission.cs @@ -1,7 +1,10 @@  namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp { - public class PowerAppPermissionsValue + /// + /// Definition of a permission set for a Power App + /// + public class PowerAppPermission { public string Name { get; set; } public string Id { get; set; } diff --git a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs b/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs deleted file mode 100644 index 33e145004..000000000 --- a/src/Commands/Model/PowerPlatform/PowerApp/PowerAppPermissions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PnP.PowerShell.Commands.Model.PowerPlatform.PowerApp -{ - public class PowerAppPermissions - { - public List value { get; set; } - } -} - diff --git a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs index ad6c538a7..36bc35bd1 100644 --- a/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs +++ b/src/Commands/PowerPlatform/PowerApps/GetPowerAppPermission.cs @@ -48,7 +48,7 @@ protected override void ExecuteCmdlet() WriteVerbose($"Retrieving specific PowerApp permissions with the provided name '{appName}' within the environment '{environmentName}'"); - var result = PowerAppsRequestHelper.GetResultCollection($"{powerAppsUrl}/providers/Microsoft.PowerApps{(AsAdmin ? "/scopes/admin/environments/" + environmentName : "")}/apps/{appName}/permissions?api-version=2022-11-01"); + var result = PowerAppsRequestHelper.GetResultCollection($"{powerAppsUrl}/providers/Microsoft.PowerApps{(AsAdmin ? "/scopes/admin/environments/" + environmentName : "")}/apps/{appName}/permissions?api-version=2022-11-01"); WriteObject(result.Select(p => p.Properties), true); }