gpt4 book ai didi

powershell - 如何解决测试连接错误 : "A parameter cannot be found that matches parameter" name 'TargetName' . "

转载 作者:行者123 更新时间:2023-12-02 18:42:08 26 4
gpt4 key购买 nike

我尝试了Test-Connection -TargetName www.google.com,即 what most examples show 。我收到错误“找不到与参数名称“TargetName”匹配的参数。”

在谷歌搜索该错误时,我没有找到很多结果。

我使用的是 Powershell 版本 5.1,我通过运行 $PSVersionTable 得知该版本。

最佳答案

我发现参数名称的首选方法是 Get-Command -Syntax - 在本例中,它向我们显示 5.1 中的正确名称是 ComputerName:

PS ~> Get-Command Test-Connection -Syntax

Test-Connection [-ComputerName] <string[]> [-AsJob] [-DcomAuthentication <AuthenticationLevel>] [-WsmanAuthentication <string>] [-Protocol <string>] [-BufferSize <int>] [-Count <int>] [-Impersonation <ImpersonationLevel>] [-ThrottleLimit <int>] [-TimeToLive <int>] [-Delay <int>] [<CommonParameters>]

Test-Connection [-ComputerName] <string[]> [-Source] <string[]> [-AsJob] [-DcomAuthentication <AuthenticationLevel>] [-WsmanAuthentication <string>] [-Protocol <string>] [-BufferSize <int>] [-Count <int>] [-Credential <pscredential>] [-Impersonation <ImpersonationLevel>] [-ThrottleLimit <int>] [-TimeToLive <int>] [-Delay <int>] [<CommonParameters>]

Test-Connection [-ComputerName] <string[]> [-DcomAuthentication <AuthenticationLevel>] [-WsmanAuthentication <string>] [-Protocol <string>] [-BufferSize <int>] [-Count <int>] [-Impersonation <ImpersonationLevel>] [-TimeToLive <int>] [-Delay <int>] [-Quiet] [<CommonParameters>]

关于powershell - 如何解决测试连接错误 : "A parameter cannot be found that matches parameter" name 'TargetName' . ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67874457/

26 4 0