PowerShell无法识别基本cmdlet

时间:2016-12-15 17:23:39

标签: powershell powershell-v3.0

在PowerShell 3.0中调用基本cmdlet时,PowerShell无法识别它们:

Write-Host "Test"
# returns error "The term 'Write-Host' is not recognized as the name of a 
# cmdlet, function, (etc.)

许多其他基本PowerShell脚本也是如此。

$ Env.Path设置为:

  

C:\ Windows \ System32下; C:\ WINDOWS; C:\ WINDOWS \ SYSTEM32 \ WBEM;   C:\ WINDOWS \ SYSTEM32 \ WindowsPowerShell \ V1.0 \; C:\ PROGRAM   Files \ Microsoft Office Servers \ 15.0 \ Bin \; c:\ Program Files   (x86)\ Microsoft SQL Server \ 110 \ Tools \ Binn \ ManagementStudio \;   c:\ Program Files(x86)\ Microsoft SQL Server \ 110 \ Tools \ Binn \;   c:\ Program Files \ Microsoft SQL Server \ 110 \ Tools \ Binn \; C:\ PROGRAM   文件(x86)\ Microsoft SQL Server \ 110 \ DTS \ Binn \; C:\ PROGRAM   Files \ Microsoft SQL Server \ 110 \ DTS \ Binn \; C:\ Program Files \ Microsoft   SQL Server \ Client SDK \ ODBC \ 110 \ Tools \ Binn \; C:\ Program Files   (x86)\ Microsoft SQL Server \ 120 \ Tools \ Binn \ ManagementStudio \;   C:\ Program Files(x86)\ Microsoft SQL Server \ 120 \ Tools \ Binn \;   C:\ Program Files \ Microsoft SQL Server \ 120 \ Tools \ Binn \; C:\ PROGRAM   文件(x86)\ Microsoft SQL Server \ 120 \ DTS \ Binn \; C:\ PROGRAM   Files \ Microsoft SQL Server \ 120 \ DTS \ Binn \

$ Env.PSModulePath显示:

  

C:\用户\ {用户名} \文件\ WindowsPowerShell \模块;; C:\程序   Files \ AppFabric 1.1 for Windows Server \ PowershellModules; C:\ Program   Files \ AppFabric 1.1 for Windows Server \ PowershellModules; C:\ Program   文件(x86)\ Microsoft SQL   Server \ 110 \ Tools \ PowerShell \ Modules \; C:\ Program Files(x86)\ Microsoft   SQL Server \ 120 \ Tools \ PowerShell \ Modules \

0 个答案:

没有答案