Skip to content

Get-ContextInfo

SYNOPSIS

Retrieves info about a context from a context vault.

SYNTAX

Get-ContextInfo [[-ID] <String[]>] [[-Vault] <String[]>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Retrieves info about contexts directly from a ContextVault. If no ID is specified, info on all contexts will be returned. Wildcards are supported to match multiple contexts. Only metadata (ID and Path) is returned without decrypting the context contents.

EXAMPLES

EXAMPLE 1

Get-ContextInfo

Output:

ID                 Vault
--                 -----
MySettings         MyVault
MyConfig           MyVault
MySecret           MyVault
Data               MyVault
PSModule.GitHub    MyVault

Retrieves all contexts from the context vault (directly from disk).

EXAMPLE 2

Get-ContextInfo -ID 'MySecret'

Output:

ID   : MySecret
Path : ...\3e223259-f242-4e97-91c8-f0fd054cfea7.json

Retrieves the context called 'MySecret' from the context vault (directly from disk).

EXAMPLE 3

'My*' | Get-ContextInfo

Output:

ID                 Vault
--                 -----
MyConfig           MyVault
MySecret           MyVault
MySettings         MyVault

Retrieves all contexts that start with 'My' from the context vault (directly from disk).

PARAMETERS

-ID

The name of the context to retrieve from the vault. Supports wildcards.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: *
Accept pipeline input: False
Accept wildcard characters: True

-Vault

The name of the vault to retrieve context info from. Supports wildcards.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: *
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

[ContextInfo]

NOTES

Returns a list of context information matching the specified ID or all contexts if no ID is specified. Each context object contains its ID and corresponding path to where the context is stored on disk.

https://psmodule.io/Context/Functions/Get-ContextInfo/