Shresht7 / PSFavorite

Favorite PowerShell commands to get as PSReadLine Predictions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PSFavorite

This module allows you to mark commands as favorites. Your favorite commands will appear as suggestions in the PSReadLine Predictor Views.

Favorites do not replace history, they complement it. The history tracks everything you've done, and favorites track the things that you've deemed important.

demo


πŸ“˜ Usage

Write a command and press Ctrl + Shift + * to mark it as favorite.

screenshot

Note: Add a helpful comment to describe the command for future reference.

Alternatively, use the Add-Favorite cmdlet

PS C:\> "Get-Command | Get-Random | Get-Help    # Get help about a random command" | Add-Favorite

Note: Remember to wrap the expressions in quotes!

Your favorite commands will start appearing as suggestions in the PSReadLine Predictor View.


πŸ“„ Requirements

  • PowerShell v7.2.0 or higher
  • PSReadLine v2.2.2 or higher

PSReadLine must allow plugins as a -PredictionSource. (i.e. Plugin or HistoryAndPlugin)

Set-PSReadLineOption -PredictionSource HistoryAndPlugin

To enable the List view:

Set-PSReadLineOption -PredictionViewStyle ListView

πŸ“¦ Installation

1. Install the Module

Install-Module -Name PSFavorite

2. Import the Module

Import-Module -Name PSFavorite

Add this to your $PROFILE if you wish to enable this for every session.

πŸͺ“ Uninstallation

  1. Close all PowerShell instances
  2. Launch a PowerShell session with no profile. pwsh -NoProfile
  3. Uninstall the Module. Uninstall-Module -Name PSFavorite -Force
  4. Close PowerShell

πŸ’½ Development

πŸ“œ Scripts

πŸ§ͺ Testing

This module uses Pester for testing. Run the following command to test the PowerShell module.

Invoke-Pester

πŸ“• Reference


πŸ“ƒ License

This project is licensed under the MIT License. Please read the LICENSE for more details.

About

Favorite PowerShell commands to get as PSReadLine Predictions

License:MIT License


Languages

Language:PowerShell 70.4%Language:C# 29.6%