You are here:

WindowsManagement.com > PowerShell > PowerShell 1.0 > ForEach-Object
ActiveXperts Network Monitor 2015 proactively manages network servers, devices, databases and more.

ForEach-Object - PowerShell 1.0

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.

ForEach-Object


Description
Back up your Hyper-V VMs Easy & Fast. 100% built for Hyper-V. Free for 2 VMs, forever.

Usage


Options
-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.
 
   CommonParameters:
        -Verbose, -Debug,-ErrorAction,-ErrorVariable, -OutVariable.

Example(s)
Loop for each object in the pipeline