Running PowerShell from SQL Agent returns an error
Running PowerShell from SQL Agent returns an error when SSMS hasn't been installed on the server.
The corresponding line is 'Import-Module SQLASCmdlets -ErrorAction SilentlyContinue -Global '. Correct the script and reschedule the job.
This appears to be happening because the PowerShell modules don't get installed in any other way. This is bad as many enterprise organizations do not install SSMS on the server.
We need another way to install the components needed to execute PowerShell from SQL Agent.