다음을 통해 공유


Import-Alias

Imports an alias list from a file.

구문

ByPath (기본값)

Import-Alias
    [-Path] <String>
    [-Scope <String>]
    [-PassThru]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByLiteralPath

Import-Alias
    -LiteralPath <String>
    [-Scope <String>]
    [-PassThru]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Import-Alias cmdlet imports an alias list from a file.

Beginning in Windows PowerShell 3.0, as a security feature, Import-Alias does not overwrite existing aliases by default. To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the Force parameter.

예제

Example 1: Import aliases from a file

Import-Alias test.txt

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

매개 변수

-Confirm

Prompts you for confirmation before running the cmdlet.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:cf

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Force

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

Get-Alias | Select-Object Name, Options

If the corresponding alias is read-only, it will be displayed in the value of the Options property.

매개 변수 속성

형식:SwitchParameter
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-LiteralPath

Specifies the path to a file that includes exported alias information. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:False
DontShow:False
별칭:PSPath

매개 변수 집합

ByLiteralPath
Position:Named
필수:True
파이프라인의 값:True
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

매개 변수 속성

형식:SwitchParameter
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-Path

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

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:True
DontShow:False

매개 변수 집합

ByPath
Position:0
필수:True
파이프라인의 값:True
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-Scope

Specifies the scope into which the aliases are imported. The acceptable values for this parameter are:

  • Global
  • Local
  • Script
  • A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent)

The default is Local. For more information, see about_Scopes.

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:wi

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

입력

String

You can pipe a string that contains a path to this cmdlet.

출력

None

By default, this cmdlet returns no output.

AliasInfo

When you use the PassThru parameter, this cmdlet returns an AliasInfo object representing the alias.

참고

Windows PowerShell includes the following aliases for Import-Alias:

  • ipal