Have you tried checking the created scheduled job? I could imagine that “-FilePath” expects an executable. So if you want to run a Powershell script you should place the path to your powershell.exe in “-FilePath” and put “the rest” of the command to the “-ArgumentList” like this: “-NoProfile -File c:\scripts\hypervbackup.ps1 $VMs,‘F:\Hyper-V Exports’,$True,$False”
It is always recommended to read ALL of the help for the cmdlets you use including the examples.
well… how does one check the scheduled job? it is listed when query for it.
the strange thing is that I deployed the same scripts on another server and they did not work… and then one day… they just started working. I tried to figure out why that started working and don’t see anything different.
you job saved under current user credentials without saved password.
thus it can run if current user logged into server
may be ‘start as batch job’ right also involved