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

Powershell script files

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 06-07-2007   #1 (permalink)
Mike Blake-Knox
Guest


 

Powershell script files

I'm having problems understanding how Powershell deals with script
inside a .ps1 file. It appears there are at least 3 "script blocks"
(begin, process and end) but the use of these isn't clear. It would
also seem desirable to use a function or method in a pipeline (or maybe
locally defined cmdlets). I have been able to use functions in a
procedural manner but it's not obvious how to extend this to
pipelining.

Where would I find documentation on Powershell scripting and files that
would help me with this?

Thanks

Mike


My System SpecsSystem Spec
Old 06-07-2007   #2 (permalink)
Brandon Shell
Guest


 

Re: Powershell script files

Take a look at Beginning PowerShell Guide. Specifically the function
section. the Begin/Process/End work exactly the same.
http://www.codeplex.com/PsObject/Wik...ringTitle=Home

Defined functions at top or in the Begin Section of the Script. Functions
have to be defined before they are called.

Also.. you may want to check out:
http://bsonposh.com/modules/wordpress/?p=23 (Birth of Script/Function)

"Mike Blake-Knox" <mikebk@nospam.nospam> wrote in message
news:VA.000000ae.22c40f48@nospam.nospam...
> I'm having problems understanding how Powershell deals with script
> inside a .ps1 file. It appears there are at least 3 "script blocks"
> (begin, process and end) but the use of these isn't clear. It would
> also seem desirable to use a function or method in a pipeline (or maybe
> locally defined cmdlets). I have been able to use functions in a
> procedural manner but it's not obvious how to extend this to
> pipelining.
>
> Where would I find documentation on Powershell scripting and files that
> would help me with this?
>
> Thanks
>
> Mike
>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Powershell script help Tboz PowerShell 3 08-01-2008 08:58 AM
What is the MIME type of Windows Powershell script files (.ps1 fil zkyboy PowerShell 3 03-11-2008 07:37 AM
Powershell script to keep a weeks worth of backup files TJ PowerShell 4 02-29-2008 03:57 AM
when run powershell script as windows service ,powershell fail powershell fail on winodws 2008 PowerShell 6 01-15-2008 03:20 PM
Is there an equivalent in powershell to get the name of the script Bob Landau PowerShell 9 09-10-2007 07:34 PM


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 51