让结果不再显示GAC信息

时间:2019-05-09 21:55:00

标签: powershell ironpython

我使用以下代码在powershell中运行ironpython代码,但输出结果始终显示GAC信息。看图片 enter image description here

[reflection.assembly]::LoadFrom("C:\Program Files\IronPython 2.7\IronPython.dll")
$py = [ironpython.hosting.python]::CreateEngine()
$py.Execute("print 'IronPython Engine loaded.'")

有什么办法可以隐藏它?我不想每次都显示它

1 个答案:

答案 0 :(得分:0)

您可以将第一个命令传递给Out-Null:

[reflection.assembly]::LoadFrom("C:\Program Files\IronPython 2.7\IronPython.dll") | Out-Null

$py = [ironpython.hosting.python]::CreateEngine() 
$py.Execute("print 'IronPython Engine loaded.'")

禁止显示该命令的所有输出。

enter image description here