Skip to content

laguill/powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 

Repository files navigation

PowerShell Configuration

This guide will help you configure PowerShell inspired by this blog post.

Install Zoxide

winget install ajeetdsouza.zoxide

install oh-my-posh

winget install JanDeDobbeleer.OhMyPosh -s winget

install nerd font

oh-my-posh font install 

select cascady cove and change the font in powershell

edit powershell profile to use oh-my-posh

code $PROFILE

Initialize Oh My Posh with the theme which we chosen

oh-my-posh init pwsh --config ""$env:POSH_THEMES_PATH\kushal.omp.json" | Invoke-Expression

Install terminal file manager

winget install --id=antonmedv.walk  -e

Install tldr-pages

winget install tldr

Edit Your Profile to Look Like This

# Initialize Oh My Posh with the theme which we chosen
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\kushal.omp.json" | Invoke-Expression

# Set some useful Alias to shorten typing and save some key stroke 
Set-Alias ll ls 
Set-Alias grep findstr

# Set Some Option for PSReadLine to show the history of our typed commands
Set-PSReadLineOption -PredictionSource History 
Set-PSReadLineOption -PredictionViewStyle ListView 
Set-PSReadLineOption -EditMode Windows 

# enable zoxide
Invoke-Expression (& { (zoxide init powershell | Out-String) })

# replace 'Ctrl+t' and 'Ctrl+r' with your preferred bindings:
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'


# ----------------------------------------Functions ----------------------------------------------

# move in selected directory using walk
function lk() {clear | z $(walk --icons $args)}

# list json files in a folder
function Get-JsonFileList {
    param(
        [Parameter(Mandatory=$false)]
        [string]$Path = "."
    )

    Get-ChildItem -Path $Path -Filter "*.json" | ForEach-Object {
        $_.BaseName >> json_file_list.txt
    }
}

# Utility Command that tells you where the absolute path of commandlets are 
function which ($command) { 
 Get-Command -Name $command -ErrorAction SilentlyContinue | 
 Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue 
} 

About

configure powershell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published