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

R5 2400G Zen CPU Cores Undervolt and Overclocking

Some quick tested values: 3600 Mhz | 1.225 mV ~ 70 Watts (need to also…

Some Common SysAdmin Tools

LAN Speed Test: https://totusoft.com/lanspeedPutty: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.htmlCutePDF: http://www.cutepdf.com/Products/CutePDF/writer.aspRemote Desktop Manager: WAN IP: https://ipchicken.com/Chrome: https://www.google.com/chrome/Firefox: https://www.mozilla.org/en-US/firefox/download/thanks/?scene=2#download-fxFlash: Java: TextPad:…

How to Disable or Remove Windows Defender

Step 1: Disable Real-time monitoring immediately to minimize current runtime memory resource utilization Set-MpPreference -DisableRealtimeMonitoring…
Other project: DragonCoin.com