Skip to content

chore: add copyright headers to PowerShell scripts #305

@WilliamBerryiii

Description

@WilliamBerryiii

Description

Add copyright and SPDX license headers to all PowerShell files (.ps1, .psm1, .psd1) in the repository. This task covers 33 files and provides exposure to the full PowerShell codebase structure.

Acceptance Criteria

  • Add headers to all 33 PowerShell files listed below
  • Headers placed at file start (after #Requires statements if present)
  • Scripts pass PSScriptAnalyzer validation
  • Pester tests continue passing

File List

Scripts (.ps1 - 29 files)

File Path Category
scripts/dev-tools/Generate-PrReference.ps1 Dev tools
scripts/extension/Package-Extension.ps1 Extension
scripts/extension/Prepare-Extension.ps1 Extension
scripts/lib/Get-VerifiedDownload.ps1 Library
scripts/linting/Invoke-LinkLanguageCheck.ps1 Linting
scripts/linting/Invoke-PSScriptAnalyzer.ps1 Linting
scripts/linting/Invoke-YamlLint.ps1 Linting
scripts/linting/Link-Lang-Check.ps1 Linting
scripts/linting/Markdown-Link-Check.ps1 Linting
scripts/linting/Validate-MarkdownFrontmatter.ps1 Linting
scripts/security/Test-DependencyPinning.ps1 Security
scripts/security/Test-SHAStaleness.ps1 Security
scripts/security/Update-ActionSHAPinning.ps1 Security
scripts/tests/pester.config.ps1 Test config
.github/skills/video-to-gif/scripts/convert.ps1 Skills
scripts/tests/dev-tools/Generate-PrReference.Tests.ps1 Tests
scripts/tests/extension/Package-Extension.Tests.ps1 Tests
scripts/tests/extension/Prepare-Extension.Tests.ps1 Tests
scripts/tests/lib/Get-VerifiedDownload.Tests.ps1 Tests
scripts/tests/linting/FrontmatterValidation.Tests.ps1 Tests
scripts/tests/linting/Invoke-LinkLanguageCheck.Tests.ps1 Tests
scripts/tests/linting/Invoke-PSScriptAnalyzer.Tests.ps1 Tests
scripts/tests/linting/Link-Lang-Check.Tests.ps1 Tests
scripts/tests/linting/LintingHelpers.Tests.ps1 Tests
scripts/tests/linting/Markdown-Link-Check.Tests.ps1 Tests
scripts/tests/linting/Validate-MarkdownFrontmatter.Tests.ps1 Tests
scripts/tests/security/Test-DependencyPinning.Tests.ps1 Tests
scripts/tests/security/Test-SHAStaleness.Tests.ps1 Tests
scripts/tests/security/Update-ActionSHAPinning.Tests.ps1 Tests

Modules (.psm1 - 3 files)

File Path Category
scripts/linting/Modules/FrontmatterValidation.psm1 Linting
scripts/linting/Modules/LintingHelpers.psm1 Linting
scripts/tests/Mocks/GitMocks.psm1 Tests

Data Files (.psd1 - 1 file)

File Path Category
scripts/linting/PSScriptAnalyzer.psd1 Linting

Implementation Steps

  1. For files starting with #Requires, place the header after all #Requires statements:

    #Requires -Version 7.0
    # Copyright (c) Microsoft Corporation.
    # SPDX-License-Identifier: MIT
  2. For files without #Requires, place the header at the start:

    # Copyright (c) Microsoft Corporation.
    # SPDX-License-Identifier: MIT
    
    <#
    .SYNOPSIS
    ...
    #>
  3. For .psd1 files, use comment syntax before the module manifest:

    # Copyright (c) Microsoft Corporation.
    # SPDX-License-Identifier: MIT
    
    @{
        # Module manifest content
    }
  4. Run validation:

    npm run psscriptanalyzer
    npm run test

Time Estimate

2-3 hours

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions