Time to read: ~ 1.5 minutes
What’s the Problem?
Recently I came upon a question online that went along the lines of…
Every time I open PowerShell it takes a while to get to the prompt…
Followed by a screenshot along the lines of…
What’s the Cause?
Straight away the online community exploded with a multitude of answers but all sharing same word
Now people use their
$profile for different things, from setting up commonly used aliases, to changing the settings of your PowerShell window, and everything in between.
Personally part of my profile is to change the default colour of error message since I’m slightly red-green colour-blind and it’s just too hard to read the default red on blue.
What about none?
If you don’t want to have a
$profile then don’t worry.
By default the
$profile variable exists but that doesn’t mean that the file does. You can test this by running
And if that returns a
True then you have a profile set up.
You can see what’s in your profile by running the following
If you don’t want to run a profile, then you can just clear it out.
Or you can start up a PowerShell.exe without a profile by specifying
What about yours?
This brings me back to the main point. My profile does 3 things
- Changes the default colour of error and warning messages,
- Sets an alias for notepad to “n” since I use it so much
Set-Alias -Name n -Value notepad, and
- loads up the dbatools prompt
I don’t import any modules because the two that I use the most are updated so frequently plus I’m currently using PowerShell 5 so they get automatically loaded when I type in one of their commands.
What’s on your one? Anything special or cool that you’d like to share? Let me know?