From 849298dfcf1d438606ff8c2221605f8d3a9ebde1 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Sun, 9 Aug 2020 23:06:43 +0100 Subject: [PATCH 1/2] Add copyright header to `.cs`, `.ps1` and `psm1` files Merge after #84 --- PowerShellStandard.psm1 | 3 +++ build.ps1 | 3 +++ doc/assets/export-TypeDoc.ps1 | 3 +++ doc/assets/export-typecompare.ps1 | 3 +++ src/3/System.Management.Automation-lib.cs | 3 +++ src/5/System.Management.Automation-lib.cs | 2 ++ .../TestSampleCmdletCommand.cs | 3 +++ test/3/core/Class1.cs | 3 +++ test/3/core/PSS3.Tests.ps1 | 3 +++ test/3/full/Class1.cs | 3 +++ test/3/full/PSS3.Tests.ps1 | 3 +++ test/5/core/Class1.cs | 3 +++ test/5/core/PSS5.Tests.ps1 | 3 +++ test/5/full/Class1.cs | 3 +++ test/5/full/PSS5.Tests.ps1 | 3 +++ test/Build.Tests.ps1 | 3 +++ test/dotnetTemplate/dotnetTemplate.Tests.ps1 | 3 +++ tools/releaseBuild/Image/buildStandard.ps1 | 3 +++ tools/releaseBuild/Image/dockerInstall.psm1 | 3 +++ tools/releaseBuild/vstsbuild.ps1 | 3 +++ 20 files changed, 59 insertions(+) mode change 100755 => 100644 src/dotnetTemplate/Microsoft.PowerShell.Standard.Module.Template/Microsoft.PowerShell.Standard.Module.Template/TestSampleCmdletCommand.cs diff --git a/PowerShellStandard.psm1 b/PowerShellStandard.psm1 index f7c17f3..c04bace 100644 --- a/PowerShellStandard.psm1 +++ b/PowerShellStandard.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + function Start-Build { param ( [switch]$CoreOnly ) # $versions = 3,5 diff --git a/build.ps1 b/build.ps1 index 7a011d9..528d783 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,4 +1,7 @@ #!/usr/bin/env pwsh +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + param ( [Parameter(HelpMessage="Remove earlier built versions")][switch]$Clean, [Parameter(HelpMessage="Run the tests")][switch]$Test, diff --git a/doc/assets/export-TypeDoc.ps1 b/doc/assets/export-TypeDoc.ps1 index 3594f71..1bf1438 100644 --- a/doc/assets/export-TypeDoc.ps1 +++ b/doc/assets/export-TypeDoc.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + $tlist = Import-CSV TypeComparison.csv @' # PowerShell Standard Library 5 diff --git a/doc/assets/export-typecompare.ps1 b/doc/assets/export-typecompare.ps1 index 74120c4..d3afda7 100644 --- a/doc/assets/export-typecompare.ps1 +++ b/doc/assets/export-typecompare.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + class CommonType { [string]$Fullname [bool]$PowerShell51 diff --git a/src/3/System.Management.Automation-lib.cs b/src/3/System.Management.Automation-lib.cs index 0e459b4..2620f60 100644 --- a/src/3/System.Management.Automation-lib.cs +++ b/src/3/System.Management.Automation-lib.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + /* First cut at removing apis that we might want to deprecate or not support diff --git a/src/5/System.Management.Automation-lib.cs b/src/5/System.Management.Automation-lib.cs index cf699a2..ae3ac88 100644 --- a/src/5/System.Management.Automation-lib.cs +++ b/src/5/System.Management.Automation-lib.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. namespace Microsoft.PowerShell { public sealed class DeserializingTypeConverter : System.Management.Automation.PSTypeConverter { diff --git a/src/dotnetTemplate/Microsoft.PowerShell.Standard.Module.Template/Microsoft.PowerShell.Standard.Module.Template/TestSampleCmdletCommand.cs b/src/dotnetTemplate/Microsoft.PowerShell.Standard.Module.Template/Microsoft.PowerShell.Standard.Module.Template/TestSampleCmdletCommand.cs old mode 100755 new mode 100644 index 1a7ac60..34c9174 --- a/src/dotnetTemplate/Microsoft.PowerShell.Standard.Module.Template/Microsoft.PowerShell.Standard.Module.Template/TestSampleCmdletCommand.cs +++ b/src/dotnetTemplate/Microsoft.PowerShell.Standard.Module.Template/Microsoft.PowerShell.Standard.Module.Template/TestSampleCmdletCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/test/3/core/Class1.cs b/test/3/core/Class1.cs index 4c128ca..db36e30 100644 --- a/test/3/core/Class1.cs +++ b/test/3/core/Class1.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + using System; using System.Management.Automation; diff --git a/test/3/core/PSS3.Tests.ps1 b/test/3/core/PSS3.Tests.ps1 index fb64add..92d4098 100644 --- a/test/3/core/PSS3.Tests.ps1 +++ b/test/3/core/PSS3.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe "PowerShell Standard 3" { BeforeAll { $cmdletAssembly = "bin/Release/netstandard2.0/Demo.Cmdlet.dll" diff --git a/test/3/full/Class1.cs b/test/3/full/Class1.cs index 4c128ca..db36e30 100644 --- a/test/3/full/Class1.cs +++ b/test/3/full/Class1.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + using System; using System.Management.Automation; diff --git a/test/3/full/PSS3.Tests.ps1 b/test/3/full/PSS3.Tests.ps1 index fa5f429..b577c7f 100644 --- a/test/3/full/PSS3.Tests.ps1 +++ b/test/3/full/PSS3.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe "PowerShell Standard 3" { BeforeAll { $cmdletAssembly = "bin/Release/net452/Demo.Cmdlet.dll" diff --git a/test/5/core/Class1.cs b/test/5/core/Class1.cs index 397e936..a5056c7 100644 --- a/test/5/core/Class1.cs +++ b/test/5/core/Class1.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/test/5/core/PSS5.Tests.ps1 b/test/5/core/PSS5.Tests.ps1 index 7798fbc..c5646d6 100644 --- a/test/5/core/PSS5.Tests.ps1 +++ b/test/5/core/PSS5.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe 'PowerShell Standard 5' { BeforeAll { diff --git a/test/5/full/Class1.cs b/test/5/full/Class1.cs index 397e936..a5056c7 100644 --- a/test/5/full/Class1.cs +++ b/test/5/full/Class1.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/test/5/full/PSS5.Tests.ps1 b/test/5/full/PSS5.Tests.ps1 index 818ec7a..82ee8cb 100644 --- a/test/5/full/PSS5.Tests.ps1 +++ b/test/5/full/PSS5.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe 'PowerShell Standard 5 - Full CLR' { BeforeAll { diff --git a/test/Build.Tests.ps1 b/test/Build.Tests.ps1 index b500ba7..5654e1e 100644 --- a/test/Build.Tests.ps1 +++ b/test/Build.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe "Ensure that the created file versions match what is in the Signing.xml file" { BeforeAll { $baseDir = Resolve-Path (Join-Path $PsScriptRoot "..") diff --git a/test/dotnetTemplate/dotnetTemplate.Tests.ps1 b/test/dotnetTemplate/dotnetTemplate.Tests.ps1 index 57f124d..b1084d5 100644 --- a/test/dotnetTemplate/dotnetTemplate.Tests.ps1 +++ b/test/dotnetTemplate/dotnetTemplate.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + Describe "PowerShell Standard C# Module Template" { Context "Targeting PowerShell Standard 5.1" { BeforeAll { diff --git a/tools/releaseBuild/Image/buildStandard.ps1 b/tools/releaseBuild/Image/buildStandard.ps1 index c247421..2419abe 100644 --- a/tools/releaseBuild/Image/buildStandard.ps1 +++ b/tools/releaseBuild/Image/buildStandard.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + param ( [string]$target ) if ( ! (test-path ${target} ) ) { new-item -type directory ${target} diff --git a/tools/releaseBuild/Image/dockerInstall.psm1 b/tools/releaseBuild/Image/dockerInstall.psm1 index 143334e..af61a91 100644 --- a/tools/releaseBuild/Image/dockerInstall.psm1 +++ b/tools/releaseBuild/Image/dockerInstall.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + function Install-ChocolateyPackage { param( diff --git a/tools/releaseBuild/vstsbuild.ps1 b/tools/releaseBuild/vstsbuild.ps1 index 3a18e58..50e17d3 100644 --- a/tools/releaseBuild/vstsbuild.ps1 +++ b/tools/releaseBuild/vstsbuild.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + [cmdletbinding()] param() From 039bae422a0846da4c2b64c00e1ee8d8338bd4e8 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Mon, 10 Aug 2020 16:25:02 +0100 Subject: [PATCH 2/2] Add copyright header template in .editorconfig --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 986aba0..f787933 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,3 +3,6 @@ root = true [*] charset = utf-8 insert_final_newline = true + +[*.{cs,ps1,psm1}] +file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.