4 ms·
Does the Linux powershell support `[System.Windows.Forms.Screen]::PrimaryScreen `? If so, I think the screen share will probably work. I'm not sure about the re
by TYMorningCoffee 5y ago
Does the Linux powershell support `[System.Windows.Forms.Screen]::PrimaryScreen
`? If so, I think the screen share will probably work. I'm not sure about the remote control.
```
$primaryDesktop = [System.Windows.Forms.Screen]::PrimaryScreen
$size = New-Object System.Drawing.Size(
($primaryDesktop.Bounds.Size.Width * $ScaleFactor),
($primaryDesktop.Bounds.Size.Height * $ScaleFactor)
)
$location = New-Object System.Drawing.Point(
($primaryDesktop.Bounds.Location.X * $ScaleFactor),
($primaryDesktop.Bounds.Location.Y * $ScaleFactor)
)
$bitmap = New-Object System.Drawing.Bitmap($size.Width, $size.Height)
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
$graphics.CopyFromScreen($location, [System.Drawing.Point]::Empty, $size)
return $bitmap
```
https://github.com/DarkCoderSc/PowerRemoteDesktop/blob/main/PowerRemoteDesktop_Server/PowerRemoteDesktop_Server.ps1 https://github.com/DarkCoderSc/PowerRemoteDesktop/blob/main/...