From c8552515f458400bbbe886a6e99b2740c3033983 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Wed, 16 Apr 2025 20:58:34 +0300 Subject: [PATCH] Added Escape button to skip choosing items for Show-Menu --- src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 | 2 +- src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 | 2 +- src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 | 2 +- .../Module/Sophia.psm1 | 2 +- src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 | 2 +- src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 | 2 +- .../Module/Sophia.psm1 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index fcc39113..f40bd8a5 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -1020,7 +1020,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index fe287e35..1648de53 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -976,7 +976,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index cf5133e7..7cf68e1f 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -976,7 +976,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index 206cfda8..2bbd72b7 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -1052,7 +1052,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index dfb53067..ecf9442c 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -995,7 +995,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index 1fd5f022..71ce216c 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -976,7 +976,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 7bc4c9c1..da5b92f0 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -1027,7 +1027,7 @@ public extern static string BrandingFormatString(string sFormat); } } } - while ($Key.Key -ne [ConsoleKey]::Enter) + while ($Key.Key -notin ([ConsoleKey]::Escape, [ConsoleKey]::Enter)) } # Extract the localized "Browse" string from shell32.dll