From a824b721cb6a3079fa6a8c864775bc0546e61596 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sun, 9 Nov 2025 03:46:29 +0330 Subject: [PATCH] improve CI PowrShell profile test debug/verbose output --- .github/workflows/tests.yml | 4 +++- vendor/profile.ps1 | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 12633d3..9b3cce6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,8 +47,10 @@ jobs: run: | cmd /c vendor\init.bat /v /d /t - name: Testing PowerShell + env: + CMDER_DEBUG: '1' run: | - PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$DebugPreference='Continue'; . 'vendor\profile.ps1' 5>&1" + PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "'vendor\profile.ps1'" - name: Testing Bash run: | bash vendor/cmder.sh diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index bbd385b..8cc1a45 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -5,6 +5,11 @@ # !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED # !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands +if ($env:CMDER_DEBUG -and ($env:CMDER_DEBUG -match '^(1|true)$')) { + $DebugPreference = 'Continue' + $VerbosePreference = 'Continue' +} + $CMDER_INIT_START = Get-Date # Compatibility with PS major versions <= 2