PowerShell Logo Small

New-Alias



This is the built-in help made by Microsoft for the command 'New-Alias', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Creates a new alias.

SYNTAX


New-Alias [-Name] <string> [-Value] <string> [-Description <string>] [-Force] [-Option {None | ReadOnly | Constant | Private | AllScope}] [-PassT
hru] [-Scope <string>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The New-Alias cmdlet creates a new alias in the current Windows PowerShell session. Aliases created by using New-Alias are not saved after you ex
it the session or close Windows PowerShell. You can use the Export-Alias cmdlet to save your alias information to a file. You can later use Impor
t-Alias to retrieve that saved alias information.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113352
Set-Alias
Get-Alias
Export-Alias
Import-Alias

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>new-alias list get-childitem



Description
-----------
This command creates an alias named "list" to represent the Get-ChildItem cmdlet.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>new-alias -name w -value get-wmiobject -description "quick wmi alias" -option ReadOnly

C:\PS> get-alias -name w | format-list *



Description
-----------
This command creates an alias named "w" to represent the Get-WMIObject cmdlet. It creates a description, "quick wmi alias", for the alias and mak
es it read only. The last line of the command uses Get-Alias to get the new alias and pipes it to Format-List to display all of the information a
bout it.