Skip to content

Get PSReadLineHistory

viscalyxbot edited this page Aug 25, 2024 · 1 revision

Get-PSReadLineHistory

SYNOPSIS

Retrieves the PSReadLine history content.

SYNTAX

Get-PSReadLineHistory [[-Pattern] <String>] [<CommonParameters>]

DESCRIPTION

The Get-PSReadLineHistory function retrieves the content of the PSReadLine history file. By default, it returns the entire history content, but you can specify a pattern to filter the results.

EXAMPLES

EXAMPLE 1

Get-PSReadLineHistory

Returns the entire content of the PSReadLine history file.

EXAMPLE 2

Get-PSReadLineHistory -Pattern "git"

Returns only the lines from the PSReadLine history file that contain the word "git".

PARAMETERS

-Pattern

Specifies a pattern to filter the history content. Only lines matching the pattern will be returned.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
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

None

OUTPUTS

System.String

NOTES

This function requires the PSReadLine module to be installed.

RELATED LINKS

https://docs.microsoft.com/en-us/powershell/module/psreadline/

Clone this wiki locally