Skip to content

Commit

Permalink
Merge pull request #155 from TuncTaylan/master
Browse files Browse the repository at this point in the history
A new powershell function to flip hdmi input between 1 and 4 "setHDMI"
  • Loading branch information
JPersson77 authored Jul 12, 2023
2 parents 21f38c3 + dfdc385 commit c2f70aa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Docs/Example scripts/Microsoft.PowerShell_profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
}
11 changes: 11 additions & 0 deletions Docs/Powershell functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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\<username>\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.

Expand Down Expand Up @@ -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!"
}
}
```

0 comments on commit c2f70aa

Please sign in to comment.