Connect-MgGraph -Scopes "WindowsUpdates.Read.All" -NoWelcome while ($true) { $response = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/admin/windows/updates/products" $products = $response.value Write-Host "" Write-Host ("{0,-12} {1,-30}" -f "product id", "product name") Write-Host ("{0,-12} {1,-30}" -f "----------", "------------") $products | ForEach-Object { Write-Host ("{0,-12} {1,-30}" -f $_.id, $_.name) } $targetid = Read-Host "`nEnter product id (or type 'exit' to quit)" if ($targetid -eq "exit") { break } $targetname = "" foreach ($product in $products) { if ($product.id -eq $targetid) { $targetname = $product.name break } } if ($targetname -ne "") { Write-Host "`n$targetname known issues and notifications`n" } else { Write-Host "Incorrect ID.`n" continue } $response = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/beta/admin/windows/updates/products/$targetid/knownIssues" $issues = $response.value if ($issues.Count -gt 0) { $issues | ForEach-Object { Write-Host "Title : $($_.title)" Write-Host "Status : " -NoNewLine if ($_.status -match 'resolved') { Write-Host $_.status -ForegroundColor Green } elseif ($_.status -match 'confirmed') { Write-Host $_.status -ForegroundColor Red } elseif ($_.status -match 'mitigated') { Write-Host $_.status -ForegroundColor Yellow } else { Write-Host $_.status -ForegroundColor Gray } Write-Host "Description : $($_.description)" Write-Host "URL : $($_.webViewUrl)" Write-Host "Updated : " -NoNewLine if ($_.lastUpdatedDateTime -lt (Get-Date).AddDays(-7)) { Write-Host $_.lastUpdatedDateTime -ForegroundColor Gray } else { Write-Host $_.lastUpdatedDateTime -ForegroundColor Cyan } Write-Host "" } } else { Write-Host "There is no known issues.`n" } $targetid = Read-Host "`nEnter to continue (or type 'exit' to quit)" if ($targetid -eq "exit") { break } } DisConnect-MGGraph