PAL 2.3.2 Error - Invoke-Expression : The variable '$m' cannot be retrieved because it has not been set.

Sep 10, 2012 at 12:32 AM

Hi,

I attempt to use a *.BLG collected from a SharePoint Server to run through the Microsoft Office SharePoint Server (MOSS) 2007 and Search threshold file template and got this error from the PowerShell Invoke-Expression command on line 3361 char:22

There is a missing $m variable that has not been set which cannot be found on the PAL.ps1

WARNING: Please post errors or problems with this tool to the PAL web site
located at http://www.codeplex.com/PAL with the following error message and a
brief description of what you were trying to do. Thank you.
Invoke-Expression : The variable '$m' cannot be retrieved because it has not be
en set.
At E:\Program Files\PAL\PAL\PAL.ps1:3361 char:22
+     Invoke-Expression <<<<  -Command $sCode
    + CategoryInfo          : InvalidOperation: (m:Token) [Invoke-Expression],
    RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined,Microsoft.PowerShell.Command
   s.InvokeExpressionCommand

***************************************************************
Looking at the code in PAL.ps1 and PALAnalyze.ps1 , I can't find this $m variable at all.

Function ExecuteCodeForGeneratedDataSource
{
    param($Code,$Name,$ExpressionPath,$htVariables,$htQuestionVariables)
    #'Code after changes:' >> CodeDebug.txt
    #'===================' >> CodeDebug.txt
    #$sCode >> CodeDebug.txt
    Invoke-Expression -Command $sCode
}

Coordinator
Sep 18, 2012 at 4:42 AM

The $m variable is PowerShell code within the Microsoft Office SharePoint Server (MOSS) 2007 and Search threshold file. Search for it there. It looks like there was a coding error there. The owner of the threshold file is Ron Grzywacz (ronalg@microsoft.com). Consider contacting him about the error.