Skip to content

MaciejTrudnos/PowerShell-Command-History

Repository files navigation

PowerShell Command History

Build

Console application allow copy to clipboard selected item from list all of the commands that have been run from PowerShell

PowerShell-Command-History

Features

  • Returns list of all the commands that have been run from PowerShell terminal
  • Filter the commands
  • Set page size list
  • Copy selected command to the clipboard
  • Save favourites commands
  • Integration with ChatGPT

Installation

Put the published version of the application into the program files directory e.g.

C:\Program Files\PSCH

Add an environment variable by command in PowerShell as Administrator

[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";C:\Program Files\PSCH", [EnvironmentVariableTarget]::Machine)

To use ChatGPT, you need to add an OPEN_AI_API_KEY key to the environment variable. Your API key can be obtained from here

[System.Environment]::SetEnvironmentVariable("OPEN_AI_API_KEY", "<Your-API-key>", "Machine")

Command usage

Print help

psch -h

Print version

psch -v

Set page size as 15

psch -s 15

Save command

psch -s

Remove command

psch -r

Saved commands list

psch -f

Start conversation with ChatGPT. Default model is GPT-4o.

psch -gpt

Set gpt-3.5-turbo model and start conversation with ChatGPT. List of models can be obtained from here

psch -gpt gpt-3.5-turbo

Simple usage psch -gpt

psch-gpt

Tech

  • Sharprompt - Interactive command-line based application framework for C#
  • .NET SDK for OpenAI - A .NET SDK for accessing OpenAI's API, provided as a community library.

License

Released under the MIT license.

About

Interactive PowerShell command history list

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages