PowerShell workflow default param string value shows error
See original GitHub issueSystem Details
- Operating system name and version: Windows 10 1607 x64
- VS Code version: 1.11.1
- PowerShell extension version: 12.2
- Output from
$PSVersionTable: (thecodecommands don’t have any output on my system?)
PS C:\> $pseditor.EditorServicesVersion
Major Minor Build Revision
----- ----- ----- --------
0 12 1 0
PS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.953
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.953
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
in powershell workflow, a string default parameter is showing an error saying it needs to be a “simple value” like an int or a string. and it is a string.
Attached Logs

Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
PowerShell Workflows: Restrictions - Scripting Blog
Updated value of A is: 3 The workflow starts by defining a variable, $a = 22, and then displaying its value. In an...
Read more >Simplify Your PowerShell Script with Parameter Validation
Simply put, parameter validation is a means for Windows PowerShell to validate a parameter's value before the body of the script or function ......
Read more >Handling Errors the PowerShell Way - Scripting Blog
When you use the -ErrorVariable parameter in a call to a command, the error is assigned to the variable name that you specify....
Read more >about_ActivityCommonParameters - Microsoft Learn
Describes the parameters that Windows PowerShell Workflow adds to activities.
Read more >Create and Use Default Values in PowerShell Scripts
The command and its associated error are shown in the following image. ... By using the Param statement and assigning a default value, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@dotps1 I know you’re probably not looking for an answer anymore, but it’s because the parameter is typed as a string array. Even though the default value specified in the script is a string, it would need to first be converted to an array for the typing to match. Workflows are compiled, so they tend to be a good deal more strict than normal PowerShell.
@dotps1 Hi Thomas, do you debug Workflows in VS Code? Can you point me at any resources that can instruct me how to do it? Thank you