Powershell输出需要更长时间才能显示

时间:2015-10-20 03:08:24

标签: powershell command-prompt

在命令提示符和powershell中运行以下命令。

第一个在命令提示符下即时显示,而在PowerShell中需要更长时间。这可能是什么原因?

type file

有没有办法改变或加快默认的PowerShell行为?

如果需要,我很乐意发布视频/ gif。

这是一个视频我会发布一个gif,如果我可以在某个时候点https://vid.me/ZjfA

2 个答案:

答案 0 :(得分:4)

命令提示符中的

type读取文本。在PowerShell中,它读取文本行并构造包含每行文件的字符串对象的.NET数组。

Get-Contentslowslow以及slowslow以及slowslow)。

答案 1 :(得分:0)

首先打开命令提示符,然后运行powershell。或按Win + r,然后键入powershell。接下来键入运行以下

powershell.exe -noexit -File "C:\Users\a\Desktop\test.ps1"

test.ps1

Remove-Item alias:ls
Remove-Item alias:cat
Remove-Item alias:echo
function ls {cmd /c "dir $args"}
function cat {cmd /c "type $args"}
function echo {cmd /c "echo $args"}

现在你的命令看起来要快得多。