Reply to Message

View discussion in a popup

Replying to:
Kaicy0443
Contributor
Contributor

can it be that if I use invoke-vmscript, but the result of it is not the same as I insert the commands on server itself?

fe:
i used this script for my server file11:

# Get the latest Quick Fix data
$LatestQuickFix = Get-WmiObject win32_quickfixengineering |
Sort-Object -Property installedon -Descending |
Select-Object -First 1

$InstallDate = $LatestQuickFix.installedon.ToString("MM/dd/yyyy")


$Script = "Write-Host 'Latest Quick Fix Installed On: $InstallDate'"


$VMName = "file11"


$result = Invoke-VMScript -VM $VMName -ScriptText $Script -GuestUser $vCenterUser -GuestPassword $vCenterPass

 

 

the $result showed me:
Latest Quick Fix Installed On: 09.26.2023

but if i do this on my server, 

the result:
InstalledOn

--------------

05.10.2023 00:00:00

 

Im new in powerCLI, can u help me a bit?



Reply
0 Kudos