#Adding NodeSettings
$nodeSettings = @{
NodeID=$nodeProps["NodeID"];
SettingName="WMICredential";
SettingValue="12";
}
#Creating node settings
$newNodeSettings = New-SwisObject $swis -EntityType "Orion.NodeSettings" -Properties $nodeSettings
Instead of SettingValue=($credentialId.ToString());, I just set the value to a string value of 12.
The script can never add the WMI credential no matter what I do.