0

I have a code which opens powershell but does not run the script. How do I run the script? Any help appreciated.

x 'C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe' -filename "L:\Work\SAS Data\.local2remote1.ps1" ;
5
  • maybe -file instead of -filename x 'C:\Windows\syswow64\Windowspowershell\v1.0\powershell.exe' -file "L:\Work\SAS Data\.local2remote1.ps1" ; Commented Oct 13, 2016 at 9:29
  • It's still the same. Opens powershell only. Commented Oct 13, 2016 at 9:48
  • The trick is to find the code required from command line or RUN window and use that. Appears to be 'X "powershell path_to_ps file"'; Commented Oct 13, 2016 at 10:56
  • Note that ideally you have no spaces in path but can get around that if you have to. Commented Oct 13, 2016 at 10:57
  • Thanks! it worked. Commented Oct 13, 2016 at 12:10

1 Answer 1

1
x 'powershell -file "L:\Work\SAS Data\local2remote1.ps1"';

is the correct syntax

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.