Function Test-ValueFromPipeline { 
    [CmdletBinding()] 
    Param( 
        [Parameter(Mandatory=$true, 
            ValueFromPipeline=$true)] 
        [string] 
        $Value 
    ) 
 
    Begin { 
        Write-Verbose 'Début du traitement : Begin' 
    } 
 
    Process { 
        Write-Verbose 'Traitement en cours ...' 
        $Value 
    } 
 
    End { 
        Write-Verbose 'Fin du traitement : End' 
    } 
 
} 


Test-ValueFromPipeline -Value 'Computer1' -Verbose 
'Computer1','Computer2','Computer3','Computer4' | Test-ValueFromPipeline -Verbose 

Function Test-ValueFromPipeline { 
    [CmdletBinding()] 
    Param( 
        [Parameter(Mandatory=$true, 
            ValueFromPipeline=$true)] 
        [string] 
        $Value 
    ) 
 
    Begin { 
        Write-Verbose 'Début du traitement : Begin' 
    } 
 
    Process { 
        if($_){ 
            Write-Warning 'Traitement à travers un pipeline' 
        }else{ 
            Write-Warning 'Traitement avec les paramètres' 
        } 
        Write-Verbose 'Traitement en cours ...' 
        $Value 
    } 
 
    End { 
        Write-Verbose 'Fin du traitement : End' 
    } 
 
} 

Test-ValueFromPipeline -Value 'Computer1' 
'Computer1','Computer2','Computer3','Computer4' | Test-ValueFromPipeline  

Function Test-ValueFromPipeline { 
    [CmdletBinding()] 
    Param( 
        [Parameter(Mandatory=$true, 
            ValueFromPipeline=$true)] 
        [string[]] 
        $Value 
    ) 
    Begin { 
        Write-Verbose 'Début du traitement : Begin' 
    } 
    Process { 
        Write-Verbose 'Execution du bloc Process' 
        foreach ($val in $Value) { 
            Write-Verbose 'Traitement en cours ...' 
            $val 
        } 
    } 
    End { 
        Write-Verbose 'Fin du traitement : End' 
    } 
 
}

Test-ValueFromPipeline -Value 'Computer1','Computer2','Computer3','Computer4' -Verbose 
'Computer1','Computer2','Computer3','Computer4' | Test-ValueFromPipeline -Verbose 
