about_script_blocks.help

about_script_blocks.help - TOPIC about_Script_Blocks SHORT...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 TOPIC about_Script_Blocks SHORT DESCRIPTION Defines what a script block is and explains how to use script blocks in the Windows PowerShell programming language. LONG DESCRIPTION In the Windows PowerShell programming language, a script block is a collection of statements or expressions that can be used as a single unit. A script block can accept arguments and return values. Syntactically, a script block is a statement list in braces, as shown in the following syntax: {<statement list>} A script block returns the output of all the commands in the script block, either as a single object or as an array. Like functions, a script block can include parameters. Use the Param keyword to assign named parameters, as shown in the following syntax: { param ([type]$parameter1 [[type]$parameter2]) <statement list> } In a script block, unlike a function, you cannot specify parameters outside the braces. Like functions, script blocks can include the DynamicParam, Begin, Process,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2010 for the course BUS fin taught by Professor Fez during the Spring '10 term at Valparaiso.

Page1 / 3

about_script_blocks.help - TOPIC about_Script_Blocks SHORT...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online