1

I'm using Windows.Forms.MonthCalendar from the System.Windows.Forms assembly.

When running the script from Powershell ISE, it looks like this: enter image description here

But when running the script via a dekstop shortcut, it looks like this: (Shortcut target: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "C:\Temp\Test.ps1") enter image description here

If Powershell ISE is using a later version of Powershell, how can I use that version in my shortcut?

TIA

S.Hampton
  • 55
  • 1
  • 6
  • 1
    Possible duplicate of https://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why, although the images are no longer available in that question… – mclayton Jan 06 '22 at 09:37

1 Answers1

0

Needed to add the following before creating the form:

[System.Windows.Forms.Application]::EnableVisualStyles();
S.Hampton
  • 55
  • 1
  • 6