I have multiple Azure PowerShell tasks in which I'd like to pass variables. Currently I'm passing variables with Script Arguments, like on the screenshot:
The problem with Script Arguments is that I'd have to edit them in every process if there is a change. Is it possible to have just a single variable that I can link to multiple processes? I've looked at VSTS: Pass build variables into Powershell script task but no matter how I edit my scripts they refuse to work. That topic also doesn't explain if variables should be put into process variables or Queue Build Variables. Here is the script that I'm trying to automate:
param
(
[Parameter(Mandatory)]
[String]$NewFileLocation1
)
Set-AzureRmVMCustomScriptExtension -Argument "-NewFileLocation1 $NewFileLocation" -ResourceGroupName Test-RG1`
-VMName VM1 `
-Location northeurope `
-FileUri https://raw.githubusercontent.com/x/assets/master/PowerShell/PS1/PS1/PS1.ps1 `
-Run 'PS1.ps1' `
-Name PS1
PS1.ps:
param
(
[Parameter(Mandatory)]
[String]$NewFileLocation
)
New-Item $NewFileLocation