< Back

Get-Secret

Sat Jan 18, 2020 9:52 pm

NAME Get-Secret



SYNOPSIS

Access a Secret in the Vault





SYNTAX

Get-Secret [-VaultObject] <PSObject> [-Path] <String> [-AsCredential] [<CommonParameters>]





DESCRIPTION

This can return a [PSCustomObject] base don the raw Secret or attempt to return a [PSCredential] object.





PARAMETERS

-VaultObject <PSObject>

The Object containing Vault access details.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

The Path to the secret as you would pass to Vault Read.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AsCredential [<SwitchParameter>]

Attempt to convert the Secret to a [PSCredential]. If the Secret contains a username property that will be

used else the function will fall back to using the Secret name.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Object





NOTES





At the current version, Vault does not yet promise backwards compatibility even with the v1 prefix. We'll

remove this warning when this policy changes. We expect we'll reach API stability by Vault 0.3.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-Secret -VaultObject $vault -Path secret/hello



value

-----

world









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-Secret -VaultObject $vault -Path secret/username -AsCredential



UserName Password

-------- --------

username System.Security.SecureString











RELATED LINKS

https://www.vaultproject.io/docs/http/index.html

Get-Vault