This project is read-only.
2

Closed

Options - errors out: "Cannot index into a null aray"

description

Options.xml file is blank (see below, even after setting the options again and saving):
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Nil />
</Objs>

There is constant output in the PowerShell window about not being able to index a null array on launch and when the options window is opened, data entered, and then saved... Removed my username in the c:\users path and replaced it with +++.

Cannot index into a null array.
At C:\Users+++\Desktop\test\Start-PoshPAIG.ps1:66 char:9
  • $Global:maxConcurrentJobs = $Optionshash['MaxJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Users+++\Desktop\test\Start-PoshPAIG.ps1:67 char:9
  • $Global:MaxRebootJobs = $Optionshash['MaxRebootJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Users+++\Desktop\test\Start-PoshPAIG.ps1:68 char:13
  • If ($Optionshash['ReportPath']) {
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Users+++\Desktop\test\Options.ps1:66 char:5
  • $MaxRebootJobs_txtbx.Text = $Optionshash['MaxRebootJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Users+++\Desktop\test\Options.ps1:67 char:5
  • $MaxJobs_txtBx.Text = $Optionshash['MaxJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Users+++\Desktop\test\Options.ps1:68 char:5
  • $ReportPath_txtbx.Text = $Optionshash['ReportPath']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

file attachments

Closed Jun 6, 2016 at 3:51 PM by boeprox

comments

goslackware wrote Apr 16, 2015 at 4:09 PM

When I click the "Save" button, the options.xml file is:
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Nil />
</Objs>

The errors I get are:

Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Options.ps1:82 char:9
  • $Optionshash['MaxRebootJobs'] = $MaxRebootJobs_txtbx.Text
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Options.ps1:89 char:9
  • $Optionshash['MaxJobs'] = $MaxJobs_txtBx.Text
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Options.ps1:96 char:9
  • $Optionshash['ReportPath'] = $ReportPath_txtbx.Text
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:66 char:9
  • $Global:maxConcurrentJobs = $Optionshash['MaxJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:67 char:9
  • $Global:MaxRebootJobs = $Optionshash['MaxRebootJobs']
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\temp\testing\PoshPAIG_2_1_5\Start-PoshPAIG.ps1:68 char:13
  • If ($Optionshash['ReportPath']) {
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : NullArray

goslackware wrote Apr 16, 2015 at 4:32 PM

As a work around, I've manually created the options.xml file, which is below.
Note the jobs is high as I run it from a 10gb network with 8core and 16GB

---- options.xml ----
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
  <T>Deserialized.System.Collections.Hashtable</T>
  <T>Deserialized.System.Object</T>
</TN>
<DCT>
  <En>
    <S N="Key">MaxRebootJobs</S>
    <I32 N="Value">500</I32>
  </En>
  <En>
    <S N="Key">MaxJobs</S>
    <I32 N="Value">500</I32>
  </En>
  <En>
    <S N="Key">ReportPath</S>
    <S N="Value">C:\temp</S>
  </En>
</DCT>
</Obj>
</Objs>

goslackware wrote Apr 16, 2015 at 5:36 PM

See attachment of the options.xml file. When I pasted it above, it's formatting got messed up.

goslackware wrote Apr 16, 2015 at 5:37 PM

try2