Skip to content

Instantly share code, notes, and snippets.

@yevster
Last active September 5, 2021 03:27
Show Gist options
  • Select an option

  • Save yevster/510bba3d3473718aaec9fe603d0f03fb to your computer and use it in GitHub Desktop.

Select an option

Save yevster/510bba3d3473718aaec9fe603d0f03fb to your computer and use it in GitHub Desktop.

Revisions

  1. yevster revised this gist Sep 5, 2021. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion PsProfile.ps1
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@
    # SPDX-License-Identifier: MIT

    Set-PSReadlineOption -BellStyle None
    Set-PSReadlineOption -EditMode Emacs

    function Stop-AllContainers() {
    docker ps -a -q | ForEach-Object { docker rm -f $_ }
    }
    @@ -32,4 +35,3 @@ function prompt {
    # Show current directory
    ) $(Get-Location)> "
    }

  2. yevster revised this gist Jan 22, 2020. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions PsProfile.ps1
    Original file line number Diff line number Diff line change
    @@ -18,9 +18,8 @@ function Set-WindowTitle {

    New-Alias -Name title -Value 'Set-WindowTitle'

    # Settings
    # More on these at https://opensource.com/article/18/7/powershell-tips
    Set-PSReadlineOption -EditMode Emacs
    # Prompt
    # More on this at https://opensource.com/article/18/7/powershell-tips

    function prompt {
    $lastResult = Invoke-Expression '$?'
  3. yevster created this gist Jan 22, 2020.
    36 changes: 36 additions & 0 deletions PsProfile.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    # SPDX-License-Identifier: MIT

    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'

    # Settings
    # More on these at https://opensource.com/article/18/7/powershell-tips
    Set-PSReadlineOption -EditMode Emacs

    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)> "
    }