There are a total of six different profiles than can be created in PowerShell by default. Four of them can exist that are applied to the PowerShell console:
$PROFILE | Format-List -Force
And four of them can also exist that are applied to the PowerShell ISE (Integrated Scripting Environment):
$profile | Format-List -Force
Two of the profiles are the same between the PowerShell console and ISE which gives you a total of six possible profile combinations that can be used to load items when you start PowerShell depending on if you want it to load for all users or for the current user and for all hosts or for the current host.
Keep in mind, if you’re sharing scripts with others, be sure to test your code with no profile
before sharing it. To accomplish this, start the PowerShell console with
The ISE can also be started with the -noprofile option:
I created all of the possible profiles for the ISE and based on my testing, this is the order they’re applied in:
I also created all of the possible profiles for the PowerShell console, added variable creation, and incremented the value of the variable in each profile to get a better idea of the precedence of each profile script:
One thing that the variables that I’ve defined in each of my profile scripts also tells us is that even though profiles are merely scripts that execute when PowerShell is launched, that any variable defined in them loads in the global scope by default. This can also be confirmed by taking a look at the global section of the about_Scopes help topic.
To learn more about PowerShell profiles see the about_Profiles help topic.