Closed sabixx closed 1 year ago
Looks like PowerShell is taking $false as the second positional parameter and assigning it to $VenafiSession.
This overwrites the script scoped $VenafiSession variable that was set when you ran New-VenafiSession. Then Test-VenafiSession gets called with $false as the value and fails.
Not much to be done here. There is an example for -Confirm usage so hopefully this helps.
Environment
Steps to reproduce
Provide a parameter with wrong settings. e.g. Remove-TPPObject -Path $cert.Path -Confirm $false
The error in the above example is with Confirm $false, correct would be Confirm:$false. but the error that's being displayed is
Please run New-VenafiSession or provide a Vas key or TP token. At ...C:...path...\ Test-VenafiSession.ps1:78 char:17 throw "Please run New-Venafisession or provide a Vaas key
Expected behavior
The error shall provide feedback of the actual parameter with the issue.
Actual behavior
The error that is provided seems like the VenafiSession is missing.
Screenshots