PowerShell 5 finally includes support for ZIP files, so if you want to backup all of your PowerShell scripts into one ZIP file, here is a one-liner:
Get-ChildItem -Path $Home -Filter *.ps1 -Recurse -ErrorAction SilentlyContinue |
Compress-Archive -DestinationPath "$home\desktop\backupAllScripts.zip" -CompressionLevel Optimal
Note that on Windows 10, all files are passed through your AV engine before they are written to ZIP. If your AV engine detects a suspicious script, chances are you get an exception and no ZIP file.
ReTweet this Tip!
What do you mean by "All Versions"? Because this cmdlet only works for version 5, I believe.