This week I have been at the PowerShell Usergroup in Munich, Germany.
They wished to get information about PowerShell Profiles, so I commited a talk on PowerShell Profile. And here is the content.
There are 4 PowerShell Profiles loaded on startup of the console. But there can be some more Profiles in your environment. That is, beacause you have two PowerShell profiles per PowerShell console. So VSCode, PowerShell ISE and the PowerShell command prompt have two profiles each. One Profile is for All Users, one for the current user. Additionally you have got a PowerShell Profile for Windows PowerShell and a seperate one for PowerShell Core. So there can be some PowerShell Profiles on your computer.
Use the following command in your prefered console to get the actual profile pathes:
By the way, they are loaded in exactly this order (which makes sense).
What I have in my PSProfile
I talked about which PowerShell Profiles exists and also, what I have in my profile as an PowerShell automator. As an automator my focus is on execution duration, so the most relevant part is the execution time in the prompt. It looks like this in my console:
There are some more featues in my PSProfile prompt, eg the color of the provider is integrated in the path, for example FileSystem and registry:
You can find my Profile on Github.
PowerShell Profile Pathes
Here are some examples of profile pathes.
# PowerShell Core with VSCode
# Windows PowerShell with VSCode
# Windows PowerShell ProfilePath with ISE
# Windosw PowerShell in the Console