Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install-PSResource -NoClobber fails #946

Closed
3 tasks done
ThomasNieto opened this issue Feb 13, 2023 · 0 comments · Fixed by #1121
Closed
3 tasks done

Install-PSResource -NoClobber fails #946

ThomasNieto opened this issue Feb 13, 2023 · 0 comments · Fixed by #1121

Comments

@ThomasNieto
Copy link
Contributor

ThomasNieto commented Feb 13, 2023

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Trying to install a resource with the -NoClobber parameter causes the install to fail in all instances regardless if there is a conflict or not.

Expected behavior

# installs

Actual behavior

Install-PSResource snmp -NoClobber -TrustRepository -PassThru
Install-PSResource: Unable to successfully install package 'SNMP': 'Object reference not set to an instance of an object.'

Error details

Exception             :
    Type           : System.Management.Automation.PSInvalidOperationException
    ErrorRecord    :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Unable to successfully install package 'SNMP': 'Object reference not set to an instance of an
object.'
            HResult : -2146233087
        CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : InvalidOperation
    Message        : Unable to successfully install package 'SNMP': 'Object reference not set to an instance of an
object.'
    InnerException :
        Type       : System.NullReferenceException
        TargetSite :
            Name          : DetectClobber
            DeclaringType : Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallHelper, PowerShellGet, Version=3.0.19.0,
Culture=neutral, PublicKeyToken=null
            MemberType    : Method
            Module        : PowerShellGet.dll
        Message    : Object reference not set to an instance of an object.
        Source     : PowerShellGet
        HResult    : -2147467261
        StackTrace :
   at Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallHelper.DetectClobber(String pkgName, Hashtable
parsedMetadataHashtable)
   at Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallHelper.InstallPackage(List`1 pkgsToInstall, String repoName,
String repoUri, PSCredentialInfo repoCredentialInfo, PSCredential credential, Boolean isLocalRepo, ScopeType scope)
    HResult        : -2146233079
TargetObject          : Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallPSResource
CategoryInfo          : InvalidOperation: (Microsoft.PowerShel…s.InstallPSResource:InstallPSResource)
[Install-PSResource], PSInvalidOperationException
FullyQualifiedErrorId : InstallPackageFailed,Microsoft.PowerShell.PowerShellGet.Cmdlets.InstallPSResource
InvocationInfo        :
    MyCommand        : Install-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : Install-PSResource snmp -NoClobber -TrustRepository -PassThru
    PositionMessage  : At line:1 char:1
                       + Install-PSResource snmp -NoClobber -TrustRepository -PassThru
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Install-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

Name          Version
----          -------
PowerShellGet 3.0.19

Name                           Value
----                           -----
PSVersion                      7.3.2
PSEdition                      Core
GitCommitId                    7.3.2
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants