Powershell with KODI: Parameters never work unless they are a single character
-
I use a series of PowerShell scripts to control Kodi in windows. This particular one has param enabled and should perform a "global search" on device: Master with Voice Word: Searching (search is used by something else).
param([string]$search)
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('kodi') ## opens the active kodi window ##
Sleep 1
$wshell.SendKeys('{/}') ## sends the hot key to open global search ##
Sleep 1
$wshell.SendKeys("$search") ## sends value of the parameter ##
sleep 1
$wshell.SendKeys('{enter}') ## presses enter ##- When I run this from the triggercmd GUI it works exactly as expected.
- When I try "... with parameter X." it works and does a search for anything named "X."
- If i try any word for example "Hercules" it wont work.
if I try
"Alexa, ask TRIGGERcmd to run searching on master with parameter Hercules." (should search for anything named Hercules)Alexa says
"I cannot find a computer with the voice word master Hercules. -
can anyone help with this?