Reputation: 119
I've entered into a bit of syntax nightmare, everything I have tried so far just will not work.
Its a single line...which works absolutely fine until I work in some Release Pipeline variables with the $(env:name-of-var)
stuff...
$primarykey = (Get-AzRelayKey -ResourceGroupName $($env:az-resourcegroupname) -Namespace $($env:az-relaynamespace) -HybridConnection $($env:AF.actionResultRelayConnectionName) -Name $($env:AF.actionResultFalloverRelayKeyName) | Select-Object -ExpandProperty PrimaryKey)
Any ideas greatly received. Thanks in advance.
Upvotes: 1
Views: 584
Reputation: 41565
Because you have -
in the variable name you got an error.
You can do it in this way (instaed of $($env:az-...)
):
${env:az-resourcegroupname}
${env:az-relaynamespace}
Upvotes: 3