Forum Discussion
Ted McLaughlin
Feb 15, 2018Brass Contributor
Changing the PS to something different
My company has two different O365 tenants, and I go back and forth between the two in PS all the time. As you can imagine it's easy to get the two mixed up.
What I'm trying to find out is if...
VasilMichev
Feb 19, 2018MVP
Personally, I prefer to leave the prompt alone (as it's still useful for showing the working directory and such) and instead change the Title of the PowerShell console to reflect on the current tenant. Here's the code I'm using:
$Host.ui.RawUI.WindowTitle = "Connected as: $($cred.username)"
Just remember to update it after each connect/disconnect event.