https://github.com/flcdrg/azure-pipelines-powershell-params
Passing parameters to script tasks in Azure Pipelines
https://github.com/flcdrg/azure-pipelines-powershell-params
azure-pipelines powershell
Last synced: 11 months ago
JSON representation
Passing parameters to script tasks in Azure Pipelines
- Host: GitHub
- URL: https://github.com/flcdrg/azure-pipelines-powershell-params
- Owner: flcdrg
- License: apache-2.0
- Created: 2023-08-06T04:59:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T07:05:11.000Z (over 1 year ago)
- Last Synced: 2025-02-03T22:04:52.223Z (about 1 year ago)
- Topics: azure-pipelines, powershell
- Homepage: https://dev.azure.com/gardiner/GitHub%20Builds/_build?definitionId=32
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure Pipelines PowerShell tasks with parameters
Trying to pass parameters to PowerShell script tasks in Azure Pipelines that use the [`param` keyword](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_functions?view=powershell-7.4&WT.mc_id=DOP-MVP-5001655#functions-with-parameters).
TL;DR
[AzureCLI@2](https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/azure-cli-v2?view=azure-pipelines&WT.mc_id=DOP-MVP-5001655) is the only one of the three tasks that allows you to pass parameters in via the `arguments` property.
The arguments property must be a single-line string, so use the `>` block style in your YAML if you want to split it over multiple lines.