- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That fixed the issue, thanks Luc.
I replaced
function Get-vraDetails {
if ($script:target.customFields.Item("vrmManagedMachine")) {
$script:vmProperty.Add("Attribute: vRA Managed","True")
$script:vmProperty.Add("Attribute: vRA Owner", $script:target.customFields.Item("VRM Owner"))
}
else {
$script:vmProperty.Add("Attribute: vRA Managed","False")
$script:vmProperty.Add("Attribute: vRA Owner", "")
}
$script:vm_Found_YES += New-Object -TypeName psobject -Property $Script:vmProperty
}
with
function Get-vraDetails {
if ($script:target.customFields.ContainsKey("vrmManagedMachine")) {
$script:vmProperty.Add("Attribute: vRA Managed","True")
$script:vmProperty.Add("Attribute: vRA Owner", $script:target.customFields.Item("VRM Owner"))
}
else {
$script:vmProperty.Add("Attribute: vRA Managed","False")
$script:vmProperty.Add("Attribute: vRA Owner", "")
}
}
No more errors on the Script and it successfully runs across all vCenters, even on vCenters where the VM's don't contain these two attributes
Thanks