Last active
July 10, 2026 08:58
-
-
Save Himura2la/86afd5a9c6cc60dfeba79d434f03d84f to your computer and use it in GitHub Desktop.
Windows Forms via PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $scriptContent = @' | |
| Add-Type -AssemblyName System.Windows.Forms | |
| $form = New-Object System.Windows.Forms.Form | |
| $form.Text = "PlaceholderWindow" | |
| [System.Windows.Forms.Application]::Run($form) | |
| '@ | |
| if (-not (Get-Module -ListAvailable -Name ps2exe)) { | |
| Write-Host "Install ps2exe module:`n`tInstall-Module -Name ps2exe -Scope CurrentUser -Force" | |
| } else { | |
| $tempScriptPath = "$env:TEMP\PlaceholderWindow_Temp.ps1" | |
| $executablePath = "$PSScriptRoot\PlaceholderWindow.exe" | |
| Set-Content -Path $tempScriptPath -Value $scriptContent | |
| Invoke-ps2exe -InputFile $tempScriptPath -OutputFile $executablePath -noConsole | |
| Remove-Item -Path $tempScriptPath | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment