Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Find-PSResource stops searching, when one of registered repositories is not available.

未关闭
#1,923 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@anamnavi 已经在做这个了。

开始于 2025年12月15日。

  • #1924 来自 @anamnavi —— 未关闭
  • #1926 来自 @anamnavi —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

Area-Find
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

When there are several repositories registered and one of them is currently not available (for example private repository when machine is out of office), then Find-PSResource stops with terminating error and refuses to search from available repositories.

Expected behavior
PS ❯ Find-PSResource sqlserver

Name      Version  Prerelease Repository Description
----      -------  ---------- ---------- -----------
SqlServer 22.4.5.1            PSGallery  This module allows SQL Server developers, administrators and business intelligence professionals to au…
Actual behavior
PS ❯ Find-PSResource sqlserver -ErrorAction Ignore
Find-PSResource: The network path was not found. : '\\server\share\folder'.
Error details
Exception             :
    Type       : System.IO.IOException
    TargetSite :
        Name          : Init
        DeclaringType : [System.IO.Enumeration.FileSystemEnumerator`1[TResult]]
        MemberType    : Method
        Module        : System.Private.CoreLib.dll
    Message    : The network path was not found. : '\\server\share\folder'.
    Source     : System.Private.CoreLib
    HResult    : -2147024843
    StackTrace :
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.LocalServerAPICalls.FindNameHelper(String packageName, String[] tags, Boolean includePrerelease
, ResourceType type, ErrorRecord& errRecord) in C:\__w\1\s\PSResourceGet\src\code\LocalServerApiCalls.cs:line 266
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.LocalServerAPICalls.FindName(String packageName, Boolean includePrerelease, ResourceType type,
ErrorRecord& errRecord) in C:\__w\1\s\PSResourceGet\src\code\LocalServerApiCalls.cs:line 109
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper.SearchByNames(ServerApiCall currentServer, ResponseUtil currentResponseUtil, PSRepos
itoryInfo repository, Boolean shouldReportErrorForEachRepo)+MoveNext() in C:\__w\1\s\PSResourceGet\src\code\FindHelper.cs:line 792
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.FindHelper.FindByResourceName(String[] name, ResourceType type, VersionRange versionRange, NuGe
tVersion nugetVersion, VersionType versionType, String version, Boolean prerelease, String[] tag, String[] repository, Boolean includeDependenci
es, Boolean suppressErrors)+MoveNext() in C:\__w\1\s\PSResourceGet\src\code\FindHelper.cs:line 223
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource.ProcessResourceNameParameterSet() in C:\__w\1\s\PSResourceGet\src\code\FindPSRes
ource.cs:line 249
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource.ProcessRecord() in C:\__w\1\s\PSResourceGet\src\code\FindPSResource.cs:line 148
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : NotSpecified: (:) [Find-PSResource], IOException
FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource
InvocationInfo        :
    MyCommand        : Find-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 13
    Line             : find-psresource sqlserver
    Statement        : find-psresource sqlserver
    PositionMessage  : At line:1 char:1
                       + find-psresource sqlserver
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : find-psresource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
Environment data
PowerShell: 5.1 and 7.5.4
PSResourceGet: 1.1.1
Visuals

No response

主要语言
C#
星标
577
派生
114
平均合并
23 小时 17 分钟
30 天内合并 PR
8

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PSResourceGet 的其他 Issue

查看 PowerShell/PSResourceGet 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。