Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

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

Reply
0 Kudos