PoshCode Logo PowerShell Code Repository

Pipeline and Parameter by halr9000 27 months ago (modification of post by halr9000 view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1428"></script>download | new post

sample by r_keith_hill

  1. param(
  2.     [Parameter(ValueFromPipeline=$true, Mandatory=$true, Position=0)]
  3.     [string[]]
  4.     $ComputerName
  5. )
  6.  
  7. Process {
  8.     foreach ($cn in $ComputerName) {
  9.         Write-Host "Processing $cn"
  10.     }
  11. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me