Skip to content

Commit

Permalink
Merge pull request #4715 from MicrosoftDocs/user/ramiMSFT/1956187
Browse files Browse the repository at this point in the history
PowerShell task
  • Loading branch information
GitHubber17 authored Jun 1, 2022
2 parents 33c63ff + 7e3ec53 commit 2f6517d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions docs/pipelines/tasks/deploy/azure-powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ms.assetid: 72A1931B-EFFB-4D2E-8FD8-F8472A07CB62
ms.custom: seodec18
ms.author: ronai
author: RoopeshNair
ms.date: 04/22/2020
ms.date: 06/01/2022
monikerRange: 'azure-devops'
---

Expand All @@ -28,17 +28,17 @@ Use this task to run a PowerShell script within an Azure environment. The Azure

|Argument|Description|
|--- |--- |
|`ConnectedServiceNameARM`<br/>Azure Subscription|(Required) Name of an Azure Resource Manager service connection for authentication. <br/>Argument alias: `azureSubscription`|
|`ScriptType`<br/>Script Type|(Optional) Type of the script: filePath or inlineScript <br/>Default value: `FilePath`|
|`ConnectedServiceNameARM`<br/>Azure Subscription|(Required) Name of an Azure Resource Manager service connection for authentication. <br/>Alias: `azureSubscription`|
|`ScriptType`<br/>Script Type|(Optional) Type of the script: filePath or inlineScript <br/>Default value: `FilePath`.|
|`ScriptPath`<br/>Script Path|(Optional) Path of the script. Should be fully qualified path or relative to the default working directory.|
|`Inline`<br/>Inline Script|(Optional) Enter the script to execute. <br/>Default value: <br/># You can write your Azure PowerShell scripts inline here.|
|`Inline`<br/>Inline Script|(Optional) You can write your scripts inline here. |
|`ScriptArguments`<br/>Script Arguments|(Optional) Additional parameters to pass to PowerShell. Can be either ordinal or named parameters. Not applicable for inline script option.|
|`errorActionPreference`<br/>ErrorActionPreference|(Optional) Select the value of the ErrorActionPreference variable for executing the script. <br/>Default value: `stop`|
|`errorActionPreference`<br/>ErrorActionPreference|(Optional) Select the value of the ErrorActionPreference variable for executing the script. <br/>Default value: `stop`. Options: stop, continue, silentlyContinue|
|`FailOnStandardError`<br/>Fail on Standard Error|(Optional) If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream. <br/>Default value: `false`|
|`TargetAzurePs`<br/>Azure PowerShell Version|(Required) In case of Microsoft-hosted agents, the supported Azure PowerShell version. To pick the latest version available on the agent, select `latestVersion` <br/>For self-hosted agents, you can specify preferred version of Azure PowerShell using "Specify version" <br/>Default value: `OtherVersion` <br/>Argument alias: `azurePowerShellVersion`|
|`CustomTargetAzurePs`<br/>preferredAzurePowerShellVersion|(Required when TargetAzurePs = OtherVersion) <br/>Preferred Azure PowerShell Version needs to be a proper semantic version. For example, 1.2.3. Regex like 2.\*,2.3.\* is not supported. <br/>Argument alias: `preferredAzurePowerShellVersion`|
|`pwsh`<br />Use PowerShell Core|(Optional) If this is true, on Windows, the task will use pwsh.exe from your PATH instead of powershell.exe.|
|`workingDirectory`<br />Working Directory|(Optional) Working directory where the script is run.|
|`workingDirectory`<br />Working Directory|(Optional) Working directory where the script is run. Default value: ''.|

## Samples

Expand Down
13 changes: 7 additions & 6 deletions docs/pipelines/tasks/includes/yaml/AzurePowerShellV5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ms.topic: include
author: RoopeshNair
ms.author: ronai
ms.date: 12/07/2018
ms.date: 06/01/2022
ms.prod: devops
ms.technology: devops-cicd-tasks
---
Expand All @@ -12,14 +12,15 @@ ms.technology: devops-cicd-tasks
# Run a PowerShell script within an Azure environment
- task: AzurePowerShell@5
inputs:
#azureSubscription: Required. Name of Azure Resource Manager service connection
#ConnectedServiceNameARM: Required. Name of Azure Resource Manager service connection. You can also use azureSubscription.
#scriptType: 'FilePath' # Optional. Options: filePath, inlineScript
#scriptPath: # Optional
#inline: '# You can write your Azure PowerShell scripts inline here. # You can also pass predefined and custom variables to this script using arguments' # Optional
#inline: # Optional. You can write your Azure PowerShell scripts inline here. You can also pass predefined and custom variables to this script using arguments
#scriptArguments: # Optional
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStandardError: false # Optional
#azurePowerShellVersion: 'OtherVersion' # Required. Options: latestVersion, otherVersion
#preferredAzurePowerShellVersion: # Required when azurePowerShellVersion == OtherVersion
#pwsh: true # Optional. If true, then will use PowerShell Core pwsh.exe
#TargetAzurePs: 'OtherVersion' # Required. Options: latestVersion, otherVersion. You can also use azurePowerShellVersion.
#CustomTargetAzurePs: # Required when azurePowerShellVersion == OtherVersion. You can also use preferredAzurePowerShellVersion.
#pwsh: true # Optional. If this is true, PowerShell Core pwsh.exe will be used in Windows environments.
#workingDirectory: '' # Optional. The working directory where the script is run.
```

0 comments on commit 2f6517d

Please sign in to comment.