Added error if resource can't be found for GetInfoFromUniqueId.ps1
This commit is contained in:
parent
af6db0eaeb
commit
cf16558acc
1 changed files with 5 additions and 5 deletions
|
@ -43,10 +43,7 @@ else {
|
|||
}
|
||||
|
||||
foreach($object in $returnedObjects.Policies) {
|
||||
if ($objectFound -eq $true) {
|
||||
break
|
||||
}
|
||||
elseif ("$target" -eq "$($object.PolicyId)") {
|
||||
if ("$target" -eq "$($object.PolicyId)") {
|
||||
if ($name -eq $true) {
|
||||
Write-Output "$($object.PolicyName)"
|
||||
}
|
||||
|
@ -59,3 +56,6 @@ foreach($object in $returnedObjects.Policies) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "Unique ID '$target' not found"
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue