Greetings,
I am tearing my hair out over this issue. I have copied the example of how this works, here.
The errant line is "Set-VMHostAccount -UserAccount $UserName -Password $NewPassword"
The error is that the UserAccount value cannot be found.
The line works when run directly in PowerShell on the server. So at least it should work.
It doesn't matter if the line is updated to have 'root' in place of the $UserName.
It doesn't matter if there are only 3 lines in the script (the connect, the error, the disconnect)
Any pointers would be much appreciated.
Irish