gpt4 book ai didi

azure - Test-NetConnection : The term 'Test-NetConnection' is not recognized as a name of a cmdlet, 函数、脚本文件或可执行程序

转载 作者:行者123 更新时间:2023-12-03 07:03:16 28 4
gpt4 key购买 nike

我想从 Azure 门户连接到我的 Windows 笔记本电脑的文件共享。但是,相关错误如下所示。

$connectTestResult = Test-NetConnection -ComputerName storagetestmy3.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:`"storagetestmy3.file.core.windows.net`" /user:`"localhost\storagetestmy3`" /pass:`"ZvWYXdvAkX112rT8k2MxQLqlcDi1oA+EZNNoGeQ2Bv88DDUWFdtcmbXXfKk/mHNMlw1TDVX3Vrkb+AStoh/kOQ==`""
# Mount the drive
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\storagetestmy3.file.core.windows.net\fileshare3" -Persist
} else {
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
}

错误:Test-NetConnection:术语“Test-NetConnection”未被识别为 cmdlet、函数、脚本文件或可执行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。

最佳答案

打开 Latest Version of PowerShell在 Windows 笔记本电脑中运行 Test-NetConnection 命令。

cmdlet 运行成功:

enter image description here

关于azure - Test-NetConnection : The term 'Test-NetConnection' is not recognized as a name of a cmdlet, 函数、脚本文件或可执行程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71936416/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com