Windows 窗体在 Powershell 和 Powershell ISE 中看起来不同。为什么?
我编写了一个脚本,它基本上是 Outlook 的一个小型所见即所得签名生成器。我们希望我们的签名采用企业颜色,并且是半标准化的——因此有此要求。
我在 Powershell ISE 中完成了开发工作,一切看起来都很好。但是,当我仅使用 powershell 运行脚本时(用户会这样做),它看起来完全不同:
Powershell vs Powershell ISE http://www.freeimagehosting.net/uploads/1d6e6c5c6f.png
最上面的一个是在 ISE 中生成的,看起来像我想要的。最下面的一个是直接从 powershell 运行的,看起来视觉上倒退了五年!
如何让脚本在 Powershell 中看起来像在 Powershell ISE 中一样时髦?
I have written a script which is basically a small wysiwyg signature generator for Outlook. We want our signatures to be in corporate colours, and semi-standardised - hence the requirement for this.
I did the development work in Powershell ISE and all looked good. However, when I run the script just using powershell (as the users will) it looks totally different:
Powershell vs Powershell ISE http://www.freeimagehosting.net/uploads/1d6e6c5c6f.png
The top one was generated in ISE, and looks as I want it. The bottom one was run from powershell directly and seems to have visually regressed five years!
How can I get the script to look as snazzy in Powershell as it does in Powershell ISE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在显示表单之前,在脚本中添加以下行:
Add the following line in your script before you show the form: