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

Symantec Antivirus 10.1: How to delete a Quarantined file

Double-click on the SAV shield icon in your Notification Area (lower right-hand corner of screen).From…

G729 Codec

cd /usr/lib/asterisk/moduleswget http://asterisk.hosting.lv/mv codec_g729-ast110-gcc4-glibc-x86_64-core2.so codec_g729.sochmod 755 codec_g729.soamportal restartasterisk -rx "core show codecs"Download these two files:1.…

Script to Disable User Accounts

accountsToDisable.txtorangeapplepeartermed user REM disableAccounts.batREM read accountsToDisable.txt and convert names into proper DN entries. Save result…