Multiple choice technology

Which of the below CmmLet give the history of the commands that has been executed in a current PowerShell Session?

  1. Invoke-History

  2. Invake-History

  3. Get-History

  4. Export-Console

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Get-History cmdlet retrieves the list of commands executed in the current PowerShell session. It returns command history with Id and CommandLine properties. Option A Invoke-History reruns a command from history but does not list them. Option B has a typo (Invake instead of Invoke). Option D Export-Console exports console configuration, not command history.