Skip to content

Instantly share code, notes, and snippets.

@uyriq
Last active June 14, 2023 15:04
Show Gist options
  • Save uyriq/934861bde232d004ad8732ce93c5e9c6 to your computer and use it in GitHub Desktop.
Save uyriq/934861bde232d004ad8732ce93c5e9c6 to your computer and use it in GitHub Desktop.
powershell get-history acts as bash history alike πŸŽ‰
function get-history {
if ($args.Count -gt 0) {
Write-Output "$args"
$search="$($args[0])"
Get-Content (Get-PSReadlineOption).HistorySavePath | ? { $_ -Like "*$($search)*" }
}
Write-Output 'get-history acts like history'
Write-Output "$args"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment