PowerShell Logo Small

New-Alias



This is the built-in help made by Microsoft for the command 'New-Alias', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' 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 <ScopedItemOptions>] [-PassThru] [-Scope <String>] [-Confirm] [-WhatIf] [<Commo
nParameters>]



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 exit the session or clo
se Windows PowerShell. You can use the Export-Alias cmdlet to save your alias information to a file. You can later use Import-Alias to retrieve that saved alias infor
mation.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=293991
Export-Alias
Get-Alias
Import-Alias
Set-Alias

REMARKS

<

Examples


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

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



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








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

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



This command creates an alias named "w" to represent the Get-WMIObject cmdlet. It creates a description, "quick wmi alias", for the alias and makes 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 about it.