diff --git a/Start-SPMigrationGUI.ps1 b/Start-SPMigrationGUI.ps1 index ef6ec25..58d0c69 100644 --- a/Start-SPMigrationGUI.ps1 +++ b/Start-SPMigrationGUI.ps1 @@ -1,7 +1,3 @@ -using assembly System.Windows.Forms -using assembly System.Drawing -using namespace System.Windows.Forms -using namespace System.Drawing [CmdletBinding()] 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.Drawing) [System.Windows.Forms.Application]::EnableVisualStyles()