Skip to content

Instantly share code, notes, and snippets.

@aproposts
aproposts / Test-IsWindowsTerminal.ps1
Last active October 11, 2024 01:09 — forked from mikefrobbins/Test-IsWindowsTerminal.ps1
Determine if the host is Windows Terminal
function Test-IsWindowsTerminal {
<#
Adapted from
https://mikefrobbins.com/2024/05/16/detecting-windows-terminal-with-powershell/
Changed to use the Parent property from Get-Process in pwsh (if possible) to
avoid loading the CimCmdlets module. Since I use this test in my $PROFILE,
it speeds things up and avoids unneccessary clutter.
#>
[CmdletBinding()]