Classes/Public/PrismNgtSetting.ps1
|
# NGT configuration and guest status, with the originating VM and session context. class PrismNgtSetting { [string]$VmExtId [string]$PrismSession [string]$ETag [string]$Version [Nullable[bool]]$IsInstalled [Nullable[bool]]$IsEnabled [Nullable[bool]]$IsIsoInserted [string[]]$Capabilities [string]$AvailableVersion [string]$GuestOsVersion [Nullable[bool]]$IsReachable [Nullable[bool]]$IsVssSnapshotCapable [Nullable[bool]]$IsVmMobilityDriversInstalled [Nullable[bool]]$IsCommunicationActiveOverSerialPort [object]$GuestInfo [object]$RawData PrismNgtSetting() { } PrismNgtSetting([object]$data, [string]$vmExtId, [string]$prismSession) { if ($null -eq $data) { throw 'The API response did not contain NGT settings.' } if ([string]::IsNullOrWhiteSpace($vmExtId)) { throw 'A VM ExtId is required.' } $this.VmExtId = $vmExtId $this.PrismSession = $prismSession $this.RawData = $data foreach ($property in $this.psobject.Properties) { if ($property.Name -in @('VmExtId', 'PrismSession', 'ETag', 'RawData')) { continue } if ($data -is [System.Collections.IDictionary]) { if ($data.Contains($property.Name)) { $this.($property.Name) = $data[$property.Name] } } elseif ($data.psobject.Properties[$property.Name]) { $this.($property.Name) = $data.($property.Name) } } } } |