I am setting the password at the Library in the Azure pipelines under a Variable group.
Now I want to use the password in one of my powershell script by using its variable name from the Library but I am getting error.
Write-Host "Signing of Scripts."
Write-Host $PSScriptRoot
If (Test-Path -Path "C:\DigiCerts\*"){
signtool sign /f C:\DigiCerts\Certificate.pfx /t http://timestamp.sectigo.com /fd SHA256 /p $DigicertsPassword C:\dev\package-scripts\scripts\*.ps1
}
Else {
Write-Host "required certificate not found to sign" -ForegroundColor Red
exit 1
}
So here I am using $DigicertsPassword from the Library under Variable group which I have stored the password.
****Error: DigicertsPassword : The term 'DigicertsPassword' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.+ ... tp://timestamp.sectigo.com /fd SHA256 /p "$(DigicertsPassword)" C:\de ... + CategoryInfo : ObjectNotFound: (DigicertsPassword:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
SignTool Error: Missing filename.****
"$(DigicertsPassword)""$(DigicertsPassword)"but faced the error, I have edited my question with the error, please check and helpsigntool sign /f C:\DigiCerts\Certificate.pfx /t http://timestamp.sectigo.com /fd SHA256 /p "$(DigicertsPassword)"Write-host "$(DigicertsPassword)"does this print the value which you have defined in the variable group?