How can I determine if my PowerShell script is running in Windows terminal? #8691

Open
opened 2026-01-31 01:35:40 +00:00 by claunia · 0 comments
Owner

Originally created by @kasini3000 on GitHub (May 30, 2020).

How can I determine if my PowerShell script is running in Windows terminal?

I wrote a script, a.ps1, which contains some special unicode characters.
I want to check whether my script is running in the powershell executed by windows terminal. How can I detect the windows terminal host?

Originally created by @kasini3000 on GitHub (May 30, 2020). How can I determine if my PowerShell script is running in Windows terminal? I wrote a script, a.ps1, which contains some special unicode characters. I want to check whether my script is running in the powershell executed by windows terminal. How can I detect the windows terminal host?
claunia added the Needs-TriageNeeds-Tag-FixIssue-Docs labels 2026-01-31 01:35:40 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8691