I am trying to run a powershell script. When running it directly from the server, it works as expected. When running it via a Windows job, it runs but it results in a bunch of files in the Workload Automation Agent's install directory.
Release : 12.0
The powershell script used in this instance was:
The output file generated gets created in whatever directory the script is run from. This is confirmed by opening a command prompt, cd'ing to the Workload Automation Agent's installation directory, and running: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe /c C:\path\to\powershell_script.ps1
It depends on the version of powershell running on the agent machine. Powershell version 5 does not support stringing along commands together using &&. Powershell version 7 does. So: