Invoke-Command -ArgumentList errors out when passing hashtable
I am using CentOS7.3, Installed PowerShell, OMI, PSRP.
When I pass a string as an argument to Invoke-Command -ArgumentList, it goes thru and the script is executed.
When I pass a hashtable to the same, it errors out.
Invoke-Command $s -FilePath /samba/anonymous/TestJSON.ps1 -ArgumentList $jsonContents
Starting a command on the remote server failed with the following error message : MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OperationStopped: (xxx.xxx.xxx.xxx:String) [], PSRemotingTransportException + FullyQualifiedErrorId : JobFailure + PSComputerName : xxx.xxx.xxx.xxx
$jsonContents is a hashtable containing filename as key and file contents(text) as value. If i replace $jsonContents with a string variable, the script is executed.
Any help would be greatly appreciated.
Thank you Ravi
This doesn't sound like a question for PoshRSJob, but something that might be better handled over at https://github.com/PowerShell/PowerShell/issues