Powershell Command : Set-Alias

Set-Alias :

It was used for create or change the alias from one cmdlet to another.

Set-Alias Description :

The Set-Alias cmdlet is used for creating or changing an alias cmdlet, such as a function, a script, a file, or other executable. You need to add these changes or save these changes to the Windows Powershell profile, if not the changes will be lost of you close the current session.

Set-Alias Syntax :

Parameter Set: Default
Set-Alias [-Name] <String> [-Value] <String> [-Description <String> ] [-Force] [-Option <ScopedItemOptions> ] [-PassThru] [-Scope <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Set-Alias Parameters :


It was used to return the objects that represents the alias.


Use to specify the new alias. Here you can use the alphanumeric characters.


Used to set the read-only alias.


Used for specifying the description.


Used to get the aliases in specified scope. Valid values are “Global”, “Local”, or “Script”, or a number relative to the current scope.


Used to specify the name of the cmdlet.


Sets the value of the Options property of the alias.


It will prompt you for a confirmation before running a cmdlet.


It will show what happens when the cmdlet runs.


-Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable.

Set-Alias Examples :

1) This command is used to create an alias called “list” for the Get-ChildItem cmdlet.

PS C:> set-alias -name list -value get-childitem

2) This command is used to set the alias for the notepad application.

PS C:> Set-Alias np c:windowsnotepad.exe

3) This command creates an alias named list for replacing the command get-childitem.

PS C:> new-alias list get-childitem

You may also like...

1 Response

  1. rhonda says:

    Thanks for the powershell tutorial script..thank you so much…

Leave a Reply

Your email address will not be published. Required fields are marked *