为什么在powershell中可以使用Out-Host -Paging,而在powershell ISE中却报错呢?


PowerShell交流中心分类: Powershell基础为什么在powershell中可以使用Out-Host -Paging,而在powershell ISE中却报错呢?
0
jason_li asked 6 年 ago

在powershell ISE中使用命令:
Get-ChildItem -Path C:\WINDOWS\System32 |Out-Host -Paging
out-lineoutput : 未实现该方法或操作。
所在位置 行:1 字符: 1
+ Get-ChildItem -Path C:\WINDOWS\System32 |Out-Host -Paging
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [out-lineoutput], NotImplementedException
+ FullyQualifiedErrorId : System.NotImplementedException,Microsoft.PowerShell.Commands.OutLineOutputCommand
 
win10自带的版本5.1

1 Answers
1
Mooser Lee 管理员 answered 6 年 ago

PowerShell ISE 中的内嵌控制台不是真正的控制台,不支持分页。 参见: https://blogs.msdn.microsoft.com/powershell/2009/04/17/differences-between-the-ise-and-powershell-console/