Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

ArgumentList parameter in Invoke-Command don't send all array

$
0
0

First short code, then question

$session = New-PSSession -ComputerName someServer

$servicesList = "Service1", "Service2", "Service3"

Invoke-Command -ScriptBlock {
    Param ($newServicesList)

    Write-Host $newServicesList

} -ArgumentList $servicesList -Session $session

Remove-PSSession  $session

The question is why Write-Host in Invoke-Command block give only this output ?

Service1

Thanks for any answers


Viewing all articles
Browse latest Browse all 6937

Latest Images

Trending Articles



Latest Images