PSResourceGet
PSResourceGet copied to clipboard
-NoClobber is not working properly
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest released version
- [X] Search the existing issues.
Steps to reproduce

Expected behavior
Should just install
Actual behavior
Gives a warning that the package is not found
Error details
Exception :
Type : System.ArgumentException
Message : Package 'Ships' with requested version range (, ) could not be installed as it was not
found in any registered repositories
HResult : -2147024809
CategoryInfo : ObjectNotFound: (:) [Install-PSResource], ArgumentException
FullyQualifiedErrorId : ResourceNotFoundError,Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallPSResource
InvocationInfo :
MyCommand : Install-PSResource
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 90
Line : Install-PSResource Ships -Repository PSGallery -NoClobber -Reinstall
PositionMessage : At line:1 char:1
+ Install-PSResource Ships -Repository PSGallery -NoClobber -Reinstall
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Install-PSResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
PS C:\demos> Get-Module PowerShellGet; $PSVersionTable
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 3.0.14 beta14 PowerShellGet {Find-PSResource, Get-PSResource, Ge…
Key : PSVersion
Value : 7.2.4
Name : PSVersion
Key : PSEdition
Value : Core
Name : PSEdition
Key : GitCommitId
Value : 7.2.4
Name : GitCommitId
Key : OS
Value : Microsoft Windows 10.0.19043
Name : OS
Key : Platform
Value : Win32NT
Name : Platform
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name : PSCompatibleVersions
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Visuals
No response
We are also seeing an issue with Install-PSResource: Unable to successfully install package 'PowerShellGet': 'Object reference not set to an instance of an object.