suprasad
suprasad

Reputation: 1513

Assign TFS Variable with $ in it

I need to assign TFS variable with 'MSSQL$Staging', unfortunately it is only picking up MSSQL. I tried using backtick to escape $ still no luck. When i try to print the value i get only MSSQL

Write-Host "DBInstance = $(DBInstance)"

DBInstance is assigned MSSQL$Staging

Any help would be greatly appreciated. Thank you

Upvotes: 0

Views: 67

Answers (1)

suprasad
suprasad

Reputation: 1513

Figured it out. After lots of trial and error finally assigning the pipeline variable to new powershell variable and the printing that fixed the issue.

$test = '$(DBInstance)'
Write-Host "DBInstance = $test"

This gave correct answer.

Thank you

Upvotes: 1

Related Questions