Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"name": "PowerShell Launch Script",
"type": "PowerShell",
"request": "launch",
"script": "^\"enter path or command to execute e.g.: \\${workspaceFolder}/src/foo.ps1 or Invoke-Pester\"",
"script": "^\"Enter path or command to execute, for example, \\${workspaceFolder}/src/foo.ps1 or Invoke-Pester\"",
"cwd": "^\"\\${cwd}\""
}
},
Expand Down Expand Up @@ -909,6 +909,20 @@
"default": false,
"markdownDescription": "Creates a temporary PowerShell Extension Terminal for each debugging session. This is useful for debugging PowerShell classes and binary modules."
},
"powershell.debugging.executeMode": {
"type": "string",
"enum": [
"DotSource",
"Call"
],
"default": "DotSource",
"markdownEnumDescriptions": [
"Use the Dot-Source operator `.` to launch the script, for example, `. 'C:\\Data\\MyScript.ps1'`",
"Use the Call operator `&` to launch the script, for example, `& 'C:\\Data\\MyScript.ps1'`"
],
"markdownDescription": "Sets the operator used to launch scripts."

},
"powershell.developer.bundledModulesPath": {
"type": "string",
"default": "../../PowerShellEditorServices/module",
Expand Down
1 change: 1 addition & 0 deletions src/features/DebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export class DebugSessionFeature extends LanguageClientConsumer

const settings = getSettings();
config.createTemporaryIntegratedConsole ??= settings.debugging.createTemporaryIntegratedConsole;
config.executeMode ??= settings.debugging.executeMode;
if (config.request === "attach") {
resolvedConfig = await this.resolveAttachDebugConfiguration(config);
} else if (config.request === "launch") {
Expand Down
6 changes: 6 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ export enum StartLocation {
Panel = "Panel"
}

export enum ExecuteMode{
Call = "Call",
DotSource = "DotSource"
}

export type PowerShellAdditionalExePathSettings = Record<string, string>;

class CodeFormattingSettings extends PartialSettings {
Expand Down Expand Up @@ -107,6 +112,7 @@ class ScriptAnalysisSettings extends PartialSettings {

class DebuggingSettings extends PartialSettings {
createTemporaryIntegratedConsole = false;
executeMode = ExecuteMode.DotSource;
}

class DeveloperSettings extends PartialSettings {
Expand Down