Posted On December 17, 2022

How to Set PowerShell Window and Prompt Title or Label

kimconnect 0 comments
blog.KimConnect.com >> Windows >> How to Set PowerShell Window and Prompt Title or Label

Have you ever wondered about changing the boring PS C:\Windows\system32> whenever a new window is opened in PowerShell? You’re in luck by finding this quick note. Here’s how you’d do it:

# Set Window title to match current machine name
$host.UI.RawUI.WindowTitle="PS $env:computername $env:username"

# Set Window prompt to match current machine name
function prompt {"PS $env:computername $env:username> "}

# Set color of label
function prompt{
Write-Host ("PS $env:computername $env:username> ") -nonewline -foregroundcolor Yellow
return " "
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PEN TEST

Kali Linux: Pen testing Linux Distro: https://www.kali.org/get-kali/ VMware Images: https://www.kali.org/get-kali/#kali-virtual-machines AirCrack-NG: WIFI Acunetix: Web Servers…

How to set up Sip Trunk between two offices

1. Set up two Asterisk machines: Asterisk1 & Asterisk2   Example for Ubuntu: vim /etc/network/interfaces configure…

How to Install Windows Dot Net 3.5 & 4.5

Run these commands to check dot net 3.5: PS C:\Windows\system32> import-module servermanagerPS C:\Windows\system32> get-windowsfeature web-asp-netDisplay…
Other project: DragonCoin.com