Update-PSResource fails with required nuget version
See original GitHub issuePrerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
Steps to reproduce
If you try and Update-PSResource
using a nuget version syntax it fails, Install-PSResource
works. This workflow worked in beta22 so something has changed to break it.
I found this while running CI for my module: CI run
PS C:\Users\Thomas> Install-PSResource -Name NetworkingDsc -Version '[8.0.0]' -PassThru
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
NetworkingDsc 8.0.0 PSGallery DSC resources for configuring settings related to networking.
PS C:\Users\Thomas> Update-PSResource -Name NetworkingDsc -Version '[8.1.0]' -PassThru
Name Version Prerelease Repository Description
---- ------- ---------- ---------- -----------
NetworkingDsc 8.1.0 PSGallery DSC resources for configuring settings related to networking.
PS C:\Users\Thomas> Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' -PassThru
Update-PSResource: Package 'NetworkingDsc' with version '[8.2.0-preview0001]' could not be found
WARNING: Installed package 'NetworkingDsc':'[8.2.0-preview0001]' was not found in repositories and cannot be updated.
PS C:\Users\Thomas> Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' -PassThru -Prerelease
Update-PSResource: Package 'NetworkingDsc' with version '[8.2.0-preview0001]' could not be found
WARNING: Installed package 'NetworkingDsc':'[8.2.0-preview0001]' was not found in repositories and cannot be updated.
Expected behavior
# works
Actual behavior
Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' -PassThru -Prerelease
Update-PSResource: Package 'NetworkingDsc' with version '[8.2.0-preview0001]' could not be found
WARNING: Installed package 'NetworkingDsc':'[8.2.0-preview0001]' was not found in repositories and cannot be updated.
Error details
Exception :
Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.PackageNotFoundException
Message : Package 'NetworkingDsc' with version '[8.2.0-preview0001]' could not be found
InnerException :
Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.V2ResourceNotFoundException
Message : Package does not exist on the server
HResult : -2146233088
HResult : -2146233088
TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper
CategoryInfo : InvalidResult: (Microsoft.PowerShel….Cmdlets.FindHelper:FindHelper) [Update-PSResource],
PackageNotFoundException
FullyQualifiedErrorId : FindNameConvertToPSResourceFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource
InvocationInfo :
MyCommand : Update-PSResource
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 4
Line : Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' -PassThru -Prerelease
Statement : Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' -PassThru -Prerelease
PositionMessage : At line:1 char:1
+ Update-PSResource -Name NetworkingDsc -Version '[8.2.0-preview0001]' …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Update-PSResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
beta23
Visuals
No response
Issue Analytics
- State:
- Created 2 months ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
visual studio 2015 - Trying to update Nuget Package fails
According to the error message, your problem occurs when retrieving package metadata from the url, you need to check the package source from ......
Read more >Troubleshooting NuGet Package Restore in Visual Studio
This error occurs when you attempt to build a project that contains references to one or more NuGet packages, but those packages are...
Read more >Unable to resolve dependencies of NuGet packages
Solution · Clear the NuGet cache files. You do this in the following way: In the toolbar of Visual Studio, navigate to Tools...
Read more >NuGet Error NU1102
Solution. Edit the project file to correct the package version. Check your NuGet.Config for the PackageSourceMapping configuration. The package ...
Read more >NuGet packages in the Package Registry
Publish NuGet packages in your project's Package Registry. Then, install the packages whenever you need to use them as a dependency. The Package...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SydneyhSmith feel free to compare to my tests for anypackage/psresourceget to see if there are any gaps.
Thanks @ThomasNieto, we should also check our tests, as a test should have caught this regression