3

I want to open a PowerShell script in the Windows Terminal instead of the normal PowerShell terminal.

The command I use to open this script is

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Users\username\Documents\A1111 Web UI Autoinstaller\Launcher\LauncherUI.ps1" skip no-autolaunch

However, this opens the script in a normal PowerShell window:

enter image description here

I would like to open it in my Windows Terminal PowerShell window:

enter image description here

How would I go about doing this?

1 Answer 1

2

You could basically run the program from the which console host you want to use.

# Use conhost
conhost.exe powershell.exe -ExecutionPolicy Bypass -File "script.ps1"

# Use wt
wt.exe powershell.exe -ExecutionPolicy Bypass -File "script.ps1"

Or, you can set Windows Terminal as default console host.

On Windows Terminal, go to Settings > Startup > Default Terminal Application > Windows Terminal

windows terminal

On Conhost, right click the title bar > Defaults > Terminal Default Terminal Application > Windows Terminal

console host

1
  • 1
    Point of note: These settings are version specific. So, for those not on the version you are demo'ing on, then those settings are moot.
    – postanote
    Feb 13, 2023 at 2:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .