AzurePowerShell@1 - v1 작업 Azure PowerShell

이 작업을 사용하여 Azure 환경 내에서 PowerShell 스크립트를 실행합니다. Azure 컨텍스트는 제공된 Azure Resource Manager 서비스 연결로 인증됩니다.

Syntax

# Azure PowerShell v1
# Run a PowerShell script within an Azure environment.
- task: AzurePowerShell@1
  inputs:
    #ConnectedServiceNameSelector: 'ConnectedServiceName' # 'ConnectedServiceName' | 'ConnectedServiceNameARM'. Azure Connection Type. Default: ConnectedServiceName.
    ConnectedServiceName: # string. Required when ConnectedServiceNameSelector = ConnectedServiceName. Azure Classic Subscription. 
    #ConnectedServiceNameARM: # string. Required when ConnectedServiceNameSelector = ConnectedServiceNameARM. Azure Subscription. 
    ScriptType: 'FilePath' # 'FilePath' | 'InlineScript'. Required. Script Type. Default: FilePath.
    #ScriptPath: # string. Optional. Use when ScriptType = FilePath. Script Path. 
    #Inline: # string. Optional. Use when ScriptType = InlineScript. Inline Script. 
    #ScriptArguments: # string. Script Arguments.

입력

ConnectedServiceNameSelector - Azure 연결 유형
string. 허용되는 값: ConnectedServiceName (Azure 클래식), ConnectedServiceNameARM (Azure Resource Manager). 기본값은 ConnectedServiceName입니다.


ConnectedServiceName - Azure 클래식 구독
string. 필요한 경우 ConnectedServiceNameSelector = ConnectedServiceName입니다.

PowerShell을 실행하기 전에 구성할 Azure 클래식 구독입니다.


ConnectedServiceNameARM - Azure 구독
string. 필요한 경우 ConnectedServiceNameSelector = ConnectedServiceNameARM입니다.

PowerShell을 실행하기 전에 구성할 Azure Resource Manager 구독입니다.


ScriptType - 스크립트 유형
string. 필수 요소. 허용되는 값: FilePath (스크립트 파일 경로), InlineScript (인라인 스크립트). 기본값은 FilePath입니다.

스크립트의 형식: 파일 경로 또는 인라인입니다.


ScriptPath - 스크립트 경로
string. 선택 사항입니다. 을 사용할 때 ScriptType = FilePath사용합니다.

스크립트의 경로입니다. 정규화된 경로이거나 기본 작업 디렉터리에 상대적인 경로여야 합니다.


Inline - 인라인 스크립트
string. 선택 사항입니다. 을 사용할 때 ScriptType = InlineScript사용합니다. 기본값은 # You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments입니다.

실행할 스크립트를 지정합니다. 지원되는 최대 인라인 스크립트 길이는 500자입니다. 더 긴 스크립트를 사용하려면 파일의 스크립트를 사용합니다.


ScriptArguments - 스크립트 인수
string.

PowerShell에 전달할 추가 매개 변수입니다. 이러한 매개 변수는 서수 또는 명명된 매개 변수일 수 있습니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성을 참조하세요.

출력 변수

없음

요구 사항

요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
실행 중 에이전트, DeploymentGroup
요청 자체 호스팅 에이전트에는 이 작업을 사용하는 작업을 실행하기 위한 다음 요구 사항과 일치하는 기능이 있어야 합니다. azureps
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
설정 가능한 변수 모두
에이전트 버전 1.95.0 이상
작업 범주 배포