7zip

7zip

Linux (Debian)

It's probably pre-installed,[1] but you can install it from the Debian repo with sudo apt install p7zip-full

Powershell

PowerShell's Verb-Noun format doesn't exactly jive with 7zip's simple instruction set, and normally you have to run the 7zip.exe from the target path. However, it's simple to add it as an variable, then alias, to allow you to use the same commands as normal.

$7zipPath = "$env:ProgramFiles\7-Zip\7z.exe"
set-alias 7z $7zipPath

Here's an example following
7zip.png

If you want to make this permanent on your profile, you can edit your profile.ps1 script (which runs whenever you launch Powershell) to set the variables for you; be warned though, that this may get you into the false-sense of security that the 7z command will just work on any other computer you interact with.

To change profile.ps1, just run notepad $profile from your Powershell terminal, and copy/paste the code above into it. Save the script, restart Powershell, and you should be good to go.

Metadata

Sources

Install and use 7zip on Linux - TutorialsPoint.com
7za man page - edenwaith.com
7zip - Running 7-Zip from within a Powershell script - Stack Overflow
How to create permanent PowerShell Aliases - Stack Overflow

Tags

#tools_sec


  1. Or I just installed it ages ago and forgot... ↩︎