• Finally figured out how to get it working. SQL uses the sqlps utility, which is a Windows PowerShell mini-shell, and it has some restrictions such as mentioned above. The SQL Agent solution is to use a job step type of not PowerShell, but Operating system (CmdExec). In the code window do: powershell.exe -command "your powershell script"