I try to open a PowerShell script in PrimalScript 2015 with a PowerShell V2 mode - I select the v2 icon on top of the Platform menu bar.
The code is shown below:
Code: Select all
[CmdletBinding()]
Param([Parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelinebyPropertyName=$true)]
[object]$object
)
BEGIN {}
PROCESS {
}
END {}
}
ERROR: <position> : Missing ] at end of type token.
ERROR: + CategoryInfo : ParserError: (Parameter(Mandatory=$true,:String) [], ParseException
ERROR: + FullyQualifiedErrorId : EndSquareBracketExpectedAtEndOfType
ERROR:
Execution time: 00:00:02
However, when I select the PowerShell V4 mode - I select the v4 icon on top of the Platform menu bar, I get the error below.
ERROR: At C:\Scriptings\PowerShell\Test.ps1:491 char:1
ERROR: + [CmdletBinding()]
ERROR: + ~~~~~~~~~~~~~~~~~
ERROR: Unexpected attribute 'CmdletBinding'.
ERROR:
ERROR: At C:\Scriptings\PowerShell\Test.ps1:492 char:2
ERROR: + Param([Parameter(Mandatory=$true,
ERROR: + ~~~~~
ERROR: Unexpected token 'Param' in expression or statement.
ERROR:
ERROR: At C:\Scriptings\PowerShell\Test.ps1:502 char:1
ERROR: + }
ERROR: + ~
ERROR: Unexpected token '}' in expression or statement.
ERROR:
ERROR:
ERROR: + CategoryInfo : ParserError: (:) [], ParseException
ERROR: + FullyQualifiedErrorId : UnexpectedAttribute
ERROR:
Execution time: 00:00:02
How can I set up PrimalScript 2015 so that it can it can generate the error ouput for both PowerShell V2 and PowerShell V4 editing modes?