forked from KurtDeGreeff/PlayPowershell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemo-v3-Gui.ps1
65 lines (63 loc) · 1.73 KB
/
Demo-v3-Gui.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#requires -version 3
[Windows.Window]@{
OpacityMask = [Windows.Media.DrawingBrush]@{
Drawing = [Windows.Media.GeometryDrawing]@{
Brush = 'Black'
Geometry = [Windows.Media.EllipseGeometry]@{
radiusX = 123
radiusY = 321
}
}
}
Background = [Windows.Media.LinearGradientBrush]@{
Opacity = 0.5
StartPoint = '0,0.5'
Endpoint = '1,0.5'
GradientStops = & {
$Stopki = New-Object Windows.Media.GradientStopCollection
$Colors = 'Blue', 'Green'
foreach ($i in 0..1) {
$Stopki.Add(
[Windows.Media.GradientStop]@{
Color = $Colors[$i]
Offset = $i
}
)
}
, $Stopki
}
}
Width = 800
Height = 400
WindowStyle = 'None'
AllowsTransparency = $true
Effect = [Windows.Media.Effects.DropShadowEffect]@{
BlurRadius = 10
}
Content = & {
$Stos = [Windows.Controls.StackPanel]@{
VerticalAlignment = 'Center'
HorizontalAlignment = 'Center'
}
$Stos.AddChild(
[Windows.Controls.Label]@{
Content = 'PowerShell Rocks!'
FontSize = 80
FontFamily = 'Consolas'
Foreground = 'White'
Effect = [Windows.Media.Effects.DropShadowEffect]@{
BlurRadius = 5
}
}
)
, $Stos
}
} | foreach {
$_.Add_MouseLeftButtonDown({
$this.DragMove()
})
$_.Add_MouseRightButtonDown({
$this.Close()
})
$_.ShowDialog()
}