Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-TppRestMethod not working in VenafiSession class. #85

Closed
wilddev65 opened this issue Feb 11, 2022 · 1 comment · Fixed by #79
Closed

Invoke-TppRestMethod not working in VenafiSession class. #85

wilddev65 opened this issue Feb 11, 2022 · 1 comment · Fixed by #79
Assignees
Labels
bug Something isn't working

Comments

@wilddev65
Copy link
Collaborator

Operating System: Windows 10
VenafiPS version: 4.1.2
PowerShell version: 5.1


# Steps to reproduce

Write-Verbose "Get APIKey and connect to TPP Server."
New-VenafiSession -Server $TPPServer -Credential $TPPCredential

# Expected behavior

A new API key is obtained by lines 138-143 of VenafiSession.ps1:
        $response = Invoke-TppRestMethod @params
        $this.Key = [pscustomobject] @{
            ApiKey     = $response.ApiKey
            Credential = $Credential
            Expires    = $response.ValidUntil
        }


# Actual behavior

Error:
WARNING: Key-based authentication will be deprecated in release 21.4 in favor of token-based.  Get started with token authentication today, https://docs.venafi.com/Docs/current/TopNav/Content/SDK/AuthSDK/t-SDKa-Setup-OAuth.php.
Invoke-TppRestMethod : The term 'Invoke-TppRestMethod' 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.
At C:\Program Files\WindowsPowerShell\Modules\VenafiPS\4.1.2\Classes\VenafiSession.ps1:138 char:21
+         $response = Invoke-TppRestMethod @params
+                     ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-TppRestMethod:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

NOTE: Changing line 138 to 'Invoke-VenafiSession' fixes the issue.
@gdbarron gdbarron added the bug Something isn't working label Feb 12, 2022
@gdbarron
Copy link
Collaborator

Nice find. This is an issue on v5 and not v7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants