π Fix VBS launchers using bare pwsh.exe β recording never starts for dpuerner#92
Merged
π Fix VBS launchers using bare pwsh.exe β recording never starts for dpuerner#92
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a bug where the iKAT recording task starts successfully (exit code 0) but never produces a recording file or any log output for
dpuerner.Root cause: Both VBS launcher files called
pwsh.exeby name only. Whenwscript.exelaunches a process viaWScript.Shell.Run, it resolves executables against the system PATH for that user's session.pwsh.exeis installed atC:\Program Files\PowerShell\7\pwsh.exeand while this is in the PATH for admin sessions, it was not resolving correctly when launched via wscript indpuerner's RDS session β causing wscript to silently return 0 without ever starting PowerShell.Fix: Replace
pwsh.exewith the full absolute path"C:\Program Files\PowerShell\7\pwsh.exe"in both.vbslaunchers.Files changed:
Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbsScripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbsWhy are we doing this?
Discovered when manually testing by running
Start-ScheduledTask -TaskName "iKAT-Record-Dina"whiledpuernerwas active β task reported success but no.tsfile ordebug.logentry was produced. A diagnostic task using the full pwsh path confirmeddpuerner's session and USERNAME were correct; the only issue was wscript failing to locatepwsh.exeby name.How should this be tested?
git pullStart-ScheduledTask -TaskName "iKAT-Record-Dina"(whiledpuerneris logged on)dpuerner_*.tsfile appears inC:\Recordingsand is growingC:\Recordings\debug.logfor aScript started. USERNAME=dpuernerentryAny deployment notes?
Pull on server β no task re-registration required since the tasks call the
.vbsfiles by path, and the.vbscontent is what changed.