Forum Discussion
John_Dodo
Oct 17, 2022Brass Contributor
Replace psexec with native powershell commands
Hello, we have a remotely located ($remoteserver1) script that we want to run on the said remote computer ($remoteserver1) from a "controler" server (via a scheduled task). As of today in a C...
John_Dodo
Brass Contributor
If I comment the line with the call to shutdown-vmguest it works all fine until the end of the script.
LainRobertson
Oct 17, 2022Silver Contributor
Do you get anything printed out if you insert the following line before the actual Shutdown-VMGuest command in vmware.ps1?
Write-Host "Shutdown-VMGuest -VM $vmname -Confirm:`$false";
So, it'd look like this:
write-host "2a";
Write-Host "Shutdown-VMGuest -VM $vmname -Confirm:`$false";
Shutdown-VMGuest -VM $vmname -Confirm:$false;
Cheers,
Lain
- John_DodoOct 26, 2022Brass Contributor
Hi Lain,
I would get the expected output form the write-host yes. Not sure what you try to demonstrate though. 🙂