PowerShell 术语未被识别为 cmdlet 函数脚本文件或可运行程序 [英] PowerShell The term is not recognized as cmdlet function script file or operable program
问题描述
我正在 powershell 中实现一个脚本并收到以下错误.屏幕截图正是我输入的内容以及由此产生的错误.
在此路径中有文件 Get-NetworkStatistics.ps1
,我从 技术网库.我正在按照它的步骤操作,尽管有错误.
您首先必须点"源脚本,所以对您来说:
<预><代码>..Get-NetworkStatistics.ps1第一个点"要求 PowerShell 将脚本文件加载到您的 PowerShell 环境中,而不是启动它.您还应该使用 set-ExecutionPolicy Unrestricted
或 set-ExecutionPolicy AllSigned
参见(执行政策说明).
I am implementing a script in powershell and getting the below error. The sceen shot is there exactly what I entered and the resulting error.
At this path there is file Get-NetworkStatistics.ps1
which I got from Technet Gallery. I am following the steps from it, though there are errors.
You first have to 'dot' source the script, so for you :
. .Get-NetworkStatistics.ps1
The first 'dot' asks PowerShell to load the script file into your PowerShell environment, not to start it. You should also use set-ExecutionPolicy Unrestricted
or set-ExecutionPolicy AllSigned
see(the Execution Policy instructions).
这篇关于PowerShell 术语未被识别为 cmdlet 函数脚本文件或可运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!