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?
bashrc equivalent becomes %CMDER_ROOT%\config\user_profile. cmd , while also significantly improving your shell/console experience.
If you previously installed git bash for window, you may also find . bashrc file in your window user profile folder. In Linux subsystem, you may local the file under /mnt/c/Users/your_window_user_name/.
bashrc . For my Windows machine, that's /c/Users/Leonardo/. bashrc .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With