From dfdc3851ef880237b0ec7f38a2183001d8b478ff Mon Sep 17 00:00:00 2001 From: Taylan Date: Tue, 11 Jul 2023 23:53:10 +0300 Subject: [PATCH] setHDMI --- Docs/Example scripts/Microsoft.PowerShell_profile.ps1 | 10 ++++++++++ Docs/Powershell functions.md | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/Docs/Example scripts/Microsoft.PowerShell_profile.ps1 b/Docs/Example scripts/Microsoft.PowerShell_profile.ps1 index f929135..7a27c2d 100644 --- a/Docs/Example scripts/Microsoft.PowerShell_profile.ps1 +++ b/Docs/Example scripts/Microsoft.PowerShell_profile.ps1 @@ -33,3 +33,13 @@ function setVolume([int]$value) & 'C:\Program Files\LGTV Companion\LGTVcli.exe' -request_with_param com.webos.service.audio/master/setVolume "{\`"volume\`":$value}" | Out-Null Write-Host "Volume set to $value" } + +function setHDMI([int]$value) +{ + if ($value -In 1..4) { + & 'C:\Program Files\LGTV Companion\LGTVcli.exe' -setHdmi "$value" | Out-Null + Write-Host "HDMI is set to $value" + } else { + Write-Host "HDMI can only be set between 1-4!" + } +} diff --git a/Docs/Powershell functions.md b/Docs/Powershell functions.md index 20ed7cf..b895364 100644 --- a/Docs/Powershell functions.md +++ b/Docs/Powershell functions.md @@ -8,6 +8,7 @@ Following functions are definedin the file [Microsoft.PowerShell_profile.ps1](./ - setVolume [0-100] - volumeUp - volumeDown +- setHDMI [1-4] If you don't have this file already, just make a folder called `WindowsPowerShell` in your `C:\Users\\Documents` and copy the file [Microsoft.PowerShell_profile.ps1](./Example%20scripts/Microsoft.PowerShell_profile.ps1) into it. The functions will be then usable in the every new powershell session. @@ -49,4 +50,14 @@ function setVolume([int]$value) & 'C:\Program Files\LGTV Companion\LGTVcli.exe' -request_with_param com.webos.service.audio/master/setVolume "{\`"volume\`":$value}" | Out-Null Write-Host "Volume set to $value" } + +function setHDMI([int]$value) +{ + if ($value -In 1..4) { + & 'C:\Program Files\LGTV Companion\LGTVcli.exe' -setHdmi "$value" | Out-Null + Write-Host "HDMI is set to $value" + } else { + Write-Host "HDMI can only be set between 1-4!" + } +} ``` \ No newline at end of file