Skip to content

Get-ContextInfo

SYNOPSIS

Retrieves info about a context from the in-memory context vault.

SYNTAX

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

DESCRIPTION

Retrieves info about context from the loaded contexts stored in memory. If no ID is specified, all available info on contexts will be returned. Wildcards are supported to match multiple contexts.

EXAMPLES

EXAMPLE 1

Get-ContextInfo

Output:

ID   : MySettings
Path : ...\b7c01dbe-bccd-4c7e-b075-c5aac1c43b1a.json

ID   : MyConfig
Path : ...\feacc853-5bea-48d1-b751-41ce9768d48e.json

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

ID   : Data
Path : ...\b7c01dbe-bccd-4c7e-b075-c5aac1c43b1a.json

ID   : PSModule.GitHub
Path : ...\feacc853-5bea-48d1-b751-41ce9768d48e.json

Retrieves all contexts from the context vault (in memory).

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 (in memory).

EXAMPLE 3

'My*' | Get-ContextInfo

Output:

ID   : MyConfig
Path : .../feacc853-5bea-48d1-b751-41ce9768d48e.json

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

ID   : MySettings
Path : .../b7c01dbe-bccd-4c7e-b075-c5aac1c43b1a.json

Retrieves all contexts that start with 'My' from the context vault (in memory).

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: True (ByPropertyName, ByValue)
Accept wildcard characters: True

-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

[System.Object]

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/