-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMonitorControlPro.ps1
More file actions
65 lines (63 loc) · 2.52 KB
/
Copy pathMonitorControlPro.ps1
File metadata and controls
65 lines (63 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<#
.SYNOPSIS
MonitorControl Pro - Advanced Display & GPU Settings Utility
.DESCRIPTION
Comprehensive GUI for monitor DDC/CI control with VCP explorer, input switching,
color temperature presets, sync across monitors, and time-based automation.
.NOTES
Version metadata is loaded by the development launcher.
#>
[CmdletBinding()]
param(
[Parameter(Position = 0)]
[string]$Command = "",
[Parameter(Position = 1)]
[string]$Argument = "",
[string]$Monitor = "",
[string]$Vcp = "",
[string]$Value = "",
[long]$Delta = [long]::MinValue,
[string]$Cycle = "",
[switch]$IfNeeded,
[switch]$Json,
[switch]$AllowRisky,
[ValidateRange(1, 120)]
[int]$TimeoutSeconds = 10,
[switch]$CliWorker,
[switch]$StartMinimized,
[string]$LoadProfile,
[ValidateSet("System", "Dark", "HighContrast")]
[string]$Theme = "System",
[ValidateRange(0, 200)]
[int]$TextScalePercent = 0,
[string]$Culture = "",
[string]$RenderDirectory = "",
[switch]$MarketingCapture
)
$script:MonitorControlRoot = $PSScriptRoot
$script:MonitorControlEntryPath = $PSCommandPath
$metadataPath = Join-Path $script:MonitorControlRoot "src\MonitorControl.Metadata.psd1"
if (-not (Test-Path -LiteralPath $metadataPath -PathType Leaf)) {
throw "MonitorControl metadata is missing: $metadataPath"
}
$metadata = $null
Import-LocalizedData -BindingVariable metadata -BaseDirectory (Split-Path $metadataPath) -FileName (Split-Path $metadataPath -Leaf)
$script:MonitorControlMetadata = $metadata
$script:AppName = [string]$script:MonitorControlMetadata.AppName
$script:AppVersion = [string]$script:MonitorControlMetadata.Version
if ([string]::IsNullOrWhiteSpace($script:AppName) -or $script:AppVersion -notmatch '^[0-9]+\.[0-9]+\.[0-9]+$') {
throw "MonitorControl metadata is invalid: $metadataPath"
}
$sourceManifestPath = Join-Path $script:MonitorControlRoot "src\MonitorControl.sources"
if (-not (Test-Path -LiteralPath $sourceManifestPath -PathType Leaf)) {
throw "MonitorControl source manifest is missing: $sourceManifestPath"
}
$sourceFiles = @(Get-Content -LiteralPath $sourceManifestPath | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
foreach ($sourceFile in $sourceFiles) {
$sourcePath = Join-Path $script:MonitorControlRoot $sourceFile
if (-not (Test-Path -LiteralPath $sourcePath -PathType Leaf)) {
throw "MonitorControl source component is missing: $sourcePath"
}
$sourceBlock = [scriptblock]::Create([System.IO.File]::ReadAllText($sourcePath))
. $sourceBlock
}