-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathazure-pipelines-22.yml
30 lines (27 loc) · 1015 Bytes
/
azure-pipelines-22.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# https://stackoverflow.com/questions/64502851/is-it-possible-to-set-variables-in-the-azure-powershell-task-in-azure-devops-and
trigger: none
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzurePowerShell@5
name: setvarStep
inputs:
ScriptType: 'InlineScript'
Inline: |
$value1 = "Value1"
$value2 = "Value2"
Write-Host "##vso[task.setvariable variable=VersionName;isOutput=true]$value1"
Write-Host "##vso[task.setvariable variable=SourceId;isOutput=true]$value2"
echo "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the value"
azurePowerShellVersion: 'LatestVersion'
azureSubscription: 'rg-the-code-manual'
- task: AzurePowerShell@5
inputs:
ScriptType: 'InlineScript'
Inline: |
Write-Host "Version name is $(setvarStep.VersionName)"
Write-Host "VM source is $(setvarStep.SourceId)"
Write-Host $(setvarStep.myOutputVar)
azurePowerShellVersion: 'LatestVersion'
azureSubscription: 'rg-the-code-manual'