Your blog post link did it. I have to use powershell -noexit "& "C:\yada_yada\run_import_script.ps1" (notice the three double quotes) I don't really understand why, but at this point, I don't really care :) Thanks a lot!
– Pekka 웃Jan 9 '10 at 22:32

According to technet.microsoft.com/en-us/library/ee176949.aspx, the '&' is for "If you actually want to execute that string value (that is, if you want to run the script whose path is enclosed in double quotes) you need to preface the path with the Call operator (the ampersand)."
– Doug DawsonMay 29 '12 at 14:32

7

Just use the command powershell c:\mypath\yadayada\myimportantscript.ps1 if your path and file name have no spaces in it but if you put quotes around it powershell will try and interpret the parameter as a string of powershell commands.
– BeowulfNode42Feb 9 '14 at 20:55

20

none of these worked for me until I bypassed powershell's default executionpolicy for my freshly-created unsigned script. Among other things this required restarting powershell As Administrator. Totally agree with @LukePuplett - it's brilliant to make the simplest use-case take 20 minutes of googling and futzing around. And the error messages! Apparently these guys worked at IBM... in the 70's.
– Spike0xffMar 1 '16 at 21:49

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).