Power Shell RRS feed

  • Question

  • How do I call a power shell script automatically - from a scheduled task for example.  I know how to start a scheduled task, but I'm not clear on the power shell syntax.  Is it something like   ps <  psfile.txt    ?    Thanks.
    Tuesday, November 25, 2008 3:13 PM


  •  In a scheduled task, you can specify a command line to run powershell scripts using the syntax like: 
    powershell.exe -command "& { get-childitem; get-date }". There is more help information if you type "powershell.exe -?" in the cmd window. Does this answer your quesion? Regards, Yutong.
    • Marked as answer by Don Pattee Tuesday, March 24, 2009 11:20 PM
    Tuesday, December 2, 2008 12:56 AM