Skip to content

Commit

Permalink
setHDMI
Browse files Browse the repository at this point in the history
  • Loading branch information
TuncTaylan committed Jul 11, 2023
1 parent 21f38c3 commit dfdc385
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 dfdc385

Please sign in to comment.