I am trying to set up a nightly refresh of a pool of VMs using a PS script and view CLI.
The script is set up and working. I can run it through powercli and have it refresh the pools manually.... Where im running into issues is when i try to run the script from the actual task.
here is the script
Connect-VIServer vCLIENT-vcenter1.SERVER.int $a = get-date ((get-date).AddMinutes(0)) -format "yyyy-MM-%d >HH:mm" Get-Pool -pool_id TEST | Get-DesktopVM | Send-LinkedCloneRefresh -schedule $a -forcelogoff $true -stoponerror $true
When i schedule the task i put the executable program as:
C:\Windows\system32\windowspowershell\v1.0\powershell.exe
Ive tired setting the paramaters to:
-noe -c ". \"D:\Program Files\VMware\VMware View\Server\extras\PowerShell\add-snapin.ps1\"" & C:\Scripts\Nightly.Refresh.ps1
But it times out in the scheduled tasks and hangs. I have to stop the task.
Does anyone know what the correct parameters should be?