PowerShell script returning the wrong screen resolution
<p>I just wrote a simple PowerShell script to get the screen resolution of my monitor, but it seems to be returning the wrong values.</p>
<pre><code># Returns an screen width and screen height of maximum screen resolution
function Get-ScreenSize {
    $screen = [System.Windows.Forms.Screen]::PrimaryScreen
    $width  = $screen.Bounds.Width
    $height = $screen.Bounds.Height
    return $width, $height
}

Get-ScreenSize
</code></pre>
<p>I am running this script on a 4k monitor with the resolution set at 3840 x 2160, but it is giving me the following output:</p>
<blockquote>
<p>1536</p>
<p>864</p>
</blockquote>
<p>Is there anything that would cause <code>System.Windows.Forms.Screen</code> to get the wrong &quot;Bounds&quot; values?</p>