Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » ForEach-Object

ForEach-Object - Powershell 1.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Loop for each object in the pipeline


-process ScriptBlock[]
        A block of powershell script that is applied to each incoming object.
    -inputObject psobject
        Accepts an object that the script block specified in the process parame
        ter will act upon. Enter a variable that contains the objects or type a
         command or expression that gets the objects.
    -begin scriptblock
        A script block to run before processing any input objects.
    -end scriptblock
        A script block to run after processing all input objects.
        -Verbose, -Debug,-ErrorAction,-ErrorVariable, -OutVariable.

Loop for each object in the pipeline