2

I want to let Windows Terminal run PS1 script while using the blue-backgrounded "PowerShell" profile. If I simply switch to Windows Terminal as default Windows console, double-clicking a PS1 file will open it in the black-backgrounded default profile.

I tried changing PS1 file association in HKCR\Microsoft.PowerShellScript.1\shell\0\command to

wt.exe new-tab -p "PowerShell" -c "powershell.exe %1"

But it seems that WT will ignore the profile choice and open a black "Default" tab as long as there is a command following. Is there any way to force WT to use a certain profile while also running some commands?

1 Answers1

1

Changing the appearance of the "Defaults" profile will change how the Terminal appears when launched in response to a commandline process being launched.

There's some heuristic for attempting to match the commandline of the process being launched to one of your profiles, but I believe that only works for exact matches. For example, powershell.exe should launch your "Windows PowerShell" profile, but powershell.exe -NoLogo -c foo.ps1 will fall back to the defaults.

zadjii
  • 386