- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps try like this.
To make sure, the $vCenterUser and $vCenterPass variables contain the credentials for the Guest OS on the VM named 'file11'?
# Get the latest Quick Fix data
$script = @'
$LatestQuickFix = Get-WmiObject win32_quickfixengineering |
Sort-Object -Property installedon -Descending |
Select-Object -First 1
$LatestQuickFix.installedon.ToString("MM/dd/yyyy")
'@
$VMName = "file11"
$result = Invoke-VMScript -VM $VMName -ScriptText $Script -GuestUser $vCenterUser -GuestPassword $vCenterPass
$result.ScriptOutput
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference