Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Powershell script files

Reply
 
Old 06-07-2007   #1 (permalink)
Mike Blake-Knox


 
 

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


 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
Here is a PowerShell script to parse nmap XML output files. PowerShell
Converting a BAT script into a PowerShell Script PowerShell
What is the MIME type of Windows Powershell script files (.ps1 fil PowerShell
Powershell script to keep a weeks worth of backup files PowerShell
when run powershell script as windows service ,powershell fail PowerShell


Vista Forums 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 Ltd

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