-
Notifications
You must be signed in to change notification settings - Fork 510
Pass command to PowerShell at startup #4360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Any particular reason you'd prefer this over using a |
Just preference I guess. Haven't really used Also, when actually opening Also, VSCode |
While searching I found #190 about Workspace Profiles. Would that solve this issue? |
Sounds like that would tie it to a VSCode workspace? I'd like it not to be like that. Maybe |
@o-l-a-v those details are readily available in the language status icon: Full version and architecture of the PowerShell executable used to launch the Extension Terminal. |
I don't have the need for this anymore. I've started using a central profile.ps1 synced with OneDrive, then local profiles points to it like so: <#
.EXAMPLE
& $(Try{$psEditor.GetEditorContext().CurrentFile.Path}Catch{$psISE.CurrentFile.FullPath})
#>
[OutputType([System.Void])]
Param()
& ('{0}\_Share\AppData\PowerShell\Profile.ps1' -f $env:OneDriveConsumer) |
Prerequisites
Summary
Unlike existing issue #1470 which asks for the ability to pass parameters to powershell.exe, I'd like the ability to pass PowerShell command(s) to whatever PowerShell version is used behind the scenes by the extension.
For the VS Code built in terminals, but also in Windows Terminal, I like to add following command at startup to quickly be able to identify what PowerShell version is used:
"'v{0} x{1}' -f $PSVersionTable.PSVersion.ToString(),$(if([System.Environment]::Is64BitProcess){'64'}else{'86'})"
For VSCode integrated terminals I add the following in
settings.json
:Click to view
For Windows Terminal it can be done like so:
Click to view
Proposed Design
A similar
config.json
settings for the PowerShell extension would be nice. Something likepowershell.integratedConsole.startupCommand
maybe?powershell.integratedConsole.startupCommand
is defined and has a value:<powershell/pwsh>.exe /Command <value_of_powershell.integratedConsole.startupCommand>
The text was updated successfully, but these errors were encountered: