I am attempting to setup a PowerShell script within a SQL Agent job (SQL Server 2016). I'm using a third party module, DBATOOLS.psd1 which appears to be where I'm getting my syntax error. Currently my SQL Job has one line of code which is failing:
Why is the job failing with the following error? This command works just fine when I run it through the PowerShell ISE.
Error Message: Unable to start execution of step 1 (reason: line(5): Syntax error). The step failed.