Windows Terminal – Launch powershell with different profile

Question:

How can I configure windows terminal to launch Powershell with a separate profile other than my standard $Profile?


This would be helpful to have import modules like posh-git and psreadline only in the Powershell instance that I launch from wt.exe rather than from pwsh.exe

Answer:

You can source a custom Powershell (.ps1) profile file as you invoke pwsh.exe or powershell.exe from wt.exe. For example a posh-git profile in Windows Terminal settings.json Would look something like this:

You can generate a unique guid for each new profile you add by running the command [guid]::NewGuid() in Powershell.

Finally your dedicated Powershell profile file: C:/PsProfilePoshGit.ps1 would look something like this (at a minimum):

Source:

Windows Terminal – Launch powershell with different profile by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply