I am attempting to execute a .ps1 on multiple VM's using the invoke-VMScript function. Currently I have the code:
Invoke-VMScript -ScriptText $script -VM $servername -guestcredential $gcred -hostcredential $hcred
and have $script = 'data.ps1'
however this returns the error stating that 'data.ps1' is not a valid function or script. Any help is greatly appreciated.
|
|||
I'm not set up to test this, but I would guess that
|
|||
|
You have to put in script variable content of your script, not file name. |
|||||
|
data.ps1
. It may be looking for it in a different folder than you think. – Nate Hekman Apr 8 '13 at 16:15