From 16fdc3f405d7df3d07bacfe67d722de760c7edd0 Mon Sep 17 00:00:00 2001 From: Joey Maffiola <7maffiolajoey@gmail.com> Date: Fri, 27 Mar 2026 10:34:19 -0500 Subject: [PATCH 1/4] fix: Use full pwsh.exe path in VBS launchers to ensure it resolves in user sessions --- Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs | 2 +- Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs index e904780..e872040 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs @@ -1 +1 @@ -CreateObject("WScript.Shell").Run "pwsh.exe -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-DinaRecording.ps1""", 0, False +CreateObject("WScript.Shell").Run "\"C:\Program Files\PowerShell\7\pwsh.exe\" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File \"C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-DinaRecording.ps1\"", 0, False diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs index 3509a83..a3f2588 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs @@ -1 +1 @@ -CreateObject("WScript.Shell").Run "pwsh.exe -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-JoeyRecording.ps1""", 0, False +CreateObject("WScript.Shell").Run "\"C:\Program Files\PowerShell\7\pwsh.exe\" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File \"C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-JoeyRecording.ps1\"", 0, False From 40fd8b0c8d0e69d940f7b96c14ec9efe88eaef2e Mon Sep 17 00:00:00 2001 From: Joey Maffiola <7maffiolajoey@gmail.com> Date: Fri, 27 Mar 2026 10:38:36 -0500 Subject: [PATCH 2/4] fix: Correct VBScript quote escaping to use double-double-quotes instead of backslash --- Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs | 2 +- Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs index e872040..971e179 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs @@ -1 +1 @@ -CreateObject("WScript.Shell").Run "\"C:\Program Files\PowerShell\7\pwsh.exe\" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File \"C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-DinaRecording.ps1\"", 0, False +CreateObject("WScript.Shell").Run """C:\Program Files\PowerShell\7\pwsh.exe"" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-DinaRecording.ps1""", 0, False diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs index a3f2588..2149a9c 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs @@ -1 +1 @@ -CreateObject("WScript.Shell").Run "\"C:\Program Files\PowerShell\7\pwsh.exe\" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File \"C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-JoeyRecording.ps1\"", 0, False +CreateObject("WScript.Shell").Run """C:\Program Files\PowerShell\7\pwsh.exe"" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-JoeyRecording.ps1""", 0, False From 39a201cd9134d0f118663df56154562c799e587a Mon Sep 17 00:00:00 2001 From: Joey Maffiola <7maffiolajoey@gmail.com> Date: Fri, 27 Mar 2026 10:49:58 -0500 Subject: [PATCH 3/4] fix: Replace PSScriptRoot with hardcoded path in runner scripts --- Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 | 5 +++-- Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 index f0245b7..f123d6d 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 @@ -8,8 +8,9 @@ $ErrorActionPreference = 'Stop' -# Determine the path to the main recording script located in the same directory -$RecordingScript = Join-Path -Path $PSScriptRoot -ChildPath "Invoke-iKATRecording.ps1" +# Use hardcoded path — $PSScriptRoot is $null when invoked via pwsh -Command (e.g. from Task Scheduler), +# which would cause Join-Path to produce a bare filename and Test-Path to fail silently. +$RecordingScript = "C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Invoke-iKATRecording.ps1" # Define the parameters for this specific troubleshooting scenario using splatting $CaptureParameters = @{ diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 index 01f1664..0549ef9 100644 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 +++ b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 @@ -8,8 +8,9 @@ $ErrorActionPreference = 'Stop' -# Determine the path to the main recording script located in the same directory -$RecordingScript = Join-Path -Path $PSScriptRoot -ChildPath "Invoke-iKATRecording.ps1" +# Use hardcoded path — $PSScriptRoot is $null when invoked via pwsh -Command (e.g. from Task Scheduler), +# which would cause Join-Path to produce a bare filename and Test-Path to fail silently. +$RecordingScript = "C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Invoke-iKATRecording.ps1" # Define the parameters for this specific troubleshooting scenario using splatting $CaptureParameters = @{ From 2e5af78ba73c15a3e15f71b16ba8e4ee7894a07b Mon Sep 17 00:00:00 2001 From: Joey Maffiola <7maffiolajoey@gmail.com> Date: Fri, 27 Mar 2026 10:52:10 -0500 Subject: [PATCH 4/4] chore: Remove obsolete VBS and runner PS1 launcher files --- .../Start-DinaRecording.ps1 | 29 ------------------- .../Start-DinaRecording.vbs | 1 - .../Start-JoeyRecording.ps1 | 29 ------------------- .../Start-JoeyRecording.vbs | 1 - 4 files changed, 60 deletions(-) delete mode 100644 Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 delete mode 100644 Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs delete mode 100644 Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 delete mode 100644 Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 deleted file mode 100644 index f123d6d..0000000 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -<# -.SYNOPSIS - Runner script to launch the FFmpeg recording for a specific user and process. -.DESCRIPTION - This script wrapper is designed to be executed by Task Scheduler on the RemoteApp/RDS server. - It calls Start-AppRecording.ps1 with the predefined parameters for the iKAT troubleshooting scenario. -#> - -$ErrorActionPreference = 'Stop' - -# Use hardcoded path — $PSScriptRoot is $null when invoked via pwsh -Command (e.g. from Task Scheduler), -# which would cause Join-Path to produce a bare filename and Test-Path to fail silently. -$RecordingScript = "C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Invoke-iKATRecording.ps1" - -# Define the parameters for this specific troubleshooting scenario using splatting -$CaptureParameters = @{ - TargetUser = "dpuerner" # The specific user encountering the issue - OutputDir = "C:\Recordings" # The directory where the .mkv files will be saved - MinFreeSpaceGB = 10 # Ensure at least 10GB of free space before recording - # FFmpegPath = "C:\Scripts\FFmpeg\ffmpeg.exe" # Uncomment and modify if ffmpeg is not in system PATH -} - -if (-not (Test-Path $RecordingScript)) { - Write-Error "Could not find the recording script at: $RecordingScript" - Exit -} - -# Execute the recording script with the parameters -& $RecordingScript @CaptureParameters diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs deleted file mode 100644 index 971e179..0000000 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-DinaRecording.vbs +++ /dev/null @@ -1 +0,0 @@ -CreateObject("WScript.Shell").Run """C:\Program Files\PowerShell\7\pwsh.exe"" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-DinaRecording.ps1""", 0, False diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 deleted file mode 100644 index 0549ef9..0000000 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -<# -.SYNOPSIS - Runner script to launch the FFmpeg recording for a specific user and process. -.DESCRIPTION - This script wrapper is designed to be executed by Task Scheduler on the RemoteApp/RDS server. - It calls Start-AppRecording.ps1 with the predefined parameters for the iKAT troubleshooting scenario. -#> - -$ErrorActionPreference = 'Stop' - -# Use hardcoded path — $PSScriptRoot is $null when invoked via pwsh -Command (e.g. from Task Scheduler), -# which would cause Join-Path to produce a bare filename and Test-Path to fail silently. -$RecordingScript = "C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Invoke-iKATRecording.ps1" - -# Define the parameters for this specific troubleshooting scenario using splatting -$CaptureParameters = @{ - TargetUser = "admin-jmaffiola" # The specific user encountering the issue - OutputDir = "C:\Recordings" # The directory where the .mkv files will be saved - MinFreeSpaceGB = 1 # Lower threshold for local testing - # FFmpegPath = "C:\Scripts\FFmpeg\ffmpeg.exe" # Uncomment and modify if ffmpeg is not in system PATH -} - -if (-not (Test-Path $RecordingScript)) { - Write-Error "Could not find the recording script at: $RecordingScript" - Exit -} - -# Execute the recording script with the parameters -& $RecordingScript @CaptureParameters diff --git a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs b/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs deleted file mode 100644 index 2149a9c..0000000 --- a/Scripts/iKAT/Invoke-FFmpegCapture/Start-JoeyRecording.vbs +++ /dev/null @@ -1 +0,0 @@ -CreateObject("WScript.Shell").Run """C:\Program Files\PowerShell\7\pwsh.exe"" -WindowStyle Hidden -ExecutionPolicy Bypass -NonInteractive -File ""C:\PowerShellScripts\Scripts\iKAT\Invoke-FFmpegCapture\Start-JoeyRecording.ps1""", 0, False