![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | writing ps script Say i've got all the coding done and it works with in the interactive mode. i thot i can save the file into *.ps extension and from cmd prompt call powershell.exe filename.ps ...does this work ? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: writing ps script The correct extension for PowerShell script files is ".ps1" (note the version number). Invoking the script file from cmd.exe should work like this: powershell.exe -command C:\do-foo.ps1 -- greetings dreeschkind "IT Staff" wrote: > Say i've got all the coding done and it works with in the interactive mode. > > i thot i can save the file into *.ps extension and from cmd prompt call > powershell.exe filename.ps ...does this work ? > > > > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: writing ps script At first, i tried to run your command below and got this error : H:\>powershell -command d:\test.ps1 File D:\test.ps1 cannot be loaded. The file D:\test.ps1 is not digitally signed .. The script will not execute on the system. Please see "get-help about_signing " for more details.. At line:1 char:11 + d:\test.ps1 <<<< Then i realised it is about signing problems so i changed to REmotesigned. The script runs fine after that. "dreeschkind" <dreeschkind@discussions.microsoft.com> wrote in message news:5F0190F8-4FB6-45BB-B321-9FB97D874E6B@microsoft.com... > The correct extension for PowerShell script files is ".ps1" (note the > version > number). > Invoking the script file from cmd.exe should work like this: > > powershell.exe -command C:\do-foo.ps1 > > -- > greetings > dreeschkind > > "IT Staff" wrote: > >> Say i've got all the coding done and it works with in the interactive >> mode. >> >> i thot i can save the file into *.ps extension and from cmd prompt call >> powershell.exe filename.ps ...does this work ? >> >> >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Include another script, keep variables in included script? | pschmidt | PowerShell | 32 | 08-18-2008 01:48 PM |
| Script file has 'OS Handle' error when run from script | Jay | PowerShell | 1 | 09-18-2007 07:06 PM |
| Can you drag-n-drop a file on top of a PS script to run the script? | Jen Taylor | PowerShell | 6 | 04-06-2007 09:02 AM |
| Demo: Writing a PS script app wrapper for Halo | Alex K. Angelopoulos [MVP] | PowerShell | 0 | 08-09-2006 04:22 PM |
| What are best prictices when writing a script? | =?Utf-8?B?QW5kcmV3IFNhdmlueWto?= | PowerShell | 0 | 08-05-2006 01:15 AM |