I was testing popups with PowerShell when I noticed something weird occurring.
The icon on the left of the popup looked different compared to another method of showing it. Also, the button styles were different.
These were both run on the same system (Windows 10 Pro), and the code is exactly the same (shown below). Both were run on PowerShell 5.1.
Add-Type -AssemblyName PresentationFramework
$result = [System.Windows.MessageBox]::Show("Would you like to continue?", "Continue?", "YesNo", "Information", "No")
Write-Host $result
1. Old Icon and Buttons
The old icon and buttons were created using the typical PowerShell application. I saved the file as a .ps1
file and then ran it like usual.
$ ./test.ps1
However, it gave me this popup. It's normal, but it looks more like a Windows 7 popup than Windows 10.
2. New Icon and Buttons
The new icon and buttons were created using the Windows PowerShell ISE. It was run without saving the file (just clicked the Run button to execute it).
This gave me a popup I would expect to see on Windows 10.
So, is this behaviour expected? Also, why is it happening?