Skip to content

Commit

Permalink
Removed incorrect $action assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfAmersfoort authored Apr 11, 2024
1 parent 819e648 commit 30288b7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions disable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ try {
}
$correlatedAccount = Invoke-RestMethod @splatGetUserParams
} catch {
if (-not($_.ErrorDetails.Message -match '211 - Object does not exist')) {
$action = 'NotFound'
if ( -not ($_.ErrorDetails.Message -match '211 - Object does not exist')) {
throw "Cannot get user error: [$($_.Exception.Message)]"
}
}
Expand Down
3 changes: 1 addition & 2 deletions enable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ try {
}
$correlatedAccount = Invoke-RestMethod @splatGetUserParams
} catch {
if (-not($_.ErrorDetails.Message -match '211 - Object does not exist')) {
$action = 'NotFound'
if ( -not ($_.ErrorDetails.Message -match '211 - Object does not exist')) {
throw "Cannot get user error: [$($_.Exception.Message)]"
}
}
Expand Down
3 changes: 1 addition & 2 deletions grantPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ try {
}
$correlatedAccount = Invoke-RestMethod @splatGetUserParams
} catch {
if (-not($_.ErrorDetails.Message -match '211 - Object does not exist')) {
$action = 'NotFound'
if ( -not ($_.ErrorDetails.Message -match '211 - Object does not exist')) {
throw "Cannot get user error: [$($_.Exception.Message)]"
}
}
Expand Down
3 changes: 1 addition & 2 deletions revokePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ try {
}
$correlatedAccount = Invoke-RestMethod @splatGetUserParams
} catch {
if (-not($_.ErrorDetails.Message -match '211 - Object does not exist')) {
$action = 'NotFound'
if ( -not ($_.ErrorDetails.Message -match '211 - Object does not exist')) {
throw "Cannot get user error: [$($_.Exception.Message)]"
}
}
Expand Down
5 changes: 2 additions & 3 deletions update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ try {
}
$correlatedAccount = Invoke-RestMethod @splatGetUserParams
} catch {
if (-not($_.ErrorDetails.Message -match '211 - Object does not exist')) {
$action = 'NotFound'
if ( -not ($_.ErrorDetails.Message -match '211 - Object does not exist')) {
throw "Cannot get user error: [$($_.Exception.Message)]"
}
}
$outputContext.PreviousData = $correlatedAccount

# Always compare the account against the current account in target system
if ($null -ne $correlatedAccount) {
$outputContext.PreviousData = $correlatedAccount
$splatCompareProperties = @{
ReferenceObject = @($outputContext.PreviousData.PSObject.Properties)
DifferenceObject = @($actionContext.Data.PSObject.Properties)
Expand Down

0 comments on commit 30288b7

Please sign in to comment.