Skip to content

Commit

Permalink
Merge pull request #80 from kayasax/copyassignment
Browse files Browse the repository at this point in the history
fix #79
  • Loading branch information
kayasax authored Jan 8, 2025
2 parents 0854ffe + 501b744 commit 7d21878
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EasyPIM/EasyPIM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RootModule = 'EasyPIM.psm1'

# Version number of this module.
ModuleVersion = '1.7.5'
ModuleVersion = '1.7.6'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function Remove-PIMAzureResourceEligibleAssignment {
#1 check if there is a request for future assignment, in that case we need to cancel the request
write-verbose "Checking if there is a future assignment for $principalID and $rolename at $scope"
$response = get-pimazureResourceEligibleAssignment -tenantID $tenantID -scope $scope -includeFutureAssignments | Where-Object { $_.principalID -eq "$principalID" -and $_.rolename -eq "$rolename" }
if ( !($null -eq $response) ) {
if ( !($null -eq $response) -and $response.status -ne "Provisioned" ) { #only non provisioned assignment can be canceled, else we need an admin remove
Write-Verbose "Found a future assignment, we need to cancel it"
$restURI = "$ARMendpoint/roleEligibilityScheduleRequests/$( $response.id.Split('/')[-1] )/cancel?api-version=2020-10-01"
$response = invoke-arm -restURI $restURI -method POST -body $null
Expand Down

0 comments on commit 7d21878

Please sign in to comment.