As a Systems Administrator I spend a lot of time working in PowerShell, and may be running multiple PS consoles simultaneously, or even generating child sessions from a parent. Keeping track of them all can be mind numbing if they are all named “Windows Powershell” or “Administrator : Windows Powershell.” So, to help quickly Alt-Tab to the correct console I have a script I run that allows me to assign a title to the Window, changing it from “Windows Powershell” to something like “PSSession into Server 1.”
Here is the content of that script :
function Name-PSWindow{
#######################################################
##
## Name-PSWindow.ps1, v1.0.1,2026
##
## Original Author : Dan Yedinak
##
#######################################################
param(
[Parameter(Mandatory=$true)][string]$title
)
if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -eq $true) {
$Host.UI.RawUI.WindowTitle = "Administrator : $title"
} else {
$Host.UI.RawUI.WindowTitle = $title
}
<#
.SYNOPSIS
Allows for naming of the title bar of a powershell window, respecting the Administrator
.DESCRIPTION
Allows for naming the current powershell window to more easily identify what is is for. If the console is running with elevated permissions it adds Administrator : to the beginning of the title string.
.PARAMETER title
Used to add a string title to a powershell window. Enclose the string in either single or double quotes. 'Administrator' will be added automatically if running with elevated permissions.
.INPUTS
title paramater
.OUTPUTS
Output is visible only on the title bar of the powershell window
.EXAMPLE
PS> Name-PSWindow -title "PSSession into Server 1"
Title Reads : "Administrator : PSSession into Server 1"
.EXAMPLE
PS> Name-PSWindow -title "Searching for Duplicates in $env:UserProfile\Documents"
Title Reads : "Searching for Duplicates in $env:UserProfile\Documents"
.LINK
Online version: https://eclat.tech/software/microsoft/powershell/naming-powershell-console-windows
.NOTES
Author : Dan Yedinak
Version : v1.0.1,2026
#>
}
Once imported, use the Get-Help Name-PSWindow -Full for full output of the included help.
Note that this script does not parse the content of the title in any way – it assumes that the script is being used internally for regular Systems Administration work.