Further examples. I was attempting to use Invoke-XmlCommand to create LDAP Providers. I run the command with Invoke-XmlCommand and got no errors or output. It just acted as if nothing happened. I ran it with my custom push and got back an error message saying the filter was wrong:
1Invoke-XmlCommand "<configConfMo inHierarchical=""true""><inConfig><aaaLdapProvider basedn='DC=DOMAIN,DC=LOCAL' rootdn=CN=OU,DC=DOMAIN,DC=LOCAL' filter='sAMAccountName=$userid' name='x.x.x.x'><aaaLdapGroupRule authorization='enable' rn='ldapgroup-rule' targetAttr='memberOf' traversal='non-recursive'/></aaaLdapProvider></inConfig></configConfMo>"
1Push-HTTPPostCommand -target $CurrentUCSMInstance.UcsUri -post "<configConfMo cookie=""$($CurrentUCSMInstance.cookie)"" inHierarchical=""true""><inConfig><aaaLdapProvider basedn='DC=DOMAIN,DC=LOCAL' rootdn='CN=OU,DC=DOMAIN,DC=LOCAL' filter='sAMAccountName=`$userid' name='x.x.x.x'><aaaLdapGroupRule authorization='enable' rn='ldapgroup-rule' targetAttr='memberOf' traversal='non-recursive'/></aaaLdapProvider></inConfig></configConfMo>"
2
3<configConfMo dn="" cookie="1312984644/dd2c702c-8059-4354-ae4d-2943681c91c4" response="yes" errorCode="101" invocationResult="unidentified-fail" errorDescr="Incorrect search filter format for provider 10.140.72.135"> </configConfMo>
So Invoke-XmlCommand doesn't report all errors returned from the UCS? Luckily using the error returned from my custom function I was able to investigate my string and see that PowerShell was replacing $userid since it saw it as a variable. Once I escaped the $ with a back tick I was able to send the command Invoke-XmlCommand.