Multiple Cmdlets emits unneeded log/errors
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
PS /tmp/jjj> $informationPreference = 'Continue'
PS /tmp/jjj> Get-PsResourceRepository
Name Uri Trusted Priority IsAllowedByPolicy
---- --- ------- -------- -----------------
MAR https://mcr.microsoft.com/ True 40 True
PSGallery https://www.powershellgallery.com/api/v2 False 50 True
PS /tmp/jjj> Save-PsResource -name az -Path . -TrustRepository -SkipDependencyCheck
Value of isRepositoryUnauthenticated: True
Value of isRepositoryUnauthenticated: True
PS /tmp/jjj> Save-PsResource -name azxx -Path . -TrustRepository -SkipDependencyCheck
Value of isRepositoryUnauthenticated: True
Save-PSResource: Response returned status code package: Not Found.
Save-PSResource: Package(s) 'azxx' could not be installed from registered repositories 'MAR, PSGallery'.
PS /tmp/jjj> Save-PsResource -name FormatMarkdownTable -Path . -TrustRepository -SkipDependencyCheck
Value of isRepositoryUnauthenticated: True
Save-PSResource: Response returned status code package: Not Found.
Information level message on every container registry server API call
- Information level is being used to pass information to unit test(s)
Container registry server 404 error messages are emitted Cmdlet
in the log MAR API is returning 404 package names "azxxx" and "FormatMarkdownTable" which is normal but the because azxxx does not exist at all and FormatMarkdownTable is available only on powershell gallery. As user I don't need that kind of error messages. IMO error should be handled between Cmdlet and API call logic
Expected behavior
No misleading error messages or test related messages on information level
Actual behavior
-
Error details
Get-Error
Exception :
Type : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
TargetSite :
Name : MoveNext
DeclaringType : [Microsoft.PowerShell.PSResourceGet.ContainerRegistryServerAPICalls+<SendRequestAsync>d__63]
MemberType : Method
Module : Microsoft.PowerShell.PSResourceGet.dll
Message : Response returned status code package: Not Found.
Source : Microsoft.PowerShell.PSResourceGet
HResult : -2146233088
StackTrace :
at Microsoft.PowerShell.PSResourceGet.ContainerRegistryServerAPICalls.SendRequestAsync(HttpRequestMessage message) in C:\__w\1\s\PSResourceGet\src\code\ContainerRegistryServerAPICalls.cs:line 1167
at Microsoft.PowerShell.PSResourceGet.ContainerRegistryServerAPICalls.GetHttpResponseJObjectUsingDefaultHeaders(String url, HttpMethod method, Collection`1 defaultHeaders, ErrorRecord& errRecord, Boolean usePagination) in
C:\__w\1\s\PSResourceGet\src\code\ContainerRegistryServerAPICalls.cs:line 969
TargetObject : Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource
CategoryInfo : InvalidResult: (Microsoft.PowerShel…lets.SavePSResource:SavePSResource) [Save-PSResource], ResourceNotFoundException
FullyQualifiedErrorId : ResourceNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource
InvocationInfo :
MyCommand : Save-PSResource
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 15
Line : Save-PsResource -name FormatMarkdownTable -Path . -TrustRepository -SkipDependencyCheck
Statement : Save-PsResource -name FormatMarkdownTable -Path . -TrustRepository -SkipDependencyCheck
PositionMessage : At line:1 char:1
+ Save-PsResource -name FormatMarkdownTable -Path . -TrustRepository -S …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InvocationName : Save-PsResource
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :
0
1
Environment data
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Binary 1.2.0 Microsoft.PowerShell.PSResourceGet {Compress-PSResource, Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository…}
Key : PSVersion
Value : 7.6.1
Name : PSVersion
Key : PSEdition
Value : Core
Name : PSEdition
Key : GitCommitId
Value : 7.6.1
Name : GitCommitId
Key : OS
Value : macOS 26.3.1
Name : OS
Key : Platform
Value : Unix
Name : Platform
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name : PSCompatibleVersions
Key : PSRemotingProtocolVersion
Value : 2.4
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Visuals
No response
- Ngôn ngữ chính
- C#
- Star
- 576
- Fork
- 114
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 7
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PowerShell/PSResourceGet
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PowerShell/PSResourceGet#2056 ·
-
feature_request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PowerShell/PSResourceGet#2013 · 3 bình luận ·
-
Needs-Triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
PowerShell/PSResourceGet#2055 ·
-
Needs-Triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
PowerShell/PSResourceGet#2054 ·
-
(dsc): Export ignores `--input` filter for `Repository` and `PSResourceList` on DSC 3.3.* or above Đang mởNeeds-Triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
PowerShell/PSResourceGet#2053 ·
Tất cả issue của PowerShell/PSResourceGet
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
azurenoops/spin_agent#975 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SubtitleEdit/subtitleedit#15108 · 1 bình luận ·