OneGet / oneget

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

Is there any way to install a module without dependencies? #494

Open msJinLei opened 3 years ago

msJinLei commented 3 years ago

Hi team, I would like to ask whether there is a way to install one module without its dependencies using PowerShellGet or PackageManagement.

I find the -SkipDependencies in cmdlet Install-Package of PackageManagement ( https://docs.microsoft.com/en-us/powershell/module/packagemanagement/install-package?view=powershell-7) but without the example of how to use it.

And I tried the execution such as • Install-Package -Name Az -Source PSGallery -SkipDependencies -RequiredVersion 4.7.0 • Install-Package -Provider PowerShellGet -Source PSGallery -RequiredVersion 4.7.0 -SkipDependencies Az However, all of above report that parameter “SkipDependencies” cannot be found.

So I would like to ask whether Install-Package supports skipping installing dependencies? Or is there other way to install a module without its dependencies with PowerShellGet or PackageManagement?

SydneyhSmith commented 3 years ago

Thanks what version of PackageManagement are you using? gmo PackageManagement -ListAvailable

msJinLei commented 3 years ago

I am using 1.4.7

> gmo PackageManagement -ListAvailable

    Directory: C:\program files\powershell\7\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.4.7                 PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}