Skip to content

Commit

Permalink
Update Test-MtPimAlertsExists.ps1 to use Invoke-MtGraphRequest instea…
Browse files Browse the repository at this point in the history
…d of Invoke-MgGraphRequest
  • Loading branch information
f-bader committed Apr 13, 2024
1 parent 47eb16c commit 35f86d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions powershell/public/Test-MtPimAlertsExists.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ Function Test-MtPimAlertsExists {

# Get PIM Alerts and store as object to be used in the test
Write-Verbose "Getting PIM Alerts"
$Alert = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/privilegedAccess/aadroles/resources/$($tenantId)/alerts" `
| Select-Object -ExpandProperty value -ErrorAction SilentlyContinue | Where-Object { $_.id -eq $AlertId }
$Alert = Invoke-MtGraphRequest -ApiVersion "beta" -RelativeUri "privilegedAccess/aadroles/resources/$($tenantId)/alerts" | Where-Object { $_.id -eq $AlertId }

$AffectedRoleAssignments = $Alert.additionalData | ForEach-Object {
$CurrentItem = $_['item']
Expand Down

0 comments on commit 35f86d8

Please sign in to comment.