Skip to content

Instantly share code, notes, and snippets.

@Daviid-P
Last active June 23, 2024 15:54
Show Gist options
  • Save Daviid-P/15b85918ca5a5e6c164161595f1b5c0b to your computer and use it in GitHub Desktop.
Save Daviid-P/15b85918ca5a5e6c164161595f1b5c0b to your computer and use it in GitHub Desktop.
Powershell Profile
Function My-History {
[CmdletBinding()]
param()
cat $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
}
Remove-Item 'Alias:\history' -Force
New-Alias -Name 'history' -Value 'My-History' -Scope Global
New-Alias -Name 'grep' -Value 'Select-String' -Scope Global
$starship_toml_config = "$HOME\.config\starship.toml"
$starship_toml_config_gist = "https://gist.githubusercontent.com/Daviid-P/ac839053e0e3315ef1b6aa8d0f419368/raw/starship.toml"
if (-not(Test-Path -Path $starship_toml_config -PathType Leaf)) {
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($starship_toml_config_gist,$starship_toml_config)
}
Import-Module Terminal-Icons
Import-Module posh-git
&starship init powershell | Invoke-Expression
$ENV:STARSHIP_CONFIG = $starship_toml_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment