Building an exe with Powershell Studio 2019 now causes errors
Posted: Wed Jul 03, 2019 6:44 am
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.165
OS: Windows 10 Pro (64 Bit)
Build: v10.0.17134.0
I have a script that I have been building into an exe with Powershell Studio 2017
The script runs without errors and the exe that was build runs without errors
When I upgraded to 2019, the exe gets built from the same ps1 without errors BUT when I run the exe it now errors out. Below is the error I get form the command prompt while executing.
I have checked the code and do not see any issues and this code works with PSS 2017. Here is the code (lines 1 to 11) where the errors are occurring:
Build: v5.6.165
OS: Windows 10 Pro (64 Bit)
Build: v10.0.17134.0
I have a script that I have been building into an exe with Powershell Studio 2017
The script runs without errors and the exe that was build runs without errors
When I upgraded to 2019, the exe gets built from the same ps1 without errors BUT when I run the exe it now errors out. Below is the error I get form the command prompt while executing.
- Line 5: At line:4 char:1
- + [CmdletBinding(ConfirmImpact = 'Medium',
- + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Unexpected attribute 'CmdletBinding'.
- At line:6 char:1
- + param
- + ~~~~~
- Unexpected token 'param' in expression or statement.
Code: Select all
[CmdletBinding(ConfirmImpact = 'Medium',
SupportsShouldProcess = $true)]
param
(
[Parameter(HelpMessage = 'Path to XML Configuration File')]
[ValidatePattern('.xml$')]
[ValidateScript({ Test-Path -Path $_ -PathType Leaf })]
[string]$Config,
[Parameter(HelpMessage = 'URI to Webservice')]
[string]$Webservice
)Codebox]
Any help would be appreciated to get the exe working again on 2019.
Thanks