This repository stores my personal PowerShell profile configuration, designed to streamline my workflow and enhance the terminal experience. Below is a breakdown of the configurations found in the Microsoft.PowerShell_profile.ps1 file.
Aliases are custom shortcuts for longer commands. They help reduce typing and simplify access to frequently used scripts.
Code:
#------------
# ALIAS
#------------
New-Alias c -Value clear
New-Alias rem -Value Remove-Item
New-Alias -Name nvim-config -Value 'C:\Users\Gabriel_Stundner\OneDrive - Dell Technologies\Documents\WindowsPowerShell\Scripts\nvim-config.ps1'
New-Alias -Name powershell-config -Value 'C:\Users\Gabriel_Stundner\OneDrive - Dell Technologies\Documents\WindowsPowerShell\Scripts\powershell-config.ps1'
New-Alias -Name cf -Value cf8Explanation:
c: Clears the terminal screen.rem: Deletes files and folders.nvim-config: Opens the Neovim configuration file for editing.powershell-config: Opens the PowerShell profile itself for editing.cf: A shortcut for thecf8command, likely related to Cloud Foundry.
Documentation:
Oh-My-Posh is a theme engine for PowerShell that allows for a highly customized and informative prompt.
Code:
#----------------------------
# OH-MY-POSH CONFIGURATION
#----------------------------
oh-my-posh init pwsh --config 'C:\Program Files (x86)\oh-my-posh\themes\spaceship.omp.json' | Invoke-ExpressionExplanation:
This line initializes Oh-My-Posh with the spaceship theme, providing a feature-rich prompt that can display Git status, the current directory, and more.
Documentation:
Chocolatey is a package manager for Windows. This configuration enables tab-completion for the choco command.
Code:
# Import the Chocolatey Profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}Explanation: The script checks for the existence of the Chocolatey profile module and imports it, which is essential for enabling command-line completion for Chocolatey commands.
Documentation:
This section includes modules that improve the overall terminal experience.
Code:
# ---------------
# AUTOCOMPLETION
# ---------------
Import-Module Terminal-Icons
if (Test-Path "C:\Users\Gabriel_Stundner\.jabba\jabba.ps1") { . "C:\Users\Gabriel_Stundner\.jabba\jabba.ps1" }Explanation:
Terminal-Icons: Adds file and folder icons to the output of commands likelsanddir, making it easier to identify file types.jabba.ps1: Integrates Jabba, a Java Version Manager, allowing for easy switching between different Java versions installed on the system.
Documentation:
| Category | Configuration | Purpose |
|---|---|---|
| Prompt Customization | oh-my-posh |
Provides a themed, information-rich command prompt. |
| Shell Enhancements | Terminal-Icons |
Adds file-specific icons to directory listings. |
Chocolatey Profile |
Enables tab-completion for the choco package manager. |
|
Jabba |
Manages and allows switching between Java versions. | |
| Aliases | c, rem, nvim-config, powershell-config, cf |
Creates shortcuts for common commands and scripts. |