Extracting Nupkg files using command line
NugetNuget Problem Overview
Firstly, I do not want to use Visual Studio at all when dealing with the certain .nupkg files.
I know there is a tool called NuGet Package Explorer and this can export nupkg files to a certain file location using a gui, but I'm looking to setup a MSBuild task to run and unpack about 50 .nupkg files, using the command line.
My question is, is there a tool you can use via the command line which will unpack .nupkg files to a specified file location?
Nuget Solutions
Solution 1 - Nuget
NuPKG files are just zip files, so anything that can process a zip file should be able to process a nupkg file, i.e, 7zip.
Solution 2 - Nuget
You can also use the NuGet command line, by specifying a local host as part of an install. For example if your package is stored in the current directory
nuget install MyPackage -Source %cd% -OutputDirectory packages
will unpack it into the target directory.
Solution 3 - Nuget
Rename it to .zip, then extract it.
Solution 4 - Nuget
did the same thing like this:
clear
cd PACKAGE_DIRECTORY
function Expand-ZIPFile($file, $destination)
{
$shell = New-Object -ComObject Shell.Application
$zip = $shell.NameSpace($file)
foreach($item in $zip.items())
{
$shell.Namespace($destination).copyhere($item)
}
}
Dir *.nupkg | rename-item -newname { $_.name -replace ".nupkg",".zip" }
Expand-ZIPFile "Package.1.0.0.zip" “DESTINATION_PATH”
Solution 5 - Nuget
With PowerShell 5.1 (PackageManagement module)
Install-Package -Name MyPackage -Source (Get-Location).Path -Destination C:\outputdirectory
Solution 6 - Nuget
This worked for me:
Rename-Item -Path A_Package.nupkg -NewName A_Package.zip
Expand-Archive -Path A_Package.zip -DestinationPath C:\Reference
Solution 7 - Nuget
I've expanded Zamarin.Essentials -version 1.6.1 with 7-zip and nuget package manager is not recognizing this package and I have source set to all. I've tried just my global package source alone too.
Also I've noticed package manager downloads multiple versions to same folder, was wondering if it's ok to put a version folder in a package and copy the package end into it?