PowerShell / PowerShell/PSResourceGet

Can't install

Aperta
#624 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs-Attention :wave:
Lingua principale
C#
Stelle
576
Fork
114
Merge medio
1g 2h
PR unite (30g)
7

Descrizione

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
# non-elevated
Install-Module -Name PowerShellGet -RequiredVersion 3.0.11-beta -AllowPrerelease -Force -Scope CurrentUser

or

# elevated
Install-Module -Name PowerShellGet -RequiredVersion 3.0.11-beta -AllowPrerelease -Force
Expected behavior
# installed
Actual behavior
Install-Package: Administrator rights are required to install or update. Log on to the computer with an account that has Administrator
rights, and then try again, or install by adding "-Scope CurrentUser" to your command. You can also try running the
Windows PowerShell session with elevated rights (Run as Administrator).
Error details
Exception             :
    Type    : System.Exception
    Message : Administrator rights are required to install or update. Log on to the computer with an account that has
Administrator rights, and then try again, or install by adding "-Scope CurrentUser" to your command. You can also try
running the Windows PowerShell session with elevated rights (Run as Administrator).
    HResult : -2146233088
TargetObject          : System.Collections.ArrayList
CategoryInfo          : InvalidArgument: (System.Collections.ArrayList:String) [Install-Package], Exception
FullyQualifiedErrorId : AdministratorRightsNeededOrSpecifyCurrentUserScope,Copy-Module,Microsoft.PowerShell.Package
Management.Cmdlets.InstallPackage
InvocationInfo        :
    MyCommand        : Install-Package
    ScriptLineNumber : 9711
    OffsetInLine     : 34
    HistoryId        : 2
    ScriptName       : C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1
    Line             : $installedPackages = PackageManagement\Install-Package @PSBoundParameters

    PositionMessage  : At C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711 char:34
                       + … talledPackages = PackageManagement\Install-Package @PSBoundParameters
                       +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PSScriptRoot     : C:\program files\powershell\7\Modules\PowerShellGet
    PSCommandPath    : C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1
    InvocationName   : PackageManagement\Install-Package
    CommandOrigin    : Internal
ScriptStackTrace      : at Install-Module<Process>, C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:
line 9711
                        at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.2.5                 PowerShellGet                       {Find-Command, Find-DscResource, Find-Module, Fin…

Key   : PSVersion
Value : 7.2.2
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.2.2
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.19044
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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con Install-Module in PSModule.psm1 alla riga 9711, quindi segui la chiamata a PackageManagement\Install-Package mostrata nell’errore. Riproduci i comandi sia per CurrentUser senza elevazione sia con elevazione nell’ambiente indicato e individua il motivo per cui la versione richiesta di PowerShellGet non viene installata. Il lavoro è completato quando il comando ha esito positivo con l’ambito o l’elevazione appropriati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
cli, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.