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

Update-PSResource Az failure #1642

Open
3 tasks done
Liturgist opened this issue Feb 28, 2024 · 1 comment
Open
3 tasks done

Update-PSResource Az failure #1642

Liturgist opened this issue Feb 28, 2024 · 1 comment

Comments

@Liturgist
Copy link

Liturgist commented Feb 28, 2024

Prerequisites

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

Steps to reproduce

I am unable to update the Az module.

Expected behavior

Az module would be updated.

Actual behavior

PS C:\> Update-PSResource Az -Repository PSGallery

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its Trusted value by running the Set-PSResourceRepository cmdlet. Are
 you sure you want to install the PSResource from 'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
Update-PSResource: 'An error occurred while sending the request.' Request sent: 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Az.Advisor'&$orderby=NormalizedVersion%20desc&$inlinecount=allpages&$skip=0&$filter=Id%20eq%20'Az.Advisor'%20and%20NormalizedVersion%20ge%20'2.0.0'%20and%20NormalizedVersion%20le%20'2.0.9'' Inner exception: 'Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host..'
Update-PSResource: Object reference not set to an instance of an object.

Error details

PS C:\> Get-Error

Exception             :
    Type       : System.NullReferenceException
    TargetSite :
        Name          : InstallVersion
        DeclaringType : Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls, Microsoft.PowerShell.PSResourceGet, Version=1.0.1.0, Culture=neutral,
PublicKeyToken=null
        MemberType    : Method
        Module        : Microsoft.PowerShell.PSResourceGet.dll
    Message    : Object reference not set to an instance of an object.
    Source     : Microsoft.PowerShell.PSResourceGet
    HResult    : -2147467261
    StackTrace :
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.InstallVersion(String packageName, String version, ErrorRecord& errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.InstallPackage(String packageName, String packageVersion, Boolean includePrerelease, ErrorRecord&
errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.BeginPackageInstall(VersionType searchVersionType, NuGetVersion specificVersion, VersionRange
versionRange, String pkgNameToInstall, PSRepositoryInfo repository, ServerApiCall currentServer, ResponseUtil currentResponseUtil, String tempInstallPath, Hashtable
packagesHash, ErrorRecord& errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.InstallPackages(String[] pkgNamesToInstall, PSRepositoryInfo repository, ServerApiCall currentServer,
ResponseUtil currentResponseUtil, ScopeType scope, Boolean skipDependencyCheck, FindHelper findHelper)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.ProcessRepositories(String[] repository, Boolean trustRepository, Boolean skipDependencyCheck,
ScopeType scope)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.BeginInstallPackages(String[] names, VersionRange versionRange, NuGetVersion nugetVersion, VersionType
versionType, String versionString, Boolean prerelease, String[] repository, Boolean acceptLicense, Boolean quiet, Boolean reinstall, Boolean force, Boolean
trustRepository, Boolean noClobber, Boolean asNupkg, Boolean includeXml, Boolean skipDependencyCheck, Boolean authenticodeCheck, Boolean savePkg, List`1
pathsToInstallPkg, Nullable`1 scope, String tmpPath, HashSet`1 pkgsInstalled)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : NotSpecified: (:) [Update-PSResource], NullReferenceException
FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.PSResourceGet.Cmdlets.UpdatePSResource
InvocationInfo        :
    MyCommand        : Update-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 83
    Line             : Update-PSResource Az -Repository PSGallery
    Statement        : Update-PSResource Az -Repository PSGallery
    PositionMessage  : At line:1 char:1
                       + Update-PSResource Az -Repository PSGallery
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Update-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
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

Version

Script 2.2.5 PowerShellGet Desk

Visuals

No response

@anamnavi anamnavi transferred this issue from PowerShell/PowerShellGet Apr 23, 2024
@anamnavi
Copy link
Member

anamnavi commented Apr 23, 2024

@Liturgist can you repro this with the latest version of Microsoft.PowerShell.PSResourceGet? And if so, can you share the output of gmo "Microsoft.PowerShell.PSResourceGet"? Thanks!

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

No branches or pull requests

2 participants