Press "Enter" to skip to content

Testing if PowerShell is Running from Windows Terminal

Mike Robbins wants to know your terminal:

In the evolving landscape of software development and system administration, understanding your environment is essential for ensuring that scripts and commands run as expected. One useful PowerShell function that helps identify whether a script is running within Windows Terminal is my Test-IsWindowsTerminal function. This function is valuable for developers and system administrators who must tailor their scripts based on the terminal environment.

Click through for a PowerShell function that does just that.