Script CancelAllQueries.ps1 has hardcoded script path inside

Mar 25, 2008 at 7:14 PM
In new PowerShell Script sample query CancelAllQueries has script path hardcoded to c:\scripts:

I believe this should be replaced with:

Mar 26, 2008 at 4:41 PM
Yes, if you execute the powershell script from within the c:\scripts folder. However, if you execute the powershell script from another location using an absolute path to refer to the script you wish to execute, the relative pathing will fail - unless you use the Set-Location command in the script. For example, Set-Location C:\Scripts - add this to the beginning of the CancelAllQueries.ps1 script - you can then use relative pathing.