Skip to content

Instantly share code, notes, and snippets.

@fcoclavero
Last active December 20, 2022 01:35
Show Gist options
  • Save fcoclavero/b507b55f70f05bbd39de3059e8598b29 to your computer and use it in GitHub Desktop.
Save fcoclavero/b507b55f70f05bbd39de3059e8598b29 to your computer and use it in GitHub Desktop.
Powershell cheatsheet
# Rename files recursively
Get-ChildItem -File -Recurse | % { Rename-Item -Path $_.PSPath -NewName $_.Name.replace(".pth",".pt")}
# Copy to clipboard
cat file.txt | clip Sort
# fish-like autosuggestions
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
# The next can be set in the PoSH profile: `notepad $profile`
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment