This Microsoft.PowerShell_profile.ps1
file contains a personalized configuration for PowerShell, offering an enhanced user experience with various features and customizations.
- UTF-8 Encoding: Sets console encoding to UTF-8 for better character support.
- Module Auto-Import: Automatically imports useful modules like
posh-git
,Terminal-Icons
, andPSFzf
. - Oh-My-Posh Theme: Configures an Oh-My-Posh theme for a customized prompt.
- PSReadLine Configuration: Customizes PSReadLine options for an improved command-line experience.
- Keyboard Shortcuts: Defines useful keyboard shortcuts for navigation and editing.
- Fzf Integration: Configures Fzf (Fuzzy Finder) for quick history and file searching.
- Custom Aliases: Defines numerous aliases for frequently used commands.
- Utility Functions: Includes several helpful functions for common tasks.
which
: Finds the path of a command.Get-PubIP
: Retrieves the public IP address.Update
: Updates all packages using winget.mkcd
: Creates a new directory and changes to it.z
: Quick navigation function based on directory usage frequency.Get-DiskUsage
: Displays disk usage information.Find-File
: Searches for files by name.Get-TopProcesses
: Shows top CPU-consuming processes.Backup-File
: Creates a backup of a specified file.Search-History
: Searches command history for a keyword.
- Clone this repository or download the
Microsoft.PowerShell_profile.ps1
file. - Place the file in your PowerShell profile directory (typically
$HOME\Documents\PowerShell
). - If you have an existing profile, you may want to merge the contents of this file with your current profile.
The profile will automatically load when you start PowerShell. To reload the profile without restarting PowerShell, use the Update-Profile
function.
Feel free to modify this file according to your needs and preferences. You can add, remove, or modify functions, aliases, or configurations to tailor the environment to your workflow.
This profile attempts to import the following modules:
- posh-git
- Terminal-Icons
- PSFzf
Ensure these modules are installed for full functionality.
Some of the defined aliases include:
vim
fornvim
ll
forls
g
forgit
u
for theUpdate
function
Check the profile for a complete list of aliases.
Ctrl+d
: Delete characterCtrl+f
: Fzf provider chordCtrl+r
: Fzf reverse history search- Up/Down Arrows: History search
For a complete list of keyboard shortcuts and their functions, refer to the profile file.