How to run a PowerShell script?

Posted by Pekka on Stack Overflow See other posts from Stack Overflow or by Pekka
Published on 2010-01-09T22:19:10Z Indexed on 2010/03/08 13:51 UTC
Read the original article Hit count: 449

Filed under:
|
|

Guys and Gals, a really stupid question:

How do I run a PowerShell script?

  • I have a script named myscript.ps1
  • I have all the necessary frameworks installed
  • I set that execution policy thing
  • I have followed the instructions on this MSDN help page and am trying to run it like so: powershell.exe 'C:\my_path\yada_yada\run_import_script.ps1' (with or withot --noexit)

which returns exactly nothing, except that the file name is output. No error, no message, nothing. Oh, when I add -noexit, the same thing happens but I remain within Powershell, and have to exit manually.

The ps1 file is supposed to run a program, and return the error level dependant on that program's output. But I'm quite sure I'm not even getting there yet.

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about powershell