I am attempting to send a hashmap to a Java API in PowerShell. I need to create a hashmap for one of the inputs required. I am able to create a hashtable via the following method:
$myMap = @{"name1" = "server1"; "name2" = "server2"}
We then echo that and get...
echo $mymap
System.Collections.Hashtable
How can I convert the System.Collections.Hashtable object to a hashmap within Powershell? Attempting to send it as a hashtable returns this error:
Cannot convert argument "in0", with value: "System.Collections.Hashtable", for "search" to type "SiteScope.Map": "Cannot create object of type "SiteScope.Map". The path property was not found for the SiteScope.Map object. The available property is: [item <SiteScope.mapItem[]>]" At line:6 char:5 + $ssWs.search($myMap,"5","$strUsername", "$strPassword","1") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument
"SiteScope" is the Java application with the API.