I can't seem to get my splatting to work in my Invoke-WmiMethod
command. I declare the hash table like so:
$HKU = 2147483651
$MyParams = @{
'Class' = 'StdRegProv';
'Name' = 'EnumKey';
'ArgumentList' = "$HKU,''";
'ComputerName' = '';
}
# additional code determining ComputerName... #
$MyParams['ComputerName'] = $MyComputer;
$Vals = Invoke-WmiMethod @MyParams
This line gives me the following error:
Invoke-WmiMethod : Input string was not in a correct format. At C:\Users\Person\Desktop\tmp.ps1:160 char:20 + $Vals = Invoke-WmiMethod @MyParams
Do you know what the problem could be?