본문 바로가기

Windows 10/PowerShell

PowerShell : Alias

반응형

- Alias

# 기본
Get-Alias

# Alias 약칭 찾기
Get-Alias copy

# Alias 약칭 찾기 (와일드카드)
Get-Alias wh*
Get-Alias *p
Get-Alias a*p

# Alias 본명칭 찾기
Get-Alias -Definition copy-item
Get-Alias -Definition *item

- Alias 만들기

# ls 명령어를 
Set-Alias lsa ls

- Alias 삭제

Remove-Alias lsa

- 주의점

  • 세션이 끝난 경우 만들었던 Alias는 자동적으로 삭제된다.

 

 

 

about_Aliases

About Aliases In this article --> SHORT DESCRIPTION Describes how to use alternate names for cmdlets and commands in PowerShell. LONG DESCRIPTION An alias is an alternate name or nickname for a cmdlet or for a command element, such as a function, script, f

docs.microsoft.com

 

Get-Alias (Microsoft.PowerShell.Utility)

The Get-Alias cmdlet gets the aliases in the current session. This includes built-in aliases, aliases that you have set or imported, and aliases that you have added to your PowerShell profile. By default, Get-Alias takes an alias and returns the command na

docs.microsoft.com

 

Set-Alias (Microsoft.PowerShell.Utility)

The Set-Alias cmdlet creates or changes an alias for a cmdlet or a command, such as a function, script, file, or other executable. An alias is an alternate name that refers to a cmdlet or command. For example, sal is the alias for the Set-Alias cmdlet. For

docs.microsoft.com

 

반응형