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

[Test-ScriptFileInfo] Fails on *NIX newlines (LF vs. CRLF) #18

@Velocet

Description

@Velocet

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

  1. Download Test-ScriptFileInfo Line Ending Test Files
  2. Valid: Test-ScriptFileInfo .\Test-ScriptFileInfo_Newline-CRLF.ps1
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions