2023-11-14 05:09:06 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Management.Automation;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace LANCommander.PowerShell.Cmdlets
|
|
|
|
|
{
|
|
|
|
|
[Cmdlet(VerbsCommon.Get, "PrimaryDisplay")]
|
|
|
|
|
[OutputType(typeof(string))]
|
2023-11-16 21:21:50 +00:00
|
|
|
|
public class GetPrimaryDisplayCmdlet : Cmdlet
|
2023-11-14 05:09:06 +00:00
|
|
|
|
{
|
|
|
|
|
protected override void ProcessRecord()
|
|
|
|
|
{
|
|
|
|
|
var screens = Screen.AllScreens;
|
|
|
|
|
|
|
|
|
|
WriteObject(screens.First(s => s.Primary));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|