vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Support for VSCode variables and arguments when defining Additional Exe Paths

Open cos4ni2s opened this issue 8 months ago • 2 comments

Prerequisites

  • [x] I have written a descriptive issue title.
  • [x] I have searched all issues to ensure it has not already been reported.

Summary

The PowerShell Additional Exe Paths setting only accept absolute path. This feature request is about getting that setting to resolve vscode's predefined variables and to accept arguments such as -NoLogo, -NoExit, and -Command.

Proposed Design

No response

cos4ni2s avatar May 25 '25 06:05 cos4ni2s

The variables in path is reasonable but not sure if the API allows us to implement it. The problem with the arguments at least for the PowerShell extension terminal is that we require certain arguments that are non-negotiable. If you just want a terminal with these, you can do that by using terminal profiles.

JustinGrote avatar May 27 '25 18:05 JustinGrote

The variables in path is reasonable but not sure if the API allows us to implement it. The problem with the arguments at least for the PowerShell extension terminal is that we require certain arguments that are non-negotiable. If you just want a terminal with these, you can do that by using terminal profiles.

I have already setup a custom PowerShell terminal profile with my desired arguments including variables:

"terminal.integrated.profiles.windows": {
	"PowerShell": {
		"overrideName": true,
		"icon": "terminal-powershell",
		"path": "${env:GROVE}${/}PowerShell${/}Version-7.5.1${/}pwsh.exe",
		"args": ["-NoLogo", "-NoExit", "-Command", ". ([System.IO.Path]::GetFullPath(\"$PSHOME${/}..${/}PowerShell.ps1\"))"]
	},
}

What I'm aiming for is to replicate that custom terminal in the powershell.powerShellAdditionalExePaths setting ideally as follows:

"powershell.powerShellAdditionalExePaths": {
	"PowerShell": "${config:terminal.integrated.profiles.windows.PowerShell}"
}

cos4ni2s avatar May 27 '25 22:05 cos4ni2s