• Actually I believe the double qoute was your original problem. Bellow I have a simplified example. A double quote is going to cause the variable to be evaluated when you create the command script.

    PassArray.ps1

    param([string[]] $ComputerArray)

    ForEach ($Computer in $ComputerArray ){

    Write-Host $Computer

    }

    CallPassArray.ps1

    $ComputerArray = @('computer1','computer2')

    $Command = 'C:\work\PassArray.ps1 $ComputerArray'

    Invoke-Expression $Command

    When executed it will return the following:

    PS M:\> C:\work\CallPassArray.ps1

    computer1

    computer2