Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

set alias in powershell

#For Windows PowerShell
set-alias -name <alias_name> -value <command>
#<alias_name> is the new alias name you want to set.
#<command> is the command you want to alias.
#NB: this is temporal and will not work when powershell is reboot.
#To make it permanent, add it to PowerShell Profile.ps1 file.
Comment

powershell create command alias

# On your profile.ps1 file
# if you don't have it yet, just run code $PROFILE to create and edit it (with vscode)

function NpmRunDev {  
  npm run dev
}

Set-Alias nrd NpmRunDev
Comment

powershell get aliases

# to get list of all aliases
Get-Alias
# or use its alias
gal

# to get a specific alias
gal <command-name>
# for example
gal man
Comment

create alias in powershell permanently

// create a profile.ps1 file to set aliases
notepad $((Split-Path $profile -Parent) + "profile.ps1")

// example aliases (opens notepad when you type `edit` in console)
Set-Alias edit notepad.exe

// example aliases (opens notepad when you type `edit` in console)
Set-Alias edit1 "C:Program FilesWindows NTAccessorieswordpad.exe"
Comment

set alias for directory in powershell

#For Windows PowerShell
function <alias_name> {cd "C:Users..."}
#We use `function` and not 
set-alias -name <new_alias> -value <command>
#because cmdlets(cd) don't work in set-alias -value.
#NB: this is temporal and will not work when powershell is rebooted.
#To make it permanent, add it to PowerShell Profile.ps1 file.
Comment

powershell alias setting

set-theme [some themes]
Comment

PREVIOUS NEXT
Code Example
Shell :: undo git commit 
Shell :: alpine linux install redis-cli 
Shell :: nuxt install 
Shell :: adb push image to gallery 
Shell :: tailwind nodejs 
Shell :: what is the difference between powershell and command prompt 
Shell :: get your ip address from terminal 
Shell :: git remove added file 
Shell :: Add Subtitles (.SRT file) To MP4 With FFMPEG 
Shell :: Fetch all braches in git 
Shell :: bash redirect output to null 
Shell :: install specific node version linux 
Shell :: revert last commit 
Shell :: run cmd as administrator command line 
Shell :: how to upgrade react in cra 
Shell :: xsltproc linux install 
Shell :: force pull in git 
Shell :: how to get remote origin url 
Shell :: add all changes and commit in git 
Shell :: install vim mac 
Shell :: install laravel globally ubuntu 
Shell :: docker image get extract dockerfile 
Shell :: script to kill a process in windows 
Shell :: git push example 
Shell :: install node using nvm windows 
Shell :: IF NOT DIR BASH 
Shell :: terminal not opening ubuntu 
Shell :: restart webmin terminal 
Shell :: undo previous commit but keep changes 
Shell :: remove cache package arch 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =