https://github.com/andria-dev/pwsh-readlinewithhistory
A module for reading from the console with up and down arrow history. Includes support for basic backspace, delete, left arrow, right arrow, home, and end keys.
https://github.com/andria-dev/pwsh-readlinewithhistory
Last synced: 2 months ago
JSON representation
A module for reading from the console with up and down arrow history. Includes support for basic backspace, delete, left arrow, right arrow, home, and end keys.
- Host: GitHub
- URL: https://github.com/andria-dev/pwsh-readlinewithhistory
- Owner: andria-dev
- Created: 2023-03-14T09:15:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T10:51:16.000Z (over 3 years ago)
- Last Synced: 2025-01-28T10:46:39.750Z (over 1 year ago)
- Language: PowerShell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pwsh-ReadLineWithHistory
Works on Linux.
## Usage
```pwsh
Import-Module ReadLineWithHistory;
$Reader = New-ReadLineWithHistory;
while ($True) {
$Command = $Reader.ReadLine("$env:USER - $env:PWD> ");
# Process the command
}
# Or
$Input = $Reader.ReadLine("PROMPT: ");
# Process the input
$Input = $Reader.ReadLine("PROMPT: ");
# Process the input
```