Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How do I resolve the error Publish-PSArtifactUtility : Failed to generate the compressed file for script when using Publish-Script?

$
0
0

I'm trying to publish a PowerShell script to PSGallery and I have successfully published PowerShell modules in the past, so my API key works (even tried renewing it).

Publish-Script -Path .\MyScript.ps1 -NuGetApiKey $ENV:MyKey
Publish-PSArtifactUtility : Failed to generate the compressed file for script 'Attempting to build package from 'MyScript.nuspec'.'.  At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2875char:17+ ...               Publish-PSArtifactUtility -PSScriptInfo $PSScriptInfo `+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo          : InvalidOperation: (:) [Write-Error], WriteErrorException+ FullyQualifiedErrorId : FailedToCreateCompressedScript,Publish-PSArtifactUtility

Using -Verbose output will provide some additional information...

An error occured while trying to parse the value '' of property 'dependencies' inthe manifest file.'' is not a valid version string.

So clearly some value is missing during the compression process in the generated MyScript.nuspec file.

I've added the following ScriptInfo parameters before trying to publish the script.

param = @{  Path = '.\MyScript.ps1'  Version = '1.0.0'  Author = 'Dennis'  Description = 'My Script'  ProjectUri = 'https://github.com/XXXXXX/MyScript'  RequiredModules = 'PSWindowsUpdate',    @{ModuleName='Pester';ModuleVersion='4.10.1'},'PendingReboot','SpeculationControl'}Update-ScriptFileInfo @param -Force

(Tags are strongly recommeded but not a requirement.)

I've tried updating nuget.exe as Administrator as found here

Invoke-WebRequest `  -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe `  -OutFile "$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\NuGet.exe"

I've probably missed something really simple, but can't figure out what...


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>