Powershell MessageBox
hi,
i add messagebox in powershell script.
i have 2 scripts, first launch script specific credentials.
first script :
start-process powershell -argumentlist "c:\scripts\script1.ps1" -credential (domain\user)
in second script use messagebox :
[system.windows.forms.messagebox]::show("test messagebox" , "information")
when run first script, have error :
unable find type [system.windows.forms.messagebox]: make sure assembly containing type loaded.
i run command : add-type –assemblyname system.windows.forms but have same error.
if run second script, don't have error.
how can fix this?
thanks.
add-type –assemblyname system.windows.forms - add command top of c:\scripts\script1.ps1
same error.
try add command to second script.
Windows Server > Windows PowerShell
Comments
Post a Comment