OneGet / oneget

PackageManagement (aka OneGet) is a package manager for Windows
MIT License
2.38k stars 189 forks source link

What is the difference between Install-Package and Save-Package? #540

Open ZenoArrow opened 9 months ago

ZenoArrow commented 9 months ago

Can someone explain what the difference between Install-Package and Save-Package is? I've searched for answers to this, but haven't found the key difference(s). If you install or save a package to the same directory, what extra steps is Install-Package doing?

ThomasNieto commented 9 months ago

Save downloads a package into a directory and can be used to inspect a package or publish to a different repository.

Install downloads and executes the installer (if one exists) then appears when using Get.

Depending on the provider there may not be a difference at all.

ZenoArrow commented 9 months ago

Thank you for clarifying @ThomasNieto . Just to check, if I used Save-Package and wanted to inspect the installer before its run, would I use Get-Package for that or is there another cmdlet that would allow me to see an installer (if it exists) before running it? Alternatively, is there a naming convention for the installer that would allow me to find it in the package?

ThomasNieto commented 9 months ago

There is no naming convention as each provider does it differently and packages can as well.

You'd just use save to download it and then go to the path you specified. Get would not see the saved package unless it supported that.