【发布时间】:2015-08-25 02:11:21
【问题描述】:
以下是我在项目目录中运行某个 grunt 任务时 Windows PowerShell 的一些示例输出:
Done, without errors.
Execution Time (2015-08-25 01:57:14 UTC)
loading tasks 9ms ██████ 17%
loading grunt-contrib-copy 23ms ███████████████ 43%
copy:styles 20ms █████████████ 38%
Total 53ms
Running "autoprefixer:server" (autoprefixer) task
Autoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixe
r]).process() instead
File .tmp/styles/main.css created.
“完成,没有错误”为绿色,“.tmp/styles/main.css”为青色。
在 Powershell ISE 中运行相同的命令,会产生以下结果:
[32mDone, without errors.[39m
Execution Time (2015-08-25 01:58:40 UTC)
loading tasks 9ms ███████ 20%
loading grunt-contrib-copy 20ms ████████████████ 45%
copy:styles 14ms ███████████ 32%
Total 44ms
[4mRunning "autoprefixer:server" (autoprefixer) task[24m
grunt : Autoprefixer's process() method is deprecated and will removed in next major release. Use
postcss([autoprefixer]).process() instead
At line:1 char:1
+ grunt serve
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Autoprefixer's ...ocess() instead:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
File .tmp/styles/main.css created.
颜色解释不正确,非 ASCII 字符也不正确。
我已尝试寻找解决方案,但没有成功。如何使 PowerShell ISE 的行为更像 PowerShell?看起来 PS ISE 只是常规 PS 的包装,但肯定还有更多。
更新: 遇到了this post,上面写着“控制台应用程序输出不是彩色的”。这是否意味着无法通过 PowerShell ISE 获得类似 PowerShell 的输出?
【问题讨论】: