You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried several combinations of "args": [] and none of them produce a $args in the debugger. Should the "args" parameter for a configuration work? Looking through the source but not finding anything yet.
{
"version": "0.1.0",
"configurations": [
{
"name": "PowerShell",
"type": "PowerShell",
"program": "PowerShell Scripts/output.ps1",
"args": ["Verbose:$true"],
"request": "launch"
}
]
}
The debugger launches fine, but attempts using "-Verbose", "-Verbose:$true", or "/Verbose:$true" do not get passed to $args. The "output.ps1" file is very simple:
Write-Output $args
Get-Process
Write-Verbose -Message "Debugging PS in VSCode!"
The text was updated successfully, but these errors were encountered:
Currently this 'args' parameter is for arguments to the launched process, they currently don't get sent along to the script that is debugged. This is great feedback though, I'll try to make this possible in a future release.
I have a working prototype for this. It requires changes mostly on the PSES side but there are a few changes required to the package.json file as well. For your case you would pass the parameter like so:
"args": ["-Verbose"],
or if you wanted to get pedantic:
"args": ["-Verbose:$true"],
or
"args": ["-Verbose:", "$true"],
Essentially the args string gets passed directly to the script to execute. If there is more than one args string, then I would join them with a space and pass that string to the script.
I have tried several combinations of "args": [] and none of them produce a $args in the debugger. Should the "args" parameter for a configuration work? Looking through the source but not finding anything yet.
{
"version": "0.1.0",
"configurations": [
{
"name": "PowerShell",
"type": "PowerShell",
"program": "PowerShell Scripts/output.ps1",
"args": ["Verbose:$true"],
"request": "launch"
}
]
}
The debugger launches fine, but attempts using "-Verbose", "-Verbose:$true", or "/Verbose:$true" do not get passed to $args. The "output.ps1" file is very simple:
Write-Output $args
Get-Process
Write-Verbose -Message "Debugging PS in VSCode!"
The text was updated successfully, but these errors were encountered: