-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessageBox.ps1
More file actions
24 lines (17 loc) · 1.08 KB
/
MessageBox.ps1
File metadata and controls
24 lines (17 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<#
.DESCRIPTION
Modal MessageBox
#>
Clear-Host
Add-Type -AssemblyName System.Windows.Forms
#$Owner = New-Object Windows.Forms.Win32Window -ArgumentList ([System.Diagnostics.Process]::GetCurrentProcess().MainWindowHandle)
#[System.Windows.Forms.MessageBox]::Show($([System.Diagnostics.Process]::GetCurrentProcess().MainWindowHandle), 'Please read marked text on the console!', 'MsSql Install', $([Windows.Forms.MessageBosButtons]::'OK', 'Warning') | Out-Null
# New-Object : Cannot find type [Win32Window]: verify that the assembly containing this type is loaded.
[System.Windows.Forms.IWin32Window]$Owner = New-Object Win32Window ([System.Diagnostics.Process]::GetCurrentProcess().MainWindowHandle.ToString())
$Owner | gm
$Text = [System.String]'Please read marked text on the console!'
$Caption = [System.String]'MsSql Install'
$Buttons = [System.Windows.Forms.MessageBoxButtons]::OK
$Icon = [System.Windows.Forms.MessageBoxIcon]::Warning
#[System.Windows.Forms.MessageBox]::Show($Owner, $Text) | Out-Null
#[System.Windows.Forms.MessageBox]::Show($Owner, $Text, $Caption, $Buttons, $Icon) | Out-Null