首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >查找包没有-ScriptSourceLocation参数。

查找包没有-ScriptSourceLocation参数。
EN

Stack Overflow用户
提问于 2019-12-24 18:53:48
回答 1查看 348关注 0票数 2

为什么Find-Package不识别-ScriptSourceLocation参数?

代码语言:javascript
复制
PS H:\> help Find-Package -Full
NAME
    Find-Package

SYNOPSIS
    Finds software packages in available package sources.


SYNTAX
    Find-Package [[-Name] <String[]>] [-AcceptLicense] [-AllowPrereleaseVersions] [-AllVersions] [-Command <String[]>] [-Credential <PSCredential>]
    [-DscResource <String[]>] [-Filter <String>] [-Force] [-ForceBootstrap] [-IncludeDependencies] [-Includes {Cmdlet | DscResource | Function |
    RoleCapability | Workflow}] [-MaximumVersion <String>] [-MinimumVersion <String>] [-PackageManagementProvider <String>] [-ProviderName {Bootstrap |
    NuGet | PowerShellGet}] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-PublishLocation <String>] [-RequiredVersion <String>] [-RoleCapability
    <String[]>] [-ScriptPublishLocation <String>] ***[-ScriptSourceLocation <String>]*** [-Source <String[]>] [-Tag <String[]>] [-Type {Module | Script | All}]
    [<CommonParameters>]

但是,如果使用异常,则会产生异常。

代码语言:javascript
复制
PS H:\> Find-Package -ProviderName 'NuGet' -ScriptSourceLocation 'https://www.powershellgallery.com/api/v2/items/psscript'
Find-Package : A parameter cannot be found that matches parameter name 'ScriptSourceLocation'.
At line:1 char:36
+ Find-Package -ProviderName 'NuGet' -ScriptSourceLocation 'https://www ...
+                                    ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Find-Package], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.FindPackage
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-24 22:03:32

我认为您在这里看到的是一个bug,无论是使用Find-Package,还是可能是一些带有命名参数集的奇怪/错误。我会在Powershell核心问题页上报告这一点,因为它看起来仍然是当前版本的PowerShell 6的一个问题。进一步的测试表明,如果您不指定-ProviderName,那么这个参数可以正常工作,并且是可以识别的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59472531

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档