Reputation: 377
I want to run some commands by default every time I open up power shell. Bash has a .bashrc file that it runs as source when it starts up. Is there a way to do this with powershell?
Upvotes: 21
Views: 18156
Reputation: 346
As pointed out by Dai in the comment section, Powershell Profiles sound like the closest equivalent to the .bashrc
file.
A PowerShell profile is a script that runs when PowerShell starts. You can use the profile as a logon script to customize the environment. You can add commands, aliases, functions, variables, snap-ins, modules, and PowerShell drives. You can also add other session-specific elements to your profile so they are available in every session without having to import or re-create them.
Upvotes: 14