Last active
September 5, 2021 03:27
-
-
Save yevster/510bba3d3473718aaec9fe603d0f03fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: MIT | |
Set-PSReadlineOption -BellStyle None | |
Set-PSReadlineOption -EditMode Emacs | |
function Stop-AllContainers() { | |
docker ps -a -q | ForEach-Object { docker rm -f $_ } | |
} | |
New-Alias -Name massacre -Value 'Stop-AllContainers' | |
function Set-WindowTitle { | |
param( | |
# Sets the title of the currnet console/powershell window | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
[string] | |
$Title` | |
) | |
$Host.UI.RawUI.WindowTitle = $Title | |
} | |
New-Alias -Name title -Value 'Set-WindowTitle' | |
# Prompt | |
# More on this at https://opensource.com/article/18/7/powershell-tips | |
function prompt { | |
$lastResult = Invoke-Expression '$?' | |
if (!$lastResult) { | |
Write-Host "Last command exited with error status." -ForegroundColor Red | |
} | |
Write-Output "${msg}$( | |
# Show time as 12:05PM | |
Get-Date -UFormat "%I:%M%p" | |
# Show current directory | |
) $(Get-Location)> " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment