This project is read-only.

Getting error when running -- Convert-SqlServerInventoryClixmlToExcel.ps1

Apr 11, 2013 at 7:48 PM
When running Convert-SqlServerInventoryClixmlToExcel.ps1, I am getting error as below :

PS C:\Users*\Documents\WindowsPowerShell> .\Convert-SqlServerInventoryClixmlToExcel.ps1 -FromPath "C:\Users*\D
ocuments\SQL Server Inventory - 2013-04-11-12-25.xml.gz"
ForEach-Object : Array assignment failed because index '1,0' was out of range.
At C:\Users**\Documents\WindowsPowerShell\Modules\SqlServerInventory\SqlServerInventory.psm1:7206 char:41
  • $_.Server.Databases | ForEach-Object <<<< {
    • CategoryInfo : InvalidOperation: (System.Object[]:Object[]) [ForEach-Object], RuntimeException
    • FullyQualifiedErrorId : IndexOutOfRange,Microsoft.PowerShell.Commands.ForEachObjectCommand
Apr 11, 2013 at 8:21 PM
Looks like one of the instances scanned didn't have any databases included in the results. If you enabled logging when you ran .\Get-SqlServerInventoryToClixml.ps1 you can see if there were any errors when collecting information.

I'll also look into updating the code so that this particular condition is handled better.