This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Description
Test-ScriptFileInfo fails if the file has LF line endings to indicate a newline.
Expected Behavior
Validates a comment block for a script.
Current Behavior
Validation fails when LF for a newline is used:
Script 'script.ps1' is missing required metadata properties. Verify that the script file has Version, Guid, Description and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file.
Possible Solution
- Open an Issue on GitHub
- Complain that you can't fix it for yourself
- Hope that someone at MSFT can do it 👍
Steps to Reproduce
- Download Test-ScriptFileInfo Line Ending Test Files
- Valid:
Test-ScriptFileInfo .\Test-ScriptFileInfo_Newline-CRLF.ps1
- Fails:
Test-ScriptFileInfo .\Test-ScriptFileInfo_Newline-LF.ps1
Context
None.
Environment
> $PSVersionTable
PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1