-
Notifications
You must be signed in to change notification settings - Fork 38
Policy Unit Testing #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Policy Unit Testing #751
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9e40dbe
Added unit test cases for New-MgPolicyPermissionGrantPolicy,New-Entra…
v-akarke c00b1cc
main pull
v-akarke 8a721bd
Added test cases for Set-EntraMSPermissionGrantPolicy,Add-EntraMSLif…
v-akarke 870c431
added test case for Get-EntraMSServicePrincipalDelegatedPermissionCla…
v-akarke f57cf2f
main pull
v-akarke 88d728d
added test case for Get-EntraBetaMSPermissionGrantPolicy
v-akarke 5910000
Merge branch 'main' of https://github.com/microsoftgraph/entra-powers…
v-uansari d5639b8
added licance and removed MS
v-uansari d53a1b2
fixed CertificateAuthorities issue
v-akarke b3da3a0
conflict
snehalkotwal e41da2d
conflict
snehalkotwal 0bbdb3c
updated mock test cases
snehalkotwal 7517a17
conflict
snehalkotwal 15b807b
updated mock test cases
snehalkotwal b1405cb
updated
snehalkotwal 96562fb
conflict
snehalkotwal 9f31257
updated
snehalkotwal 210d9e8
Merge branch 'main' into Mock-Testing-Policy
v-akarke 24f7ef6
Merge branch 'main' into Mock-Testing-Policy
KenitoInc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
| BeforeAll { | ||
| if ((Get-Module -Name Microsoft.Graph.Entra) -eq $null) { | ||
| Import-Module Microsoft.Graph.Entra | ||
| } | ||
| Import-Module (Join-Path $psscriptroot "..\Common-Functions.ps1") -Force | ||
|
|
||
| $scriptblock = { | ||
| return @( | ||
| [PSCustomObject]@{ | ||
| "Value" = "True" | ||
| "AdditionalProperties" = "{[@odata.context, https://graph.microsoft.com/v1.0/$metadata#Edm.Boolean]}" | ||
| "Parameters" = $args | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| Mock -CommandName Add-MgGroupToLifecyclePolicy -MockWith $scriptblock -ModuleName Microsoft.Graph.Entra | ||
| } | ||
|
|
||
| Describe "Add-EntraLifecyclePolicyGroup" { | ||
| Context "Test for Add-EntraLifecyclePolicyGroup" { | ||
| It "Should return created LifecyclePolicyGroup" { | ||
| $result = Add-EntraLifecyclePolicyGroup -Id "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" -GroupId "11bb11bb-cc22-dd33-ee44-55ff55ff55ff | ||
| $result | Should -Not -BeNullOrEmpty" | ||
| $result.Value | should -Be "True" | ||
|
|
||
| Should -Invoke -CommandName Add-MgGroupToLifecyclePolicy -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when Id is invalid" { | ||
| { Add-EntraLifecyclePolicyGroup -Id "" -GroupId "11bb11bb-cc22-dd33-ee44-55ff55ff55ff" } | Should -Throw "Cannot bind argument to parameter 'Id' because it is an empty string.*" | ||
| } | ||
| It "Should fail when Id is empty" { | ||
| { Add-EntraLifecyclePolicyGroup -Id -GroupId "11bb11bb-cc22-dd33-ee44-55ff55ff55ff" } | Should -Throw "Missing an argument for parameter 'Id'.*" | ||
| } | ||
| It "Should fail when GroupId is invalid" { | ||
| { Add-EntraLifecyclePolicyGroup -Id "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" -GroupId "" } | Should -Throw "Cannot bind argument to parameter 'GroupId' because it is an empty string.*" | ||
| } | ||
| It "Should fail when GroupId is empty" { | ||
| { Add-EntraLifecyclePolicyGroup -Id "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" -GroupId } | Should -Throw "Missing an argument for parameter 'GroupId'.*" | ||
| } | ||
| It "Should contain 'User-Agent' header" { | ||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Add-EntraLifecyclePolicyGroup" | ||
|
|
||
| Add-EntraLifecyclePolicyGroup -Id "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" -GroupId "11bb11bb-cc22-dd33-ee44-55ff55ff55ff" | ||
|
|
||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Add-EntraLifecyclePolicyGroup" | ||
|
|
||
| Should -Invoke -CommandName Add-MgGroupToLifecyclePolicy -ModuleName Microsoft.Graph.Entra -Times 1 -ParameterFilter { | ||
| $Headers.'User-Agent' | Should -Be $userAgentHeaderValue | ||
| $true | ||
| } | ||
| } | ||
| It "Should execute successfully without throwing an error" { | ||
| # Disable confirmation prompts | ||
| $originalDebugPreference = $DebugPreference | ||
| $DebugPreference = 'Continue' | ||
|
|
||
| try { | ||
| # Act & Assert: Ensure the function doesn't throw an exception | ||
| { Add-EntraLifecyclePolicyGroup -Id "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" -GroupId "11bb11bb-cc22-dd33-ee44-55ff55ff55ff" -Debug } | Should -Not -Throw | ||
| } finally { | ||
| # Restore original confirmation preference | ||
| $DebugPreference = $originalDebugPreference | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
| BeforeAll { | ||
| if ((Get-Module -Name Microsoft.Graph.Entra) -eq $null) { | ||
| Import-Module Microsoft.Graph.Entra | ||
| } | ||
| Import-Module (Join-Path $psscriptroot "..\Common-Functions.ps1") -Force | ||
|
|
||
| $scriptblock = { | ||
| return @( | ||
| [PSCustomObject]@{ | ||
| "DefaultUserRolePermissions" = @{AllowedToCreateApps = "False"; AllowedToCreateSecurityGroups = "False"; AllowedToCreateTenants = "True"; | ||
| AllowedToReadBitlockerKeysForOwnedDevice = "True"; AllowedToReadOtherUsers = "False"; PermissionGrantPoliciesAssigned = ""; | ||
| AdditionalProperties = "" | ||
| } | ||
| "DeletedDateTime" = $null | ||
| "GuestUserRoleId" = "00aa00aa-bb11-cc22-dd33-44ee44ee44ee" | ||
| "DisplayName" = "AuthorizationPolicy" | ||
| "Description" = "AuthorizationPolicy" | ||
| "AllowEmailVerifiedUsersToJoinOrganization" = $True | ||
| "AllowedToSignUpEmailBasedSubscriptions" = $True | ||
| "AllowInvitesFrom" = "everyone" | ||
| "AllowUserConsentForRiskyApps" = "" | ||
| "AllowedToUseSspr" = $True | ||
| "BlockMsolPowerShell" = $True | ||
| "Id" = "authorizationPolicy" | ||
| "Parameters" = $args | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| Mock -CommandName Get-MgPolicyAuthorizationPolicy -MockWith $scriptblock -ModuleName Microsoft.Graph.Entra | ||
| } | ||
|
|
||
| Describe "Get-EntraAuthorizationPolicy" { | ||
| Context "Test for Get-EntraAuthorizationPolicy" { | ||
| It "Should return AuthorizationPolicy" { | ||
| $result = Get-EntraAuthorizationPolicy | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.Id | should -Be 'authorizationPolicy' | ||
| $result.DisplayName | should -Be 'AuthorizationPolicy' | ||
| $result.Description | should -Be 'AuthorizationPolicy' | ||
| $result.AllowInvitesFrom | should -Be 'everyone' | ||
| $result.GuestUserRoleId | should -Be '00aa00aa-bb11-cc22-dd33-44ee44ee44ee' | ||
| $result.AllowEmailVerifiedUsersToJoinOrganization | should -Be $True | ||
| $result.AllowedToSignUpEmailBasedSubscriptions | should -Be $True | ||
| $result.AllowedToUseSspr | should -Be $True | ||
| $result.BlockMsolPowerShell | should -Be $True | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyAuthorizationPolicy -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Property parameter should work" { | ||
| $result = Get-EntraAuthorizationPolicy -Property DisplayName | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.DisplayName | Should -Be 'AuthorizationPolicy' | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyAuthorizationPolicy -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when Property is empty" { | ||
| { Get-EntraAuthorizationPolicy -Property } | Should -Throw "Missing an argument for parameter 'Property'*" | ||
| } | ||
| It "Should contain 'User-Agent' header" { | ||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraAuthorizationPolicy" | ||
|
|
||
| Get-EntraAuthorizationPolicy | ||
|
|
||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraAuthorizationPolicy" | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyAuthorizationPolicy -ModuleName Microsoft.Graph.Entra -Times 1 -ParameterFilter { | ||
| $Headers.'User-Agent' | Should -Be $userAgentHeaderValue | ||
| $true | ||
| } | ||
| } | ||
| It "Should execute successfully without throwing an error" { | ||
| # Disable confirmation prompts | ||
| $originalDebugPreference = $DebugPreference | ||
| $DebugPreference = 'Continue' | ||
|
|
||
| try { | ||
| # Act & Assert: Ensure the function doesn't throw an exception | ||
| { Get-EntraAuthorizationPolicy -Debug } | Should -Not -Throw | ||
| } finally { | ||
| # Restore original confirmation preference | ||
| $DebugPreference = $originalDebugPreference | ||
| } | ||
| } | ||
| } | ||
| } | ||
88 changes: 88 additions & 0 deletions
88
test/module/Entra/Get-EntraPermissionGrantPolicy.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
| BeforeAll { | ||
| if ((Get-Module -Name Microsoft.Graph.Entra) -eq $null) { | ||
| Import-Module Microsoft.Graph.Entra | ||
| } | ||
| Import-Module (Join-Path $psscriptroot "..\Common-Functions.ps1") -Force | ||
|
|
||
| $scriptblock = { | ||
| return @( | ||
| [PSCustomObject]@{ | ||
| "Id" = "microsoft-all-application-permissions" | ||
| "DeletedDateTime" = "2/8/2024 6:39:16 AM" | ||
| "Description" = "Includes all application permissions (app roles), for all APIs, for any client application." | ||
| "DisplayName" = "All application" | ||
| "Excludes" = @{} | ||
| "Includes" = @("00aa00aa-bb11-cc22-dd33-44ee44ee44ee") | ||
| "Parameters" = $args | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| Mock -CommandName Get-MgPolicyPermissionGrantPolicy -MockWith $scriptblock -ModuleName Microsoft.Graph.Entra | ||
| } | ||
|
|
||
| Describe "Get-EntraPermissionGrantPolicy" { | ||
| Context "Test for Get-EntraPermissionGrantPolicy" { | ||
| It "Should return specific PermissionGrantPolicy" { | ||
| $result = Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.Id | should -Be "microsoft-all-application-permissions" | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyPermissionGrantPolicy -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when Id is empty" { | ||
| { Get-EntraPermissionGrantPolicy -Id "" } | Should -Throw "Cannot bind argument to parameter 'Id' because it is an empty string." | ||
| } | ||
| It "Should fail when Id is empty" { | ||
| { Get-EntraPermissionGrantPolicy -Id } | Should -Throw "Missing an argument for parameter 'Id'. Specify a parameter of type 'System.String' and try again." | ||
| } | ||
| It "Result should Contain ObjectId" { | ||
| $result = Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" | ||
| $result.ObjectId | should -Be "microsoft-all-application-permissions" | ||
| } | ||
| It "Should contain PermissionGrantPolicyId in parameters when passed ObjectId to it" { | ||
| $result = Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" | ||
| $params = Get-Parameters -data $result.Parameters | ||
| $params.PermissionGrantPolicyId | Should -Be "microsoft-all-application-permissions" | ||
| } | ||
| It "Property parameter should work" { | ||
| $result = Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" -Property DisplayName | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.DisplayName | Should -Be 'All application' | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyPermissionGrantPolicy -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when Property is empty" { | ||
| { Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" -Property } | Should -Throw "Missing an argument for parameter 'Property'*" | ||
| } | ||
| It "Should contain 'User-Agent' header" { | ||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraPermissionGrantPolicy" | ||
|
|
||
| $result = Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" | ||
| $result | Should -Not -BeNullOrEmpty | ||
|
|
||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraPermissionGrantPolicy" | ||
|
|
||
| Should -Invoke -CommandName Get-MgPolicyPermissionGrantPolicy -ModuleName Microsoft.Graph.Entra -Times 1 -ParameterFilter { | ||
| $Headers.'User-Agent' | Should -Be $userAgentHeaderValue | ||
| $true | ||
| } | ||
| } | ||
| It "Should execute successfully without throwing an error" { | ||
| # Disable confirmation prompts | ||
| $originalDebugPreference = $DebugPreference | ||
| $DebugPreference = 'Continue' | ||
|
|
||
| try { | ||
| # Act & Assert: Ensure the function doesn't throw an exception | ||
| { Get-EntraPermissionGrantPolicy -Id "microsoft-all-application-permissions" -Debug } | Should -Not -Throw | ||
| } finally { | ||
| # Restore original confirmation preference | ||
| $DebugPreference = $originalDebugPreference | ||
| } | ||
| } | ||
| } | ||
| } |
96 changes: 96 additions & 0 deletions
96
test/module/Entra/Get-EntraServicePrincipalDelegatedPermissionClassification.Tests.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # ------------------------------------------------------------------------------ | ||
| # Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. | ||
| # ------------------------------------------------------------------------------ | ||
| BeforeAll { | ||
| if ((Get-Module -Name Microsoft.Graph.Entra) -eq $null) { | ||
| Import-Module Microsoft.Graph.Entra | ||
| } | ||
| Import-Module (Join-Path $psscriptroot "..\Common-Functions.ps1") -Force | ||
|
|
||
| $scriptblock = { | ||
| return @( | ||
| [PSCustomObject]@{ | ||
| "Id" = "T2qU_E28O0GgkLLIYRPsTwE" | ||
| "Classification" = "low" | ||
| "PermissionId" = "22cc22cc-dd33-ee44-ff55-66aa66aa66aa" | ||
| "PermissionName" = "LicenseManager.AccessAsUser" | ||
| "Parameters" = $args | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| Mock -CommandName Get-MgServicePrincipalDelegatedPermissionClassification -MockWith $scriptblock -ModuleName Microsoft.Graph.Entra | ||
| } | ||
|
|
||
| Describe "Get-EntraServicePrincipalDelegatedPermissionClassification" { | ||
| Context "Test for Get-EntraServicePrincipalDelegatedPermissionClassification" { | ||
| It "Should return specific ServicePrincipalDelegatedPermissionClassification" { | ||
| $result = Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.Id | should -Be "T2qU_E28O0GgkLLIYRPsTwE" | ||
|
|
||
| Should -Invoke -CommandName Get-MgServicePrincipalDelegatedPermissionClassification -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when ServicePrincipalId is invalid" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "" } | Should -Throw "Cannot bind argument to parameter 'ServicePrincipalId' because it is an empty string.*" | ||
| } | ||
| It "Should fail when ServicePrincipalId is empty" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId } | Should -Throw "Missing an argument for parameter 'ServicePrincipalId'.*" | ||
| } | ||
| It "Should return specific ServicePrincipalDelegatedPermissionClassification when Id passed to it" { | ||
| $result = Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Id 'T2qU_E28O0GgkLLIYRPsTwE' | ||
| $params = Get-Parameters -data $result.Parameters | ||
| $params.DelegatedPermissionClassificationId | should -Be "T2qU_E28O0GgkLLIYRPsTwE" | ||
| } | ||
| It "Should fail when Id is invalid" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Id "" } | Should -Throw "Cannot bind argument to parameter 'Id' because it is an empty string.*" | ||
| } | ||
| It "Should fail when Id is empty" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Id } | Should -Throw "Missing an argument for parameter 'Id'.*" | ||
| } | ||
| It "Should return specific ServicePrincipalDelegatedPermissionClassification when applied filter to it" { | ||
| $result = Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Filter "PermissionName eq 'LicenseManager.AccessAsUser'" | ||
| $result.PermissionName | should -Be "LicenseManager.AccessAsUser" | ||
| $result.ObjectId | should -Be "T2qU_E28O0GgkLLIYRPsTwE" | ||
| } | ||
| It "Should fail when Filter is empty" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Filter } | Should -Throw "Missing an argument for parameter 'Filter'.*" | ||
| } | ||
| It "Property parameter should work" { | ||
| $result = Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Property PermissionName | ||
| $result | Should -Not -BeNullOrEmpty | ||
| $result.PermissionName | Should -Be 'LicenseManager.AccessAsUser' | ||
|
|
||
| Should -Invoke -CommandName Get-MgServicePrincipalDelegatedPermissionClassification -ModuleName Microsoft.Graph.Entra -Times 1 | ||
| } | ||
| It "Should fail when Property is empty" { | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Property } | Should -Throw "Missing an argument for parameter 'Property'*" | ||
| } | ||
| It "Should contain 'User-Agent' header" { | ||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraServicePrincipalDelegatedPermissionClassification" | ||
|
|
||
| $result = Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" | ||
| $result | Should -Not -BeNullOrEmpty | ||
|
|
||
| $userAgentHeaderValue = "PowerShell/$psVersion EntraPowershell/$entraVersion Get-EntraServicePrincipalDelegatedPermissionClassification" | ||
|
|
||
| Should -Invoke -CommandName Get-MgServicePrincipalDelegatedPermissionClassification -ModuleName Microsoft.Graph.Entra -Times 1 -ParameterFilter { | ||
| $Headers.'User-Agent' | Should -Be $userAgentHeaderValue | ||
| $true | ||
| } | ||
| } | ||
| It "Should execute successfully without throwing an error" { | ||
| # Disable confirmation prompts | ||
| $originalDebugPreference = $DebugPreference | ||
| $DebugPreference = 'Continue' | ||
|
|
||
| try { | ||
| # Act & Assert: Ensure the function doesn't throw an exception | ||
| { Get-EntraServicePrincipalDelegatedPermissionClassification -ServicePrincipalId "aaaaaaaa-bbbb-cccc-1111-222222222222" -Debug } | Should -Not -Throw | ||
| } finally { | ||
| # Restore original confirmation preference | ||
| $DebugPreference = $originalDebugPreference | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add test for parameter
IdUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KenitoInc Id parameter is missing in mg graph so it is not working on the Entra cmdlet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@v-varshamane @snehalkotwal We should update the docs https://github.com/microsoftgraph/entra-powershell/blob/main/module/docs/entra-powershell-v1.0/Microsoft.Graph.Entra/Get-EntraAuthorizationPolicy.md