Hello, I need to update vmtools version 11.360 to 12, but our ESXi 6.5 U3 cannot be updated yet, it will take time. So I have to go from ISO. To accomplish this I grabbed few lines from this post https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerShell-remoting-to-install-VMWare-... and tested locally, and it works. However, when inside Invoke-Command from remote it does not. These are the lines I'm using:
$CDRom = Get-WmiObject -class Win32_CDROMDrive | Select-Object Drive | ForEach-Object { $_.Drive }
$Subpath = '\setup64.exe'
$EXE = Join-Path -Path $CDRom -ChildPath $Subpath
$runEXE = $EXE + " " + "/S /v /qn REBOOT=ReallySuppress"
cmd.exe /c $runEXE
no I didn't. Found the above to be working, not elegant but for now it'll do.
How did you pass this to the Invoke-Command?
Did you try using a transcript log (Start-Transcript)?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
very simply like this:
$block = {
}
Invoke-Command -Session $Session -ScriptBlock $block
Did you try to use a transcript file?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
$CDRom = Get-WmiObject -class Win32_CDROMDrive | Select-Object Drive | ForEach-Object { $_.Drive }
$Subpath = '\setup64.exe'
$EXE = Join-Path -Path $CDRom -ChildPath $Subpath
$runEXE = $EXE + " " + "/S /v /qn REBOOT=ReallySuppress"
cmd.exe /c $runEXE
no I didn't. Found the above to be working, not elegant but for now it'll do.