DexterPOSH / PSRemotely

Remote operations validation framework, exposes a DSL to wrap existing Pester/PoshSpec based validation tests.
http://psremotely.readthedocs.io/en/latest/
MIT License
46 stars 7 forks source link

Fix Using custom arguments as variables in remote PSSession #22

Closed DexterPOSH closed 7 years ago

DexterPOSH commented 7 years ago

Serious bug, this was never used but we should be able to pass a hashtable Key-Value pairs to the -ArgumentList to PSRemotely and have access to the variables with name (key) inside the underlying PSSessions to the remote nodes.

DexterPOSH commented 7 years ago

Fix for this issue must allow passing Null values -ArgumentList parameter to ReinitializeSession function. Since during the bootstrap phase in the Node function, this function is called by default.

So even if the ArgumentList is empty, this function should be able to run.

DexterPOSH commented 7 years ago

Fixed in #24

DexterPOSH commented 7 years ago

Function CreateSessions in Private\RemoteSession.ps1 Line - 137 says

# set the variables in the remote pssession
                ReinitializeSession -SessionInfo $PSRemotely.sessionHashTable[$node] -ArgumentList $argumentList

Where the $Node is flowing from the configuration data, it should be replaced by $Node.NodeName