Method invocation failed ....

May 14, 2015 at 9:35 PM
Edited May 14, 2015 at 9:36 PM
When attempting to run PAL from powershell (as adminstrator): (substituted <some_directory> and <user> for obvious reasons....)

PS C:\Program Files\PAL\PAL> Powershell .\PAL.ps1 -Log 'C:\<some_directory>\Tserver1_20150428.blg' -ThresholdFile 'C:\Program Files\PAL\PAL\SystemOverview.xml' -Interval 'AUTO' -IsOutputHtml $True -HtmlOu
tputFileName '[LogFileName]_PAL_ANALYSIS_[DateTimeStamp].htm' -IsOutputXml $True -XmlOutputFileName '[LogFileName]_PAL_ANALYSIS_[DateTimeStamp].xml' -OutputDir 'C:\Brannen Bank' -AllCounterStats $True
-NumberOfThreads 1 -IsLowPriority $False -OS '64-bit Windows Server 2008 R2' -PhysicalMemory '4' -UserVa '2048'

--A clear screen happens here--

Transcript started, output file is C:\Users\<user>\AppData\Local\Temp\2\PAL.log
PAL v2.4 (
Written by: Clint Huffman ( and other contributors.
Last Modified: 01/20/2015 16:24:05
The information and actions by this tool is provided "as is" and is intended for information purposes only. The authors and contributors of this tool take no responsibility for damages or losses incur
red by use of this tool.

Your locale is set to: English (United States)
WARNING: Please post errors or problems with this tool to the PAL web site located at with the following error message and a brief description of what you were trying
to do. Thank you.
Method invocation failed because [System.Int32] doesn't contain a method named 'SubString'.
At C:\Program Files\PAL\PAL\PAL.ps1:508 char:42
  • If ($MyArgs[$i].SubString <<<< (0,1) -eq '-')
    • CategoryInfo : InvalidOperation: (SubString:String) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : MethodNotFound
PS C:\Program Files\PAL\PAL>

I want to be able to set up a foreach for a list of files, and run PAL against each file. Am trying to get the powershell syntax correct, and am running into this error.

The section of code around line 508:
            #// Add the extra arguments into a hash table
            #Write-host $MyArgs.Count
            For ($i=0;$i -lt $MyArgs.Count;$i++)
                If ($MyArgs[$i].SubString(0,1) -eq '-')
                    $sName = $MyArgs[$i].SubString(1);$i++;$sValue = $MyArgs[$i]
                    #// $htQuestionVariables is a global variable
                    If (($sValue -eq 'True') -or ($sValue -eq 'False'))
                        $IsTrueOrFalse = ConvertTextTrueFalse $sValue
                        [void] $htQuestionVariables.Add($sName,$sValue)
                        [void] $htQuestionVariables.Add($sName,$sValue)                    
This does run from the wizard.


Thanks, Jason