我在powershell中实现了一个脚本并得到了以下错误.瞬间镜头正是我输入的内容和产生的错误.
在这条路径上有我从这里得到的文件Get-NetworkStatistics.ps1 .我正在遵循它的步骤,虽然有错误.
我正在 cmd 中执行 powershell 脚本。
首先我写命令
C:\Windows\system32>start powershell.exe Set-ExecutionPolicy RemoteSigned
它工作成功
比运行脚本我写命令
C:\Windows\system32>start powershell.exe C:\\Get-NetworkStatistics.ps1
Run Code Online (Sandbox Code Playgroud)
也能成功运行
问题是当我尝试运行该函数时
C:\Windows\system32>start powershell.exe Get-NetworkStatistics -computername Gbsi1 | Format-Table -autosize
Run Code Online (Sandbox Code Playgroud)
它给出错误“‘Format-Table’未被识别为内部或外部命令、可操作程序或批处理文件。”
这是它的屏幕截图。

在powershell中可以成功,但在cmd中却不能。管道有问题吗| 我把它放在格式表之前