2017-04-19 43 views
0

我正在为PowerShell脚本制作GUI,并且想要使用MetroFramework显示MetroMessageBox,它只需要有一条消息和用于解除的“确定”按钮。在PowerShell中使用MetroMessageBox

在线搜索我发现的所有内容都是针对VB.Net和C#的。我已经看过如何在PS中运行VB.Net和C#代码,试用它没有运气。

System.Windows代码纵观MessageBox

[System.Windows.MessageBox]::Show('Hello') 

我试过,没有运气。

[MetroFramework.MetroMessageBox]::Show('Hello') 

如何在PowerShell中使用MetroMessageBox

+0

寻找像你将需要与添加库'添加-Type'那么你应该能够使用应该看起来像这样的方法:'[MetroFramework.MetroMessageBox] :: Show(this,“Your message here。”,“Title Here”,MessageBoxButtons.OKCancel,MessageBoxIcon.Hand)' – BenH

回答

0

得到它一起工作这

[MetroFramework.MetroMessageBox]::Show($mainForm,"Your message here.","Title Here","OK","Info","211") 

没有需要使用添加型或任何其他的东西