Import-Alias

 

Additional Resources for Import-Alias

 

Importing Saved Windows PowerShell Aliases

http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/import-alias.mspx

 

 

SYNOPSIS

Imports an alias list from a file.

 

SYNTAX

Import-Alias [-path] <string> [-passThru] [-scope <string>] [-force] [-whatIf] [-confirm] [<CommonParameters>]

 

DETAILED DESCRIPTION

Imports an alias list from a file.

 

PARAMETERS

 

-path <string>

Specifies the path to a file that includes exported alias information. Wildcards are allowed but they must resolve to a single name.

 

Required?

true

Position?

1

Default value

 

Accept pipeline input?  

true (ByValue, ByPropertyName)

Accept wildcard characters? 

true

 

-passThru <SwitchParameter>

Passes the object created by this cmdlet through the pipeline. By default, this cmdlet does not pass any objects through the pipeline.

 

Required?

false

Position?

named

Default value

False

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-scope <string>

Specifies the scope to apply to the imported aliases. This can be a named scope: "global", "local", or "script", or it can be a number relative to the current scope (0 through the number of scopes where 0 is the current scope and 1 is its parent).

 

Required?

false

Position?

named

Default value

local

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-force <SwitchParameter>

Allows cmdlet to import an alias that is already defined and is read only. You can use the following command to display information about the currently-defined aliases:

 

get-alias | select-object name,Options

The value of the Options property will include 'ReadOnly' if the corresponding alias is read only.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-whatIf

Describes what would happen if you executed the command without actually executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

-confirm

Prompts you for confirmation before executing the command.

 

Required?

false

Position?

named

Default value

 

Accept pipeline input?  

false

Accept wildcard characters? 

false

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

INPUT TYPE

System.Management.Automation.AliasInfo

 

RETURN TYPE

System.Management.Automation.AliasInfo

 

EXAMPLE 1

 

import-alias test.txt

 

This command imports alias info from a file named test.txt.

 

RELATED LINKS

Export-Alias

Get-Alias

New-Alias

Set-Alias