Skip to content

Fix PowerShell 5.1 compatibility in New-HelpCabinetFile#843

Open
kborowinski wants to merge 1 commit intoPowerShell:mainfrom
kborowinski:fix-new-helpcabinetfile
Open

Fix PowerShell 5.1 compatibility in New-HelpCabinetFile#843
kborowinski wants to merge 1 commit intoPowerShell:mainfrom
kborowinski:fix-new-helpcabinetfile

Conversation

@kborowinski
Copy link
Copy Markdown

@kborowinski kborowinski commented May 7, 2026

PR Summary

Fixes #842 New-HelpCabinetFile so it can run on Windows PowerShell 5.1 by avoiding unconditional use of the $IsWindows automatic variable

$IsWindows is available in PowerShell Core, but it is not defined in Windows PowerShell 5.1. The updated check only evaluates $IsWindows when $PSEdition is Core, while preserving the existing behavior that blocks this cmdlet on non-Windows platforms.

PR Context

New-HelpCabinetFile is a Windows-only cmdlet, but the previous platform check could fail on Windows PowerShell 5.1 because $IsWindows does not exist there.

This change allows the cmdlet to continue working on Windows PowerShell 5.1 while still throwing the existing unsupported-platform error when running PowerShell Core on non-Windows systems.


This change is Reviewable

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.

New-HelpCabinetFile fails on Windows PowerShell 5.1 because $IsWindows is undefined

1 participant