I'm trying to write an Azure CLI task to use for further getting account keys and so on. First want to just have an output variable from the inline script but I got this error when build the pipeline:
"##[error]PowerShell exited with code '1'." "The term 'myOutputVar' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." This is how I wrote it :
- task: AzureCLI@2
displayName: Azure CLI
inputs:
azureSubscription: mySubscription
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
Write-Host "##vso[task.setvariable variable=myOutputVar;isOutput=true]this is the value"
Write-Host "This is my output $(myOutputVar)"
Any idea on what I am doing wrong ? since I'm new to this, thanks