Do you happen to have an updated copy of the import script too? This updated export script worked like a champ but the import script is giving me errors.
Thanks,
- Ben
---------------------------------------------------------------------
Index operation failed; the array index evaluated to null.
At C:\VM_permissions_import.ps1:33 char:11
+ $roleHash[ <<<< $_.Name] = $_.RoleId
+ CategoryInfo : InvalidOperation: (System.Collections.Hashtable:
Hashtable) [], RuntimeException
+ FullyQualifiedErrorId : NullArrayIndex
Method invocation failed because [System.String] doesn't contain a method named
'Load'.
At C:\VM_permissions_import.ps1:38 char:17
+ $vInventory.Load <<<< ($XMLfile)
+ CategoryInfo : InvalidOperation: (Load:String) [], RuntimeExcep
tion
+ FullyQualifiedErrorId : MethodNotFound
Cannot convert value "Inventory/Roles/Role" to type "System.Xml.XmlDocument". E
rror: "Data at the root level is invalid. Line 1, position 1."
At C:\VM_permissions_import.ps1:40 char:20
+ $XpathRoles = [xml] <<<< "Inventory/Roles/Role"
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
Cannot convert value "Inventory/Permissions/Permission" to type "System.Xml.Xml
Document". Error: "Data at the root level is invalid. Line 1, position 1."
At C:\VM_permissions_import.ps1:41 char:26
+ $XpathPermissions = [xml] <<<< "Inventory/Permissions/Permission"
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
Method invocation failed because [System.String] doesn't contain a method named
'SelectNodes'.
At C:\VM_permissions_import.ps1:43 char:24
+ $vInventory.SelectNodes <<<< ($XpathRoles) | % {
+ CategoryInfo : InvalidOperation: (SelectNodes:String) [], Runti
meException
+ FullyQualifiedErrorId : MethodNotFound
Method invocation failed because [System.String] doesn't contain a method named
'SelectNodes'.
At C:\VM_permissions_import.ps1:53 char:24
+ $vInventory.SelectNodes <<<< ($XpathPermissions) | % {
+ CategoryInfo : InvalidOperation: (SelectNodes:String) [], Runti
meException
+ FullyQualifiedErrorId : MethodNotFound