Loops and Constructs


As illustrated in the following table, there's nearly a one-to-one correspondence between VBScript and PowerShell constructs:

In VBScript

In PowerShell

Exit Do, Exit For

Break

ForNext

For

For EachNext

Foreach

Function

Function

Sub

(no equivalent; use Function)

IfThen

If

IfElseIfElse

If, ElseIf, and Else

SelectCase

Switch

DoLoop Until, Do UntilLoop

Dountil, Do until

DoLoop While, Do WhileLoop

DoWhile, While

Refer to Chapter 8 to review the discussion of these loops and constructs.



Windows PowerShell. TFM
Internet Forensics
ISBN: 982131445
EAN: 2147483647
Year: 2004
Pages: 289

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net