Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Load / run .ps1 script on poweshell commandline (like CALL)

Closed Thread
 
Thread Tools Display Modes
Old 10-17-2006   #1 (permalink)
peterchen
Guest


 

Load / run .ps1 script on poweshell commandline (like CALL)

I have a .ps1 file in the current folder, which I want to execute
(inside powershell). How do I do that?

(the same thin CALL does in a batch file)

I feel totallystupid - I spent half an hour searching and reading for
that with no result whatsoever.

Old 10-17-2006   #2 (permalink)
Andrew Webb
Guest


 

RE: Load / run .ps1 script on poweshell commandline (like CALL)

Are you typing interactively? Then do this:-

../myfile.ps1 <enter>

Just typing myfile.ps1 <enter> won't work.

Andrew Webb
Old 10-17-2006   #3 (permalink)
Rob Kenny
Guest


 

Re: Load / run .ps1 script on poweshell commandline (like CALL)

Andrew Webb wrote:
> Are you typing interactively? Then do this:-
>
> ../myfile.ps1 <enter>
>
> Just typing myfile.ps1 <enter> won't work.
>
> Andrew Webb


If the file is not signed then you will also need to make sure you
execution policy allows it.

Get-ExecutionPolicy will tell you what you are current set to. At the
moment mine is set to RemoteSigned (Set-ExecutionPolicy RemoteSigned)
because I have not got round to setting up a short cut to sign scripts.

I have to admit the ./ and execution policy had me scratching my head a
bit to begin with.

RoB
Old 10-18-2006   #4 (permalink)
peterchen
Guest


 

Re: Load / run .ps1 script on poweshell commandline (like CALL)

thanks fols, that helps a lot
Rob Kenny wrote:
> Andrew Webb wrote:
> > Are you typing interactively? Then do this:-
> >
> > ../myfile.ps1 <enter>
> >
> > Just typing myfile.ps1 <enter> won't work.
> >
> > Andrew Webb

>
> If the file is not signed then you will also need to make sure you
> execution policy allows it.
>
> Get-ExecutionPolicy will tell you what you are current set to. At the
> moment mine is set to RemoteSigned (Set-ExecutionPolicy RemoteSigned)
> because I have not got round to setting up a short cut to sign scripts.
>
> I have to admit the ./ and execution policy had me scratching my head a
> bit to begin with.
>
> RoB


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ann] another way to call api's from script (the PB way) mr_unreliable VB Script 0 07-03-2008 12:28 PM
Howcome something works on the commandline but not when i put thesame commands in a script? Gobba PowerShell 3 06-03-2008 07:48 AM
Re: Using a colon in a script to call another cmdlet Keith Hill [MVP] PowerShell 0 04-29-2008 10:58 PM
function call from within powershell script Anatoli PowerShell 2 08-08-2007 12:54 PM
Call Powershell script from ASP.NET page? Tim PowerShell 1 05-23-2007 07:55 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50