The module targets PowerShell Core and uses syntax not supported by Windows PowerShell 5.1, such as the clean block. When a user attempts to import the module on Windows PowerShell, the error message is cryptic and unhelpful — a parse error about a missing closing } rather than a clear statement about edition incompatibility (as seen in #36).
Request
Desired capability
Adding #Requires -PSEdition Core to Install-NerdFont.ps1 would cause PowerShell to emit a clear, descriptive error when the function is loaded on an unsupported edition. This moves the guidance from documentation into the runtime shell itself, making the incompatibility self-documenting.
The #Requires -PSEdition directive is the idiomatic way to declare edition requirements in PowerShell.
Acceptance criteria
#Requires -PSEdition Core is present in Install-NerdFont.ps1
- Running
Import-Module NerdFonts on Windows PowerShell 5.1 produces a clear error indicating PowerShell Core is required, instead of a parse error
- No change in behavior on PowerShell 7+
Related
Technical decisions
Directive placement: Add #Requires -PSEdition Core at the top of src/functions/public/Install-NerdFont.ps1, alongside the existing #Requires -Modules directives.
Scope: Only Install-NerdFont.ps1 uses syntax (clean block) that is incompatible with Windows PowerShell 5.1. Other public functions may not need this directive, but should be evaluated.
Implementation plan
The module targets PowerShell Core and uses syntax not supported by Windows PowerShell 5.1, such as the
cleanblock. When a user attempts to import the module on Windows PowerShell, the error message is cryptic and unhelpful — a parse error about a missing closing}rather than a clear statement about edition incompatibility (as seen in #36).Request
Desired capability
Adding
#Requires -PSEdition CoretoInstall-NerdFont.ps1would cause PowerShell to emit a clear, descriptive error when the function is loaded on an unsupported edition. This moves the guidance from documentation into the runtime shell itself, making the incompatibility self-documenting.The
#Requires -PSEditiondirective is the idiomatic way to declare edition requirements in PowerShell.Acceptance criteria
#Requires -PSEdition Coreis present inInstall-NerdFont.ps1Import-Module NerdFontson Windows PowerShell 5.1 produces a clear error indicating PowerShell Core is required, instead of a parse errorRelated
Technical decisions
Directive placement: Add
#Requires -PSEdition Coreat the top ofsrc/functions/public/Install-NerdFont.ps1, alongside the existing#Requires -Modulesdirectives.Scope: Only
Install-NerdFont.ps1uses syntax (cleanblock) that is incompatible with Windows PowerShell 5.1. Other public functions may not need this directive, but should be evaluated.Implementation plan
#Requires -PSEdition Coreto the top ofsrc/functions/public/Install-NerdFont.ps1Get-NerdFont.ps1andcompleters.ps1also need the directive