My PowerShell Profile
This is my PowerShell profile (as of 2021). It is based on Scott Hanselmans just minus a few things.
Modules to Install
Install-Module PowershellGet -Force -Scope CurrentUser -AllowClobber
Install-Module posh-git -Scope CurrentUser
Install-Module PSReadLine -AllowPrerelease -Scope CurrentUser -Force
Install-Module -Name Terminal-Icons -Repository PSGallery -Scope CurrentUser
My PowerShell_profile.ps1:
Import-Module -Name posh-git
Import-Module -Name Terminal-Icons
Import-Module -Name PSReadLine
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
function Get-ChildItem-Formatted{
param(
[String[]] $Path,
[String] $Filter,
[String[]] $Include,
[String[]] $Exclude,
[String[]] $LiteralPath,
[uint32] $Depth,
[switch] $Directory,
[switch] $File,
[switch] $FollowSymlink,
[Alias("a")][switch] $Force,
[switch] $Hidden,
[switch] $Name,
[switch] $ReadOnly,
[switch] $Recurse,
[switch] $System
)
process{
Get-ChildItem @PSBoundParameters @args | Format-Wide
}
}
#ls -> Get-ChildItem
Set-Alias -Name ls -Option AllScope -Value Get-ChildItem-Formatted