我编写了一个脚本,它基本上是一个用于 Outlook 的小型所见即所得签名生成器。我们希望我们的签名采用企业颜色,并且是半标准化的——因此需要这样做。
我在 Powershell ISE 中进行了开发工作,一切看起来都不错。但是,当我仅使用 powershell 运行脚本时(就像用户一样),它看起来完全不同:
Powershell vs Powershell ISE http://www.freeimagehosting.net/uploads/1d6e6c5c6f.png
最上面的一个是在 ISE 中生成的,看起来就像我想要的那样。最下面的一个是直接从powershell运行的,视觉上好像倒退了五年!
如何让脚本在 Powershell 中看起来像在 Powershell ISE 中一样时髦?
谢谢,
本
最佳答案
在显示表单之前,在脚本中添加以下行:
[System.Windows.Forms.Application]::EnableVisualStyles();
关于forms - Windows 窗体在 Powershell 和 Powershell ISE 中看起来不同。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3358372/