Prerequisites
Steps to reproduce
New-HelpCabinetFile currently checks whether the platform is Windows by using the $IsWindows automatic variable:
if (! $IsWindows) {
throw "'New-HelpCabinetFile' is only supported on Windows."
}
However, $IsWindows is only available in PowerShell Core and is not defined in Windows PowerShell 5.1.
As a result, running New-HelpCabinetFile on Windows PowerShell 5.1 fails even though the cmdlet is intended to be supported on Windows.
Expected behavior
New-HelpCabinetFile should run successfully on Windows PowerShell 5.1.
Actual behavior
The cmdlet fails because $IsWindows is not defined in Windows PowerShell 5.1.
Error details
New-HelpCabinetFile -CabinetFilesFolder D:\TMP\ -MarkdownModuleFile D:\TMP\tmp.md -OutputFolder $PWD
'New-HelpCabinetFile' is only supported on Windows.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerShell.PlatyPS\1.0.1\Microsoft.PowerShell.PlatyPS.psm1:277 char:13
+ throw "'New-HelpCabinetFile' is only supported on Windows ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: ('New-HelpCabine...ted on Windows.:String) [], RuntimeException
+ FullyQualifiedErrorId : 'New-HelpCabinetFile' is only supported on Windows.
Environment data
Name Value
---- -----
PSVersion 5.1.26100.8328
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.26100.8328}
BuildVersion 10.0.26100.8328
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version
1.0.1
Visuals

Prerequisites
Steps to reproduce
New-HelpCabinetFilecurrently checks whether the platform is Windows by using the$IsWindowsautomatic variable:However,
$IsWindowsis only available in PowerShell Core and is not defined in Windows PowerShell 5.1.As a result, running
New-HelpCabinetFileon Windows PowerShell 5.1 fails even though the cmdlet is intended to be supported on Windows.Expected behavior
New-HelpCabinetFile should run successfully on Windows PowerShell 5.1.Actual behavior
The cmdlet fails because $IsWindows is not defined in Windows PowerShell 5.1.Error details
Environment data
Version
1.0.1
Visuals