This file contains 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
# You should insert this script into your PowerShell Profile script so it exists in every session | |
# Fun fact: This script was mostly generated by ChatGPT by giving it the bash version of the output | |
# from `github-copilot-cli alias -- "$0"` with a few fixes from me | |
function Invoke-CopilotWhatTheShell { | |
$TMPFILE = New-TemporaryFile; | |
try { | |
github-copilot-cli what-the-shell $args --shellout $TMPFILE | |
if ($LASTEXITCODE -eq 0) { |
This file contains 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
# Set the parameters | |
$path = Get-Location | |
$numbOfThreads = 50 | |
$exclude_patterns = "^.*(\.git|\.idea|node_modules|\.next|\.(jpeg|jpg|png|gif|mp4|mkv|mp3|wav)$).*$" | |
# Find filles to convert | |
$files = Get-ChildItem -Path $path -Recurse -Include * -File -Force | Where-Object {$_.FullName -notmatch $exclude_patterns} | |
Write-Host "Found $($files.Count) files" | |
$files | ForEach-Object -Parallel { |