Powershell Command : Import-Alias

Import-Alias :

Used to Import a list of alias from a file.

Import-Alias Description :

The Import-Alias cmdlet is used to import the aliases(alternate names for executable files and commands) and will overwrite the existing alias cmdlets. To overwrite the default alias cmdlets you need you need to use the Force parameter.

Import-Alias Syntax :

Parameter Set: ByPath
Import-Alias [-Path] <String> [-Force] [-PassThru] [-Scope <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: ByLiteralPath
Import-Alias -LiteralPath <String> [-Force] [-PassThru] [-Scope <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Import-Alias Parameters :


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


It was used for importing the alias from a file and will replace the default alias.


Used for specifying the path.


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


It was also used for specifying the path to a file. Unlike Path, the value of the LiteralPath parameter is used exactly as it is typed.


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.

Import-Alias Examples :

1) This command imports the alias information from a file.

PS C:> import-alias test.txt

You may also like...

Leave a Reply

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