We’re updating a certificate hash from CertifyTheWeb via a powershell script that uses Octopus.Client.dll. However, there are separate thumbprints depending on the environment. How do i update just one scope value for a variable. I can do it with just one:
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path "$currentDir\Octopus.Client.dll"
$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $octoServer,$octoApiKey
$repository = New-Object Octopus.Client.OctopusRepository $endpoint
#### Modify the "SD.SslThumbprint" value in the "Standard SD Variable Set" ####
$libraryVariableSet = $repository.LibraryVariableSets.FindByName("Standard SD Variable Set")
$variables = $repository.VariableSets.Get($libraryVariableSet.VariableSetId);
$sslThumbprintVariable = $variables.Variables | ? Name -eq "SD.SslThumbprint"
$sslThumbprintVariable.Value = $thumbPrint;
#$variables.AddOrUpdateVariableValue("SD.SslThumbprint", "Test")
#$sslThumbprintVariable
$response = $repository.VariableSets.Modify($variables);
"Octopus Updated"
But how do I modify just one particualar variable value with a certain environment?