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) {
|
foreach($object in $returnedObjects.Policies) {
|
||||||
if ($objectFound -eq $true) {
|
if ("$target" -eq "$($object.PolicyId)") {
|
||||||
break
|
|
||||||
}
|
|
||||||
elseif ("$target" -eq "$($object.PolicyId)") {
|
|
||||||
if ($name -eq $true) {
|
if ($name -eq $true) {
|
||||||
Write-Output "$($object.PolicyName)"
|
Write-Output "$($object.PolicyName)"
|
||||||
}
|
}
|
||||||
|
@ -58,4 +55,7 @@ foreach($object in $returnedObjects.Policies) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Output "Unique ID '$target' not found"
|
||||||
|
exit
|
||||||
|
|
Loading…
Reference in a new issue