Example Powershell/Windows Terminal Command setup

Here are some of the PowerShell / Windows terminal commands commands I have set up in my profile.

Load fork into current folder.

Function loadFork {
  c:\users\<user account>\AppData\Local\Fork\fork.exe $pwd
}
Set-Alias -Name fork -Value loadFork

Change to a certain folder

I have many of these set up to easily change to my project folders and this main one to go to the root location of all my projects. These save so much time when changing directories

Function cdCode {Set-Location -Path C:\users\<user account>\code}
Set-Alias -Name cdcd -Value cdCode

Stop Node process

Function stopNodeProcess {
  Stop-Process -name node
}
Set-Alias -Name stopnode -Value stopNodeProcess

Get my “git” stash list

Function printStashList {
  &git stash list --pretty=format:"%C(red)%h%C(reset) - %C(dim yellow)(%C(bold magenta)%gd%C(dim yellow))%C(reset) %<(70,trunc)%s %C(green)(%ci) %C(bold blue)<%an>%C(reset)"
}
Set-Alias -Name gsl -Value printStashList

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.