Skip to content

Verbose output for Get-Secret is incorrect #200

Open
@joshuabennett-com

Description

@joshuabennett-com

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Get a secret that doesn't exist.

PS C:\Scripts> Get-Secret -Name 'blalba'
or
PS C:\Scripts> Get-Secret -Name 'blalba' -Vault "impactAutomation"

Expected behavior

Verbose should not report success if the secret doesn't exist.

Actual behavior

VERBOSE: Secret information was successfully retrieved from vault ImpactAutomation.

Error details

VERBOSE: Secret information was successfully retrieved from vault ImpactAutomation.
Get-Secret : The secret blalba was not found.
At line:1 char:1
+ Get-Secret -Name 'blalba'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...etSecretCommand:GetSecretCommand) [Get-Secret], ItemNotFoundException
    + FullyQualifiedErrorId : GetSecretNotFound,Microsoft.PowerShell.SecretManagement.GetSecretCommand

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.1320
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1320
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

None

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions