Contact Info

Crumbtrail

ActiveXperts.com » Administration » Powershell » Powershell 1.0 » New-Alias

New-Alias - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »

New-Alias

Description
Create a new alias.

Usage


Options


Example(s)
Create an alias named 'list' to represent Get-ChildItem:

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

Create a ReadOnly alias named 'w' to represent Get-WMIObject:

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

Uses Get-Alias to display all the information about the alias called 'List':

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

Associate the alias, "np", with the executable file for Notepad:

PS C:\>Set-Alias np c:\windows\notepad.exe

Create a function that will set location as C:\windows\system32 and then assign the alias "cd32", to the new function:

PS C:\>function func32 {set-location c:\windows\system32}
PS C:\>set-alias cd32 func32