Remove unnecessary using directives for WinForms and Drawing in Start-SPMigrationGUI.ps1

This commit is contained in:
Torsten Brendgen
2026-06-29 12:21:38 +02:00
parent 7d2f54951c
commit 396caa2ca4

View File

@@ -1,7 +1,3 @@
using assembly System.Windows.Forms
using assembly System.Drawing
using namespace System.Windows.Forms
using namespace System.Drawing
[CmdletBinding()] [CmdletBinding()]
param( param(
@@ -784,6 +780,7 @@ class DialogBuilder : BaseComponent {
} }
} }
# PowerShell 7 can fail to resolve WinForms via `using assembly`, but runtime loading works reliably.
[void](Add-Type -AssemblyName System.Windows.Forms) [void](Add-Type -AssemblyName System.Windows.Forms)
[void](Add-Type -AssemblyName System.Drawing) [void](Add-Type -AssemblyName System.Drawing)
[System.Windows.Forms.Application]::EnableVisualStyles() [System.Windows.Forms.Application]::EnableVisualStyles()