he term 'Register-ScheduledJob' is not recognized as the name of a cmdlet....
amnich opened this issue · comments
add 'Import-Module PSScheduledJob' inside the scriptblock of invoke-command cos it throws an exception:
The term 'Register-ScheduledJob' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
What version of Powershell are you trying to run this on? And what OS?
After some testing, I believe the minimum requirement for this script would be PowerShell 3.0 on the remote machine.