I have a variable in the powershell command. We are considering to run it in SQL Agent job step 1. However I always get the below error.
$a = $(Get-Date).AddMonths(1).ToString("yyyyMM")
Unable to start execution of step 1 (reason: The job step contains tokens. For SQL Server 2005 Service Pack 1 or later, you must use the appropriate ESCAPE_xxx macro to update job steps containing tokens before the job can run.). The step failed.