简体   繁体   中英

Is there a Windows 10 PowerShell equivalent to .bashrc for Linux Bash?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM