konstantinvlasenko / PowerSlim

Fitnesse Slim implementation in PowerShell. PowerSlim makes it possible to use PowerShell in the acceptance testing
powerslim.org
GNU General Public License v3.0
48 stars 21 forks source link

Symbol sharing won't work if the symbol is remote object #83

Closed lonestep closed 8 years ago

lonestep commented 8 years ago

Try this :

!define REMOTE_SERVER {localhost:35}

!|script|Remote|${REMOTE_SERVER}|
|eval|!-
function GetRemoteComputerCommands()
{
    $ret = New-Object -TypeName PSObject -Property @{
            "Success" = $false
            "Name" = $null
            "CommandType"  = $null
            "ModuleName" = $null
    }
    try{
        $cmds = Get-Command *Computer
    }
    catch{
        return $ret
    }
    $ret.Success     = $true
    $ret.Name        = $cmds.Name
    $ret.CommandType = $cmds.CommandType
    $ret.ModuleName  = $cmds.ModuleName
    return $ret
}
-!| |$computerCmds=|eval|GetRemoteComputerCommands| |check|eval|$computerCmds.Success|True| |$commandNames=|eval|$computerCmds.Name| !|script|Remote|${REMOTE_SERVER}| |$whereIsMyCommandNames=|eval|$computerCmds.Name| |check|eval||$whereIsMyCommandNames|$commandNames|