PowerShell / PowerShell/PSResourceGet
Save-PSResource -AsNupkg causes pipeline input to fail
Nessuno ha ancora preso questa issue.
- 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
Using -AsNupkg causes pipeline input to fail. Notice the error message name for the resource is the type name not resource.
Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru
Expected behavior
# works
Actual behavior
Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru
Save-PSResource: Package 'Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo' with requested version range '(, )' could not be found in any trusted repositories
Error details
Exception :
Type : System.ArgumentException
Message : Package 'Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo' with requested version range '(,
)' could not be found in any trusted repositories
HResult : -2147024809
CategoryInfo : ObjectNotFound: (:) [Save-PSResource], ArgumentException
FullyQualifiedErrorId : ResourceNotFoundError,Microsoft.PowerShell.PowerShellGet.Cmdlets.SavePSResource
InvocationInfo :
MyCommand : Save-PSResource
ScriptLineNumber : 1
OffsetInLine : 24
HistoryId : 13
Line : Find-PSResource snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository -PassThru
PositionMessage : At line:1 char:24
+ … urce snmp | Save-PSResource -Path c:\temp -AsNupkg -TrustRepository - …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Save-PSResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
Environment data
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il comando della pipeline con Find-PSResource e Save-PSResource usando -AsNupkg e -PassThru. Traccia il percorso dell’input della pipeline di Save-PSResource e la costruzione di ResourceNotFoundError; il lavoro è completato quando il PSResourceInfo passato tramite pipeline viene salvato correttamente e l’errore, se viene generato, identifica la risorsa effettiva anziché il suo nome di tipo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, powershell
- Ambito
- cli, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100