Skip to content

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Plaster v2.0.0-alpha uses the null-coalescing operator (??) introduced in PowerShell 7.0, breaking compatibility with PowerShell 5.1 as specified in the module manifest.

Changes

Write-PlasterLog.ps1

  • Replaced ?? operators with conditional expressions compatible with PS5.1+
# Before
$currentLogLevel = $script:LogLevel ?? 'Information'
$currentLevelValue = $logLevels[$currentLogLevel] ?? 2

# After
$currentLogLevel = if ($null -ne $script:LogLevel) { $script:LogLevel } else { 'Information' }
$currentLevelValue = if ($null -ne $logLevels[$currentLogLevel]) { $logLevels[$currentLogLevel] } else { 2 }

Plaster.psm1

  • Added dot-sourcing for Private and Public function files
  • Implemented selective export of public functions only

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.powershellgallery.com
    • Triggering command: /usr/bin/pwsh pwsh -NoProfile -File ./build.ps1 -Bootstrap (dns block)
    • Triggering command: /usr/bin/pwsh pwsh -NoProfile -Command Register-PSRepository -Default -ErrorAction SilentlyContinue Get-PSRepository (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Plaster v2.0.0-alpha broken on Windows</issue_title>
<issue_description>Hiya,

Sampler uses Plaster and we've noticed on our pipelines that the prerelease version breaks on windows because Write-PlasterLog uses the Null-coalescing operator.

https://github.com/PowerShellOrg/Plaster/blob/v2/Plaster/Private/Write-PlasterLog.ps1#L52-L54

Could you please fix soonish, or would you recommend we pin an old version?</issue_description>

<agent_instructions>Search for any use of null coalescing and remove it. This module must be able to run PS5.1</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix Plaster v2.0.0-alpha for Windows compatibility Replace null-coalescing operators with PS5.1-compatible syntax Feb 12, 2026
Copilot AI requested a review from HeyItsGilbert February 12, 2026 17:05
@HeyItsGilbert HeyItsGilbert changed the base branch from master to v2 February 12, 2026 17:08
@HeyItsGilbert HeyItsGilbert force-pushed the copilot/fix-null-coalescing-issue branch from 3b24123 to 4bde3a8 Compare February 12, 2026 17:12
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Test Results

  3 files  189 suites   35s ⏱️
210 tests 208 ✅ 2 💤 0 ❌
630 runs  624 ✅ 6 💤 0 ❌

Results for commit e019b41.

♻️ This comment has been updated with latest results.

@HeyItsGilbert HeyItsGilbert marked this pull request as ready for review February 12, 2026 17:20
Copilot AI and others added 3 commits February 12, 2026 09:34
@HeyItsGilbert HeyItsGilbert force-pushed the copilot/fix-null-coalescing-issue branch from 955ce7d to e019b41 Compare February 12, 2026 17:34
Copy link
Collaborator

@HeyItsGilbert HeyItsGilbert left a comment

Choose a reason for hiding this comment

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

LGTM

@HeyItsGilbert HeyItsGilbert merged commit a01a711 into v2 Feb 12, 2026
5 checks passed
@HeyItsGilbert HeyItsGilbert deleted the copilot/fix-null-coalescing-issue branch February 12, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plaster v2.0.0-alpha broken on Windows

2 participants