r/PowerShell • u/Rulylake • Dec 09 '25
Question Make custom commands in Powershell
Can you make a custom command in powershell, and if so, how?
I want to make a command that does:
git add -A
git commit -m "catchup"
git pull
In one go.
Also, feel free to tell me if making a lot of commits with the same name to pull is bad practice, though i want this for small projects with friends :)
30
Upvotes
View all comments
Show parent comment
1
u/omers Dec 09 '25
You can get an error on the first line if you don't have a profile script. Using something like
code $profileif you have VS Code orise $profileif you don't will open it for editing. If it doesn't exist it will give you a blank file and you can just hit Ctrl+S to save and create it.Then you can put the function /u/pertymoose gave you in it:
And that function will be available every time you open PowerShell. If you're familiar with Linux, the $Profile script is sort of like
.bashrc. By default it is~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1with a separate one for ISE.