最上面的一个是在ISE中生成的,看起来像我想要的.最底层的是直接从powershell运行的,看起来在视觉上已经退缩了五年!如何使脚本在Powershell中看起来像在Powershell ISE中一样时髦?谢谢本解决方案在显示表单之前,在脚本中添加以下行:[System.Windows.Forms.Application]::EnableVisualStyles();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.pngThe 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?Thanks,Ben 解决方案 Add the following line in your script before you show the form:[System.Windows.Forms.Application]::EnableVisualStyles(); 这篇关于Windows窗体在Powershell和Powershell ISE中看起来有所不同.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 09:21