Does anyone have a syntax example for executing a powershell script for vmware utilizing scheduling in XP?
thanks
You can run your script using PowerShell as long as you add the command "add-pssnapin VMware.VimAutomation.Core" at the top of your script. The toolkit environment just loads this snapin, sets a few aliases, and a few other things.
create a scheduled task with the following syntax
powershell -command "& 'c:\path\test.ps1'
Thanks for the response
Wouldn't you need to call the vitoolkit instead of powershell?
You can run your script using PowerShell as long as you add the command "add-pssnapin VMware.VimAutomation.Core" at the top of your script. The toolkit environment just loads this snapin, sets a few aliases, and a few other things.
Hi All need some assistance I have been trying to ran a Scheduled Task running XP for a PowerShell Script, but i can't get it to go....
1. I start Add Schedule Task
2. I search for the Windows PowerShell program
3. Give the task a name and when to perform the task
4. Place my log in credentials
5. now in the Run: is where I am having problem I dont know what should go there
any advice?
Thank you,
Express
In the Run field you give PowerShell + parameters + script.
Something like this
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\vim.psc1" -NoExit -Command "C:\script.ps1"
Have a look at Alan's blog entry on this subject: Running a PowerCLI Scheduled task
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the infor I finally got it to work last night at about 2am. Just about everything you have except for the (VIToolkitForWindows\vim.psc1) since I did not install that.
Thanks.
Thank you,
Express