mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add Instruction to ensure Copyright header is present at start of script and module files (#27408)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
---
|
||||
applyTo:
|
||||
- "**/*.ps1"
|
||||
- "**/*.psm1"
|
||||
---
|
||||
|
||||
# Script and Module File Format
|
||||
|
||||
These instructions define required file-level formatting for PowerShell scripts and module files in this repository.
|
||||
|
||||
## Copyright Header
|
||||
|
||||
If a change adds a new `.ps1` file or `.psm1` file or touches an existing one, the file should start with the copyright and license header and have an empty line after it, as shown in the example below:
|
||||
|
||||
```powershell
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
```
|
||||
|
||||
Do not place blank lines, comments, or code before this header.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Add the copyright header when creating a new `.ps1` or `.psm1` file.
|
||||
- Preserve the header when editing an existing `.ps1` or `.psm1` file.
|
||||
- If an existing `.ps1` or `.psm1` file is missing the header, only modify that file to add the header if a change touches that file. Do not make a change to add the header if the file is not being modified.
|
||||
Reference in New Issue
Block a user