Forrest logo
back to the Get-History tool

get-history:tldr:3c899

get-history: Get PowerShell history item by ID.
$ Get-History -Id ${id}
try on your machine

The command "Get-History -Id ${id}" is used in PowerShell to retrieve a specific command from the command history based on its Id.

Here's a breakdown of the command and its components:

  • "Get-History" is a PowerShell cmdlet that provides a list of commands executed in the current session.
  • "-Id" is a parameter of the "Get-History" cmdlet that allows you to specify the Id of a particular command.
  • "${id}" is a placeholder for the specific Id of the command you want to retrieve. You need to replace "${id}" with the actual Id value.

By running this command with the appropriate Id value, you can retrieve details about a specific command executed in the PowerShell session history, such as the command text, execution time, and Id.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the Get-History tool