小编use*_*712的帖子

PowerShell该术语不被识别为cmdlet功能脚本文件或可操作程序

我在powershell中实现了一个脚本并得到了以下错误.瞬间镜头正是我输入的内容和产生的错误.在此输入图像描述

在这条路径上有我从这里得到的文件Get-NetworkStatistics.ps1 .我正在遵循它的步骤,虽然有错误.

powershell cmd command-prompt powershell-2.0

35
推荐指数
1
解决办法
15万
查看次数

PowerShell 在命令提示符问题中,“Format-Table”未被识别为内部或外部命令、可操作程序或批处理文件

我正在 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中却不能。管道有问题吗| 我把它放在格式表之前

windows powershell cmd command-prompt

1
推荐指数
1
解决办法
5037
查看次数