Having issues getting this running...

Jan 7, 2013 at 8:36 PM

Hey...

 I'm trying to get this app working to help with monthly patching, but have had very very little luck with it.... I'm not a Powershell guy, I'm much better at Vbs and classic batch scripts... Andy help would be very appreciated...

Ran this on a Win7 with PS3 and win2k8 with PS2. I first get errors about it being not signed. So I start PowerShell and at the prompt I type... Set-ExecutionPolicy Unrestricted -force

Now it warns me 3 times with the following error...

Run only scripts that you trust. While scripts from the internet can be useful,
 this script can potentially harm your computer. Do you want to run
C:\PatchTool\Start-PoshPAIG.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"):

So I hit the "R" 3 times  and the app eventually starts.

I then get this error in the PS window...

Cannot index into a null array.
At C:\PatchTool\Start-PoshPAIG.ps1:53 char:9
+         $Global:maxConcurrentJobs = $Optionshash['MaxJobs']
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\PatchTool\Start-PoshPAIG.ps1:54 char:9
+         $Global:MaxRebootJobs = $Optionshash['MaxRebootJobs']
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\PatchTool\Start-PoshPAIG.ps1:55 char:13
+         If ($Optionshash['ReportPath']) {
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

If I edit the Start-PoshPAIG.ps1 to take the defaults and skip the options.xml and load the defaults this does not pop up, so a work around, not a fix.

Function Set-PoshPAIGOption {
#    If (Test-Path (Join-Path $Path 'options.xml')) {
#        $Optionshash = Import-Clixml -Path (Join-Path $Path 'options.xml')
#        $Global:maxConcurrentJobs = $Optionshash['MaxJobs']
#        $Global:MaxRebootJobs = $Optionshash['MaxRebootJobs']
#        If ($Optionshash['ReportPath']) {
#            $Global:reportpath = $Optionshash['ReportPath']
#   
#        } Else {
#            $Optionshash['ReportPath'] = $Global:reportpath = (Join-Path $Home 'Desktop')
#        }
#   } Else {
        #Default Options
        $optionshash = @{
            MaxJobs = 20
            MaxRebootJobs = 5
            ReportPath = ($Home)
        }
#    }
    $optionshash | Export-Clixml -Path (Join-Path $pwd 'options.xml') -Force
}

 

So now I get the app open, I can add in a server, but it doesn't really do anything...

Any ideas?

Coordinator
Jan 9, 2013 at 1:57 AM

For the issue with the popup about scripts downloaded from the internet, your best bet is to right click on the .zip file and select to unblock the file. If you do it from that file, all of the other scripts will run from the .zip without that popup from happening.

For the second issue, I would recommend deleting the options.xml file that is in the poshpaig folder. Once you do that, it should auto create a new options file with the correct information in it.