I’m new to powershell so maybe it’s easy.
I have a parameter ComputerName which has the following parameter properties:
Computer Name oder mehrere Computer Namen
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNull()] [ValidateNotNullOrEmpty()] [Alias("hostname","Name")] [String]$ComputerName
Now I learnt (I do hope that I get this right) that when passing objects via the pipeline the process block will be automatically looped for every object coming from the pipeline. Do I have this right?
However, when I use get-something -ComputerName client1, client2 etc I need to loop through the “array” of $ComputerName.
Can I determine in the Begin block if the script is used as a pipeline “target”?