From a07416277b73229b23386932cf914c7176791379 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Mon, 20 Mar 2023 00:17:50 -0500 Subject: [PATCH] Update display snippet to grab primary display. Previous calls did not work with some drivers. --- LANCommander/Snippets/Variables/Display.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LANCommander/Snippets/Variables/Display.ps1 b/LANCommander/Snippets/Variables/Display.ps1 index d16fcf5..5e09b9e 100644 --- a/LANCommander/Snippets/Variables/Display.ps1 +++ b/LANCommander/Snippets/Variables/Display.ps1 @@ -1,2 +1,3 @@ -# Accessible via $Display.ScreenWidth and $Display.ScreenHeight -$Display = Get-WmiObject -Class Win32_DesktopMonitor | Select-Object ScreenWidth,ScreenHeight \ No newline at end of file +# Accessible via $Display.Width and $Display.Height +Add-Type -AssemblyName System.Windows.Forms +$Display = [System.Windows.Forms.Screen]::AllScreens | Where-Object Primary | Select Bounds \ No newline at end of file