Skip to content

PowerShell 7.6.6 - #27

Merged
N6REJ merged 5 commits into
mainfrom
7.6.6
Sep 23, 2026
Merged

N6REJ merged 5 commits into
mainfrom
7.6.6

Conversation

@jwaisner

Copy link
Copy Markdown
Contributor

No description provided.

@jwaisner
jwaisner requested a review from N6REJ as a code owner September 20, 2026 00:22
@jwaisner jwaisner added the enhancement ✨ Improve program label Sep 20, 2026
Auto-generated from release 2026.9.19
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add PowerShell 7.6.6 bundle with enhanced console support

✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds Bearsampp bundle metadata and dependencies for PowerShell 7.6.6.
• Configures Nerd Fonts, UTF-8 console settings, and automatic font registration.
• Enhances sessions with Oh My Posh, Terminal-Icons, and PSReadLine.
Diagram

graph TD
  BUILD["Build metadata"] --> BUNDLE["7.6.6 bundle"] --> LAUNCH["Console launcher"] --> FONT["Font setup"] --> REG[("Windows registry")]
  LAUNCH --> PWSH["PowerShell 7.6.6"] --> PROFILE["Shell profile"] --> ENHANCE["Prompt modules"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Generate version bundles from shared templates
  • ➕ Reduces duplication across PowerShell version directories
  • ➕ Keeps launcher, profile, and font behavior synchronized
  • ➕ Makes future version additions smaller and easier to review
  • ➖ Adds template-generation complexity to the build
  • ➖ Makes historical bundles less self-contained
  • ➖ Requires migration and validation across existing versions

Recommendation: Keep the self-contained 7.6.6 bundle because it follows the repository’s established immutable version-directory convention. Consider a separate templating refactor if launcher and profile files are expected to remain identical across future releases.

Files changed (7) +472 / -1

Enhancement (3) +379 / -0
Microsoft.PowerShell_profile.ps1Configure the enhanced interactive PowerShell profile +52/-0

Configure the enhanced interactive PowerShell profile

• Adds bundled module paths and initializes Oh My Posh and Terminal-Icons. Configures PSReadLine history, prediction, colors, completion keys, and the interactive welcome banner.

bin/powershell7.6.6/config/Microsoft.PowerShell_profile.ps1

register-fonts.ps1Install and register bundled Nerd Fonts +137/-0

Install and register bundled Nerd Fonts

• Discovers font files and family names, installs changed fonts into the user font directory, and registers them with Windows. It also configures console TrueType font support and broadcasts the settings change.

bin/powershell7.6.6/config/register-fonts.ps1

powershell.batLaunch PowerShell with UTF-8 and Nerd Font support +190/-0

Launch PowerShell with UTF-8 and Nerd Font support

• Adds a configurable launcher that discovers or installs a compatible Nerd Font, applies console registry settings, and starts PowerShell with UTF-8 encoding and the custom profile. Supports custom titles, starting directories, fallback executables, and nested-shell optimization.

bin/powershell7.6.6/powershell.bat

Documentation (1) +67 / -0
README.mdDocument console font and profile customization +67/-0

Document console font and profile customization

• Documents the required Nerd Font setup for Windows Terminal and Console Host, profile behavior, environment variables, and customization options.

bin/powershell7.6.6/config/README.md

Other (3) +26 / -1
bearsampp.confDefine PowerShell 7.6.6 bundle metadata +9/-0

Define PowerShell 7.6.6 bundle metadata

• Registers the PowerShell version, executable, launcher, profile, Nerd Font, and default console dimensions for the new bundle.

bin/powershell7.6.6/bearsampp.conf

deps.propertiesDeclare shell enhancement dependencies +16/-0

Declare shell enhancement dependencies

• Defines download sources for Oh My Posh, its Paradox theme, Terminal-Icons, and PSReadLine, plus the expected Nerd Font family.

bin/powershell7.6.6/deps.properties

build.propertiesAdvance the PowerShell bundle release +1/-1

Advance the PowerShell bundle release

• Updates the bundle release date from 2026.8.26 to 2026.9.19 for the new package publication.

build.properties

@qodo-code-review

qodo-code-review Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Paths with exclamation marks break ✓ Resolved 🐞 Bug ≡ Correctness
Description
powershell.bat enables delayed expansion before capturing its own directory and user-supplied
title and starting-directory values. When the bundle or requested directory contains a legal !
character, command processing removes or expands part of the value before locating PowerShell or
constructing Set-Location.
Code

bin/powershell7.6.6/powershell.bat[9]

+setlocal EnableDelayedExpansion
Evidence
Delayed expansion is enabled at line 9, before %~dp0 and argument values are assigned, and those
values are subsequently expanded with !…! into registry and PowerShell commands. This makes an
exclamation mark part of command expansion rather than preserved path data.

bin/powershell7.6.6/powershell.bat[9-14]
bin/powershell7.6.6/powershell.bat[48-64]
bin/powershell7.6.6/powershell.bat[97-100]
bin/powershell7.6.6/powershell.bat[169-184]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Delayed expansion corrupts valid bundle paths, starting directories, and titles containing exclamation marks.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[9-14]
- bin/powershell7.6.6/powershell.bat[48-64]
- bin/powershell7.6.6/powershell.bat[97-100]

## Recommended Fix
Keep delayed expansion disabled while reading paths and arguments, and enable it only in narrowly scoped blocks that require it. Transfer values across those scopes using a quoting technique that preserves literal exclamation marks.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Release rebuilds ship changing code 🐞 Bug ⛨ Security
Description
deps.properties obtains the Oh My Posh executable from a latest URL, and the build accepts the
download after checking only that a file exists. Rebuilding the same 7.6.6 release after the
upstream asset changes packages different unverified executable code, which the profile runs at
every shell startup.
Code

bin/powershell7.6.6/deps.properties[R1-2]

+oh_my_posh = https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-windows-amd64.exe
+oh_my_posh_theme = https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/paradox.omp.json
Evidence
The dependency URL explicitly resolves the moving latest release, while the build downloads it and
verifies only the resulting filename's existence. The packaged executable is then invoked by the
PowerShell profile and its generated initialization code is evaluated in the user's session.

bin/powershell7.6.6/deps.properties[1-16]
build.gradle[653-693]
build.gradle[889-957]
bin/powershell7.6.6/config/Microsoft.PowerShell_profile.ps1[18-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The release packages mutable executable and module downloads without validating expected cryptographic hashes.

## Fix Focus Areas
- bin/powershell7.6.6/deps.properties[1-16]
- build.gradle[653-693]
- build.gradle[889-957]
- bin/powershell7.6.6/config/Microsoft.PowerShell_profile.ps1[18-24]

## Recommended Fix
Replace `latest` and unversioned package endpoints with immutable version URLs, record a trusted SHA-256 digest for every dependency, and make the build reject any mismatch before packaging. Keep dependency versions and hashes tied to the 7.6.6 bundle metadata.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Failed font installs appear successful ✓ Resolved 🐞 Bug ☼ Reliability
Description
register-fonts.ps1 catches copy, registry, and dynamic-registration failures with Write-Error
but still emits $finalName on the success stream, while the native registration return value is
discarded. The launcher captures only success output and consequently configures the console to use
that name even when the font was never installed.
Code

bin/powershell7.6.6/config/register-fonts.ps1[R101-104]

+                    $gdi32::AddFontResourceEx($destFile, 0, [IntPtr]::Zero) | Out-Null
+                } catch {
+                    Write-Error "Failed to install font $internalName"
+                }
Evidence
The installation catch writes an error but does not record failure or stop processing, and lines
109-131 subsequently output the detected name regardless. The caller assigns captured success-stream
output to FONT_NAME, so error-stream text does not prevent the unavailable name from being applied
to console registry settings.

bin/powershell7.6.6/config/register-fonts.ps1[91-105]
bin/powershell7.6.6/config/register-fonts.ps1[109-134]
bin/powershell7.6.6/powershell.bat[89-93]
bin/powershell7.6.6/powershell.bat[107-132]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Font installation failures still produce a successful font name, causing the launcher to select an unavailable font.

## Fix Focus Areas
- bin/powershell7.6.6/config/register-fonts.ps1[91-105]
- bin/powershell7.6.6/config/register-fonts.ps1[109-134]
- bin/powershell7.6.6/powershell.bat[89-93]

## Recommended Fix
Use terminating errors for copy and registry failures, verify `AddFontResourceEx` returns success, and emit the font name only after all required steps complete. Have the caller check the script process exit status before accepting its output and otherwise retain a verified fallback.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View high (1)
4. Launching changes unrelated consoles ✓ Resolved 🐞 Bug ≡ Correctness
Description
powershell.bat force-writes font, size, weight, and code-page values for MariaDB, MySQL,
PostgreSQL, Git, Python, and other unrelated console profiles. On the first launch where font setup
is not skipped, these persisted user settings are replaced even though none of those consoles
launched PowerShell.
Code

bin/powershell7.6.6/powershell.bat[R147-150]

+for %%T in ("Bearsampp PowerShell Console" "MariaDB" "MySQL" "PostgreSQL" "Git" "Python" "Composer" "PEAR" "Perl" "Ruby" "Ghostscript" "ngrok" "Node.js" "Console") do (
+    reg add "HKCU\Console\%%~T" /v FaceName /t REG_SZ /d "!FONT_NAME!" /f >nul 2>&1
+    reg add "HKCU\Console\%%~T" /v FontFamily /t REG_DWORD /d 54 /f >nul 2>&1
+    reg add "HKCU\Console\%%~T" /v FontSize /t REG_DWORD /d 0x00100000 /f >nul 2>&1
Evidence
The launcher first writes global defaults under HKCU\Console, then explicitly iterates over
unrelated application titles and force-overwrites five persistent values for each one. The entire
registry block is reached whenever the existing font-name heuristic does not set SKIP_FONT_CHECK.

bin/powershell7.6.6/powershell.bat[105-153]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Launching the new PowerShell bundle persistently overwrites settings for unrelated console applications and the user's global console defaults.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[107-153]

## Recommended Fix
Write console settings only under the registry profile for the PowerShell window title being launched. Remove the global `HKCU\Console` writes and the loop that changes MariaDB, MySQL, Git, and other unrelated profiles.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. Nested shell options are ignored 🐞 Bug ≡ Correctness
Description
powershell.bat jumps directly to skip_registry_config when BEARSAMPP_SHELL is inherited,
bypassing parse_args as well as registry configuration. Because every launched shell receives that
marker, invoking the launcher from an existing Bearsampp shell silently discards --title,
--startingDirectory, and exit and uses defaults instead.
Code

bin/powershell7.6.6/powershell.bat[R32-33]

+REM Check if we are running in a specialized console that doesn't need re-config
+if defined BEARSAMPP_SHELL goto skip_registry_config
Evidence
The jump at line 33 occurs before the parser beginning at line 49, while the launcher sets
BEARSAMPP_SHELL=1 before starting the child process. Child shells therefore inherit the marker and
take the early jump on subsequent launcher calls.

bin/powershell7.6.6/powershell.bat[26-33]
bin/powershell7.6.6/powershell.bat[48-73]
bin/powershell7.6.6/powershell.bat[163-167]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The inherited shell marker bypasses command-line parsing, so documented options stop working when the launcher is called from a Bearsampp shell.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[32-73]
- bin/powershell7.6.6/powershell.bat[166-167]

## Recommended Fix
Always run argument parsing before branching on `BEARSAMPP_SHELL`. Use the marker only to skip font and registry setup after the requested title, starting directory, and exit behavior have been captured.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Apostrophes disable font installation 🐞 Bug ≡ Correctness
Description
POWERSHELL_SCRIPT embeds the font source, registration script, and destination paths directly
inside single-quoted PowerShell literals without escaping apostrophes. Installing the bundle beneath
a directory such as C:\User's\Bearsampp produces malformed command syntax before
register-fonts.ps1 can run.
Code

bin/powershell7.6.6/powershell.bat[R87-89]

+REM Fast font discovery and registration
+REM This script outputs the FONT_NAME to be used
+set "POWERSHELL_SCRIPT=$fontName = '!FONT_NAME!'; if (-not (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -Name '*!FONT_NAME!*' -ErrorAction SilentlyContinue)) { $fallbacks = @('CaskaydiaMono NF', 'CaskaydiaCove NF', 'JetBrainsMono NF', 'MesloLGS NF', 'Cascadia Mono NF'); foreach ($f in $fallbacks) { if (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -Name '*$f*' -ErrorAction SilentlyContinue) { $fontName = $f; break } } }; if ('!FONTS_SRC!' -ne '' -and (Test-Path '!REGISTER_FONTS_PS1!')) { $captured = & '!REGISTER_FONTS_PS1!' '!FONTS_SRC!' '!FONTS_DEST!'; if ($captured -and $captured -notmatch 'WARNING:|ERROR:') { $fontName = $captured } }; $fontName"
Evidence
Line 89 places FONTS_SRC, REGISTER_FONTS_PS1, and FONTS_DEST between literal apostrophes. The
later escaping block handles only the title, starting directory, and profile path, leaving all
font-command paths unescaped.

bin/powershell7.6.6/powershell.bat[79-100]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Font registration constructs PowerShell source from unescaped filesystem paths, so apostrophes in an installation path break the command.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[79-93]

## Recommended Fix
Do not interpolate filesystem paths into a `-Command` string. Invoke `register-fonts.ps1` with `-File` and separately quoted arguments, or encode the command and pass paths through environment variables that PowerShell reads as data.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 8/18, lines 473/200; both must reach the floor). Router rationale: This adds substantial, independently risky PowerShell and batch runtime logic across multiple paths, including font installation, registry mutation, process launching, profile execution, and dependency setup.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread bin/powershell7.6.6/powershell.bat Outdated
Comment thread bin/powershell7.6.6/powershell.bat Outdated
Comment on lines +32 to +33
REM Check if we are running in a specialized console that doesn't need re-config
if defined BEARSAMPP_SHELL goto skip_registry_config

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

5. Nested shell options are ignored 🐞 Bug ≡ Correctness

powershell.bat jumps directly to skip_registry_config when BEARSAMPP_SHELL is inherited,
bypassing parse_args as well as registry configuration. Because every launched shell receives that
marker, invoking the launcher from an existing Bearsampp shell silently discards --title,
--startingDirectory, and exit and uses defaults instead.
Agent Prompt
## Issue description
The inherited shell marker bypasses command-line parsing, so documented options stop working when the launcher is called from a Bearsampp shell.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[32-73]
- bin/powershell7.6.6/powershell.bat[166-167]

## Recommended Fix
Always run argument parsing before branching on `BEARSAMPP_SHELL`. Use the marker only to skip font and registry setup after the requested title, starting directory, and exit behavior have been captured.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread bin/powershell7.6.6/config/register-fonts.ps1 Outdated
Comment thread bin/powershell7.6.6/powershell.bat Outdated
Comment on lines +87 to +89
REM Fast font discovery and registration
REM This script outputs the FONT_NAME to be used
set "POWERSHELL_SCRIPT=$fontName = '!FONT_NAME!'; if (-not (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -Name '*!FONT_NAME!*' -ErrorAction SilentlyContinue)) { $fallbacks = @('CaskaydiaMono NF', 'CaskaydiaCove NF', 'JetBrainsMono NF', 'MesloLGS NF', 'Cascadia Mono NF'); foreach ($f in $fallbacks) { if (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -Name '*$f*' -ErrorAction SilentlyContinue) { $fontName = $f; break } } }; if ('!FONTS_SRC!' -ne '' -and (Test-Path '!REGISTER_FONTS_PS1!')) { $captured = & '!REGISTER_FONTS_PS1!' '!FONTS_SRC!' '!FONTS_DEST!'; if ($captured -and $captured -notmatch 'WARNING:|ERROR:') { $fontName = $captured } }; $fontName"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

6. Apostrophes disable font installation 🐞 Bug ≡ Correctness

POWERSHELL_SCRIPT embeds the font source, registration script, and destination paths directly
inside single-quoted PowerShell literals without escaping apostrophes. Installing the bundle beneath
a directory such as C:\User's\Bearsampp produces malformed command syntax before
register-fonts.ps1 can run.
Agent Prompt
## Issue description
Font registration constructs PowerShell source from unescaped filesystem paths, so apostrophes in an installation path break the command.

## Fix Focus Areas
- bin/powershell7.6.6/powershell.bat[79-93]

## Recommended Fix
Do not interpolate filesystem paths into a `-Command` string. Invoke `register-fonts.ps1` with `-File` and separately quoted arguments, or encode the command and pass paths through environment variables that PowerShell reads as data.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +1 to +2
oh_my_posh = https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-windows-amd64.exe
oh_my_posh_theme = https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/paradox.omp.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

4. Release rebuilds ship changing code 🐞 Bug ⛨ Security

deps.properties obtains the Oh My Posh executable from a latest URL, and the build accepts the
download after checking only that a file exists. Rebuilding the same 7.6.6 release after the
upstream asset changes packages different unverified executable code, which the profile runs at
every shell startup.
Agent Prompt
## Issue description
The release packages mutable executable and module downloads without validating expected cryptographic hashes.

## Fix Focus Areas
- bin/powershell7.6.6/deps.properties[1-16]
- build.gradle[653-693]
- build.gradle[889-957]
- bin/powershell7.6.6/config/Microsoft.PowerShell_profile.ps1[18-24]

## Recommended Fix
Replace `latest` and unversioned package endpoints with immutable version URLs, record a trusted SHA-256 digest for every dependency, and make the build reject any mismatch before packaging. Keep dependency versions and hashes tied to the 7.6.6 bundle metadata.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

N6REJ and others added 3 commits September 21, 2026 08:47
… settings

Removed unnecessary registry writes to HKCU\Console and HKCU\Console\<CommonTitles> that were setting default console properties globally. The launcher now only configures registry settings for the specific window title being launched, reducing registry operations and potential conflicts with other console applications while maintaining proper font and UTF-8 support for Bearsampp PowerShell windows.
…ad of delayed expansion

This change simplifies the batch script by removing EnableDelayedExpansion and converting all delayed expansion syntax (!var!) to standard expansion (%var%). This improves compatibility and reduces complexity while maintaining all functionality including font configuration, registry settings, and UTF-8 support.
… handling

- Change font registration invocation from dot-sourcing to -File parameter for proper script execution
- Add comprehensive error handling with exit codes for font installation failures
- Improve AddFontResourceEx error detection by checking return value
- Add error handling for TrueType font registry operations
- Use -LiteralPath for safer file copy operations
- Move GDI32 type definition outside loop for better performance
- Exit with error code 1 when font installation or registration fails
@N6REJ
N6REJ merged commit f610f1d into main Sep 23, 2026
2 checks passed
@N6REJ
N6REJ deleted the 7.6.6 branch September 23, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ Improve program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants