diff --git a/build.psm1 b/build.psm1 index 96e88e38048..2acbd36713e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # On Unix paths is separated by colon # On Windows paths is separated by semicolon $script:TestModulePathSeparator = [System.IO.Path]::PathSeparator @@ -873,7 +876,6 @@ function Get-PSOutput { } } - function Get-PesterTag { param ( [Parameter(Position=0)][string]$testbase = "$PSScriptRoot/test/powershell" ) $alltags = @{} @@ -1362,7 +1364,6 @@ function Test-PSPesterResults } } - function Start-PSxUnit { [CmdletBinding()]param( [string] $SequentialTestResultsFile = "SequentialXUnitResults.xml", @@ -1430,7 +1431,6 @@ function Start-PSxUnit { } } - function Install-Dotnet { [CmdletBinding()] param( @@ -1914,7 +1914,6 @@ function Start-ResGen } } - function Find-Dotnet() { $originalPath = $env:PATH $dotnetPath = if ($Environment.IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } @@ -1972,7 +1971,6 @@ function Convert-TxtResourceToXml } } - function script:Use-MSBuild { # TODO: we probably should require a particular version of msbuild, if we are taking this dependency # msbuild v14 and msbuild v4 behaviors are different for XAML generation @@ -1991,7 +1989,6 @@ function script:Use-MSBuild { Set-Alias msbuild $frameworkMsBuildLocation -Scope Script } - function script:log([string]$message) { Write-Host -Foreground Green $message #reset colors for older package to at return to default after error message on a compilation error @@ -2534,7 +2531,6 @@ function Restore-PSModule } } - $script:RESX_TEMPLATE = @' diff --git a/demos/Apache/Apache/Apache.psm1 b/demos/Apache/Apache/Apache.psm1 index a572561f103..489502a6d39 100644 --- a/demos/Apache/Apache/Apache.psm1 +++ b/demos/Apache/Apache/Apache.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + #Region utility functions $global:sudocmd = "sudo" @@ -216,7 +219,6 @@ Function Restart-ApacheHTTPServer{ } - Function Get-ApacheModule{ $cmd = GetApacheCmd diff --git a/demos/Apache/apache-demo.ps1 b/demos/Apache/apache-demo.ps1 index 30ada4e97e7..1f5d60587d7 100644 --- a/demos/Apache/apache-demo.ps1 +++ b/demos/Apache/apache-demo.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Import-Module $PSScriptRoot/Apache/Apache.psm1 #list Apache Modules diff --git a/demos/Azure/Azure-Demo.ps1 b/demos/Azure/Azure-Demo.ps1 index d3688e7ea18..444ec34973d 100644 --- a/demos/Azure/Azure-Demo.ps1 +++ b/demos/Azure/Azure-Demo.ps1 @@ -1,4 +1,7 @@ -### The techniques used in this demo are documented at +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +### The techniques used in this demo are documented at ### https://azure.microsoft.com/en-us/documentation/articles/powershell-azure-resource-manager/ ### Import AzureRM.Profile.NetCore.Preview and AzureRM.Resources.NetCore.Preview modules. diff --git a/demos/DSC/dsc-demo.ps1 b/demos/DSC/dsc-demo.ps1 index 95b694c638a..f393916408b 100644 --- a/demos/DSC/dsc-demo.ps1 +++ b/demos/DSC/dsc-demo.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. #Get Distro type and set distro-specific variables $OSname = Get-Content "/etc/os-release" |Select-String -Pattern "^Name=" diff --git a/demos/Docker-PowerShell/Docker-PowerShell.ps1 b/demos/Docker-PowerShell/Docker-PowerShell.ps1 index 3517e805882..4639f7ee1d0 100644 --- a/demos/Docker-PowerShell/Docker-PowerShell.ps1 +++ b/demos/Docker-PowerShell/Docker-PowerShell.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # This is a short example of the Docker-PowerShell module. The same cmdlets may be used to manage both local & remote machines, including both Windows & Linux hosts # The only difference between them is the example container image is pulled & run. @@ -26,4 +29,4 @@ Get-Container | Where-Object State -eq "exited" | Remove-Container Remove-ContainerImage hello-world # And list the container images left on the container host -Get-ContainerImage \ No newline at end of file +Get-ContainerImage diff --git a/demos/SystemD/SystemD/SystemD.psm1 b/demos/SystemD/SystemD/SystemD.psm1 index 38ea8fd4146..b127a2e5169 100644 --- a/demos/SystemD/SystemD/SystemD.psm1 +++ b/demos/SystemD/SystemD/SystemD.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Function Get-SystemDJournal { [CmdletBinding()] param ( @@ -15,4 +18,4 @@ Function Get-SystemDJournal { { $Result } -} \ No newline at end of file +} diff --git a/demos/SystemD/journalctl-demo.ps1 b/demos/SystemD/journalctl-demo.ps1 index 7e4fc37831b..c979a97467b 100644 --- a/demos/SystemD/journalctl-demo.ps1 +++ b/demos/SystemD/journalctl-demo.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Import-Module $PSScriptRoot/SystemD/SystemD.psm1 #list recent journal events diff --git a/demos/crontab/CronTab/CronTab.psd1 b/demos/crontab/CronTab/CronTab.psd1 index 02374b1d791..df7d8149420 100755 --- a/demos/crontab/CronTab/CronTab.psd1 +++ b/demos/crontab/CronTab/CronTab.psd1 @@ -13,10 +13,10 @@ CompatiblePSEditions = @('Core') GUID = '508bb97f-de2e-482e-aae2-01caec0be8c7' # Author of this module -Author = 'Microsoft' +Author = 'PowerShell' # Company or vendor of this module -CompanyName = 'Unknown' +CompanyName = 'Microsoft Corporation' # Copyright statement for this module Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' diff --git a/demos/crontab/CronTab/CronTab.psm1 b/demos/crontab/CronTab/CronTab.psm1 index ee90c69f782..15fedb52070 100644 --- a/demos/crontab/CronTab/CronTab.psm1 +++ b/demos/crontab/CronTab/CronTab.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Collections.Generic using namespace System.Management.Automation diff --git a/demos/crontab/crontab.ps1 b/demos/crontab/crontab.ps1 index f0ef43376ae..72cc084d41e 100644 --- a/demos/crontab/crontab.ps1 +++ b/demos/crontab/crontab.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Import-Module $PSScriptRoot/CronTab/CronTab.psd1 diff --git a/demos/dsc.ps1 b/demos/dsc.ps1 index 27e09f29e46..8f93dd507c3 100644 --- a/demos/dsc.ps1 +++ b/demos/dsc.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # DSC MOF Compilation # DSC Configuration() script that: # Defines base configuration users, groups, settings @@ -8,4 +11,4 @@ # Show the .ps1 # Run the .ps1 to generate a MOF # Apply the MOF locally with Start-DSCConfiguration -# Show the newly configured state \ No newline at end of file +# Show the newly configured state diff --git a/demos/powershellget/PowerShellGet.ps1 b/demos/powershellget/PowerShellGet.ps1 index 67032152418..0dc33f85c46 100644 --- a/demos/powershellget/PowerShellGet.ps1 +++ b/demos/powershellget/PowerShellGet.ps1 @@ -1,4 +1,7 @@ -#region find, install, update, uninstall the PowerShell scripts from an online repository. +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +#region find, install, update, uninstall the PowerShell scripts from an online repository. # Value: equivalent of pypi # List of PowerShellGet commands @@ -74,4 +77,4 @@ Set-PSRepository -Name "myPrivateGallery" -InstallationPolicy "Untrusted" # Remove a private feed Unregister-PSRepository -Name "myPrivateGallery" -#endregion \ No newline at end of file +#endregion diff --git a/demos/python/class1.ps1 b/demos/python/class1.ps1 index 16b426a91db..291677fd948 100644 --- a/demos/python/class1.ps1 +++ b/demos/python/class1.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # # Wrap Python script in such a way to make it easy to # consume from PowerShell diff --git a/demos/python/demo_script.ps1 b/demos/python/demo_script.ps1 index 0544efe15e5..586e14a2085 100644 --- a/demos/python/demo_script.ps1 +++ b/demos/python/demo_script.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # # Demo simple interoperation between PowerShell and Python @@ -55,7 +58,6 @@ cat inline_python.ps1 # and run it ./inline_python - #################################### # cleanup rm hi diff --git a/demos/python/inline_python.ps1 b/demos/python/inline_python.ps1 index c9026304c91..fdad32a8601 100644 --- a/demos/python/inline_python.ps1 +++ b/demos/python/inline_python.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # # An example showing inline Python code in a PowerShell script # diff --git a/demos/rest/rest.ps1 b/demos/rest/rest.ps1 index 59bea0ce0d4..db9867e8d28 100644 --- a/demos/rest/rest.ps1 +++ b/demos/rest/rest.ps1 @@ -1,4 +1,6 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + #----------------- function Get-Issue diff --git a/docker/tests/container.tests.ps1 b/docker/tests/container.tests.ps1 index 2f4fb5e6481..48165baf535 100644 --- a/docker/tests/container.tests.ps1 +++ b/docker/tests/container.tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Import-module -Name "$PSScriptRoot\containerTestCommon.psm1" -Force $script:linuxContainerTests = Get-LinuxContainer $script:windowsContainerTests = Get-WindowsContainer diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index 68ae2f3491b..524f0c651d4 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + $script:forcePull = $true # Get docker Engine OS function Get-DockerEngineOs @@ -87,7 +90,6 @@ function Get-WindowsContainer } } - $script:repoName = 'microsoft/powershell' function Get-RepoName { @@ -251,7 +253,6 @@ function Test-PSPackage $packageLocationStubName = 'PACKAGELOCATIONSTUB' $packageLocationStubValue = $PSPackageLocation - $results = @{} $returnValue = $true diff --git a/docs/host-powershell/sample-dotnet1.1/Logic/UseRunspace.cs b/docs/host-powershell/sample-dotnet1.1/Logic/UseRunspace.cs index f9aa64abfdd..e126fd28a3a 100644 --- a/docs/host-powershell/sample-dotnet1.1/Logic/UseRunspace.cs +++ b/docs/host-powershell/sample-dotnet1.1/Logic/UseRunspace.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/docs/host-powershell/sample-dotnet1.1/MyApp/Program.cs b/docs/host-powershell/sample-dotnet1.1/MyApp/Program.cs index 9391a589827..27e082c3653 100644 --- a/docs/host-powershell/sample-dotnet1.1/MyApp/Program.cs +++ b/docs/host-powershell/sample-dotnet1.1/MyApp/Program.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using System.Reflection; diff --git a/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/Logic/UseRunspace.cs b/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/Logic/UseRunspace.cs index f9aa64abfdd..e126fd28a3a 100644 --- a/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/Logic/UseRunspace.cs +++ b/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/Logic/UseRunspace.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/MyApp/Program.cs b/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/MyApp/Program.cs index 9391a589827..27e082c3653 100644 --- a/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/MyApp/Program.cs +++ b/docs/host-powershell/sample-dotnet2.0-powershell.beta.1/MyApp/Program.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using System.Reflection; diff --git a/docs/host-powershell/sample-dotnet2.0-powershell.beta.3/MyApp/Program.cs b/docs/host-powershell/sample-dotnet2.0-powershell.beta.3/MyApp/Program.cs index 92f03751969..ec88a87b6e4 100644 --- a/docs/host-powershell/sample-dotnet2.0-powershell.beta.3/MyApp/Program.cs +++ b/docs/host-powershell/sample-dotnet2.0-powershell.beta.3/MyApp/Program.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs index 7a2005fee6c..eeb950a6394 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Reflection; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs index bbf97b2fb50..8e575e235a9 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs index 773f81ad6d2..fad68f72b47 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs index b9f9962710d..b496a963d93 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs index 2f5dd0ac2ab..b3fb43ba926 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -804,7 +802,6 @@ internal void ThrowTerminatingError(Exception exception, string operation) /// internal const string ClassNameSessionSet = "ClassNameSessionSet"; - /// /// resource Uri session set name /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs index 47a0df29796..524f1c928ad 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs index e660b8ad4a9..61a1fbcdd02 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs index ad23b933c3e..41b6434ad0f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs index 34a6319f08a..c32c1f3a7b5 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs index 79f91a1d868..33e7e1e9fc0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs index 84b0883feb1..7543e21a184 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs index 785e0f20002..d8a49bd9857 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using Microsoft.Management.Infrastructure.Options; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs index 91005d8ecf0..909f994a445 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs index e5fed39d402..c9454f8e6c8 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs index f8758d98a69..8939e6d64e0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs index d1cf303cb50..bdc22c965dc 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs index 2dd000d96d2..ea84a9d718a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs index eadc0bc8e68..c8ab7fa01b2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -11,7 +9,6 @@ using System.Globalization; using System.Management.Automation; - #endregion namespace Microsoft.Management.Infrastructure.CimCmdlets diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs index 9b2396c7d29..72ad2505645 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -416,7 +414,6 @@ internal InvocationContext CimInvocationContext } } - /// /// /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs index f0259d744b2..0c3d07d4d0e 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs index 23b34f60a0d..67f3250c282 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs index 1a87b451af3..48310add1a2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs index f5d84647cdd..ab87b0676ab 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System.Management.Automation; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 87f5466f121..9f05857fe6d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -12,7 +10,6 @@ #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index 58a8538e077..21425d7b63a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs index a59208be6a8..f9a3b21db4a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -13,7 +11,6 @@ #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs index 57e610ddcc6..628ea348115 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -10,7 +8,6 @@ using System.Management.Automation; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index f67ee6cb5ba..0b619f87a7a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -11,7 +9,6 @@ using System.Management.Automation; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index c843acdb045..14f9c5f13c7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -11,7 +9,6 @@ using System.Management.Automation; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs index 8e601f60e92..a9cfe00ee49 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -11,7 +9,6 @@ #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index c03352af012..9bdc9c6c608 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -12,7 +10,6 @@ using Microsoft.Management.Infrastructure.Options; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs index 39ce6cfcd62..ec3005062b8 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; @@ -11,7 +9,6 @@ using Microsoft.PowerShell.Commands; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index 6544f9d4427..eb815411193 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -12,7 +10,6 @@ #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// @@ -64,7 +61,6 @@ public CimSession[] CimSession } private CimSession[] cimSession; - /// /// /// The following is the definition of the input parameter "ResourceUri". diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs index 97194b95247..fbefb223027 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index 3ff061400c5..e1a85f30b21 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives using System; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs index 66828f9b611..95d9efdc270 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs @@ -1,7 +1,5 @@ -/*============================================================================ - * Copyright (c) Microsoft Corporation. All rights reserved. - *============================================================================ - */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // #define LOGENABLE // uncomment this line to enable the log, // create c:\temp\cim.log before invoking cimcmdlets diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs index 8ee3e95903d..13b3eece1c2 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections; using System.Diagnostics; @@ -87,11 +90,9 @@ uint dwFlags [DllImport(LibraryLoadDllName)] private static extern bool FreeLibrary(IntPtr hModule); - [DllImport(LocalizationDllName, EntryPoint = "GetUserDefaultLangID", CallingConvention = CallingConvention.Winapi, SetLastError = true)] private static extern ushort GetUserDefaultLangID(); - public static uint FormatMessageFromModule(uint lastError, string moduleName, out String msg) { Debug.Assert(!string.IsNullOrEmpty(moduleName)); diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs index 88b3a6f134f..5ea3041de9e 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if CORECLR using System.ComponentModel; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs index 858f5f0b6ff..f41e26a3a88 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs @@ -1,6 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs index 4ba65b3c8ea..7732b20360c 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs @@ -1,7 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// - +// Licensed under the MIT License. using System; using System.Reflection; @@ -13,7 +11,6 @@ using System.Globalization; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.PowerShell.Commands.GetCounter { public class PerformanceCounterSample @@ -56,7 +53,6 @@ public string Path } private string _path = ""; - public string InstanceName { get { return _instanceName; } @@ -64,7 +60,6 @@ public string InstanceName } private string _instanceName = ""; - public double CookedValue { get { return _cookedValue; } @@ -107,7 +102,6 @@ public DateTime Timestamp } private DateTime _timeStamp = DateTime.MinValue; - public UInt64 Timestamp100NSec { get { return _timeStamp100nSec; } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs index fb7edd1ac92..d981700a11c 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs @@ -1,6 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// +// Licensed under the MIT License. using System; using System.Collections; @@ -64,7 +63,6 @@ public PerformanceCounterCategoryType CounterSetType } private PerformanceCounterCategoryType _counterSetType; - public string Description { get diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs index 9a7e138b521..2769277e590 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs @@ -1,7 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// - +// Licensed under the MIT License. using System; using System.Text; @@ -27,7 +25,6 @@ using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -54,7 +51,6 @@ public string Path private string _path; private string _resolvedPath; - // // Format parameter. // Valid strings are "blg", "csv", "tsv" (case-insensitive). @@ -73,8 +69,6 @@ public string FileFormat } private string _format = "blg"; - - // // MaxSize parameter // Maximum output file size, in megabytes. @@ -88,7 +82,6 @@ public UInt32 MaxSize } private UInt32 _maxSize = 0; - // // InputObject parameter // @@ -109,7 +102,6 @@ public PerformanceCounterSampleSet[] InputObject } private PerformanceCounterSampleSet[] _counterSampleSets = new PerformanceCounterSampleSet[0]; - // // Force switch // @@ -134,8 +126,6 @@ public SwitchParameter Circular } private SwitchParameter _circular; - - private ResourceManager _resourceMgr = null; private PdhHelper _pdhHelper = null; @@ -213,7 +203,6 @@ protected override void EndProcessing() _pdhHelper.Dispose(); } - /// /// Handle Control-C /// @@ -279,7 +268,6 @@ protected override void ProcessRecord() _queryInitialized = true; } - foreach (PerformanceCounterSampleSet set in _counterSampleSets) { _pdhHelper.ResetRelogValues(); diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index 29da31a48bd..50d099b25f8 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -1,7 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// - +// Licensed under the MIT License. using System; using System.Text; @@ -27,7 +25,6 @@ using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -59,7 +56,6 @@ public string[] ListSet } private string[] _listSet = { "*" }; - // // Counter parameter // @@ -93,7 +89,6 @@ public string[] Counter private List _accumulatedCounters = new List(); - // // SampleInterval parameter. // Defaults to 1 second. @@ -111,7 +106,6 @@ public int SampleInterval } private int _sampleInterval = 1; - // // MaxSamples parameter // @@ -134,7 +128,6 @@ public Int64 MaxSamples private Int64 _maxSamples = 1; private bool _maxSamplesSpecified = false; - // // Continuous switch // @@ -146,7 +139,6 @@ public SwitchParameter Continuous } private bool _continuous = false; - // // ComputerName parameter // @@ -228,7 +220,6 @@ protected override void BeginProcessing() return; } - if (Continuous.IsPresent && _maxSamplesSpecified) { Exception exc = new Exception(string.Format(CultureInfo.CurrentCulture, _resourceMgr.GetString("CounterContinuousOrMaxSamples"))); @@ -249,7 +240,6 @@ protected override void EndProcessing() _pdhHelper.Dispose(); } - // // Handle Control-C // @@ -449,7 +439,6 @@ private void ProcessGetCounter() _cultureAndSpecialCharacterMap.TryGetValue(culture.Name, out characterReplacementList); } - StringCollection allExpandedPaths = new StringCollection(); foreach (string path in paths) { @@ -597,7 +586,6 @@ private void ReportPdhError(uint res, bool bTerminate) } } - // // CombineMachinesAndCounterPaths() helper. // For paths that do not contain machine names, creates a path for each machine in machineNames. diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs index f23a6da9ad0..78b64e74b6d 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs @@ -1,6 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// +// Licensed under the MIT License. using System; using System.Xml; @@ -73,7 +72,6 @@ public string[] LogName } private string[] _logName = { "*" }; - /// /// ListProvider parameter /// @@ -99,7 +97,6 @@ public string[] ListProvider } private string[] _listProvider = { "*" }; - /// /// ProviderName parameter /// @@ -123,7 +120,6 @@ public string[] ProviderName } private string[] _providerName; - /// /// Path parameter /// @@ -147,7 +143,6 @@ public string[] Path } private string[] _path; - /// /// MaxEvents parameter /// @@ -244,7 +239,6 @@ public PSCredential Credential } private PSCredential _credential = PSCredential.Empty; - /// /// FilterXPath parameter /// @@ -294,7 +288,6 @@ public XmlDocument FilterXml } private XmlDocument _xmlQuery = null; - /// /// FilterHashtable parameter /// @@ -349,7 +342,6 @@ public SwitchParameter Oldest } private bool _oldest = false; - // // Query builder constant strings // @@ -404,7 +396,6 @@ public SwitchParameter Oldest private const string hashkey_data_lc = "data"; private const string hashkey_supress_lc = "suppresshashfilter"; - /// /// BeginProcessing() is invoked once per pipeline: we will load System.Core.dll here /// @@ -413,7 +404,6 @@ protected override void BeginProcessing() _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); } - /// /// EndProcessing() is invoked once per pipeline /// @@ -438,7 +428,6 @@ protected override void EndProcessing() } } - /// /// ProcessRecord() override. /// This is the main entry point for the cmdlet. @@ -481,7 +470,6 @@ protected override void ProcessRecord() } } - // // AccumulatePipelineCounters() accumulates log names in the pipeline scenario: // we do not want to construct a query until all the log names are supplied. @@ -540,7 +528,6 @@ private void ProcessGetLog() } } - // // Process GetProviderSet parameter set // @@ -558,7 +545,6 @@ private void ProcessGetProvider() return; } - EventLogQuery logQuery = null; if (_providersByLogMap.Count > 1) { @@ -584,7 +570,6 @@ private void ProcessGetProvider() } } - // // Process ListLog parameter set // @@ -746,7 +731,6 @@ private void ProcessFilterXml() } } - // // Process FileSet parameter set // @@ -857,7 +841,6 @@ private EventLogSession CreateSession() return eventLogSession; } - // // ReadEvents helper. // @@ -901,7 +884,6 @@ private void ReadEvents(EventLogQuery logQuery) } outputObj.Properties.Add(new PSNoteProperty("Message", evtMessage)); - // // Enumerate the object one level to get to event payload // @@ -918,8 +900,6 @@ private void ReadEvents(EventLogQuery logQuery) } } - - // // BuildStructuredQuery() builds a structured query from cmdlet arguments. // @@ -1311,7 +1291,6 @@ private string BuildStructuredQueryFromHashTable(EventLogSession eventLogSession } } //end foreach hashtable - result.Append(queryListClose); return result.ToString(); @@ -1444,7 +1423,6 @@ private string HandleContextHashValue(Object value) return string.Format(CultureInfo.InvariantCulture, SystemSecurityTemplate, sidCandidate.ToString()); } - // // HandleStartTimeHashValue helper for hashtable structured query builder. // Constructs and returns TimeCreated XPath portion as a string. @@ -1488,7 +1466,6 @@ private string HandleStartTimeHashValue(Object value, Hashtable hash) return ret.ToString(); } - // // HandleEndTimeHashValue helper for hashtable structured query builder. // Constructs and returns TimeCreated XPath portion as a string. @@ -1563,7 +1540,6 @@ private string HandleDataHashValue(Object value) return ret.ToString(); } - // // HandleNamedDataHashValue helper for hashtable structured query builder. // Constructs and returns named event data field XPath portion as a string. @@ -1598,7 +1574,6 @@ private string HandleNamedDataHashValue(String key, Object value) return ret.ToString(); } - // // Helper checking whether at least one of log, _path, provider is specified. // It will ThrowTerminatingError in case none of those keys are present. @@ -1673,7 +1648,6 @@ private bool ValidateLogName(string logName, EventLogSession eventLogSession) return true; } - // // KeywordStringToInt64 helper converts a string to Int64. // Returns true and keyLong ref if successful. @@ -1876,7 +1850,6 @@ private string AddProviderPredicatesToFilter(StringCollection providers) return ret; } - // // BuildProvidersPredicate() builds a predicate expression like: // "System/Provider[@Name='a' or @Name='b']" @@ -1903,7 +1876,6 @@ private string BuildProvidersPredicate(StringCollection providers) return predicate.ToString(); } - // // BuildAllProvidersPredicate() builds a predicate expression like: // "System/Provider[@Name='a' or @Name='b']" @@ -1948,7 +1920,6 @@ private string BuildAllProvidersPredicate() return predicate.ToString(); } - // // AddLogsForProviderToInternalMap helper. // Retrieves log names to which _providerName writes. @@ -2130,4 +2101,3 @@ private void FindProvidersByLogForWildcardPatterns(EventLogSession eventLogSessi } } - diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs index 6aa23f2eca7..a4483c7497f 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs @@ -1,7 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// - +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs index d8635b38b5d..b9275784fc4 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs @@ -1,7 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// - +// Licensed under the MIT License. using System; using System.Text; @@ -27,7 +25,6 @@ using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -62,7 +59,6 @@ public string[] Path private List _accumulatedFileNames = new List(); - // // ListSet parameter // @@ -84,7 +80,6 @@ public string[] ListSet } private string[] _listSet = new string[0]; - // // StartTime parameter // @@ -100,7 +95,6 @@ public DateTime StartTime } private DateTime _startTime = DateTime.MinValue; - // // EndTime parameter // @@ -116,7 +110,6 @@ public DateTime EndTime } private DateTime _endTime = DateTime.MaxValue; - // // Counter parameter // @@ -165,14 +158,12 @@ public Int64 MaxSamples } private Int64 _maxSamples = KEEP_ON_SAMPLING; - private ResourceManager _resourceMgr = null; private PdhHelper _pdhHelper = null; private bool _stopping = false; - // // AccumulatePipelineFileNames() accumulates counter file paths in the pipeline scenario: // we do not want to construct a Pdh query until all the file names are supplied. @@ -182,7 +173,6 @@ private void AccumulatePipelineFileNames() _accumulatedFileNames.AddRange(_path); } - // // BeginProcessing() is invoked once per pipeline // @@ -241,7 +231,6 @@ protected override void EndProcessing() _pdhHelper.Dispose(); } - // // Handle Control-C // @@ -251,7 +240,6 @@ protected override void StopProcessing() _pdhHelper.Dispose(); } - // // ProcessRecord() override. // This is the main entry point for the cmdlet. @@ -331,7 +319,6 @@ private void ProcessListSet() continue; } - StringCollection counterSetCounters = new StringCollection(); StringCollection counterSetInstances = new StringCollection(); @@ -508,7 +495,6 @@ private void ProcessGetCounter() } } - // // ValidateFilePaths() helper. // Validates the _resolvedPaths: present for all parametersets. @@ -563,7 +549,6 @@ private void ValidateFilePaths() } } - // // ResolveFilePath helper. // Returns a string collection of resolved file paths. @@ -674,4 +659,3 @@ private void WriteSampleSetObject(PerformanceCounterSampleSet set, bool firstSet } } - diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index ec064f0d8be..e242d3455ab 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -1,6 +1,5 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -30,7 +29,6 @@ public sealed class NewWinEventCommand : PSCmdlet private const string DataTag = "data"; private ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); - /// /// ProviderName /// @@ -73,7 +71,6 @@ public int Id private int _id; private bool _idSpecified = false; - /// /// Version (event version) /// @@ -95,7 +92,6 @@ public byte Version private byte _version; private bool _versionSpecified = false; - /// /// Event Payload /// @@ -353,4 +349,4 @@ internal EventWriteException(string msg) : base(msg) { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs index ce1eea08e91..d42d6a2f60b 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics; @@ -105,8 +104,6 @@ internal static class PdhResults public const long PDH_QUERY_PERF_DATA_TIMEOUT = 0xC0000BFEL; } - - internal static class PerfDetail { public const uint PERF_DETAIL_NOVICE = 100; // The uninformed can understand it @@ -203,7 +200,6 @@ public PdhHelper(bool isPreVista) _isPreVista = isPreVista; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct PDH_COUNTER_PATH_ELEMENTS { @@ -274,7 +270,6 @@ private struct PDH_TIME_INFO public UInt32 SampleCount; } - /* // // This is the structure returned by PdhGetCounterInfo(). @@ -304,7 +299,6 @@ struct PDH_COUNTER_INFO { [FieldOffset(104)]public IntPtr DataBuffer; }*/ - [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhBindInputDataSource(out PdhSafeDataSourceHandle phDataSource, string szLogFileNameList); @@ -347,7 +341,6 @@ out PdhSafeLogHandle phLog [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern void PdhResetRelogCounterValues(PdhSafeLogHandle LogHandle); - //Win7+ only [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhSetCounterValue(IntPtr CounterHandle, @@ -396,7 +389,6 @@ private static extern uint PdhParseCounterPath(string szFullPathBuffer, ref IntPtr pdwBufferSize, uint dwFlags); - [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhExpandWildCardPathH(PdhSafeDataSourceHandle hDataSource, string szWildCardPath, @@ -427,11 +419,9 @@ private static extern uint PdhExpandWildCardPathH(PdhSafeDataSourceHandle hDataS [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhSetQueryTimeRange(PdhSafeQueryHandle hQuery, ref PDH_TIME_INFO pInfo); - [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhLookupPerfNameByIndex(string szMachineName, UInt32 dwNameIndex, IntPtr szNameBuffer, ref int pcchNameBufferSize); - private PdhSafeDataSourceHandle _hDataSource = null; private PdhSafeQueryHandle _hQuery = null; @@ -468,7 +458,6 @@ public void Dispose() // private Dictionary _consumerPathToHandleAndInstanceMap = new Dictionary(); - // // m_ReloggerPathToHandleAndInstanceMap map is used for writing relog counters. // @@ -504,8 +493,6 @@ private void ReadPdhMultiString(ref IntPtr strNative, Int32 strSize, ref StringC strColl.AddRange(allSubstringsWithNulls.Split('\0')); } - - private uint GetCounterInfoPlus(IntPtr hCounter, out UInt32 counterType, out UInt32 defaultScale, out UInt64 timeBase) { uint res = 0; @@ -586,7 +573,6 @@ public uint ConnectToDataSource(string dataSourceName) return res; } - public uint ConnectToDataSource(StringCollection blgFileNames) { if (blgFileNames.Count == 1) @@ -635,7 +621,6 @@ public uint OpenLogForWriting(string logName, PdhLogFileType logFileType, bool b return res; } - public uint SetQueryTimeRange(DateTime startTime, DateTime endTime) { Debug.Assert(_hQuery != null); @@ -799,7 +784,6 @@ public uint GetValidPathsFromFiles(ref StringCollection validPaths) { Debug.Assert(_hDataSource != null && !_hDataSource.IsInvalid, "Call ConnectToDataSource before GetValidPathsFromFiles"); - StringCollection machineNames = new StringCollection(); uint res = this.EnumBlgFilesMachines(ref machineNames); if (res != 0) @@ -894,7 +878,6 @@ public bool IsPathValid(string path) } } - private uint MakePath(PDH_COUNTER_PATH_ELEMENTS pathElts, out string outPath, bool bWildcardInstances) { outPath = ""; @@ -947,7 +930,6 @@ private uint MakeAllInstancePath(string origPath, out string unifiedPath) return MakePath(elts, out unifiedPath, true); } - private uint ParsePath(string fullPath, ref PDH_COUNTER_PATH_ELEMENTS pCounterPathElements) { IntPtr bufSize = new IntPtr(0); @@ -1022,7 +1004,6 @@ public uint TranslateLocalCounterPath(string englishPath, out string localizedPa RegistryKey rootKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009"); string[] regCounters = (string[])rootKey.GetValue("Counter"); - // NOTE: 1-based enumeration because the name strings follow index strings in the array Int32 counterIndex = -1; Int32 objIndex = -1; @@ -1062,7 +1043,6 @@ public uint TranslateLocalCounterPath(string englishPath, out string localizedPa return (uint)PdhResults.PDH_INVALID_PATH; } - // Now, call retrieve the localized names of the object and the counter by index: string objNameLocalized; res = LookupPerfNameByIndex(pathElts.MachineName, (uint)objIndex, out objNameLocalized); @@ -1072,7 +1052,6 @@ public uint TranslateLocalCounterPath(string englishPath, out string localizedPa } pathElts.ObjectName = objNameLocalized; - string ctrNameLocalized; res = LookupPerfNameByIndex(pathElts.MachineName, (uint)counterIndex, out ctrNameLocalized); if (res != 0) @@ -1085,11 +1064,9 @@ public uint TranslateLocalCounterPath(string englishPath, out string localizedPa res = MakePath(pathElts, out localizedPath, false); - return res; } - public uint LookupPerfNameByIndex(string machineName, uint index, out string locName) { // @@ -1124,8 +1101,6 @@ public uint LookupPerfNameByIndex(string machineName, uint index, out string loc return res; } - - public uint GetValidPaths(string machineName, string objectName, ref StringCollection counters, @@ -1168,7 +1143,6 @@ public uint GetValidPaths(string machineName, return res; } - public uint AddCounters(ref StringCollection validPaths, bool bFlushOldCounters) { Debug.Assert(_hQuery != null && !_hQuery.IsInvalid); @@ -1210,7 +1184,6 @@ public uint AddCounters(ref StringCollection validPaths, bool bFlushOldCounters) return bAtLeastOneAdded ? 0 : res; } - // // AddRelogCounters combines instances and adds counters to m_hQuery. // The counter handles and full paths @@ -1325,8 +1298,6 @@ public uint AddRelogCounters(PerformanceCounterSampleSet sampleSet) return (_reloggerPathToHandleAndInstanceMap.Keys.Count > 0) ? 0 : res; } - - // // AddRelogCountersPreservingPaths preserves all paths and adds as relog counters to m_hQuery. // The counter handles and full paths are added to m_ReloggerPathToHandleAndInstanceMap @@ -1534,7 +1505,6 @@ public uint ReadNextSetPreVista(out PerformanceCounterSampleSet nextSet, bool bS return res; } - public uint ReadNextSet(out PerformanceCounterSampleSet nextSet, bool bSkipReading) { Debug.Assert(_hQuery != null && !_hQuery.IsInvalid); @@ -1658,7 +1628,6 @@ public uint ReadNextSet(out PerformanceCounterSampleSet nextSet, bool bSkipReadi fmtValueDouble.CStatus); } - nextSet = new PerformanceCounterSampleSet(batchStamp, samplesArr, _firstReading); _firstReading = false; @@ -1677,7 +1646,6 @@ public uint ReadNextSet(out PerformanceCounterSampleSet nextSet, bool bSkipReadi return res; } - public uint GetFilesSummary(out CounterFileInfo summary) { IntPtr pNumEntries = new IntPtr(0); @@ -1770,7 +1738,6 @@ public uint SetCounterValue(PerformanceCounterSample sample, out bool bUnknownPa rawStruct.TimeStamp.dwLowDateTime = (int)(new DateTime(sample.Timestamp.Ticks, DateTimeKind.Utc).ToFileTimeUtc() & 0xFFFFFFFFL); rawStruct.CStatus = sample.Status; - return PdhSetCounterValue(_reloggerPathToHandleAndInstanceMap[lcPath].hCounter, ref rawStruct, /*PPDH_RAW_COUNTER */ _reloggerPathToHandleAndInstanceMap[lcPath].InstanceName); diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs index b2adb011268..c77e9f10f5e 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Runtime.InteropServices; @@ -21,7 +20,6 @@ public override bool IsInvalid } } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { @@ -29,9 +27,6 @@ protected override bool ReleaseHandle() } } - - - internal sealed class PdhSafeQueryHandle : SafeHandle { private PdhSafeQueryHandle() : base(IntPtr.Zero, true) { } @@ -44,7 +39,6 @@ public override bool IsInvalid } } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { @@ -64,7 +58,6 @@ public override bool IsInvalid } } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs index 793bb0e6ba8..b878633b759 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs index 0854414a440..af44bb8fee8 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs index 93bb4f7932b..1ed6dadfa91 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Microsoft.Management.Infrastructure; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs index 58b981c0ce5..70911217468 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Microsoft.Management.Infrastructure; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs index 2ed6c186d06..c28363eae55 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs index 366f31a76ae..1b7fbf99da9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs index 86adf0750e6..088b56b796a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Microsoft.Management.Infrastructure; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs index db81ea37936..f93c54cd7c4 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs index 49a227dadcc..a1cb7ad62ad 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs index c51085292a2..c1f0206420a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Microsoft.Management.Infrastructure; using Microsoft.PowerShell.Cim; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs index 734f87e7e1b..bdddd60ac56 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs index 662d890b69c..edeb98b7848 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Microsoft.Management.Infrastructure; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs index f19fadc6678..a2a400eb7b2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Microsoft.Management.Infrastructure; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs index 67035a15e2d..dc4a9c8d48c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs index cf2a78ca39e..98007451289 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Concurrent; @@ -398,7 +397,6 @@ internal CimOperationOptions CreateOperationOptions() operationOptions.SetOption("__MI_OPERATIONOPTIONS_IMPROVEDPERF_STREAMING", 1); - operationOptions.Flags |= this.JobContext.CmdletInvocationContext.CmdletDefinitionContext.SchemaConformanceLevel; if (this.JobContext.CmdletInvocationContext.CmdletDefinitionContext.ResourceUri != null) @@ -524,7 +522,6 @@ private CimCustomOptionsDictionary GetJobSpecificCustomOptions() return _jobSpecificCustomOptions.Value; } - #endregion #region Controlling job state diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs index 50b4d486975..9d5606fd5bb 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs index 75866b49e36..96fd9c1e376 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs index 9c6679697c1..c51de701a70 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -666,4 +665,4 @@ internal static void AssertIntrinsicCimType(Type type) "Caller should verify that type is an intrinsic CIM type"); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs index 2cee2f22a88..89f0cad9064 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs index 528dac6cdab..bbd6bad2fc8 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs index 4878cf51bf7..3add2eb53fd 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs index 8a7bfa882a5..81fc991dd4e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs index 683384b5a8d..f07114a5379 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs index f9784f9f5e0..04b2c6df353 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -52,7 +51,6 @@ internal override void SeekContentPosition(List contentHolders) holder.PathInfo.Path, e); - // Log a provider health event MshLog.LogProviderHealthEvent( diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs index ad56f989ae7..28f4e97f43e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs index f0e57fc3e44..acda6e95aed 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -77,7 +76,6 @@ protected override bool ProviderSupportsShouldProcess } } - /// /// A virtual method for retrieving the dynamic parameters for a cmdlet. Derived cmdlets /// that require dynamic parameters should override this method and return the diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs index b752936ac11..60ded819c9c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation; @@ -173,6 +172,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // ClearItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs index 183c3712fbc..9e2ec6eb743 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Management.Automation; using System.Runtime.InteropServices; using System.IO; @@ -251,4 +254,4 @@ internal enum RecycleFlags : uint [DllImport("Shell32.dll", CharSet = CharSet.Unicode)] internal static extern uint SHEmptyRecycleBin(IntPtr hwnd, string pszRootPath, RecycleFlags dwFlags); } -} \ No newline at end of file +} diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs index a1fd4a9ee47..be7cda5a31a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -217,7 +216,6 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // JoinPathCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs index a23aa040ed9..8d583a7fecc 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs index 744849d3d99..208c75d0614 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Collections; using System.Collections.Generic; @@ -1046,7 +1046,6 @@ protected override void ProcessRecord() } }// end while(true) - if (_timeUp) { // The timeout expires. Write out timeout error messages for the computers that haven't finished restarting @@ -1139,7 +1138,6 @@ public sealed class StopComputerCommand : PSCmdlet, IDisposable [Alias("CN", "__SERVER", "Server", "IPAddress")] public String[] ComputerName { get; set; } = new string[] { "." }; - /// /// The following is the definition of the input parameter "Credential". /// Specifies a user account that has permission to perform this action. Type a @@ -1481,7 +1479,7 @@ private void DoRenameComputerWsman(string computer, string computerName, string Microsoft.Management.Infrastructure.CimType.String, (dPassword == null) ? CimFlags.NullValue : CimFlags.None)); - if ( ! InternalTestHooks.TestRenameComputer ) + if ( ! InternalTestHooks.TestRenameComputer ) { CimMethodResult result = cimSession.InvokeMethod( ComputerWMIHelper.CimOperatingSystemNamespace, @@ -1771,7 +1769,6 @@ internal static class ComputerWMIHelper /// internal const string localhostStr = "localhost"; - /// /// Get the local admin user name from a local NetworkCredential /// @@ -1967,7 +1964,6 @@ internal static RenameComputerChangeInfo GetRenameComputerStatusObject(int error return renamecomputerchangeinfo; } - internal static void WriteNonTerminatingError(int errorcode, PSCmdlet cmdlet, string computername) { Win32Exception ex = new Win32Exception(errorcode); @@ -2107,7 +2103,7 @@ internal static bool InvokeWin32ShutdownUsingWsman( Microsoft.Management.Infrastructure.CimType.SInt32, CimFlags.None)); - if ( ! InternalTestHooks.TestStopComputer ) + if ( ! InternalTestHooks.TestStopComputer ) { CimMethodResult result = cimSession.InvokeMethod( ComputerWMIHelper.CimOperatingSystemNamespace, diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs index 87a32563161..f82be5f916f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -348,7 +347,6 @@ public PSObject AttachNotes(PSObject content) } // AttachNotes } // ContentPathsCache - /// /// A struct to hold the path information and the content readers/writers /// for an item. @@ -410,7 +408,6 @@ internal void CloseContent(List contentHolders, bool disposing) holder.PathInfo.Path, e); - // Log a provider health event MshLog.LogProviderHealthEvent( @@ -448,7 +445,6 @@ internal void CloseContent(List contentHolders, bool disposing) holder.PathInfo.Path, e); - // Log a provider health event MshLog.LogProviderHealthEvent( diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs index 5950e80b0f4..8c8dcbe2e26 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs index ef093e91071..06ea2fc7924 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation; @@ -126,7 +125,6 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // ConvertPathCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs index a5392a7cafe..15b3327b3c4 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -152,6 +151,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // CopyItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs index 86194f41fe5..eececdd3d33 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -132,7 +131,6 @@ public long[] InstanceId } private long[] _instanceIds = null; - /// /// match eventlog entries by the Index /// gets or sets an array of indexes @@ -152,7 +150,6 @@ public int[] Index } private int[] _indexes = null; - /// /// match eventlog entries by the EntryType /// gets or sets an array of EntryTypes @@ -224,7 +221,6 @@ public string Message [Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; } - /// /// Return the log names rather than the EventLog objects /// @@ -442,8 +438,6 @@ private void Process(EventLog log) } } - - private bool FiltersMatch(EventLogEntry entry) { if (_indexes != null) @@ -614,7 +608,6 @@ public sealed class ClearEventLogCommand : PSCmdlet [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LogName { get; set; } - /// /// Clear eventlog entries from these Computers. /// @@ -706,7 +699,6 @@ public sealed class WriteEventLogCommand : PSCmdlet [ValidateNotNullOrEmpty] public string LogName { get; set; } - /// /// The source by which the application is registered on the specified computer. /// @@ -748,7 +740,6 @@ public sealed class WriteEventLogCommand : PSCmdlet [ValidateLength(0, 32766)] public string Message { get; set; } - /// /// Write eventlog entries of this log /// @@ -1318,7 +1309,6 @@ public class RemoveEventLogCommand : PSCmdlet [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public String[] Source { get; set; } - /// /// BeginProcessing method. /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs index 695648a1829..f71f0ee751f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -278,7 +277,6 @@ internal override object GetDynamicParameters(CmdletProviderContext context) #endregion command data - #region command code /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs index 176ee347211..f88f79aefb5 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Management.Automation; using System.Collections.Generic; using System.Windows.Forms; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs index a4a0e4ff122..f94c1190742 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX @@ -571,7 +570,6 @@ private static MiscInfoGroup GetOtherInfo(CimSession session) //TODO: Local machine only. Check for that? rv.physicallyInstalledMemory = GetPhysicallyInstalledSystemMemory(); - // get time zone // we'll use .Net's TimeZoneInfo for now. systeminfo uses Caption from Win32_TimeZone var tzi = TimeZoneInfo.Local; @@ -5119,7 +5117,6 @@ private static class PInvokeDllNames public const UInt32 S_OK = 0; - /// /// Import WINAPI function PowerDeterminePlatformRoleEx /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs index dee0e3835f5..5248ac19e59 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs index 7cf2b94cd7d..8c746508e97 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs index f7182e46d75..05216d7e1bc 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs index e6b85ded55e..3488b10e0ea 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -21,7 +20,6 @@ public class GetWmiObjectCommand : WmiBaseCmdlet { #region Parameters - /// /// The WMI class to query /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs index 8f10d92d370..e96fa603d01 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -26,7 +25,6 @@ using System.Security.AccessControl; using Dbg = System.Management.Automation; - namespace Microsoft.PowerShell.Commands { #region Get-HotFix @@ -79,7 +77,6 @@ public sealed class GetHotFixCommand : PSCmdlet, IDisposable #region Overrides - private ManagementObjectSearcher _searchProcess; private bool _inputContainsWildcard = false; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs index fa275c3303a..8a911bfb69b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs index d51f40b7cae..ffdf1b95ca9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -168,6 +167,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // MoveItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 7378d2bf508..a4f7e8750e2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -206,7 +205,6 @@ protected override void StopProcessing() /// public virtual string Filter { get; set; } - /// /// Gets or sets the include property /// @@ -225,7 +223,6 @@ protected override void StopProcessing() // Include - /// /// Gets or sets the exclude property /// @@ -244,7 +241,6 @@ protected override void StopProcessing() // Exclude - /// /// Gets or sets the force property /// @@ -276,7 +272,6 @@ public virtual SwitchParameter Force } // Force private bool _force; - /// /// Retrieves the dynamic parameters for the command from /// the provider. @@ -419,7 +414,6 @@ public class GetLocationCommand : DriveMatchingCoreCommandBase #region Location parameter set parameters - /// /// Gets or sets the provider from which to get the current location. /// @@ -486,7 +480,6 @@ public string[] StackName #region command data - #region Location parameter set data /// @@ -505,10 +498,8 @@ public string[] StackName #endregion Stack parameter set data - #endregion command data - #region command code /// @@ -717,7 +708,6 @@ protected override void ProcessRecord() } // class GetLocationCommand #endregion GetLocationCommand - #region SetLocationCommand /// @@ -962,7 +952,6 @@ public string LiteralPath } // set } // LiteralPath - /// /// Gets or sets the parameter -passThru which states output from /// the command should be placed in the pipeline. @@ -1156,10 +1145,8 @@ public string StackName #endregion Command data - #region Command code - /// /// Gets the top container from the location stack and sets the /// location to it. @@ -1586,7 +1573,6 @@ internal List GetMatchingDrives( } } - WildcardPattern providerMatcher = null; PSSnapinQualifiedName pssnapinQualifiedProviderName = null; @@ -1606,7 +1592,6 @@ internal List GetMatchingDrives( WildcardOptions.IgnoreCase); } - WildcardPattern nameMatcher = null; if (!driveNameEmpty) @@ -3387,7 +3372,6 @@ private void MoveItem(string path) continue; } - // See if the item to be moved is in use. bool isCurrentLocationOrAncestor = false; try @@ -3561,7 +3545,6 @@ public override SwitchParameter Force set { base.Force = value; } } - /// /// Gets or sets the pass through property which determines /// if the object that is set should be written to the pipeline. diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs index 9d36ec244ed..fbf3312c149 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -182,6 +181,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // NewItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs index 1b096166a7b..a87643e36b7 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -48,7 +47,6 @@ public class SplitPathCommand : CoreCommandWithCredentialsBase /// private const string extensionSet = "ExtensionSet"; - /// /// The parameter set name to get the qualifier set. /// @@ -187,7 +185,6 @@ public string[] LiteralPath #region parameter data - #endregion parameter data #region Command code diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs index cb70655f8bc..7f4e3e65c06 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs index 5028632301b..734433ffc90 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs index 66bbe573a17..37f39e54e24 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -207,7 +206,6 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // PingPathCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 30ef0e096ac..251e0cfd619 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -719,7 +718,6 @@ private static PSObject AddUserNameToProcess(Process process) return processAsPsobj; } - /// /// Retrieve the UserName through PInvoke /// @@ -901,7 +899,6 @@ public int Timeout private int _timeout = 0; private bool _timeOutSpecified; - #endregion Parameters private bool _disposed = false; @@ -948,7 +945,6 @@ private void myProcess_Exited(object sender, System.EventArgs e) private ManualResetEvent _waitHandle; private int _numberOfProcessesToWaitFor; - /// /// gets the list of process /// @@ -1135,7 +1131,6 @@ public SwitchParameter PassThru set { _passThru = value; } } - //Addition by v-ramch Mar 18 2008 //Added force parameter /// @@ -1270,7 +1265,6 @@ protected override void ProcessRecord() } } // ProcessRecord - /// /// Kill the current process here. /// @@ -1616,7 +1610,6 @@ public sealed class StartProcessCommand : PSCmdlet, IDisposable [Alias("PSPath")] public string FilePath { get; set; } - /// /// Arguments for the process /// @@ -1626,7 +1619,6 @@ public sealed class StartProcessCommand : PSCmdlet, IDisposable [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] ArgumentList { get; set; } - /// /// Credentials for the process /// @@ -1652,7 +1644,6 @@ public PSCredential Credential [ValidateNotNullOrEmpty] public string WorkingDirectory { get; set; } - /// /// load user profile from registry /// @@ -1691,7 +1682,6 @@ public SwitchParameter NoNewWindow [Parameter] public SwitchParameter PassThru { get; set; } - /// /// Redirect error /// @@ -1709,7 +1699,6 @@ public string RedirectStandardError } private string _redirectstandarderror; - /// /// Redirect input /// @@ -1727,7 +1716,6 @@ public string RedirectStandardInput } private string _redirectstandardinput; - /// /// Redirect output /// @@ -1865,7 +1853,6 @@ protected override void BeginProcessing() startInfo.Arguments = sb.ToString(); ; } - //WorkingDirectory if (WorkingDirectory != null) { @@ -2263,7 +2250,6 @@ private SafeFileHandle GetSafeFileHandleForRedirection(string RedirectionPath, u System.IntPtr hFileHandle = System.IntPtr.Zero; ProcessNativeMethods.SECURITY_ATTRIBUTES lpSecurityAttributes = new ProcessNativeMethods.SECURITY_ATTRIBUTES(); - hFileHandle = ProcessNativeMethods.CreateFileW(RedirectionPath, ProcessNativeMethods.GENERIC_READ | ProcessNativeMethods.GENERIC_WRITE, ProcessNativeMethods.FILE_SHARE_WRITE | ProcessNativeMethods.FILE_SHARE_READ, @@ -2655,11 +2641,9 @@ internal static class ProcessNativeMethods internal static UInt32 OF_READWRITE = 0x00000002; internal static UInt32 OPEN_EXISTING = 3; - // Methods // static NativeMethods(); - [DllImport(PinvokeDllNames.GetStdHandleDllName, CharSet = CharSet.Ansi, SetLastError = true)] public static extern IntPtr GetStdHandle(int whichHandle); @@ -2702,7 +2686,6 @@ public static extern FileNakedHandle CreateFileW( System.IntPtr hTemplateFile ); - [Flags] internal enum LogonFlags { @@ -2745,7 +2728,6 @@ protected override bool ReleaseHandle() } } - [StructLayout(LayoutKind.Sequential)] internal class STARTUPINFO { diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs index f64d33e18f7..9f65a40b9d6 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs index 091e1903a45..0e288454b0d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -45,7 +44,6 @@ public class RegisterWmiEventCommand : ObjectEventRegistrationBase [ValidateNotNullOrEmpty] public string ComputerName { get; set; } = "localhost"; - /// /// The WMI class to use /// @@ -97,7 +95,6 @@ private string GetScopeString(string computer, string namespaceParameter) } #endregion helper functions - /// /// Returns the object that generates events to be monitored /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs index b6c1b4b3e7d..76df0806b8d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -180,6 +179,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // RemoveItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs index 711cd7ea074..31c78f79e82 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs index 5e3000ceb57..8f2fc873ce1 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; @@ -149,6 +148,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // RenameItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs index d1222aa6596..140c4c3e1a0 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -76,7 +75,6 @@ public SwitchParameter Relative } // Relative private SwitchParameter _relative; - #endregion Parameters #region parameter data @@ -158,7 +156,6 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // ResolvePathCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs index 4f48e18b8e0..1c586b100c9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Dbg = System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 0e4229762a7..f2281439839 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if !UNIX // Not built on Unix using System; @@ -551,7 +551,6 @@ public string[] Name [Alias("DS")] public SwitchParameter DependentServices { get; set; } - /// /// This returns the ServicesDependedOn of the specified service. /// @@ -1472,8 +1471,6 @@ public class SetServiceCommand : ServiceOperationBaseCommand [Credential()] public PSCredential Credential { get; set; } - - /// /// The following is the definition of the input parameter "Description". /// Specifies a new description for the service. @@ -1493,7 +1490,6 @@ public string Description } internal string description = null; - /// /// The following is the definition of the input parameter "StartupType". /// Changes the starting mode of the service. Valid values for StartupType are: @@ -1516,7 +1512,6 @@ public ServiceStartupType StartupType // distinguish when this is and is not set. internal ServiceStartupType startupType = ServiceStartupType.InvalidValue; - /// /// The following is the definition of the input parameter "Status". /// This specifies what state the service should be in (e.g. Running, Stopped, diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs index a59d4a69670..525c4a975c8 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Management.Automation; using System.Collections.Generic; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs index bd2584a3f7a..5eeaec0a1d8 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using System.Management.Automation.Internal; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs index f64bfaf3217..74a1d384150 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -227,6 +226,5 @@ protected override void ProcessRecord() } // ProcessRecord #endregion Command code - } // SetItemPropertyCommand } // namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs index acdbea27d00..94744c03cfe 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs index 4d91c4d5461..a2eb9469891 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs index 75b41682981..42c54f74caa 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -665,7 +668,6 @@ public struct TIME_ZONE_INFORMATION [return: MarshalAs(UnmanagedType.Bool)] public static extern bool PrivilegeCheck(IntPtr ClientToken, ref PRIVILEGE_SET RequiredPrivileges, ref bool pfResult); - /// /// PInvoke AdjustTokenPrivilege API /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs index a36f997a144..43b722d08f7 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs index 8cf7df9d61d..91abff494e7 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -1018,7 +1017,6 @@ internal static string GetScopeString(string computer, string namespaceParameter } #endregion Helper Classes - /// /// A class to set WMI connection options /// @@ -1708,8 +1706,6 @@ private void HandleJobUnblocked(object sender, EventArgs eventArgs) } } - - private ThrottleManager _throttleManager = new ThrottleManager(); private object _syncObject = new object(); // sync object @@ -1783,7 +1779,6 @@ internal PSWmiChildJob(Cmdlet cmds, string computerName, ThrottleManager throttl private bool _bJobFailed; private bool _bAtLeastOneObject; - private ArrayList _wmiSinkArray; /// /// Event raised by this job to indicate to its parent that @@ -1884,7 +1879,6 @@ private void JobDoneForWin32Shutdown(object sender, EventArgs arg) /// public override string StatusMessage { get; } = "test"; - /// /// Indicates if there is more data available in /// this Job diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs index 7ddb52ec825..84d966e9094 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs @@ -1,6 +1,5 @@ -/********************************************************************-- -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -27,7 +26,6 @@ using Microsoft.Win32; using System.Text.RegularExpressions; - namespace Microsoft.PowerShell.Commands { #region New-WebServiceProxy @@ -105,7 +103,6 @@ public PSCredential Credential } private PSCredential _credential; - /// /// use default credential.. /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs index ec5d50ab3bf..eb2731450ca 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs b/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs index 742ccf2f2a0..06661bb6b2a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.ComponentModel; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs index 9c19d68183b..87395206242 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -132,7 +131,6 @@ public SwitchParameter PassThru get { return _passThru; } } - #region Simplifying NoteProperty Declaration private const string NotePropertySingleMemberSet = "NotePropertySingleMemberSet"; @@ -180,7 +178,6 @@ public IDictionary NotePropertyMembers #endregion Simplifying NoteProperty Declaration - private static object GetParameterType(object sourceValue, Type destinationType) { return LanguagePrimitives.ConvertTo(sourceValue, destinationType, CultureInfo.InvariantCulture); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 4bba1753e39..9234ba97083 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; @@ -23,7 +22,6 @@ using PathType = System.IO.Path; - namespace Microsoft.PowerShell.Commands { /// @@ -476,7 +474,6 @@ public OutputAssemblyType OutputType internal OutputAssemblyType outputType = OutputAssemblyType.Library; internal bool outputTypeSpecified = false; - /// /// Flag to pass the resulting types along. /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs index 5ee144d0309..ba8bb6be34a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CSVCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -54,7 +53,6 @@ public char Delimiter [Parameter(ParameterSetName = "UseCulture")] public SwitchParameter UseCulture { get; set; } - /// /// Abstract Property - Input Object which is written in Csv format /// Derived as Different Attributes.In ConvertTo-CSV, This is a positional parameter. Export-CSV not a Positional behaviour. @@ -82,8 +80,6 @@ public abstract PSObject InputObject #endregion Command Line Parameters - - /// /// Write the string to a file or pipeline /// @@ -171,8 +167,6 @@ public string LiteralPath } private bool _isLiteralPath = false; - - /// /// Property that sets force parameter. /// @@ -266,7 +260,6 @@ protected override void BeginProcessing() _helper = new ExportCsvHelper(this, base.Delimiter); } - /// /// Convert the current input object to Csv and write to file/WriteObject /// @@ -516,7 +509,6 @@ public sealed [ValidateNotNull] public char Delimiter { get; set; } - /// /// mandatory file name to read from /// @@ -576,7 +568,6 @@ public SwitchParameter UseCulture } private bool _useculture; - /// /// Header property to customize the names /// @@ -703,8 +694,6 @@ protected override _helper = new ExportCsvHelper(this, base.Delimiter); } - - /// /// Convert the current input object to Csv and write to stream/WriteObject /// @@ -897,7 +886,6 @@ internal class ExportCsvHelper : IDisposable //Name of properties to be written in CSV format - /// /// Get the name of properties from source PSObject and /// add them to _propertyNames. @@ -1363,7 +1351,6 @@ private Collection //Read the next character char ch = ReadChar(); - if ((ch == _delimiter)) { if (seenBeginQuote) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs index ffbc04e3cb9..6fe3c3f5c0d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs @@ -1,8 +1,5 @@ -/********************************************************************++ - -Copyright (c) Microsoft Corporation. All rights reserved. - ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -63,8 +60,6 @@ public ConsoleColorCmdlet() } } - - /// /// /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs index 3d9a63b6329..9ad5a1c0c95 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs index 48d42ea9b07..bce8acb1269 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs index c2ea7725843..09aacba0d2a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { @@ -279,7 +278,6 @@ internal void WriteOneObject(object source, string property, int depth) return; } - if (HandlePrimitiveKnownTypePSObject(source, property, depth)) { return; @@ -428,7 +426,6 @@ private bool HandleKnownContainerTypes(object source, string property, int depth return true; } - /// /// Checks if source is known container type and returns appropriate /// information diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs index 109880780cd..9c22f590aa0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { @@ -11,7 +10,6 @@ internal static class CustomSerializationStrings { #region element tags - /// /// Element tag for root node /// @@ -27,7 +25,6 @@ internal static class CustomSerializationStrings /// internal const string Properties = "Property"; - #region attribute tags /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs index 0c3ef0080c7..003fcef583b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs index 770eae7490c..9f7f3a3efbd 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs index 37736ca2f33..d4ba85d090b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs index acfd146caa6..81acbef07a3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs index c83b2272c2c..bebc287c449 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -254,7 +253,6 @@ protected override void ProcessRecord() } } // ProcessRecord - /// /// Writes the aliases to the file /// @@ -327,7 +325,6 @@ private static string GetAliasLine(AliasInfo alias, string formatString) return result; } - private void WriteHeader(StreamWriter writer) { WriteFormattedResourceString(writer, AliasCommandStrings.ExportAliasHeaderTitle); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ColumnInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ColumnInfo.cs index ad398a7e766..1c18571c9b2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ColumnInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ColumnInfo.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ExpressionColumnInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ExpressionColumnInfo.cs index d0a4221fd81..e56e2b4d2e1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ExpressionColumnInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ExpressionColumnInfo.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/HeaderInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/HeaderInfo.cs index 0def6c0b648..a6b86061673 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/HeaderInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/HeaderInfo.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OriginalColumnInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OriginalColumnInfo.cs index 7329ed8117e..395eaee2040 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OriginalColumnInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OriginalColumnInfo.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs index e3f013dd78a..1461f226017 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutGridViewCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutWindowProxy.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutWindowProxy.cs index f6e929c5a4d..adcf5f0c127 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutWindowProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/OutWindowProxy.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { @@ -22,7 +21,6 @@ internal class OutWindowProxy : IDisposable private const string IndexPropertyName = "IndexValue"; private int _index; - /// Columns definition of the underlying Management List private HeaderInfo _headerInfo; @@ -261,8 +259,6 @@ public void Dispose() GC.SuppressFinalize(this); } - - /// /// Close the window if it has already been displayed. /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ScalarTypeColumnInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ScalarTypeColumnInfo.cs index 62195903f2d..e8204464c95 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ScalarTypeColumnInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/ScalarTypeColumnInfo.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/TableView.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/TableView.cs index 062d5571903..f828d1324de 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/TableView.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/OutGridView/TableView.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/GetFormatDataCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/GetFormatDataCommand.cs index e8c9142b91d..7f047e376a6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/GetFormatDataCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/GetFormatDataCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq; @@ -76,7 +75,6 @@ protected override void BeginProcessing() } } - private static Dictionary> GetTypeGroupMap(IEnumerable groupDefinitions) { var typeGroupMap = new Dictionary>(); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs index 609253074fd..c78b54090e4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/common/WriteFormatDataCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs index bc90a9536ba..89ab8c1ca21 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-hex/Format-Hex.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Text; @@ -82,9 +85,9 @@ protected override void ProcessRecord() } else { - List pathsToProcess = String.Equals(this.ParameterSetName, "LiteralPath", StringComparison.OrdinalIgnoreCase) ? + List pathsToProcess = String.Equals(this.ParameterSetName, "LiteralPath", StringComparison.OrdinalIgnoreCase) ? ResolvePaths(LiteralPath, true) : ResolvePaths(Path, false); - + ProcessPath(pathsToProcess); } } @@ -241,18 +244,18 @@ private void ProcessObjectContent(PSObject inputObject) List pathsToProcess = ResolvePaths(path, true); ProcessPath(pathsToProcess); } - + else if (obj is string) { string inputString = obj.ToString(); inputBytes = Encoding.GetBytes(inputString); } - + else if (obj is byte) { inputBytes = new byte[] { (byte)obj }; } - + else if (obj is byte[]) { inputBytes = ((byte[])obj); @@ -279,7 +282,7 @@ private void ProcessObjectContent(PSObject inputObject) { inputBytes = BitConverter.GetBytes((Int64)obj); } - + else if (obj is Int64[]) { List inputStreamArray = new List(); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-list/Format-List.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-list/Format-List.cs index 3cd9ed9d607..6db95821034 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-list/Format-List.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-list/Format-List.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Microsoft.PowerShell.Commands.Internal.Format; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-object/format-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-object/format-object.cs index 266a5d65b68..a4efe117997 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-object/format-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-object/format-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Microsoft.PowerShell.Commands.Internal.Format; @@ -22,7 +21,6 @@ public FormatCustomCommand() this.implementation = new InnerFormatShapeCommand(FormatShape.Complex); } - #region Command Line Switches /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-table/Format-Table.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-table/Format-Table.cs index 06dce665064..fcf92d00f6d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-table/Format-Table.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-table/Format-Table.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; @@ -24,4 +23,3 @@ public FormatTableCommand() } } - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-wide/Format-Wide.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-wide/Format-Wide.cs index 6a68001373b..9075782e26b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-wide/Format-Wide.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/format-wide/Format-Wide.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -25,7 +24,6 @@ public FormatWideCommand() this.implementation = new InnerFormatShapeCommand(FormatShape.Wide); } - #region Command Line Switches /// @@ -60,7 +58,6 @@ public SwitchParameter AutoSize } private Nullable _autosize = null; - /// /// optional, non positional parameter /// @@ -110,7 +107,6 @@ internal override FormattingCommandLineParameters GetCommandLineParameters() // the user specified -autosize:true AND a column number string msg = StringUtil.Format(FormatAndOut_format_xxx.CannotSpecifyAutosizeAndColumnsError); - ErrorRecord errorRecord = new ErrorRecord( new InvalidDataException(), "FormatCannotSpecifyAutosizeAndColumns", diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs index 3b01c1b57fb..01b8ff081fa 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-file/Out-File.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -176,7 +175,6 @@ protected override void BeginProcessing() base.BeginProcessing(); } - /// /// one time initialization: acquire a screen host interface /// by creating one on top of a file diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/PrinterLineOutput.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/PrinterLineOutput.cs index 910e8906dcd..7b79ddaaafc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/PrinterLineOutput.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/PrinterLineOutput.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -264,7 +263,6 @@ private void pd_PrintPage(object sender, PrintPageEventArgs ev) ev.HasMorePages = _lines.Count > 0; } - /// /// flag for one time initialization of the interface (columns, etc.) /// @@ -290,7 +288,6 @@ private void pd_PrintPage(object sender, PrintPageEventArgs ev) /// private int _printFontSize = 0; - /// /// default font, used if the printFont is not specified or if the /// printFont is not fixed pitch. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/out-printer.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/out-printer.cs index b1c0944133f..d70f044340d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/out-printer.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-printer/out-printer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Microsoft.PowerShell.Commands.Internal.Format; @@ -61,6 +60,3 @@ private LineOutput InstantiateLineOutputInterface() } } - - - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs index 55f3db8f07d..fb63659b4c8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/FormatAndOutput/out-string/out-string.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs index 3701640e241..cd449e2e481 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -264,7 +263,6 @@ protected override void ProcessRecord() } } - /// /// Gives the criteria to filter breakpoints /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs index 54a12b175bc..3b07991f428 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs index a9e35503eec..568bbdfbb21 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -110,8 +109,6 @@ private void WriteMatches(string value, string parametersetname) aliasTable = SessionState.Internal.GetAliasTable(); } - - bool matchfound = false; bool ContainsWildcard = WildcardPattern.ContainsWildcardCharacters(value); WildcardPattern wcPattern = WildcardPattern.Get(value, WildcardOptions.IgnoreCase); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs index a370026e515..1667ca7c6ba 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; @@ -23,4 +22,3 @@ protected override void BeginProcessing() } // GetCultureCommand } // Microsoft.PowerShell.Commands - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs index 9f9da1ed28a..9668376a900 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -42,7 +41,6 @@ public DateTime Date private DateTime _date; private bool _dateSpecified; - /// /// Allows the user to override the year /// @@ -63,7 +61,6 @@ public int Year private int _year; private bool _yearSpecified; - /// /// Allows the user to override the month /// @@ -84,7 +81,6 @@ public int Month private int _month; private bool _monthSpecified; - /// /// Allows the user to override the day /// @@ -105,7 +101,6 @@ public int Day private int _day; private bool _daySpecified; - /// /// Allows the user to override the hour /// @@ -126,7 +121,6 @@ public int Hour private int _hour; private bool _hourSpecified; - /// /// Allows the user to override the minute /// @@ -147,7 +141,6 @@ public int Minute private int _minute; private bool _minuteSpecified; - /// /// Allows the user to override the second /// @@ -194,7 +187,6 @@ public int Millisecond [Parameter] public DisplayHintType DisplayHint { get; set; } = DisplayHintType.DateTime; - /// /// Unix format string /// @@ -202,7 +194,6 @@ public int Millisecond [ValidateNotNullOrEmpty] public string UFormat { get; set; } - /// /// Unix format string /// @@ -323,7 +314,6 @@ protected override void ProcessRecord() } } // EndProcessing - /// /// This is more an implementation of the UNIX strftime /// @@ -539,4 +529,3 @@ public enum DisplayHintType #endregion } // namespace Microsoft.PowerShell.Commands - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs index cac484db50e..7de6d9879eb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -58,7 +57,6 @@ public int EventIdentifier } private int _eventId = -1; - #endregion parameters private WildcardPattern _matchPattern; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs index 3e00f79679d..7ef87569f3d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -47,7 +46,6 @@ public string SourceIdentifier [Alias("Id")] public int SubscriptionId { get; set; } = -1; - /// /// Also show supporting events /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs index 336c4829d42..732619dc522 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs index c4906048279..90d36efe409 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs index bee70b23fa6..6806d930bec 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -68,7 +67,6 @@ public class GetMemberCommand : PSCmdlet [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } - /// /// The member names to be retrieved /// @@ -76,7 +74,6 @@ public class GetMemberCommand : PSCmdlet [ValidateNotNullOrEmpty] public string[] Name { set; get; } = new string[] { "*" }; - /// /// The member types to be retrieved /// @@ -84,7 +81,6 @@ public class GetMemberCommand : PSCmdlet [Alias("Type")] public PSMemberTypes MemberType { set; get; } = PSMemberTypes.All; - /// /// View from which the members are retrieved. /// @@ -190,7 +186,6 @@ protected override void ProcessRecord() // PSMemberSet instance is created to represent PSExtended, PSAdapted, PSBase, PSObject hidden // properties. We should honor extended properties for such case. - // request is to search dotnet or adapted or both members. // dotnet,adapted members cannot be Script*,Note*,Code* memberTypeToSearch ^= (PSMemberTypes.AliasProperty | PSMemberTypes.CodeMethod | PSMemberTypes.CodeProperty @@ -265,7 +260,6 @@ public int Compare(MemberDefinition first, MemberDefinition second) } } - /// /// This method implements the End method for get-member command /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index 35bba80c9df..87e81a45373 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs index 65fc5cb7be9..009c1c2a43f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs index 6f8693e4b35..9a958d1e1bc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; @@ -23,4 +22,3 @@ protected override void BeginProcessing() } // GetUICultureCommand } // Microsoft.PowerShell.Commands - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs index 4b9e68af770..d3cedd9a83e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -24,7 +23,6 @@ public sealed class GetUniqueCommand : PSCmdlet [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } = AutomationNull.Value; - /// /// This parameter specifies that objects should be converted to /// strings and the strings should be compared. @@ -38,7 +36,6 @@ public SwitchParameter AsString } private bool _asString; - /// /// This parameter specifies that just the types of the objects /// should be compared. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs index 609df1d6558..1d8b178cfc7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs index 384c1030085..878f753dfa3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Management.Automation; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index e2217f688e7..f9394ffcebf 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -2054,7 +2053,6 @@ private void GenerateTopComment(TextWriter writer) throw '{3}' }} - $script:WriteHost = $executionContext.InvokeCommand.GetCommand('Write-Host', [System.Management.Automation.CommandTypes]::Cmdlet) $script:WriteWarning = $executionContext.InvokeCommand.GetCommand('Write-Warning', [System.Management.Automation.CommandTypes]::Cmdlet) $script:WriteInformation = $executionContext.InvokeCommand.GetCommand('Write-Information', [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs index ea6fb4dc21e..5e31191303e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs index 332742d08d7..4a98475ab5e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs index d0418892bdb..ee253baf228 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Diagnostics.CodeAnalysis; using System.Management.Automation; @@ -17,7 +20,7 @@ public class ImportPowerShellDataFileCommand : PSCmdlet /// /// Path specified, using globbing to resolve /// - [Parameter(Mandatory = true, Position = 0, ParameterSetName = "ByPath")] + [Parameter(Mandatory = true, Position = 0, ParameterSetName = "ByPath")] [ValidateNotNullOrEmpty] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] Path { get; set; } @@ -84,7 +87,7 @@ private void WritePathNotFoundError(string path) } void WriteInvalidDataFileError(string resolvedPath, string errorId) - { + { var errorCategory = ErrorCategory.InvalidData; var errorMessage = string.Format(UtilityResources.CouldNotParseAsPowerShellDataFile, resolvedPath); var exception = new InvalidOperationException(errorMessage); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeCommandCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeCommandCmdlet.cs index e415dc7de24..7c751922b4d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeCommandCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeCommandCmdlet.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using System.Management.Automation.Internal; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs index 17adfd80f85..ef70aacf40d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -116,7 +115,6 @@ public string Filename } private string _filename; - /// /// The full path of the file containing the matching line. /// @@ -435,7 +433,6 @@ public bool Contains(T item) throw new NotImplementedException(); } - [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] public void CopyTo(T[] array, int arrayIndex) { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs index 06b77334d7a..0a16b3a3155 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -131,7 +130,6 @@ public GenericObjectMeasureInfo() public object Minimum { get; set; } } - /// /// Class output by Measure-Object /// @@ -413,7 +411,6 @@ public SwitchParameter IgnoreWhiteSpace #endregion TextMeasure ParameterSet #endregion Command Line Switches - /// /// Which parameter set the Cmdlet is in. /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs index 64f3d2934fc..bc6276eada2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -38,7 +37,6 @@ protected override void ProcessRecord() existingAlias = SessionState.Internal.GetAliasAtScope(Name, Scope); } - if (existingAlias != null) { // Throw if alias exists and is private... diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs index b4a80fd63fc..b8ecc9381f8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs index 2ea91339037..36b7d3f1450 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs index 71504e063b4..c346dfb6697 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -39,7 +38,6 @@ public DateTime Start private DateTime _start; private bool _startSpecified; - /// /// This parameter indicates the end of a time span. It is used if two /// times are being compared. If one of the times is not specified, @@ -61,28 +59,24 @@ public DateTime End private DateTime _end; private bool _endSpecified = false; - /// /// Allows the user to override the day /// [Parameter(ParameterSetName = "Time")] public int Days { get; set; } = 0; - /// /// Allows the user to override the hour /// [Parameter(ParameterSetName = "Time")] public int Hours { get; set; } = 0; - /// /// Allows the user to override the minute /// [Parameter(ParameterSetName = "Time")] public int Minutes { get; set; } = 0; - /// /// Allows the user to override the second /// @@ -134,4 +128,3 @@ protected override void ProcessRecord() } // NewTimeSpanCommand } // namespace Microsoft.PowerShell.Commands - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs index 77df4fa926a..2de48409515 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -43,7 +42,6 @@ internal ObjectCommandPropertyValue(object propVal, bool isCaseSensitive, Cultur this.cultureInfo = cultureInfo; } - internal object PropertyValue { get; } internal bool IsExistingProperty { get; } @@ -154,7 +152,6 @@ private static bool IsValueNull(object value) return (val == null); } - internal int Compare(ObjectCommandPropertyValue first, ObjectCommandPropertyValue second) { if (first.IsExistingProperty && second.IsExistingProperty) @@ -196,7 +193,6 @@ public int Compare(object first, object second) // objects are considered the same if (IsValueNull(first) && IsValueNull(second)) return 0; - PSObject firstMsh = first as PSObject; if (firstMsh != null) { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs index 6b726c1deac..afed3c1e6fc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs index f37c274aadf..a6d8962b95c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -84,7 +83,6 @@ public sealed class ReadHostCommand : PSCmdlet } #endregion Parameters - #region Cmdlet Overrides /// @@ -171,8 +169,6 @@ protected override void BeginProcessing() #endregion Cmdlet Overrides - - private object _prompt = null; private Boolean _safe = false; } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs index 01bc5af4424..15dd6f50197 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs index 48a3fe8a09c..8346b7aace8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs index 286c79437a2..395e30829b7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs index 92f0c1fbf2e..dfc98d2c2b9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Management.Automation; using System.Management.Automation.Internal; @@ -16,23 +19,23 @@ public class RemoveAliasCommand : PSCmdlet /// /// The alias name to remove. - /// + /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] public string[] Name { get; set; } - + /// /// The scope parameter for the command determines /// which scope the alias is removed from. - /// + /// [Parameter] public string Scope { get; set; } /// /// If set to true and an existing alias of the same name exists /// and is ReadOnly, it will still be deleted. - /// + /// [Parameter] - public SwitchParameter Force { get; set; } + public SwitchParameter Force { get; set; } #endregion Parameters @@ -40,12 +43,12 @@ public class RemoveAliasCommand : PSCmdlet /// /// The main processing loop of the command. - /// + /// protected override void ProcessRecord() { foreach(string aliasName in Name) - { - AliasInfo existingAlias = null; + { + AliasInfo existingAlias = null; if (String.IsNullOrEmpty(Scope)) { existingAlias = SessionState.Internal.GetAlias(aliasName); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs index e50431aaf63..d59db2282ea 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs index df2014d9fc2..0b6651920aa 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -9,7 +8,6 @@ using System.Diagnostics.CodeAnalysis; using System.Management.Automation; - namespace Microsoft.PowerShell.Commands { #region SendMailMessage @@ -208,7 +206,6 @@ public String Subject } private String _subject; - /// /// Specifies the To address for this e-mail message. /// @@ -272,10 +269,8 @@ public int Port #endregion - #region private variables and methods - // Instantiate a new instance of MailMessage private MailMessage _mMailMessage = new MailMessage(); @@ -361,8 +356,6 @@ protected override AddAddressesToMailMessage(_cc, "cc"); } - - //set the delivery notification _mMailMessage.DeliveryNotificationOptions = _deliverynotification; @@ -382,7 +375,6 @@ protected override // Set the priority of the mail message to normal _mMailMessage.Priority = _priority; - //get the PowerShell environment variable //globalEmailServer might be null if it is deleted by: PS> del variable:PSEmailServer PSVariable globalEmailServer = SessionState.Internal.GetVariable(SpecialVariables.PSEmailServer); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs index 1371eec048a..67e48bbf904 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -46,7 +45,6 @@ public int Column } private int? _column = null; - /// /// the command(s) to set the breakpoint on /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs index ce54fa27ce0..dd5d8ea0575 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs index 1f7e91e8230..fb7f0fc9fde 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma warning disable 1634, 1691 using System; @@ -27,7 +27,6 @@ public sealed class SetDateCommand : PSCmdlet [Parameter(Position = 0, Mandatory = true, ParameterSetName = "Date", ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] public DateTime Date { get; set; } - /// /// Allows a use to specify a timespan with which to apply to the current time /// @@ -35,7 +34,6 @@ public sealed class SetDateCommand : PSCmdlet [AllowNull] public TimeSpan Adjust { get; set; } - /// /// This option determines the default output format used to display the object set-date emits /// @@ -137,4 +135,3 @@ public struct SystemTime } // SetDateCommand } // namespace Microsoft.PowerShell.Commands - diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs index e048249152e..f2a1476fecf 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs index c6e6ae0457a..fc02201d3fa 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.ShowCommandExtension { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs index 384c4c8bc6f..9f9d663ef9e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.ShowCommandExtension { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs index 95ce809a7e0..c9eed0a7d12 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.ShowCommandExtension { @@ -11,7 +8,6 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension using System.Linq; using System.Management.Automation; - /// /// Implements a facade around ShowCommandParameterInfo and its deserialized counterpart /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs index 0a1933e4427..3b572bfd94e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.ShowCommandExtension { @@ -11,7 +8,6 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension using System.Linq; using System.Management.Automation; - /// /// Implements a facade around CommandParameterSetInfo and its deserialized counterpart /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs index 9760a704688..a8769d2c9c4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.ShowCommandExtension { @@ -10,7 +7,6 @@ namespace Microsoft.PowerShell.Commands.ShowCommandExtension using System.Collections; using System.Management.Automation; - /// /// Implements a facade around ShowCommandParameterInfo and its deserialized counterpart /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs index fcda24ca44f..20ab1c538d3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { @@ -127,7 +124,6 @@ internal AutoResetEvent WindowLoaded } } - internal string CommandNeedingHelp { get @@ -149,7 +145,6 @@ internal void DisplayHelp(Collection helpResults) _graphicalHostReflectionWrapper.CallMethod("DisplayHelp", helpResults); } - internal string GetImportModuleCommand(string module) { return (string)_graphicalHostReflectionWrapper.CallStaticMethod("GetImportModuleCommand", module, false, true); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs index fa12ccaa598..2abf326f546 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -36,8 +35,6 @@ public void Dispose() #endregion - - #region parameters /// @@ -48,7 +45,6 @@ public void Dispose() [ValidateRangeAttribute(0, int.MaxValue / 1000)] public int Seconds { get; set; } - /// /// Allows sleep time to be specified in milliseconds /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs index 7cbab7653be..26857e97e42 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs @@ -1,13 +1,12 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; using System.Management.Automation.Internal; - #endregion namespace Microsoft.PowerShell.Commands @@ -28,7 +27,6 @@ public sealed class MeasureCommandCommand : PSCmdlet [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } = AutomationNull.Value; - /// /// The script block to apply /// @@ -45,7 +43,6 @@ public sealed class MeasureCommandCommand : PSCmdlet #region methods - /// /// Output the timer /// @@ -54,7 +51,6 @@ protected override void EndProcessing() WriteObject(_stopWatch.Elapsed); } // EndProcessing - /// /// Execute the script block passing in the current pipeline object as /// it's only parameter. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs index 5578654c42c..932d2ee44c6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ #region Using directives diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs index 8ab72b1cd40..267aa5d52f8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs index 36a90b93c83..1cf0cf8e940 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs @@ -1,12 +1,10 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; using System.Collections.ObjectModel; - namespace Microsoft.PowerShell.Commands { /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs index b81a6501ded..50a9a2973cd 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Concurrent; @@ -13,7 +12,6 @@ using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell.Commands { /// @@ -129,7 +127,6 @@ public string SerializationMethod get { return _serializationMethod; } } - /// /// TargetTypeForDeserialization /// @@ -141,7 +138,6 @@ public Type TargetTypeForDeserialization get { return _targetTypeForDeserialization; } } - /// /// SerializationDepth /// @@ -154,7 +150,6 @@ public int SerializationDepth get { return _serializationDepth; } } - /// /// DefaultDisplayProperty /// @@ -166,7 +161,6 @@ public string DefaultDisplayProperty get { return _defaultDisplayProperty; } } - /// /// InheritPropertySerializationSet /// @@ -178,7 +172,6 @@ public Nullable InheritPropertySerializationSet get { return _inheritPropertySerializationSet; } } - /// /// StringSerializationSource /// @@ -190,7 +183,6 @@ public string StringSerializationSource get { return _stringSerializationSource; } } - /// /// DefaultDisplayPropertySet /// @@ -215,7 +207,6 @@ public string[] DefaultKeyPropertySet get { return _defaultKeyPropertySet; } } - /// /// PropertySerializationSet /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs index c5988b3a450..af39227d230 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -9,7 +8,6 @@ using System.Diagnostics.CodeAnalysis; using System.Globalization; - [module: SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Scope = "type", Target = "Microsoft.PowerShell.Commands.ByteCollection")] namespace Microsoft.PowerShell.Commands diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs index e596e0cb64a..f0d39620af1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -75,7 +74,6 @@ protected string[] ExcludeFilters } private string[] _exclude = new string[0]; - #region helpers /// @@ -244,7 +242,6 @@ internal List GetMatchingVariables(string name, string lookupScope, } - /// /// Implements get-variable command. /// @@ -277,8 +274,6 @@ public string[] Name } private string[] _name = new string[] { "*" }; - - /// /// Output only the value(s) of the requested variable(s). /// @@ -296,7 +291,6 @@ public SwitchParameter ValueOnly } private bool _valueOnly; - /// /// The Include parameter for all the variable commands /// @@ -409,7 +403,6 @@ public sealed class NewVariableCommand : VariableCommandBase [Parameter] public string Description { get; set; } - /// /// The options for the variable to specify if the variable should /// be ReadOnly, Constant, and/or Private. @@ -574,7 +567,6 @@ protected override void ProcessRecord() } // ProcessRecord } // NewVariableCommand - /// /// This class implements set-variable command /// @@ -638,7 +630,6 @@ public string[] Exclude [Parameter] public string Description { get; set; } - /// /// The options for the variable to specify if the variable should /// be ReadOnly, Constant, and/or Private. @@ -694,7 +685,6 @@ public SessionStateEntryVisibility Visibility } private SessionStateEntryVisibility? _visibility; - /// /// The variable object should be passed down the pipeline. /// @@ -976,7 +966,6 @@ private void SetVariable(string[] varNames, object varValue) matchingVariable.Value = varValue; } - if (Description != null) { matchingVariable.Description = Description; @@ -1114,7 +1103,6 @@ protected override void ProcessRecord() Scope = "local"; } - foreach (string varName in Name) { // First look for existing variables to set. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs index a66bda09d81..041e1b53453 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -123,7 +122,6 @@ private void ReceivedEvents_PSEventReceived(Object sender, PSEventArgs e) } } - // Go through all the received events. If one matches the subscription identifier, // break. private void ScanEventQueue() diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs index c2899459a40..dfa6c16108e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/BasicHtmlWebResponseObject.Common.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/ContentHelper.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/ContentHelper.Common.cs index 82f3033b7c8..751ff60d872 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/ContentHelper.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/ContentHelper.Common.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs index 7c6a149cc7f..0ca37557ea3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/InvokeRestMethodCommand.Common.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs index 748732d7c6b..a7b5bcfa233 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -554,7 +553,6 @@ internal virtual void PrepareSession() WebSession.UseDefaultCredentials = true; } - if (null != CertificateThumbprint) { X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); @@ -947,7 +945,6 @@ internal virtual HttpClient GetHttpClient(bool handleRedirect) handler.SslProtocols = (SslProtocols)SslProtocol; - HttpClient httpClient = new HttpClient(handler); // check timeout setting (in seconds instead of milliseconds as in HttpWebRequest) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs index ee29d80e6f2..e819f246f2d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebResponseObject.Common.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs index 3718b0937c2..dca51d7fc49 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs index b5ccb144244..a51779dc18e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs index 944df03eb4e..1de3a7c14e5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/InvokeWebRequestCommand.CoreClr.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/InvokeWebRequestCommand.CoreClr.cs index f7d0c831845..e2cc32bc7fb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/InvokeWebRequestCommand.CoreClr.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/InvokeWebRequestCommand.CoreClr.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebProxy.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebProxy.cs index 256db1888f5..a3fbb5b7049 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebProxy.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Net; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs index 0949b343176..47b0367f220 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseObjectFactory.CoreClr.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseObjectFactory.CoreClr.cs index 2623da9ea32..0e7689788eb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseObjectFactory.CoreClr.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/CoreCLR/WebResponseObjectFactory.CoreClr.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Net.Http; using System.IO; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs index fcb17ce1753..a4ca4ab6671 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs index 23e9129caf2..601c12e2c7b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs index f06514ab4af..1096ff1c7ea 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs index 7fd144c3e34..0c1f9e63cab 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs index 7664652cb6c..cd02e225332 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -316,7 +315,6 @@ internal static void WriteToStream(Stream input, Stream output, PSCmdlet cmdlet) } } while (read != 0); - if (cmdlet != null) { ProgressRecord record = new ProgressRecord(ActivityId, diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs index 83044fabc9c..4325e29054e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs index 11afdf24b19..40ae4d45a68 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs index b55639acd77..43809cd39c7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Net; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs index 2ac76d2c63a..a525ee6e3bc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs index 9e195d3e30f..478e0cbf3a5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -74,7 +73,6 @@ public SwitchParameter PassThru [Parameter] public string Scope { get; set; } - /// /// If set to true and an existing alias of the same name exists /// and is ReadOnly, the alias will be overwritten. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs index c53dc13623d..f7f8c24bc46 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -22,8 +21,6 @@ public sealed class WriteHostCommand : ConsoleColorCmdlet // Parameters // - - /// /// /// Object to be output. @@ -33,7 +30,6 @@ public sealed class WriteHostCommand : ConsoleColorCmdlet [Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)] public object Object { get; set; } = null; - /// /// /// False to add a newline to the end of the output string, true if not. @@ -53,8 +49,6 @@ public SwitchParameter NoNewline } } - - /// /// /// The separator to print between objects @@ -65,7 +59,6 @@ public SwitchParameter NoNewline [Parameter] public object Separator { get; set; } = " "; - // // Cmdlet Overrides // @@ -118,8 +111,6 @@ private string ProcessObject(object o) return null; } - - /// /// /// Outputs the object to the host console, with optional newline diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs index d9936e14229..7bbd3bd3370 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs @@ -1,15 +1,11 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; using Dbg = System.Management.Automation.Diagnostics; - - namespace Microsoft.PowerShell.Commands { /// @@ -35,7 +31,6 @@ public sealed class WriteProgressCommand : PSCmdlet HelpMessageResourceId = "ActivityParameterHelpMessage")] public string Activity { get; set; } - /// /// /// Describes the current state of the activity. @@ -50,7 +45,6 @@ public sealed class WriteProgressCommand : PSCmdlet [ValidateNotNullOrEmpty] public string Status { get; set; } = WriteProgressResourceStrings.Processing; - /// /// /// Uniquely identifies this activity for purposes of chaining subordinate activities. @@ -62,7 +56,6 @@ public sealed class WriteProgressCommand : PSCmdlet [ValidateRange(0, Int32.MaxValue)] public int Id { get; set; } = 0; - /// /// /// Percentage completion of the activity, or -1 if n/a @@ -74,7 +67,6 @@ public sealed class WriteProgressCommand : PSCmdlet [ValidateRange(-1, 100)] public int PercentComplete { get; set; } = -1; - /// /// /// Seconds remaining to complete the operation, or -1 if n/a @@ -85,7 +77,6 @@ public sealed class WriteProgressCommand : PSCmdlet [Parameter] public int SecondsRemaining { get; set; } = -1; - /// /// /// Description of current operation in activity, empty if n/a @@ -96,7 +87,6 @@ public sealed class WriteProgressCommand : PSCmdlet [Parameter] public string CurrentOperation { get; set; } - /// /// /// Identifies the parent Id of this activity, or -1 if none. @@ -108,7 +98,6 @@ public sealed class WriteProgressCommand : PSCmdlet [ValidateRange(-1, Int32.MaxValue)] public int ParentId { get; set; } = -1; - /// /// /// Identifies whether the activity has completed (and the display for it should be removed), @@ -130,8 +119,6 @@ public SwitchParameter Completed } } - - /// /// /// Identifies the source of the record. @@ -142,7 +129,6 @@ public SwitchParameter Completed [Parameter] public int SourceId { get; set; } - /// /// /// Writes a ProgressRecord created from the parameters. @@ -163,10 +149,8 @@ protected override WriteProgress(SourceId, pr); } - private bool _completed; - private const string HelpMessageBaseName = "WriteProgressResourceStrings"; } } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs index 33845a3f23e..ae9140f3cb6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -137,7 +136,6 @@ protected override CreateFileStream(); } - /// /// /// @@ -314,7 +312,6 @@ public String[] LiteralPath } private bool _isLiteralPath = false; - #endregion Command Line Parameters #region IDisposable Members @@ -367,7 +364,6 @@ protected override void StopProcessing() } } - /// /// implementation for the convertto-xml command /// @@ -378,7 +374,6 @@ public sealed class ConvertToXmlCommand : PSCmdlet, IDisposable { #region Command Line Parameters - /// /// Depth of serialization /// @@ -386,7 +381,6 @@ public sealed class ConvertToXmlCommand : PSCmdlet, IDisposable [ValidateRange(1, int.MaxValue)] public int Depth { get; set; } = 0; - /// /// Input Object which is written to XML format /// @@ -394,7 +388,6 @@ public sealed class ConvertToXmlCommand : PSCmdlet, IDisposable [AllowNull] public PSObject InputObject { get; set; } - /// /// Property that sets NoTypeInformation parameter. /// @@ -422,7 +415,6 @@ public SwitchParameter NoTypeInformation #endregion Command Line Parameters - #region Overrides /// @@ -441,7 +433,6 @@ protected override void BeginProcessing() } } - /// /// override ProcessRecord /// @@ -454,7 +445,6 @@ protected override void ProcessRecord() if (null != _serializer) _serializer.SerializeAsStream(InputObject); - if (null != _serializer) { _serializer.DoneAsStream(); @@ -630,7 +620,6 @@ private void CleanUp() #endregion IDisposable Members } - /// /// Helper class to import single XML file /// @@ -742,7 +731,6 @@ internal void Import() _cmdlet.WriteObject(totalCount); } - ulong skip = _cmdlet.PagingParameters.Skip; ulong first = _cmdlet.PagingParameters.First; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/compare-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/compare-object.cs index 0dd2e5b2c96..68b5cd89abf 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/compare-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/compare-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs index 89e61edbf98..3cbcf8e7f93 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/convert-HTML.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -398,7 +397,6 @@ private static string SafeToString(object obj) return ""; } - /// /// /// @@ -419,7 +417,6 @@ protected override void BeginProcessing() WebUtility.HtmlEncode(_title); } - // This first line ensures w3c validation will succeed. However we are not specifying // an encoding in the HTML because we don't know where the text will be written and // if a particular encoding will be used. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/group-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/group-object.cs index 60d316aecb0..f967cd3a071 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/group-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/group-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -109,8 +108,6 @@ internal virtual void Add(PSObject groupValue) Count++; } - - private static string BuildName(List propValues) { StringBuilder sb = new StringBuilder(); @@ -141,7 +138,6 @@ private static string BuildName(List propValues) return sb.Length >= 2 ? sb.Remove(sb.Length - 2, 2).ToString() : string.Empty; } - /// /// /// Values of the group diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/new-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/new-object.cs index 89f7bccf977..82f78f06848 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/new-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/new-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives @@ -101,7 +100,6 @@ private void CreateMemberSetValueError(SetValueException e) new ErrorRecord(ex, "SetValueException", ErrorCategory.InvalidData, null)); } - private static string ParameterSet2ResourceString(string parameterSet) { if (parameterSet.Equals(netSetName, StringComparison.OrdinalIgnoreCase)) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/neweventcommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/neweventcommand.cs index 29ac9dfa987..14812d759f0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/neweventcommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/neweventcommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; @@ -92,7 +91,6 @@ public PSObject MessageData #endregion parameters - /// /// Add the event to the event queue /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs index b5c4f0a3581..c11fd593cfa 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/select-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -79,7 +78,6 @@ public sealed class SelectObjectCommand : PSCmdlet [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } = AutomationNull.Value; - /// /// /// @@ -147,7 +145,6 @@ public int First private int _first = 0; private bool _firstOrLastSpecified; - /// /// Skips the specified number of items from top when used with First,from end when used with Last /// @@ -293,8 +290,6 @@ public PSObject StreamingDequeue() /// private List _expandMshParameterList; - - private MshExpressionFilter _exclusionFilter; private class UniquePSObjectHelper @@ -351,7 +346,6 @@ private void ProcessObject(PSObject inputObject) return; } - //If property parameter is mentioned List matchedProperties = new List(); foreach (MshParameter p in _propertyMshParameterList) @@ -396,8 +390,6 @@ private void ProcessObject(PSObject inputObject) } } - - private void ProcessParameter(MshParameter p, PSObject inputObject, List result) { string name = p.GetEntry(NameEntryDefinition.NameEntryKey) as string; @@ -473,7 +465,6 @@ private void ProcessExpandParameter(MshParameter p, PSObject inputObject, MshExpression ex = p.GetEntry(FormatParameterDefinitionKeys.ExpressionEntryKey) as MshExpression; List expressionResults = ex.GetValues(inputObject); - if (expressionResults.Count == 0) { ErrorRecord errorRecord = new ErrorRecord( diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs index b3288396a30..e322af31fe5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/sort-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs index b5520bbad74..1b1937df9b1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/tee-object.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs index 8b9103f2923..26bcdaaa7f5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs index ae0af27e05b..0d8b2dd7845 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs index 49c4c51ffa3..90a335f32a7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Diagnostics; @@ -43,7 +42,6 @@ public PSTraceSourceOptions Option } } // Flags - /// /// The parameter which determines the options for output from the /// trace listeners. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs index 292a69db892..55faf98812e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs index bffa86fcc93..df22e683c68 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -138,7 +137,6 @@ public SwitchParameter PSHost set { base.PSHostListener = value; } } // PSHost - #endregion Parameters #region Cmdlet code @@ -153,7 +151,6 @@ protected override void BeginProcessing() Collection preconfiguredSources = null; _matchingSources = ConfigureTraceSource(base.NameInternal, false, out preconfiguredSources); - TurnOnTracing(_matchingSources, false); TurnOnTracing(preconfiguredSources, true); @@ -215,14 +212,12 @@ protected override void ProcessRecord() return; } - if (!LanguagePrimitives.IsNull(result)) { WriteObject(result, true); } } // ProcessRecord - /// /// Finishes running the command if specified and then sets the /// tracing options and listeners back to their original values. diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs index 34ddcc2e007..ab3955a0d95 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -29,7 +28,6 @@ public class TraceListenerCommandBase : TraceCommandBase /// internal string[] NameInternal { get; set; } = new string[0]; - /// /// The flags to be set on the TraceSource /// @@ -441,7 +439,6 @@ internal static void RemoveListenersByName( } } // RemoveAllTraceListenersFromSource - #endregion RemoveTraceListeners #region SetTraceListenerOptions diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/update-list.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/update-list.cs index afff8f3b8d5..22f0e65e0ad 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/update-list.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/update-list.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -113,7 +112,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/write.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/write.cs index f1b1bcd51a7..6d5ccb134c3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/write.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/write.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -26,7 +25,6 @@ public sealed class WriteDebugCommand : PSCmdlet [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-Debug command /// @@ -76,7 +74,6 @@ public sealed class WriteVerboseCommand : PSCmdlet [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-verbose command /// @@ -126,7 +123,6 @@ public sealed class WriteWarningCommand : PSCmdlet [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-Warning command /// @@ -214,7 +210,6 @@ protected override void ProcessRecord() #endregion WriteInformationCommand - #region WriteOrThrowErrorCommand /// @@ -311,7 +306,6 @@ public class WriteOrThrowErrorCommand : PSCmdlet [Alias("TargetType")] public string CategoryTargetType { get; set; } = ""; - /// /// Write an error to the output pipe, or throw a terminating error. /// @@ -493,5 +487,3 @@ protected WriteErrorException(SerializationInfo info, #endregion WriteErrorException } //namespace - - diff --git a/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs b/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs index b26ef9a062a..7248db150a2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.ComponentModel; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs b/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs index 5ccccbcb8e1..617b095eeec 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Reflection; using System.Runtime.CompilerServices; #if !CORECLR diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 840e8fb4d68..0854b7a2ca6 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 84ae968d209..13687f7d35d 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -1,8 +1,7 @@ -#if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +#if !UNIX // Implementation notes: In the functions that take ConsoleHandle parameters, we only assert that the handle is valid and not // closed, as opposed to doing a check and throwing an exception. This is because the win32 APIs that those functions wrap will @@ -13,7 +12,6 @@ // could do is diddle with the console buffer. #pragma warning disable 1634, 1691 - using System; using System.Text; using System.Runtime.InteropServices; @@ -724,13 +722,10 @@ internal static void SetMode(ConsoleHandle consoleHandle, ConsoleModes mode) } } - #endregion #region Input - - /// /// /// Reads input from the console device according to the mode in effect (see GetMode, SetMode) @@ -1344,7 +1339,6 @@ internal static void CheckWriteEdges( } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called in CHK builds")] private static void CheckWriteConsoleOutputContents(BufferCell[,] contents, Rectangle contentsRegion) { @@ -2051,7 +2045,6 @@ internal static void ReadConsoleOutputCJK readRegion.Top += bufferSize.Y; } // row iteration - // The following nested loop set the value of the empty cells in contents: // character to ' ' // foreground color to console's foreground color @@ -2097,7 +2090,6 @@ out background } #endregion ReadConsoleOutput CJK - private static void ReadConsoleOutputPlain ( ConsoleHandle consoleHandle, @@ -2277,7 +2269,6 @@ out background } } - /// /// Wraps Win32 FillConsoleOutputCharacter /// @@ -2543,8 +2534,6 @@ internal static Size GetLargestConsoleWindowSize(ConsoleHandle consoleHandle) return new Size(result.X, result.Y); } - - /// /// Wraps Win32 GetConsoleTitle. 1K is the safe limit experimentally. The 64K limit /// found in the docs is disregarded because it is essentially meaningless. @@ -2808,7 +2797,6 @@ internal static bool IsCJKOutputCodePage(out uint codePage) #region Cursor - /// /// Wraps Win32 SetConsoleCursorPosition /// @@ -2848,8 +2836,6 @@ internal static void SetConsoleCursorPosition(ConsoleHandle consoleHandle, Coord } } - - /// /// Wraps Win32 GetConsoleCursorInfo /// @@ -3125,7 +3111,6 @@ IntPtr reserved [DllImport(PinvokeDllNames.GetConsoleScreenBufferInfoDllName, SetLastError = true, CharSet = CharSet.Unicode)] internal static extern bool GetConsoleScreenBufferInfo(NakedWin32Handle consoleHandle, out CONSOLE_SCREEN_BUFFER_INFO consoleScreenBufferInfo); - internal enum FileType { Unknown, diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index 060fa942b56..d52122c10f8 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -1,8 +1,7 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ -#pragma warning disable 1634, 1691 +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +#pragma warning disable 1634, 1691 using System; using System.Diagnostics.CodeAnalysis; @@ -273,8 +272,6 @@ internal static int Start( } private static CommandLineParameterParser s_cpp; - - #if UNIX /// /// @@ -856,8 +853,6 @@ public override PSObject PrivateData } private PSObject _consoleColorProxy; - - /// /// /// See base class @@ -877,8 +872,6 @@ public override System.Globalization.CultureInfo CurrentCulture } } - - /// /// /// See base class @@ -1249,7 +1242,6 @@ internal RunspaceRef RunspaceRef internal WrappedSerializer.DataFormat OutputFormat { get; private set; } - internal WrappedSerializer.DataFormat InputFormat { get; private set; } internal WrappedDeserializer.DataFormat ErrorFormat @@ -1919,7 +1911,6 @@ private void RunProfile(string profileFileName, Executor exec) } } - /// /// /// Escapes backtick and tick characters with a backtick, returns the result @@ -2071,7 +2062,6 @@ private void ReportExceptionFallback(Exception e, string header) /// internal event EventHandler RunspacePushed; - #endregion non-overrides #region debugger @@ -2885,11 +2875,8 @@ private class ConsoleHostStartupException : Exception private static ConsoleHost s_theConsoleHost; - internal static InitialSessionState DefaultInitialSessionState; - - [TraceSource("ConsoleHost", "ConsoleHost subclass of S.M.A.PSHost")] private static PSTraceSource s_tracer = PSTraceSource.GetTracer("ConsoleHost", "ConsoleHost subclass of S.M.A.PSHost"); @@ -2937,4 +2924,3 @@ internal RunspaceCreationEventArgs(string initialCommand, } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index af6f660c628..8d90d6af037 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs @@ -1,9 +1,7 @@ -#if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +#if !UNIX using System; using System.Management.Automation; @@ -19,8 +17,6 @@ using WORD = System.UInt16; using DWORD = System.UInt32; - - namespace Microsoft.PowerShell { /// @@ -131,8 +127,6 @@ public override } } - - /// /// /// See base class @@ -189,8 +183,6 @@ public override } } - - /// /// /// See base class @@ -234,8 +226,6 @@ public override } } - - /// /// /// See base class @@ -303,8 +293,6 @@ public override } } - - /// /// /// See base class @@ -375,8 +363,6 @@ public override } } - - /// /// /// See base class @@ -436,8 +422,6 @@ public override } } - - /// /// /// See base class @@ -570,8 +554,6 @@ public override } } - - /// /// /// See base class @@ -598,8 +580,6 @@ public override } } - - /// /// /// See base class @@ -788,8 +768,6 @@ public override return keyInfo; } - - private static void KEY_EVENT_RECORDToKeyInfo(ConsoleControl.KEY_EVENT_RECORD keyEventRecord, out KeyInfo keyInfo) @@ -801,8 +779,6 @@ private static keyEventRecord.KeyDown); } - - /// /// /// See base class @@ -826,8 +802,6 @@ public override cachedKeyEvent.RepeatCount = 0; } - - /// /// /// See base class @@ -884,7 +858,6 @@ public override } } - /// /// /// See base class @@ -1004,8 +977,6 @@ public override ConsoleControl.WriteConsoleOutput(handle, origin, contents); } - - /// /// /// If is completely outside of the screen buffer, it's a no-op. @@ -1185,8 +1156,6 @@ public override } } - - /// /// /// See base class. @@ -1271,8 +1240,6 @@ public override return contents; } - - /// /// /// See base class @@ -1386,7 +1353,6 @@ int LengthInBufferCells(string s, int offset) return ConsoleControl.LengthInBufferCells(s, offset, parent.SupportsVirtualTerminal); } - /// /// /// See base class @@ -1423,7 +1389,6 @@ internal void ClearKeyCache() #region helpers - // pass-by-ref for speed. /// /// @@ -1455,7 +1420,6 @@ private static } } - /// /// Get output buffer info /// @@ -1475,8 +1439,6 @@ private static return result; } - - #endregion helpers private ConsoleColor defaultForeground = ConsoleColor.Gray; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs index b9143e878ea..61f56ee1319 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs @@ -1,19 +1,13 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; using System.Management.Automation.Host; using System.Management.Automation.Internal; - using Dbg = System.Management.Automation.Diagnostics; - - namespace Microsoft.PowerShell { internal sealed partial @@ -39,7 +33,6 @@ class ConsoleHost } private bool _isTranscribing; - /* internal void StartTranscribing(string transcriptFilename, bool shouldAppend) { @@ -74,8 +67,6 @@ internal void StartTranscribing(string transcriptFilename, bool shouldAppend) */ private string _transcriptFileName = String.Empty; - - internal string StopTranscribing() @@ -113,8 +104,6 @@ internal void StartTranscribing(string transcriptFilename, bool shouldAppend) } } - - internal void WriteToTranscript(string text) @@ -128,11 +117,8 @@ internal void StartTranscribing(string transcriptFilename, bool shouldAppend) } } - - private StreamWriter _transcriptionWriter; private object _transcriptionStateLock = new object(); } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 6d178849871..7c57d9532b4 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -128,7 +127,6 @@ public override PSHostRawUserInterface RawUI // } //} - /// /// /// true if command completion is currently running @@ -190,7 +188,6 @@ public override string ReadLine() return ReadLine(false, "", out unused, true, true); } - /// /// /// See base class @@ -452,7 +449,6 @@ private object ReadLineSafe(bool isSecureString, char? printToken) } } - /// /// /// Handle writing print token with proper cursor adjustment for ReadLineSafe @@ -500,8 +496,6 @@ private void WritePrintToken( WriteToConsole(printToken, false); } - - /// /// /// Handle backspace with proper cursor adjustment for ReadLineSafe @@ -548,8 +542,6 @@ private void WriteBackSpace(Coordinates originalCursorPosition) // do nothing if cursorPosition.X is left of screen } - - /// /// Blank out at and move rawui.CursorPosition to /// @@ -561,7 +553,6 @@ private void BlankAtCursor(Coordinates cursorPosition) _rawui.CursorPosition = cursorPosition; } - #if !UNIX /// /// @@ -643,8 +634,6 @@ internal void WriteToConsole(string value, bool transcribeResult) } } - - private void WriteToConsole(ConsoleColor foregroundColor, ConsoleColor backgroundColor, string text) { ConsoleColor fg = RawUI.ForegroundColor; @@ -670,8 +659,6 @@ private void WriteLineToConsole(string text) WriteToConsole(Crlf, true); } - - private void WriteLineToConsole() { WriteToConsole(Crlf, true); @@ -679,8 +666,6 @@ private void WriteLineToConsole() #endregion WriteToConsole - - /// /// /// See base class. @@ -725,8 +710,6 @@ public override void Write(string value) } } - - /// /// /// See base class @@ -775,8 +758,6 @@ public override void Write(ConsoleColor foregroundColor, ConsoleColor background } } - - /// /// /// See base class @@ -808,8 +789,6 @@ public override void WriteLine(string value) #region Word Wrapping - - /// /// /// This is a poor-man's word-wrapping routine. It breaks a single string into segments small enough to fit within a @@ -928,15 +907,12 @@ internal List WrapText(string text, int maxWidthInBufferCells) return result; } - - /// /// /// Struct used by WrapText /// /// - [Flags] internal enum WordFlags { @@ -951,8 +927,6 @@ internal struct Word internal WordFlags Flags; } - - /// /// /// Chops text into "words," where a word is defined to be a sequence of whitespace characters, or a sequence of @@ -1066,8 +1040,6 @@ internal List ChopTextIntoWords(string text, int maxWidthInBufferCells) return result; } - - /// /// /// Helper for ChopTextIntoWords. Takes a span of characters in a string and adds it to the word list, further @@ -1274,7 +1246,6 @@ public override void WriteVerboseLine(string message) } } - /// /// /// See base class @@ -1356,8 +1327,6 @@ public override void WriteProgress(Int64 sourceId, ProgressRecord record) } } - - public override void WriteErrorLine(string value) { if (string.IsNullOrEmpty(value)) @@ -1408,11 +1377,8 @@ public override void WriteErrorLine(string value) #endregion Line-oriented interaction - #region implementation - - // We use System.Environment.NewLine because we are platform-agnostic internal static string Crlf = System.Environment.NewLine; @@ -1886,7 +1852,6 @@ private char GetCharacterUnderCursor(Coordinates cursorPosition) } #endif - /// /// Strip nulls from a string... /// @@ -1905,7 +1870,6 @@ private string RemoveNulls(string input) return sb.ToString(); } - /// /// /// Reads a line, and completes the input for the user if they hit tab. diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs index 6c9350802cc..d8b19a68812 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs @@ -1,15 +1,11 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; using Dbg = System.Management.Automation.Diagnostics; using System.Threading; - namespace Microsoft.PowerShell { internal partial @@ -55,8 +51,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - /// /// /// Invoked by ConsoleHostUserInterface.WriteProgress to update the set of outstanding activities for which @@ -106,8 +100,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - /// /// /// TimerCallback for '_progPaneUpdateTimer' to update 'progPaneUpdateFlag' @@ -131,8 +123,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private void PostWrite() @@ -143,8 +133,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private void PostWrite(string value) @@ -164,8 +152,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private void PreRead() @@ -176,8 +162,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private void PostRead() @@ -188,8 +172,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private void PostRead(string value) @@ -210,8 +192,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } - - private ProgressPane _progPane = null; private PendingProgress _pendingProgress = null; // The timer set up 'progPaneUpdateFlag' every 'UpdateTimerThreshold' milliseconds to update 'ProgressPane' @@ -221,5 +201,3 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt } } // namespace - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index 660cd741436..97ae10731d3 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -17,8 +14,6 @@ using Dbg = System.Management.Automation.Diagnostics; using InternalHostUserInterface = System.Management.Automation.Internal.Host.InternalHostUserInterface; - - namespace Microsoft.PowerShell { internal partial @@ -44,8 +39,6 @@ private enum PromptCommonInputErrors Overflow } - - private static bool AtLeastOneHelpMessageIsPresent(Collection descriptions) @@ -64,8 +57,6 @@ private static return false; } - - /// /// /// See base class diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs index 369a9385443..719d489904c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs index b945d24dc21..8501bffec35 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Security; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs index 89703712e50..ec3b1044b62 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using System.Management.Automation.Runspaces; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs index 7e14ca9d8cd..cc4cebebc3f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -13,8 +10,6 @@ using DWORD = System.UInt32; using NakedWin32Handle = System.IntPtr; - - namespace Microsoft.PowerShell { internal @@ -30,8 +25,6 @@ class ConsoleTextWriter : TextWriter _ui = ui; } - - public override Encoding Encoding @@ -42,8 +35,6 @@ public override } } - - public override void Write(string value) @@ -51,8 +42,6 @@ public override _ui.WriteToConsole(value, true); } - - public override void WriteLine(string value) @@ -60,8 +49,6 @@ public override this.Write(value + ConsoleHostUserInterface.Crlf); } - - public override void Write(Boolean b) @@ -69,8 +56,6 @@ public override this.Write(b.ToString()); } - - public override void Write(Char c) @@ -78,8 +63,6 @@ public override this.Write(new String(c, 1)); } - - public override void Write(Char[] a) @@ -87,10 +70,7 @@ public override this.Write(new String(a)); } - - private ConsoleHostUserInterface _ui; } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index b3ba10f1ec3..c8cdc9068fe 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -91,8 +90,6 @@ private void OutputObjectStreamHandler(object sender, EventArgs e) } } - - // called on the pipeline thread private void ErrorObjectStreamHandler(object sender, EventArgs e) @@ -114,7 +111,6 @@ private void ErrorObjectStreamHandler(object sender, EventArgs e) } } - /// /// This method handles the failure in executing pipeline asynchronously /// @@ -425,7 +421,6 @@ internal Collection ExecuteCommandHelper(Pipeline tempPipeline, out Ex return results; } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Needed by ProfileTests as mentioned in bug 140572")] internal Collection ExecuteCommand(string command) { diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs index b82b277b7bc..71693b3573c 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Reflection; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs index c2be475e02c..d4a6ae51ca5 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -12,7 +9,6 @@ using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell { /// @@ -157,8 +153,6 @@ class PendingProgress AgeNodesAndResetStyle(); } - - private void EvictNode() @@ -183,7 +177,6 @@ class PendingProgress } } - /// /// /// Removes a node from the tree. @@ -221,7 +214,6 @@ class PendingProgress #endif } - private void RemoveNodeAndPromoteChildren(ArrayList nodes, int indexToRemove) @@ -267,8 +259,6 @@ class PendingProgress } } - - /// /// /// Adds a node to the tree, first removing the oldest node if the tree is too large. @@ -298,8 +288,6 @@ class PendingProgress #endif } - - private class FindOldestNodeVisitor : NodeVisitor { @@ -318,30 +306,21 @@ internal override return true; } - - internal ProgressNode FoundNode; - - internal ArrayList ListWhereFound; - - internal int IndexWhereFound = -1; - private int _oldestSoFar; } - - private ProgressNode FindOldestLeafmostNodeHelper(ArrayList treeToSearch, out ArrayList listWhereFound, out int indexWhereFound) @@ -367,7 +346,6 @@ internal override return v.FoundNode; } - private ProgressNode FindOldestLeafmostNode(out ArrayList listWhereFound, out int indexWhereFound) @@ -394,8 +372,6 @@ internal override return result; } - - /// /// /// Convenience overload. @@ -412,8 +388,6 @@ internal override FindNodeById(sourceId, activityId, out listWhereFound, out indexWhereFound); } - - private class FindByIdNodeVisitor : NodeVisitor { @@ -424,8 +398,6 @@ class FindByIdNodeVisitor : NodeVisitor _idToFind = activityIdToFind; } - - internal override bool Visit(ProgressNode node, ArrayList listWhereFound, int indexWhereFound) @@ -440,32 +412,22 @@ internal override return true; } - - internal ProgressNode FoundNode; - - internal ArrayList ListWhereFound; - - internal int IndexWhereFound = -1; - - private int _idToFind = -1; private Int64 _sourceIdToFind; } - - /// /// /// Finds a node with a given ActivityId in provided set of nodes. Recursively walks the set of nodes and their children. @@ -521,8 +483,6 @@ internal override return v.FoundNode; } - - /// /// /// Finds the oldest node with a given rendering style that is at least as old as a given age. @@ -593,8 +553,6 @@ internal override return found; } - - private class AgeAndResetStyleVisitor : NodeVisitor { @@ -608,8 +566,6 @@ internal override } } - - /// /// /// Increments the age of each of the nodes in the given list, and all their children. Also sets the rendering @@ -627,14 +583,10 @@ internal override NodeVisitor.VisitNodes(_topLevelNodes, arsv); } - - #endregion // Updating Code #region Rendering Code - - /// /// /// Generates an array of strings representing as much of the outstanding progress activities as possible within the given @@ -715,8 +667,6 @@ internal override return (string[])result.ToArray(typeof(string)); } - - /// /// /// Helper function for Render(). Recursively renders nodes. @@ -777,8 +727,6 @@ internal override } } - - private class HeightTallyer : NodeVisitor { @@ -845,7 +793,6 @@ private int TallyHeight(PSHostRawUserInterface rawUi, int maxHeight, int maxWidt return ht.Tally; } - #if DEBUG || ASSERTIONS_TRACE /// @@ -887,8 +834,6 @@ private int TallyHeight(PSHostRawUserInterface rawUi, int maxHeight, int maxWidt return true; } - - /// /// /// Debugging code. NodeVisitor that counts up the number of nodes in the tree. @@ -912,8 +857,6 @@ internal override Count; } - - /// /// /// Debugging code. Counts the number of nodes in the tree of nodes. @@ -936,7 +879,6 @@ internal override #endif - /// /// /// Helper function to CompressToFit. Considers compressing nodes from one level to another. @@ -1030,8 +972,6 @@ internal override return false; } - - /// /// /// "Compresses" the nodes representing the outstanding progress activities until their rendering will fit within a @@ -1130,15 +1070,10 @@ internal override return 0; } - - - #endregion // Rendering Code #region Utility Code - - private abstract class NodeVisitor { @@ -1199,16 +1134,11 @@ internal static } } - #endregion - - private ArrayList _topLevelNodes = new ArrayList(); private int _nodeCount; private const int maxNodeCount = 128; } } // namespace - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs index 159a1d5c78a..2529c31927b 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -12,7 +9,6 @@ using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell { /// @@ -52,8 +48,6 @@ namespace Microsoft.PowerShell FullPlus = 4, }; - - /// /// /// Constructs an instance from a ProgressRecord. @@ -76,8 +70,6 @@ namespace Microsoft.PowerShell this.SourceId = sourceId; } - - /// /// /// Renders a single progress node as strings of text according to that node's style. The text is appended to the @@ -340,8 +332,6 @@ private static void RenderFullDescription(string description, string indent, int } } - - /// /// /// Renders a node in the "Minimal" style. @@ -402,8 +392,6 @@ private static void RenderFullDescription(string description, string indent, int maxWidth)); } - - /// /// /// The nodes that have this node as their parent. @@ -414,8 +402,6 @@ private static void RenderFullDescription(string description, string indent, int ArrayList Children; - - /// /// /// The "age" of the node. A node's age is incremented by PendingProgress.Update each time a new ProgressRecord is @@ -433,8 +419,6 @@ private static void RenderFullDescription(string description, string indent, int int Age; - - /// /// /// The style in which this node should be rendered. @@ -445,8 +429,6 @@ private static void RenderFullDescription(string description, string indent, int RenderStyle Style = RenderStyle.FullPlus; - - /// /// /// Identifies the source of the progress record. @@ -457,7 +439,6 @@ private static void RenderFullDescription(string description, string indent, int Int64 SourceId; - /// /// /// The number of vertical BufferCells that are required to render the node in its current style. @@ -494,7 +475,6 @@ internal int LinesRequiredMethod(PSHostRawUserInterface rawUi, int maxWidth) return 0; } - /// /// /// The number of vertical BufferCells that are required to render the node in the Full style. @@ -553,7 +533,6 @@ private int LinesRequiredInFullStyleMethod(PSHostRawUserInterface rawUi, int max return lines; } - /// /// /// The number of vertical BufferCells that are required to render the node in the Compact style. @@ -586,4 +565,3 @@ private int LinesRequiredInFullStyleMethod(PSHostRawUserInterface rawUi, int max } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs index b1d20c83140..922aad8f174 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs @@ -1,15 +1,11 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation.Host; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell { /// @@ -41,8 +37,6 @@ class ProgressPane _rawui = ui.RawUI; } - - /// /// /// Indicates whether the pane is visible on the screen buffer or not. @@ -64,8 +58,6 @@ class ProgressPane } } - - /// /// /// Shows the pane in the screen buffer. Saves off the content of the region of the buffer that will be overwritten so @@ -149,8 +141,6 @@ class ProgressPane } } - - /// /// /// Hides the pane by restoring the saved contents of the region of the buffer that the pane occupies. If the pane is @@ -175,8 +165,6 @@ class ProgressPane } } - - /// /// /// Updates the pane with the rendering of the supplied PendingProgress, and shows it. @@ -257,8 +245,6 @@ class ProgressPane } } - - private Coordinates _location = new Coordinates(0, 0); private Coordinates _savedCursor; private Size _bufSize; @@ -269,6 +255,3 @@ class ProgressPane } } // namespace - - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs index 9eefb0e3b97..760570099cb 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs @@ -1,17 +1,13 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; using System.Management.Automation; using System.Xml; - using Dbg = System.Management.Automation.Diagnostics; - - namespace Microsoft.PowerShell { /// @@ -56,8 +52,6 @@ internal enum DataFormat None = 2 } - - protected Serialization(DataFormat dataFormat, string streamName) { @@ -67,16 +61,12 @@ internal enum DataFormat this.streamName = streamName; } - - protected static string XmlCliTag = "#< CLIXML"; protected string streamName; protected DataFormat format; } - - internal class WrappedSerializer : Serialization { @@ -106,8 +96,6 @@ class WrappedSerializer : Serialization } } - - internal void Serialize(object o) @@ -138,7 +126,6 @@ class WrappedSerializer : Serialization } } - internal void End() @@ -162,15 +149,12 @@ class WrappedSerializer : Serialization } } - internal TextWriter textWriter; private XmlWriter _xmlWriter; private Serializer _xmlSerializer; private bool _firstCall = true; } - - internal class WrappedDeserializer : Serialization { @@ -208,8 +192,6 @@ class WrappedDeserializer : Serialization } } - - internal object Deserialize() @@ -250,8 +232,6 @@ class WrappedDeserializer : Serialization return o; } - - internal bool AtEnd @@ -279,8 +259,6 @@ class WrappedDeserializer : Serialization } } - - internal void End() @@ -297,7 +275,6 @@ class WrappedDeserializer : Serialization } } - internal TextReader textReader; private XmlReader _xmlReader; private Deserializer _xmlDeserializer; @@ -306,4 +283,3 @@ class WrappedDeserializer : Serialization } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs index 6739e770736..06009b22d2a 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -10,7 +7,6 @@ using System.Management.Automation; using System.Management.Automation.Internal; - namespace Microsoft.PowerShell.Commands { /// @@ -147,7 +143,6 @@ public SwitchParameter IncludeInvocationHeader get; set; } - /// /// /// Starts the transcription @@ -344,5 +339,3 @@ private void ReportMultipleFilesNotSupported() } } - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs index 8c058a5e787..fa60872b01f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs @@ -1,14 +1,10 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; using System.Management.Automation.Internal; - namespace Microsoft.PowerShell.Commands { /// @@ -49,6 +45,3 @@ protected override } } } - - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs index ac035ba7305..12008425843 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using Microsoft.ApplicationInsights; using Microsoft.ApplicationInsights.DataContracts; diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs index d768faabd92..82755a31493 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs index 62d6c4c25b1..63f2a974552 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.ComponentModel; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs index a504b27b286..e9ec9e8826a 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Runtime.CompilerServices; using System.Reflection; [assembly: InternalsVisibleTo("System.Management.Automation,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs index 36244513e78..2b8cbcfc39e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs @@ -1,8 +1,5 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Runtime.InteropServices; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs index b628b885f10..baa14c16e8a 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs @@ -1,8 +1,5 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Runtime.InteropServices; @@ -266,7 +263,6 @@ private static void SetLastError(int error) } } - [System.Security.SecurityCritical] private static unsafe string EncodeObject(ref object data, EventData* dataDescriptor, byte* dataBuffer) /*++ @@ -427,7 +423,6 @@ to fill the passed in ETW data descriptor. return null; } - /// /// WriteMessageEvent, method to write a string with level and Keyword. /// The activity ID will be propagated only if the call stays on the same native thread as SetActivityId(). @@ -487,7 +482,6 @@ public bool WriteMessageEvent(string eventMessage) return WriteMessageEvent(eventMessage, 0, 0); } - /// /// WriteEvent method to write parameters with event schema properties /// @@ -597,7 +591,6 @@ protected bool WriteEvent(ref EventDescriptor eventDescriptor, int dataCount, In return true; } - /// /// WriteTransferEvent, method to write a parameters with event schema properties /// @@ -767,7 +760,6 @@ private static Guid GetActivityId() return t_activityId; } - [System.Security.SecurityCritical] public static void SetActivityId(ref Guid id) { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs index f692701cbc9..c2a9c026e54 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs @@ -1,8 +1,5 @@ -//------------------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using System.Globalization; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs index 120738c142e..71be5f4ca3e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -34,7 +36,6 @@ internal IntPtr GetMemory() return handle; } - public override bool IsInvalid { get diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs index eecfcb274e5..6e7694949a6 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -40,7 +42,6 @@ internal IntPtr GetMemory() return handle; } - public override bool IsInvalid { get diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs index 8b700059f05..bc937391a21 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventBookmark.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs index 435556b0148..3d7c298d821 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventKeyword.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs index 909f18f5ad0..bac4f8db586 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLevel.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs index 88a9942df0e..c8580091f0d 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogConfiguration.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -284,7 +286,6 @@ public void Dispose() GC.SuppressFinalize(this); } - [System.Security.SecuritySafeCritical] protected virtual void Dispose(bool disposing) { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs index 14010a4bdb4..486c45e5723 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogException.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs index fbb5dd8b66c..06222aa8081 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs index 6311574009f..daebcc3787d 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogInformation.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -26,7 +28,6 @@ public sealed class EventLogInformation private long? _oldestRecordNumber; private bool? _isLogFull; - [System.Security.SecuritySafeCritical] internal EventLogInformation(EventLogSession session, string channelName, PathType pathType) { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs index c40819565fa..59417750283 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogLink.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -78,7 +80,6 @@ private void PrepareData() } } - public string LogName { get diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs index c9bed16f3b5..f1ba68016da 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogPropertySelector.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs index 570a8811a4a..65eaee0e6d6 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogQuery.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs index 668e02a1a82..7190cb04a02 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogReader.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs index d71761c08a4..ae1ea29482f 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogRecord.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -68,7 +70,6 @@ internal EventLogHandle Handle } } - internal void PrepareSystemData() { if (_systemProperties.filled) @@ -285,7 +286,6 @@ public IEnumerable MatchedQueryIds } } - public override EventBookmark Bookmark { [System.Security.SecuritySafeCritical] @@ -340,7 +340,6 @@ public override string LevelDisplayName } } - public override string OpcodeDisplayName { get @@ -392,7 +391,6 @@ public override IEnumerable KeywordsDisplayNames } } - public override IList Properties { get diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogSession.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogSession.cs index 8ed35125315..9bf610ca61a 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogSession.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogSession.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -60,7 +62,6 @@ public class EventLogSession : IDisposable // private EventLogHandle _handle = EventLogHandle.Zero; - //setup the System Context, once for all the EventRecords. [System.Security.SecuritySafeCritical] internal void SetupSystemContext() diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogStatus.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogStatus.cs index 0b12cedf3e0..489c47e6e79 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogStatus.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogStatus.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventMetadata.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventMetadata.cs index c6ae17d208e..6a016d50662 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventMetadata.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventMetadata.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -105,7 +107,6 @@ public EventTask Task } } - public IEnumerable Keywords { get diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventOpcode.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventOpcode.cs index f6bc7ad2ea7..64c35238bfb 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventOpcode.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventOpcode.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventProperty.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventProperty.cs index 4cde07513ab..dd9cdecfb4d 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventProperty.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventProperty.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventPropertyContext.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventPropertyContext.cs index 035d053edd2..99c6219955b 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventPropertyContext.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventPropertyContext.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventRecord.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventRecord.cs index 671b8312892..53f3e9132e2 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventRecord.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventRecord.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventTask.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventTask.cs index 620d7135523..1d9e1732578 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventTask.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventTask.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -27,7 +29,6 @@ public sealed class EventTask private ProviderMetadata _pmReference; private object _syncObject; - //called from EventMetadata internal EventTask(int value, ProviderMetadata pmReference) { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs index 73a8d428ce9..0e048b0fc32 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -64,7 +66,6 @@ public static EventLogHandle EvtQuery( return handle; } - [System.Security.SecurityCritical] public static void EvtSeek( EventLogHandle resultSet, @@ -213,7 +214,6 @@ public static void EvtSaveChannelConfig(EventLogHandle channelConfig, int flags) EventLogException.Throw(win32Error); } - [System.Security.SecurityCritical] public static EventLogHandle EvtOpenLog(EventLogHandle session, string path, PathType flags) { @@ -429,7 +429,6 @@ public static object EvtGetPublisherMetadataProperty(EventLogHandle pmHandle, Un } } - [System.Security.SecurityCritical] internal static EventLogHandle EvtGetPublisherMetadataPropertyHandle(EventLogHandle pmHandle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId thePropertyId) { @@ -466,7 +465,6 @@ internal static EventLogHandle EvtGetPublisherMetadataPropertyHandle(EventLogHan } } - // implies UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId flag. [System.Security.SecurityCritical] public static string EvtFormatMessage(EventLogHandle handle, uint msgId) @@ -987,7 +985,6 @@ public static string EvtFormatMessageRenderName(EventLogHandle pmHandle, EventLo return sb.ToString(); } - //The EvtFormatMessage used for the obtaining of the Keywords names. [System.Security.SecuritySafeCritical] public static IEnumerable EvtFormatMessageRenderKeywords(EventLogHandle pmHandle, EventLogHandle eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags flag) @@ -1087,7 +1084,6 @@ public static string EvtRenderBookmark(EventLogHandle eventHandle) } } - //Get the formatted description, using the msgId for FormatDescription(string []) [System.Security.SecuritySafeCritical] public static string EvtFormatMessageFormatDescription(EventLogHandle handle, EventLogHandle eventHandle, string[] values) @@ -1265,7 +1261,6 @@ public static object ConvertToObject(UnsafeNativeMethods.EvtVariant val, UnsafeN if (val.Type != (int)desiredType) throw new EventLogInvalidDataException(); - return ConvertToObject(val); } @@ -1287,7 +1282,6 @@ public static string ConvertToAnsiString(UnsafeNativeMethods.EvtVariant val) return Marshal.PtrToStringAnsi(val.AnsiString); } - [System.Security.SecurityCritical] public static EventLogHandle ConvertToSafeHandle(UnsafeNativeMethods.EvtVariant val) { @@ -1297,7 +1291,6 @@ public static EventLogHandle ConvertToSafeHandle(UnsafeNativeMethods.EvtVariant return new EventLogHandle(val.Handle, true); } - [System.Security.SecurityCritical] public static Array ConvertToArray(UnsafeNativeMethods.EvtVariant val, int size) where T : struct { @@ -1381,7 +1374,6 @@ public static Array ConvertToSysTimeArray(UnsafeNativeMethods.EvtVariant val) } } - [System.Security.SecurityCritical] public static string[] ConvertToStringArray(UnsafeNativeMethods.EvtVariant val, bool ansi) { diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadata.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadata.cs index 0843386d611..5ff0706e3c3 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadata.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadata.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -178,7 +180,6 @@ public IList LogLinks List channelList = new List(arraySize); - for (int index = 0; index < arraySize; index++) { string channelName = (string)NativeWrapper.EvtGetObjectArrayProperty(elHandle, index, (int)UnsafeNativeMethods.EvtPublisherMetadataPropertyId.EvtPublisherMetadataChannelReferencePath); @@ -405,7 +406,6 @@ internal object GetProviderListProperty(EventLogHandle providerHandle, UnsafeNat generalDisplayName = NativeWrapper.EvtFormatMessage(providerHandle, unchecked((uint)generalMessageId)); } - switch (objectTypeName) { case ObjectTypeName.Level: @@ -445,7 +445,6 @@ internal object GetProviderListProperty(EventLogHandle providerHandle, UnsafeNat } } - public IList Levels { get @@ -498,7 +497,6 @@ public IList Keywords } } - public IList Tasks { get @@ -516,7 +514,6 @@ public IList Tasks } } - public IEnumerable Events { [System.Security.SecurityCritical] diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadataCachedInformation.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadataCachedInformation.cs index 6fedf2f149f..feb1823cc3c 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadataCachedInformation.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/ProviderMetadataCachedInformation.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** @@ -129,7 +131,6 @@ private void DeleteCacheEntry(ProviderMetadataId key) value.ProviderMetadata.Dispose(); } - private void AddCacheEntry(ProviderMetadataId key, ProviderMetadata pm) { if (IsCacheFull()) diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/Winmeta.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/Winmeta.cs index 47746d76868..0534158c2a8 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/Winmeta.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/Winmeta.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /*============================================================ ** diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs index c2a43ba09e9..3089ce8b17e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs @@ -1,4 +1,5 @@ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Diagnostics.Eventing { @@ -78,7 +79,6 @@ internal static class UnsafeNativeMethods private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; - [DllImport(FormatMessageDllName, CharSet = CharSet.Unicode, BestFitMapping = false)] [SecurityCritical] internal static extern int FormatMessage(int dwFlags, IntPtr lpSource, @@ -140,7 +140,6 @@ [In][Out]ref long registrationHandle [SecurityCritical] internal static extern int EventUnregister([In] long registrationHandle); - // // Control (Is Enabled) APIs // @@ -524,7 +523,6 @@ internal struct EvtRpcLogin public int Flags; } - //SEEK [Flags] internal enum EvtSeekFlags @@ -682,7 +680,6 @@ internal static extern bool EvtGetEventMetadataProperty( out int eventMetadataPropertyBufferUsed ); - //Channel Configuration Native Api [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] @@ -703,7 +700,6 @@ internal static extern bool EvtNextChannelPath( out int channelPathBufferUsed ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] internal static extern EventLogHandle EvtOpenPublisherEnum( @@ -737,7 +733,6 @@ internal static extern bool EvtSaveChannelConfig( int flags ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -748,7 +743,6 @@ internal static extern bool EvtSetChannelConfigProperty( ref EvtVariant propertyValue ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -771,7 +765,6 @@ internal static extern EventLogHandle EvtOpenLog( [MarshalAs(UnmanagedType.I4)]PathType flags ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -839,7 +832,6 @@ internal static extern bool EvtRender( out int propCount ); - [DllImport(WEVTAPI, EntryPoint = "EvtRender", CallingConvention = CallingConvention.Winapi, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -853,7 +845,6 @@ internal static extern bool EvtRender( out int propCount ); - [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] internal struct EvtStringVariant { diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs index 65540314dcc..70b2e9f18cc 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -11,7 +14,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -94,7 +96,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +105,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -125,7 +125,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// @@ -209,7 +208,6 @@ private LocalPrincipal MakePrincipal(string groupId, LocalPrincipal member) return null; } - /// /// Determine if a principal should be processed. /// Just a wrapper around Cmdlet.ShouldProcess, with localized string diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs index 9d7d4c5ca3c..eb47f20ec8a 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -10,7 +13,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -91,7 +93,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -101,7 +102,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -119,7 +119,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs index cf0562f23f5..f872439c55c 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -10,7 +13,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -91,9 +93,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -103,7 +102,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -121,7 +119,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs index bd93d56fa6e..69c1416a787 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -61,9 +63,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -73,7 +72,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -91,7 +89,6 @@ protected override void ProcessRecord() ProcessSids(); } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs index 0acb4d03ded..a9f28b792c3 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -8,7 +11,6 @@ using System.Management.Automation.SecurityAccountsManager.Extensions; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -92,7 +94,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -102,7 +103,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -128,7 +128,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs index e37acc70611..d5a33ac357e 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -8,7 +11,6 @@ using System.Management.Automation.SecurityAccountsManager.Extensions; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -64,8 +66,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -75,7 +75,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -93,7 +92,6 @@ protected override void ProcessRecord() ProcessSids(); } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs index 35a6272de96..d7283d54308 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -57,8 +59,6 @@ public string Name private string name; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -68,7 +68,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -93,7 +92,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs index 70690eb8584..566a3039c0c 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -179,8 +181,6 @@ public System.Management.Automation.SwitchParameter UserMayNotChangePassword private System.Management.Automation.SwitchParameter usermaynotchangepassword; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -195,7 +195,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -250,7 +249,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs index cb93071ca5d..cccc31e7915 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -9,7 +12,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -84,7 +86,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -94,7 +95,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -112,7 +112,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs index b8c87bef98a..26c5914fafb 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Collections.Generic; @@ -11,7 +14,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -94,7 +96,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +105,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -125,7 +125,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs index cbcef6ef48f..a5e36fcc81f 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -9,7 +12,6 @@ using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -85,8 +87,6 @@ public System.Security.Principal.SecurityIdentifier[] SID private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -96,7 +96,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -114,7 +113,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs index 25254cf05fc..a1e458e6d10 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -95,7 +97,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -105,7 +106,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -123,7 +123,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs index 4a48b659e62..c731820caa6 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -95,8 +97,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -106,7 +106,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -124,7 +123,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs index eeaf701bffd..b22806aad9d 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -93,8 +95,6 @@ public System.Security.Principal.SecurityIdentifier SID private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +104,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -148,7 +147,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs index 4ae4e422d39..0b3e4b2fbec 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #region Using directives using System; using System.Management.Automation; @@ -8,7 +11,6 @@ using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -185,8 +187,6 @@ public System.Boolean UserMayChangePassword private System.Boolean usermaychangepassword; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -201,7 +201,6 @@ protected override void BeginProcessing() sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -278,7 +277,6 @@ protected override void ProcessRecord() } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs index a9f7193efe4..679c89d009b 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Management.Automation; using System.Management.Automation.SecurityAccountsManager; using System.Runtime.Serialization; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs index 86ef63e3ef7..0a956c10867 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs @@ -1,4 +1,7 @@ -using System.Runtime.InteropServices; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.InteropServices; using System.Security; using System.Security.Principal; using System.Text.RegularExpressions; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs index 170493522fb..eb544986332 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using Microsoft.PowerShell.LocalAccounts; @@ -47,7 +50,6 @@ private LocalGroup(LocalGroup other) } #endregion Construction - #region Public Methods /// /// Provides a string representation of the LocalGroup object. diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs index 94e5972d265..eef3d02b30f 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs @@ -1,4 +1,7 @@ -using System.Security.Principal; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Security.Principal; namespace Microsoft.PowerShell.Commands { diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs index fb27679feac..12e8832bf0e 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using Microsoft.PowerShell.LocalAccounts; @@ -52,7 +55,6 @@ public class LocalUser : LocalPrincipal /// public bool UserMayChangePassword { get; set; } - /// /// Indicates whether the user must have a password (true) or not (false). /// @@ -69,7 +71,6 @@ public class LocalUser : LocalPrincipal public DateTime? LastLogon { get; set; } #endregion Public Properties - #region Construction /// /// Initializes a new LocalUser object. diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs index 4a085d7867f..e7a7d0ec7f8 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Runtime.InteropServices; using System.Text; @@ -162,7 +165,6 @@ public void Dispose() } } - // These structures are filled in by Marshalling, so fields will be initialized // invisibly to the C# compiler, and some fields will not be used in C# code. #pragma warning disable 0649, 0169 @@ -195,7 +197,6 @@ internal static class Win32 internal const UInt32 STANDARD_RIGHTS_WRITE = READ_CONTROL; internal const UInt32 STANDARD_RIGHTS_EXECUTE = READ_CONTROL; - internal const UInt32 STANDARD_RIGHTS_ALL = 0x001F0000; internal const UInt32 SPECIFIC_RIGHTS_ALL = 0x0000FFFF; @@ -209,7 +210,6 @@ internal static class Win32 internal const UInt32 GENERIC_EXECUTE = 0x20000000; internal const UInt32 GENERIC_ALL = 0x10000000; - // These constants control the behavior of the FormatMessage Windows API function internal const uint FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; internal const uint FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; @@ -335,7 +335,6 @@ internal static class Win32 internal const int NERR_LastAdmin = NERR_BASE + 352; // This operation is not allowed on the last administrative account. #endregion Win32 Error Codes - #region SECURITY_DESCRIPTOR Control Flags internal const UInt16 SE_DACL_PRESENT = 0x0004; internal const UInt16 SE_SELF_RELATIVE = 0x8000; @@ -366,7 +365,6 @@ internal static extern bool LookupAccountName(string systemName, ref uint domainNameLength, out SID_NAME_USE peUse); - [DllImport(PInvokeDllNames.GetSecurityDescriptorDaclDllName, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool GetSecurityDescriptorDacl(IntPtr pSecurityDescriptor, diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs index 59e00f0b252..231909c9171 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs @@ -1,4 +1,6 @@ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Diagnostics.CodeAnalysis; namespace System.Management.Automation.SecurityAccountsManager.Native @@ -18,7 +20,6 @@ internal static class NtStatus public const UInt32 STATUS_SEVERITY_INFORMATIONAL = 0x1; public const UInt32 STATUS_SEVERITY_ERROR = 0x3; - public const UInt32 STATUS_SUCCESS = 0x00000000; // // MessageText: @@ -28,11 +29,6 @@ internal static class NtStatus public const UInt32 STATUS_MORE_ENTRIES = 0x00000105; - - - - - ///////////////////////////////////////////////////////////////////////// // // Standard Information values @@ -453,7 +449,6 @@ public static bool IsError(UInt32 ntstatus) return Severity(ntstatus) == STATUS_SEVERITY_ERROR; } - /// /// Determine if an NTSTATUS value indicates a Warning /// @@ -480,7 +475,6 @@ public static bool IsInformational(UInt32 ntstatus) return Severity(ntstatus) == STATUS_SEVERITY_INFORMATIONAL; } - /// /// Return the Severity part of an NTSTATUS value /// @@ -493,7 +487,6 @@ public static uint Severity(UInt32 ntstatus) return ntstatus >> 30; } - /// /// Return the Facility part of an NSTATUS value /// @@ -508,7 +501,6 @@ public static uint Facility(UInt32 ntstatus) return (ntstatus >> 16) & 0x0FFF; } - /// /// Return the Code part of an NTSTATUS value /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs index 6a4688584f1..026a47ca6f6 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs index b74184e1685..6afc175ae84 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security.AccessControl; using System.Security.Principal; @@ -44,7 +47,6 @@ internal class SamRidEnumeration #endregion Additional members } - /// /// Provides methods for manipulating local Users and Groups. /// @@ -176,7 +178,6 @@ internal enum DomainAccess : uint Max = Win32.MAXIMUM_ALLOWED } - /// /// The operation under way. Used in the class. /// @@ -855,7 +856,6 @@ internal void RemoveLocalUser(LocalUser user) RemoveUser(user.SID); } - /// /// Rename a local user. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs index e0c686ea7c7..a4598947308 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -210,7 +213,6 @@ internal struct USER_LOGON_HOURS_INFORMATION public LOGON_HOURS LogonHours; } - [StructLayout(LayoutKind.Sequential)] internal struct POLICY_PRIMARY_DOMAIN_INFO { @@ -273,7 +275,6 @@ internal static class SamApi internal const UInt32 SAM_USER_ENUMERATION_FILTER_INTERNET = 0x00000002; internal const UInt32 SAM_SERVER_LOOKUP_DOMAIN = 0x0020; - // // Bits to be used in UserAllInformation's WhichFields field (to indicate // which items were queried or set). @@ -311,7 +312,6 @@ internal static class SamApi internal const UInt32 USER_ALL_UNDEFINED_MASK = 0xC0000000; - // // Bit masks for the UserAccountControl member of the USER_ALL_INFORMATION structure // @@ -351,7 +351,6 @@ public static extern UInt32 SamConnect(ref UNICODE_STRING serverName, UInt32 desiredAccess, ref OBJECT_ATTRIBUTES objectAttributes); - [DllImport("samlib.dll")] internal static extern UInt32 SamRidToSid(IntPtr objectHandle, UInt32 rid, out IntPtr sid); @@ -444,7 +443,6 @@ internal static extern UInt32 SamCreateUser2InDomain(IntPtr domainHandle, out UInt32 grantedAccess, out UInt32 relativeId); - [DllImport("samlib.dll")] internal static extern UInt32 SamQueryInformationUser(IntPtr userHandle, USER_INFORMATION_CLASS userInformationClass, diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs index afc20f12612..24943c563c3 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs @@ -1,4 +1,7 @@ -using System.Globalization; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Globalization; using System.Management.Automation.SecurityAccountsManager.Native; namespace System.Management.Automation.SecurityAccountsManager diff --git a/src/Microsoft.PowerShell.PSReadLine/SamplePSReadlineProfile.ps1 b/src/Microsoft.PowerShell.PSReadLine/SamplePSReadlineProfile.ps1 index cfde8a0c817..a1f618c315a 100644 --- a/src/Microsoft.PowerShell.PSReadLine/SamplePSReadlineProfile.ps1 +++ b/src/Microsoft.PowerShell.PSReadLine/SamplePSReadlineProfile.ps1 @@ -425,7 +425,6 @@ Set-PSReadlineKeyHandler -Key F1 ` } } - # # Ctrl+Shift+j then type a key to mark the current directory. # Ctrj+j then the same key will change back to that directory without diff --git a/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs b/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs index 8be32293508..08853e30b8b 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Reflection; using System.Resources; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs index bf61ff71491..5754ed682cf 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -335,7 +335,6 @@ public override void UnblockJobAsync() throw new PSNotSupportedException(); } - /// /// StopJob /// @@ -375,7 +374,6 @@ public override void SuspendJobAsync(bool force, string reason) throw new PSNotSupportedException(); } - #endregion #region Implementation of ISerializable diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs index 826b4cfdc75..a0485ed55c3 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.ObjectModel; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs index 25ad74822b1..858288f3c4c 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs index 37d3eab4b23..5e14b5f12c7 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs index b73dbc7432b..a145b5b5c16 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs index 1ac15ed476d..9daebe32810 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs index e89df8051fe..36713a7a885 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs index 0bfb6d8ae5b..4837a664865 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs index a84de3eacea..bd1ed864a14 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs index 73553266f6b..a6f7f037ed2 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs index e8d73e93f73..ebc4db8774c 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs index fc1e2ef5530..f51ceced32f 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs index 3344785d844..67584690694 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs index 54b8790aa17..494fd080811 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs index a59869d902c..fb1539f6bad 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs index 469176d0f42..dc188dc0676 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs index be12fb0e3e9..07058f03a72 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs index cabb4e3b66b..f7a83d88c92 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs index 224c11a8b5d..55fb9a4c0bd 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs index b451a9fc168..9a48be140b9 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -27,7 +26,6 @@ public sealed class RegisterScheduledJobCommand : ScheduleJobCmdletBase private const string FilePathParameterSet = "FilePath"; private const string ScriptBlockParameterSet = "ScriptBlock"; - /// /// File path for script to be run in job. /// diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs index 757e52f39b9..2456b46de6e 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs index 25509d8cc5e..6021aa6ea97 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs index 135bcc9cb37..89571e90e56 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs index ca3f42809ba..cf7631b47a2 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -26,7 +25,6 @@ public sealed class SetScheduledJobCommand : ScheduleJobCmdletBase private const string ScriptBlockParameterSet = "ScriptBlock"; private const string FilePathParameterSet = "FilePath"; - /// /// Name of scheduled job definition. /// diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs index bfe72b9e073..7a365ea12d2 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs index ef329895bd2..3ebe841629d 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs index 8eea6a6b00a..bde525a2944 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index e4a8d0421d3..40cf6aa33da 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -1,8 +1,5 @@ -#pragma warning disable 1634, 1691 - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -107,7 +104,6 @@ internal CmdletProviderContext CmdletProviderContext } } // CmdletProviderContext - #region brokered properties /// diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index 722a8b07072..08051337a53 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -1,8 +1,7 @@ -#if !UNIX +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +#if !UNIX using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs index 94d032e48a7..024bbbb62ac 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Dbg = System.Management.Automation.Diagnostics; @@ -69,7 +67,6 @@ public string[] LiteralPath // private ArrayList _filesNotFound = new ArrayList(); - /// /// Initializes a new instance of the GetPfxCertificateCommand /// class @@ -123,7 +120,6 @@ protected override void ProcessRecord() string resolvedProviderPath = SecurityUtils.GetFilePathOfExistingFile(this, resolvedPath); - if (resolvedProviderPath == null) { _filesNotFound.Add(p); diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 533cb60767b..01e2db04f11 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Management.Automation; @@ -614,7 +614,6 @@ public CertificateProvider() } } // constructor - /// /// Removes an item at the specified path /// @@ -1321,7 +1320,6 @@ private void AttemptToImportPkiModule() return; } - CommandInfo commandInfo = new CmdletInfo( "Import-Module", @@ -1369,7 +1367,6 @@ private string MyGetChildName(string path) int separatorIndex = path.LastIndexOf(StringLiterals.DefaultPathSeparator); - // Since there was no path separator return the entire path if (separatorIndex == -1) { @@ -2218,7 +2215,6 @@ protected override void GetChildNames( GetChildItemsOrNames(path, false, returnContainers, true, GetFilter()); } // GetChildNames - /// /// Determines if the item at the specified path is a store /// or location. @@ -2877,7 +2873,6 @@ string ICmdletProviderSupportsHelp.GetHelpMaml(string helpItemName, string path) nsMgr.AddNamespace("msh", HelpCommentsParser.mshURI); nsMgr.AddNamespace("command", HelpCommentsParser.commandURI); - // Compose XPath query to select the appropriate node based on the cmdlet string xpathQuery = String.Format( CultureInfo.InvariantCulture, @@ -3245,7 +3240,6 @@ public sealed class EnhancedKeyUsageProperty { private List _ekuList = new List(); - /// /// get property of EKUList /// @@ -3371,7 +3365,6 @@ public DnsNameProperty(X509Certificate2 cert) } } - /// /// downlevel helper function to determine if the OS is WIN8 and above /// @@ -3525,7 +3518,6 @@ internal static List GetStoreNamesAtLocation(StoreLocation location) Security.NativeMethods.CertEnumSystemStoreCallBackProto callBack = new Security.NativeMethods.CertEnumSystemStoreCallBackProto(CertEnumSystemStoreCallBack); - // Return a new list to avoid synchronization issues. List names = new List(); @@ -3544,7 +3536,6 @@ internal static List GetStoreNamesAtLocation(StoreLocation location) return names; } - /// /// call back function used by CertEnumSystemStore /// diff --git a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs index b93a55f5e08..944d14ae46b 100644 --- a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -228,7 +227,6 @@ public string LiteralPath } private string _resolvedPath = null; - /// /// Validate / convert arguments /// @@ -438,7 +436,6 @@ protected override void BeginProcessing() } } - /// /// Processes records from the input pipeline. /// For each input object, the command gets the information diff --git a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs index 1bc1d186d67..cdf7a3ce4c4 100644 --- a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; - namespace Microsoft.PowerShell.Commands { /// diff --git a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs index 6720d3d9c89..f0c318021af 100644 --- a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs b/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs index c426e0d8ce4..83b40529c96 100644 --- a/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -199,7 +198,6 @@ protected override void ProcessRecord() } } - /// /// Defines the implementation of the 'ConvertTo-SecureString' cmdlet. /// This cmdlet imports a new SecureString from encrypted data -- @@ -278,7 +276,6 @@ public SwitchParameter Force } private bool _force; - /// /// Processes records from the input pipeline. /// For each input object, the command decrypts the data, diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index 94f8a8a6913..b7a3e1cb856 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Security/security/Utils.cs b/src/Microsoft.PowerShell.Security/security/Utils.cs index 1e2c758f1d3..2f865bbb739 100644 --- a/src/Microsoft.PowerShell.Security/security/Utils.cs +++ b/src/Microsoft.PowerShell.Security/security/Utils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -157,7 +156,6 @@ ErrorRecord CreateNotSupportedErrorRecord(string resourceStr, return er; } - /// /// Create an error record for 'operation not supported' condition /// @@ -183,7 +181,6 @@ ErrorRecord CreateInvalidArgumentErrorRecord(Exception e, return er; } - /// /// convert the specified provider path to a provider path /// and make sure that all of the following is true: diff --git a/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs b/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs index 222cdc33472..0a1f7372f2e 100644 --- a/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs +++ b/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Runtime.Serialization; diff --git a/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs b/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs index 7f884b13f96..43a3eb71411 100644 --- a/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs +++ b/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index f2a21a1e34e..c4d01b9e3bc 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Collections; @@ -176,7 +176,6 @@ string ICmdletProviderSupportsHelp.GetHelpMaml(string helpItemName, string path) #endregion - #region DriveCmdletProvider /// /// @@ -221,7 +220,6 @@ protected override PSDriveInfo RemoveDrive(PSDriveInfo drive) return drive; } - #endregion #region ItemCmdletProvider @@ -390,8 +388,6 @@ protected override bool HasChildItems(string path) object sessionobj; SessionObjCache.TryGetValue(host, out sessionobj); - - /* WsMan Config Can be divided in to Four Fixed Regions to Check Whether it has Child Items. @@ -574,7 +570,6 @@ protected override void GetItem(string path) return; } - if (path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { //Get the ChildName @@ -866,7 +861,6 @@ protected override void SetItem(string path, object value) return; } - if (path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { //Get the ChildName @@ -1353,7 +1347,6 @@ protected override object SetItemDynamicParameters(string path, object value) return null; } - #endregion #region ContainerCmdletProvider @@ -1426,8 +1419,6 @@ protected override bool IsItemContainer(string path) object sessionobj; SessionObjCache.TryGetValue(host, out sessionobj); - - /* WsMan Config Can be divided in to Four Fixed Regions to Check Whether Item is Container @@ -1491,7 +1482,6 @@ WsMan Config Can be divided in to Four Fixed Regions to Check Whether Item is Co strPathCheck = strPathCheck + WSManStringLiterals.DefaultPathSeparator; XmlDocument xmlPlugins = FindResourceValue(sessionobj, WsManURI, null); - string currentpluginname = string.Empty; GetPluginNames(xmlPlugins, out objPluginNames, out currentpluginname, path); strPathCheck = strPathCheck + currentpluginname; @@ -1616,7 +1606,6 @@ protected override void RemoveItem(string path, bool recurse) string host = GetHostName(path); string uri = NormalizePath(path, host); - //Chk for Winrm Service if (IsPathLocalMachine(host)) { @@ -1644,7 +1633,6 @@ protected override void RemoveItem(string path, bool recurse) string strPathCheck = String.Empty; strPathCheck = host + WSManStringLiterals.DefaultPathSeparator; - if (path.Contains(strPathCheck + WSManStringLiterals.containerPlugin))//(path.Contains(@"\plugin")) { if (path.EndsWith(strPathCheck + WSManStringLiterals.containerPlugin, StringComparison.OrdinalIgnoreCase)) @@ -1766,7 +1754,6 @@ protected override void NewItem(string path, string itemTypeName, object newItem return; } - if (path.Length == 0 || !path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { NewItemCreateComputerConnection(path); @@ -1797,7 +1784,6 @@ protected override void NewItem(string path, string itemTypeName, object newItem Dictionary SessionObjCache = WSManHelper.GetSessionObjCache(); SessionObjCache.TryGetValue(host, out sessionobj); - string strPathChk = host + WSManStringLiterals.DefaultPathSeparator; if (path.Contains(strPathChk + WSManStringLiterals.containerPlugin))//(path.Contains(@"\plugin")) { @@ -2069,7 +2055,6 @@ private void NewItemPluginOrPluginChild(object sessionobj, string path, string h string NewItem = String.Empty; string[] Keys = null; - int pos = path.LastIndexOf(strPathChk + WSManStringLiterals.DefaultPathSeparator, StringComparison.OrdinalIgnoreCase) + strPathChk.Length + 1; int pindex = path.IndexOf(WSManStringLiterals.DefaultPathSeparator, pos); if (pindex != -1) @@ -2089,7 +2074,6 @@ private void NewItemPluginOrPluginChild(object sessionobj, string path, string h ArrayList ResourceArray = ProcessPluginResourceLevel(pxml, out SecurityArray); ArrayList InitParamArray = ProcessPluginInitParamLevel(pxml); - strPathChk = strPathChk + WSManStringLiterals.DefaultPathSeparator + pName + WSManStringLiterals.DefaultPathSeparator; if (path.Contains(strPathChk + WSManStringLiterals.containerResources)) { @@ -3734,7 +3718,6 @@ private void RemoveListenerOrCertMapping(object sessionobj, string WsManUri, str } } - /// /// Used By ItemExists, HasChildItem,IsValidPath, IsItemContainer /// @@ -3763,7 +3746,6 @@ private bool CheckValidContainerOrPath(string path) ChildName = path; } - //Get the wsman host name to find the session object string host = GetHostName(path); @@ -4065,7 +4047,6 @@ private void GetChildItemsOrNames(string path, ProviderMethods methodname, bool throw new InvalidOperationException("InvalidPath"); } - //Checks the WinRM Service if (IsPathLocalMachine(host)) { @@ -4230,8 +4211,6 @@ private void GetChildItemsOrNames(string path, ProviderMethods methodname, bool obj.Properties.Add(new PSNoteProperty(p.Properties["ResourceDir"].Value.ToString(), WSManStringLiterals.ContainerChildValue)); WritePSObjectPropertiesAsWSManElementObjects(obj, path, key, null, WsManElementObjectTypes.WSManConfigContainerElement, recurse); - - //WriteItemObject(new WSManConfigContainerElement(p.Properties["ResourceDir"].Value.ToString(), WSManStringLiterals.ContainerChildValue, key), path + WSManStringLiterals.DefaultPathSeparator + p.Properties["ResourceDir"].Value.ToString(), true); break; case ProviderMethods.GetChildNames: @@ -4585,7 +4564,6 @@ private void GenerateObjectNameAndKeys(Hashtable InputAttributes, string Resourc keys = keysColumns.Split('|'); } - private void ProcessCertMappingObjects(XmlDocument xmlCerts, out Hashtable Certcache, out Hashtable Keyscache) { Hashtable lCache = new Hashtable(); @@ -4790,7 +4768,6 @@ private ArrayList ProcessPluginResourceLevel(XmlDocument xmldoc, out ArrayList a objResource.Properties.Add(new PSNoteProperty("SupportsOptions", false)); } - //Processing capabilities XmlDocument xmlCapabilities = new XmlDocument(); @@ -5365,7 +5342,6 @@ public Hashtable OptionSet } private Hashtable optionset; - /// /// The following is the definition of the input parameter "Authentication". /// This parameter takes a set of authentication methods the user can select @@ -5793,7 +5769,6 @@ public bool Enabled } - #endregion #region Listener Dynamic Parameters @@ -5975,7 +5950,6 @@ public SwitchParameter Concatenate private SwitchParameter _concatenate = false; } - #endregion SetItemDynamicParameters #endregion @@ -6124,7 +6098,6 @@ internal static class WSManStringLiterals /// internal const string containerCertMapping = "Service/certmapping"; - /// /// Possible Values in Plugin Top Level XML /// @@ -6358,11 +6331,7 @@ public string[] Keys private string[] _keys; } - - #endregion "WsMan Output Objects" - } - diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index cfe47a63a51..5112eee6026 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -99,7 +99,6 @@ internal IWSManSession CreateWSManSession() /// access a second hop /// - [Cmdlet(VerbsLifecycle.Disable, "WSManCredSSP", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=141438")] [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")] [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SSP")] @@ -1005,14 +1004,7 @@ protected override void BeginProcessing() #endregion IDisposable Members - - - - } - - - #endregion } diff --git a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs index 02b2038fdb6..aeb78f97bb4 100644 --- a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs +++ b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs @@ -1,19 +1,5 @@ -//------------------------------------------------------------------ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -// -// Pankaj Sarda -// -// -// -// Class that queries the server and gets current configurations. -// Also provides a generic way to update the configurations. -// -// -// -//------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.WSMan.Management { diff --git a/src/Microsoft.WSMan.Management/Interop.cs b/src/Microsoft.WSMan.Management/Interop.cs index 5d8a6802db4..4d526f01501 100644 --- a/src/Microsoft.WSMan.Management/Interop.cs +++ b/src/Microsoft.WSMan.Management/Interop.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -22,8 +22,6 @@ namespace Microsoft.WSMan.Management #region "public Api" - - #region WsManEnumFlags /// _WSManEnumFlags enumeration. @@ -60,9 +58,6 @@ public enum WSManEnumFlags #endregion WsManEnumFlags - - - #region WsManSessionFlags /// WSManSessionFlags enumeration. /// @@ -388,7 +383,6 @@ void SetProxy(int accessType, int ProxyAuthenticationUseDigest(); }; - #endregion IWSManConnectionOptions #region IWSManEnumerator @@ -498,7 +492,6 @@ public interface IWSManEx object CreateSession([MarshalAs(UnmanagedType.BStr)] string connection, int flags, [MarshalAs(UnmanagedType.IDispatch)] object connectionOptions); #endif - /// CreateConnectionOptions method of IWSManEx interface. /// An original IDL definition of CreateConnectionOptions method was the following: HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue); // IDL: HRESULT CreateConnectionOptions ([out, retval] IDispatch** ReturnValue); @@ -511,7 +504,6 @@ public interface IWSManEx #endif object CreateConnectionOptions(); - /// /// /// @@ -540,12 +532,10 @@ string Error get; } - /// CreateResourceLocator method of IWSManEx interface. /// An original IDL definition of CreateResourceLocator method was the following: HRESULT CreateResourceLocator ([optional, defaultvalue("")] BSTR strResourceLocator, [out, retval] IDispatch** ReturnValue); // IDL: HRESULT CreateResourceLocator ([optional, defaultvalue("")] BSTR strResourceLocator, [out, retval] IDispatch** ReturnValue); - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "str")] [DispId(5)] #if CORECLR @@ -567,7 +557,6 @@ string Error /// An original IDL definition of SessionFlagCredUsernamePassword method was the following: HRESULT SessionFlagCredUsernamePassword ([out, retval] long* ReturnValue); // IDL: HRESULT SessionFlagCredUsernamePassword ([out, retval] long* ReturnValue); - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Username")] [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cred")] [DispId(7)] @@ -717,7 +706,6 @@ string Error [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")] - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sel")] [Guid("A7A1BA28-DE41-466A-AD0A-C4059EAD7428")] @@ -729,7 +717,6 @@ string Error [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] #endif - public interface IWSManResourceLocator { #if CORECLR @@ -775,7 +762,6 @@ string ResourceUri // Add selector to resource locator // IDL: HRESULT AddSelector (BSTR resourceSelName, VARIANT selValue); - [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "resource")] [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "sel")] [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sel")] @@ -787,8 +773,6 @@ string ResourceUri // Clear all selectors // IDL: HRESULT ClearSelectors (void); - - [DispId(3)] void ClearSelectors(); @@ -810,7 +794,6 @@ string FragmentPath set; } - /// FragmentDialect property of IWSManResourceLocator interface. Gets the Fragment dialect /// An original IDL definition of FragmentDialect property was the following: BSTR FragmentDialect; // Gets the Fragment dialect @@ -837,7 +820,6 @@ string FragmentDialect [DispId(6)] void AddOption([MarshalAs(UnmanagedType.BStr)] string OptionName, object OptionValue, int mustComply); - /// MustUnderstandOptions property of IWSManResourceLocator interface. Sets the MustUnderstandOptions value /// An original IDL definition of MustUnderstandOptions property was the following: long MustUnderstandOptions; // Sets the MustUnderstandOptions value @@ -855,7 +837,6 @@ int MustUnderstandOptions set; } - /// ClearOptions method of IWSManResourceLocator interface. Clear all options /// An original IDL definition of ClearOptions method was the following: HRESULT ClearOptions (void); // Clear all options @@ -864,8 +845,6 @@ int MustUnderstandOptions [DispId(8)] void ClearOptions(); - - /// Error property of IWSManResourceLocator interface. /// An original IDL definition of Error property was the following: BSTR Error; // IDL: BSTR Error; @@ -882,8 +861,6 @@ string Error get; } - - } #endregion IWsManResourceLocator @@ -922,7 +899,6 @@ public interface IWSManSession /// An original IDL definition of Get method was the following: HRESULT Get (VARIANT resourceUri, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); // IDL: HRESULT Get (VARIANT resourceUri, [optional, defaultvalue(0)] long flags, [out, retval] BSTR* ReturnValue); - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] [DispId(1)] [return: MarshalAs(UnmanagedType.BStr)] @@ -965,7 +941,6 @@ public interface IWSManSession [DispId(5)] String Invoke([MarshalAs(UnmanagedType.BStr)] string actionURI, [In] object resourceUri, [MarshalAs(UnmanagedType.BStr)] string parameters, [In] int flags); - /// Enumerate method of IWSManSession interface. /// An original IDL definition of Enumerate method was the following: HRESULT Enumerate (VARIANT resourceUri, [optional, defaultvalue("")] BSTR filter, [optional, defaultvalue("")] BSTR dialect, [optional, defaultvalue(0)] long flags, [out, retval] IDispatch** ReturnValue); // IDL: HRESULT Enumerate (VARIANT resourceUri, [optional, defaultvalue("")] BSTR filter, [optional, defaultvalue("")] BSTR dialect, [optional, defaultvalue(0)] long flags, [out, retval] IDispatch** ReturnValue); @@ -1001,7 +976,6 @@ string Error get; } - /// BatchItems property of IWSManSession interface. /// An original IDL definition of BatchItems property was the following: long BatchItems; // IDL: long BatchItems; @@ -1018,7 +992,6 @@ int BatchItems set; } - /// Timeout property of IWSManSession interface. /// An original IDL definition of Timeout property was the following: long Timeout; // IDL: long Timeout; @@ -1068,7 +1041,6 @@ public interface IWSManResourceLocatorInternal #endregion IWSManResourceLocatorInternal - /// WSMan interface. [Guid("BCED617B-EC03-420b-8508-977DC7A686BD")] [ComImport] diff --git a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs index 6d9aba72967..936f97dd639 100644 --- a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs +++ b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -14,8 +14,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - - namespace Microsoft.WSMan.Management { /// @@ -206,7 +204,6 @@ public Hashtable ValueSet } private Hashtable valueset; - /// /// The following is the definition of the input parameter "ResourceURI". /// URI of the resource class/instance representation @@ -223,13 +220,11 @@ public Uri ResourceURI } private Uri resourceuri; - private WSManHelper helper; IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); IWSManSession m_session = null; string connectionStr = string.Empty; - /// /// BeginProcessing method. /// @@ -242,7 +237,6 @@ protected override void BeginProcessing() //create the connection string connectionStr = helper.CreateConnectionString(connectionuri, port, computername, applicationname); - } /// @@ -251,7 +245,6 @@ protected override void BeginProcessing() protected override void ProcessRecord() { - try { //create the resourcelocator object @@ -321,9 +314,5 @@ protected override void EndProcessing() } - - - - }//End Class } diff --git a/src/Microsoft.WSMan.Management/NewWSManSession.cs b/src/Microsoft.WSMan.Management/NewWSManSession.cs index ab730bcdd26..c927bbc88a7 100644 --- a/src/Microsoft.WSMan.Management/NewWSManSession.cs +++ b/src/Microsoft.WSMan.Management/NewWSManSession.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -15,8 +15,6 @@ using System.Diagnostics.CodeAnalysis; using System.Net; - - namespace Microsoft.WSMan.Management { /// @@ -28,7 +26,6 @@ namespace Microsoft.WSMan.Management /// Connect-WSMan /// - [Cmdlet(VerbsCommon.New, "WSManSessionOption", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=141449")] public class NewWSManSessionOptionCommand : PSCmdlet { @@ -87,7 +84,6 @@ public PSCredential ProxyCredential } private PSCredential _proxycredential; - /// /// The following is the definition of the input parameter "SkipCACheck". /// When connecting over HTTPS, the client does not validate that the server @@ -211,10 +207,6 @@ public SwitchParameter UseUTF16 } private bool useutf16; - - - - /// /// BeginProcessing method. /// @@ -241,8 +233,6 @@ protected override void BeginProcessing() return; } - - //Creating the Session Object SessionOption objSessionOption = new SessionOption(); diff --git a/src/Microsoft.WSMan.Management/PingWSMan.cs b/src/Microsoft.WSMan.Management/PingWSMan.cs index 21e9bd95695..66dd6800b28 100644 --- a/src/Microsoft.WSMan.Management/PingWSMan.cs +++ b/src/Microsoft.WSMan.Management/PingWSMan.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -14,7 +14,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.WSMan.Management { @@ -124,7 +123,6 @@ public String ApplicationName } private String applicationname = null; - /// /// ProcessRecord method. /// diff --git a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs index 6edb2b0d0ed..c7378949be1 100644 --- a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs +++ b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -14,7 +14,6 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.WSMan.Management { #region Set-WsManQuickConfig @@ -91,11 +90,8 @@ protected override void BeginProcessing() QuickConfigRemoting(false); }//End BeginProcessing() - - #region private - private void QuickConfigRemoting(bool serviceonly) { IWSManSession m_SessionObj = null; @@ -112,7 +108,6 @@ private void QuickConfigRemoting(bool serviceonly) string xpathStatus = string.Empty; string xpathResult = string.Empty; - if (!usessl) { transport = "http"; @@ -134,7 +129,6 @@ private void QuickConfigRemoting(bool serviceonly) action = "Analyze"; } - string analysisOutputXml = m_SessionObj.Invoke(action, "winrm/config/service", analysisInputXml, 0); XmlDocument resultopxml = new XmlDocument(); resultopxml.LoadXml(analysisOutputXml); @@ -152,8 +146,6 @@ private void QuickConfigRemoting(bool serviceonly) xpathUpdate = "/cfg:Analyze_OUTPUT/cfg:EnableRemoting_INPUT"; } - - XmlNamespaceManager nsmgr = new XmlNamespaceManager(resultopxml.NameTable); nsmgr.AddNamespace("cfg", "http://schemas.microsoft.com/wbem/wsman/1/config/service"); string enabled = resultopxml.SelectSingleNode(xpathEnabled, nsmgr).InnerText; diff --git a/src/Microsoft.WSMan.Management/WSManConnections.cs b/src/Microsoft.WSMan.Management/WSManConnections.cs index dd8b14e20cf..b63d3d5d2e1 100644 --- a/src/Microsoft.WSMan.Management/WSManConnections.cs +++ b/src/Microsoft.WSMan.Management/WSManConnections.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -16,7 +16,6 @@ using System.Diagnostics.CodeAnalysis; using Dbg = System.Management.Automation; - namespace Microsoft.WSMan.Management { #region Base class for cmdlets taking credential, authentication, certificatethumbprint @@ -227,8 +226,6 @@ public SwitchParameter UseSSL } private SwitchParameter usessl; - - #endregion /// @@ -356,8 +353,6 @@ protected override void BeginProcessing() } }//End BeginProcessing() - - }//End Class #endregion Disconnect-WSMAN } diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index 96dfa8e8434..8b968e6b9d6 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Reflection; @@ -17,7 +17,6 @@ using Dbg = System.Management.Automation; using System.Globalization; - namespace Microsoft.WSMan.Management { #region Get-WSManInstance @@ -579,7 +578,6 @@ protected override void ProcessRecord() #endregion IDisposable Members - /// /// BeginProcessing method. /// @@ -589,7 +587,6 @@ protected override void EndProcessing() helper.CleanUp(); } - } #endregion @@ -685,7 +682,6 @@ public string FilePath } private string filepath; - /// /// The following is the definition of the input parameter "Fragment". /// Specifies a section inside the instance that is to be updated or retrieved @@ -816,8 +812,6 @@ public Hashtable ValueSet } private Hashtable valueset; - - #endregion private WSManHelper helper ; @@ -831,7 +825,6 @@ protected override void ProcessRecord() helper.WSManOp = "set"; IWSManSession m_session = null; - if (dialect != null) { if (dialect.ToString().Equals(helper.ALIAS_WQL, StringComparison.CurrentCultureIgnoreCase)) @@ -941,11 +934,8 @@ protected override void EndProcessing() } - - #endregion - #region Remove-WsManInstance /// @@ -1111,12 +1101,8 @@ public SwitchParameter UseSSL } private SwitchParameter usessl; - - - #endregion - /// /// ProcessRecord method. /// @@ -1200,10 +1186,8 @@ protected override void ProcessRecord() #endregion IDisposable Members - } - #endregion #region New-WsManInstance @@ -1418,7 +1402,6 @@ protected override void BeginProcessing() }//End BeginProcessing() - /// /// ProcessRecord method. /// diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index f0843fad94a..45e906510dc 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Collections.Generic; using System.Text; @@ -88,7 +88,6 @@ internal class WSManHelper private static ResourceManager _resourceMgr = new ResourceManager("Microsoft.WSMan.Management.resources.WsManResources", typeof(WSManHelper).GetTypeInfo().Assembly); - // // //Below class is just a static container which would release sessions in case this DLL is unloaded. @@ -109,7 +108,6 @@ internal class Sessions // // - internal static void ReleaseSessions() { lock (Sessions.SessionObjCache) @@ -200,7 +198,6 @@ static private string FormatResourceMsgFromResourcetextS( return result; } - /// /// add a session to dictionary /// @@ -568,7 +565,6 @@ internal IWSManResourceLocator InitializeResourceLocator(Hashtable optionset, Ha { m_resource = (IWSManResourceLocator)wsmanObj.CreateResourceLocator(resource); - if (optionset != null) { foreach (DictionaryEntry entry in optionset) @@ -765,7 +761,6 @@ internal IWSManSession CreateSessionObject(IWSManEx wsmanObject, AuthenticationM connObject.SetProxy((int)sessionoption.ProxyAccessType, (int)sessionoption.ProxyAuthentication, null, null); } - } if (sessionoption.SkipCACheck) { @@ -830,7 +825,6 @@ internal IWSManSession CreateSessionObject(IWSManEx wsmanObject, AuthenticationM internal void CleanUp() { - if (_sr != null) { _sr.Dispose(); @@ -1097,7 +1091,6 @@ internal static void LoadResourceData() throw (e); } - } /// @@ -1126,6 +1119,5 @@ internal static string GetResourceString(string Key) /// private static Dictionary ResourceValueCache = new Dictionary(); - } } diff --git a/src/Microsoft.WSMan.Management/WsManSnapin.cs b/src/Microsoft.WSMan.Management/WsManSnapin.cs index b47e57f424f..8f7ed601778 100644 --- a/src/Microsoft.WSMan.Management/WsManSnapin.cs +++ b/src/Microsoft.WSMan.Management/WsManSnapin.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.Diagnostics; using System.Text; diff --git a/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs b/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs index 0a5a9c2268d..0477dcc7aee 100644 --- a/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs +++ b/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Xml; @@ -16,10 +16,6 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; - - - - [assembly: CLSCompliant(true)] namespace Microsoft.WSMan.Management { diff --git a/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 index 88a0034539f..56bb9287184 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 @@ -1,6 +1,6 @@ @{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 b/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 index cd915abe7ae..c55839fd440 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. ## Converts a SDDL string into an object-based representation of a security ## descriptor diff --git a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index c270ed53848..1eef40c487d 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -1,6 +1,6 @@ @{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 index 20df5b5ea26..5afb77fe13c 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -1,6 +1,6 @@ @{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index 65f4c80fc5b..b6ae4542427 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -1,6 +1,6 @@ @{ GUID="1DA87E53-152B-403E-98DC-74D7B4D63D59" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Windows-Core+Full/CimCmdlets/CimCmdlets.psd1 b/src/Modules/Windows-Core+Full/CimCmdlets/CimCmdlets.psd1 index 049f89c7d10..f43e7df4ab3 100644 --- a/src/Modules/Windows-Core+Full/CimCmdlets/CimCmdlets.psd1 +++ b/src/Modules/Windows-Core+Full/CimCmdlets/CimCmdlets.psd1 @@ -1,6 +1,6 @@ @{ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" diff --git a/src/Modules/Windows-Core+Full/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Windows-Core+Full/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 index 34343b00634..5ce8045b8b5 100644 --- a/src/Modules/Windows-Core+Full/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Windows-Core+Full/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -1,6 +1,6 @@ @{ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Windows-Core+Full/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 b/src/Modules/Windows-Core+Full/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 index 52c5e2ab83a..5049c15af56 100644 --- a/src/Modules/Windows-Core+Full/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 +++ b/src/Modules/Windows-Core+Full/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 @@ -1,6 +1,6 @@ @{ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psd1 b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psd1 index a84bd87f3c6..fe88525544e 100644 --- a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psd1 +++ b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psd1 @@ -1,6 +1,6 @@ @{ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " - Author="Microsoft Corporation" + Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" diff --git a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 index 524f2ccb73e..d0b184bf44c 100644 --- a/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 +++ b/src/Modules/Windows-Core+Full/PSDiagnostics/PSDiagnostics.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + <# Windows PowerShell Diagnostics Module This module contains a set of wrapper scripts that @@ -434,7 +437,6 @@ namespace Microsoft.PowerShell.Diagnostics } "@ - if ($psedition -eq 'Core') { # Currently we only support these cmdlets as logman.exe is not working on Nano/Lot system. diff --git a/src/Modules/Windows-Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Windows-Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 index af936717b68..1eaafbce6ab 100644 --- a/src/Modules/Windows-Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 +++ b/src/Modules/Windows-Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 @@ -1,6 +1,6 @@ @{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index 4c48be5e2a8..04d4e360645 100644 --- a/src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -1,6 +1,6 @@ @{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index 6aa5b03d76a..35a987c1c8b 100644 --- a/src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -1,6 +1,6 @@ @{ GUID="1DA87E53-152B-403E-98DC-74D7B4D63D59" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Windows-Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 index 5d95cfb3a7d..6db471f5247 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 @@ -1,6 +1,6 @@ @{ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.0.0.0" diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 b/src/Modules/Windows-Full/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 index 8f682e53675..dd879947383 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 @@ -2,7 +2,7 @@ RootModule = 'Microsoft.Powershell.LocalAccounts' ModuleVersion = '1.0.0.0' GUID = '8e362604-2c0b-448f-a414-a6a690a644e2' -Author = 'Microsoft Corporation' +Author = 'PowerShell' CompanyName = 'Microsoft Corporation' Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' Description = 'Provides cmdlets to work with local users and local groups' diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Windows-Full/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index 1f68c7822b5..e7a43cf4aea 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -1,6 +1,6 @@ @{ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 index 0c0921821d9..967268f8bbf 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 @@ -1,5 +1,7 @@ -Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # Add .NET classes used by the module Add-Type -TypeDefinition $global:BaseClassDefinitions @@ -813,7 +815,6 @@ function GenerateGetProxyCmdlet } } - # Add Query Parameters (i.e., Top, Skip, OrderBy, Filter) to the generated Get-* cmdlets. $queryParameters = @{ diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 index 4f1b1e47012..b4ad19bd6f5 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 @@ -16,7 +16,7 @@ ModuleVersion = '1.0' GUID = 'fa1606d1-94cb-4264-bfb6-def714420084' # Author of this module -Author = 'Microsoft Corporation' +Author = 'PowerShell' # Company or vendor of this module CompanyName = 'Microsoft Corporation' diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 index 9d5e5254726..2909c7f731b 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 @@ -1,5 +1,7 @@ -Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # This module doesn't support Arm because of Add-Type cmdlet $ProcessorArchitecture = (Get-WmiObject -query "Select Architecture from Win32_Processor").Architecture diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 index 473d39909e2..d332635db6a 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # Base class definitions used by the actual Adapter modules $global:BaseClassDefinitions = @" using System; diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 index 9ecd112b2e8..b19636df0f1 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Import-LocalizedData LocalizedData -FileName Microsoft.PowerShell.ODataUtilsStrings.psd1 # Add .NET classes used by the module @@ -384,7 +387,6 @@ function ParseTypeDefinitions if($null -eq $SchemaXML) { throw ($LocalizedData.ArguementNullError -f "SchemaXML", "ParseTypeDefinitions") } - foreach ($typeDefinition in $SchemaXML.TypeDefinition) { $newType = [ODataUtils.EntityTypeV4] @{ @@ -779,7 +781,6 @@ function VerifyMetadata $validEntitySets = @() $sessionCommands = Get-Command -All - foreach ($metadata in $metadataSet) { foreach ($entitySet in $metadata.EntitySets) @@ -1653,7 +1654,6 @@ function SaveCDXMLInstanceCmdlets } $xmlWriter.WriteAttributeString('DefaultCmdletParameterSet', $defaultCmdletParameterSet) - $xmlWriter.WriteStartElement('QueryableProperties') $position = 0 @@ -1758,7 +1758,6 @@ function SaveCDXMLInstanceCmdlets $xmlWriter.WriteEndElement() } - $xmlWriter.WriteEndElement() } @@ -2665,4 +2664,4 @@ namespace $($dotNetNamespace) Write-Verbose ($LocalizedData.VerboseSavedTypeDefinationModule -f $typeDefinationFileName, $OutputModule) return $complexTypeMapping -} \ No newline at end of file +} diff --git a/src/Modules/Windows-Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Windows-Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index 4a48f4ec1e7..b8bd33f155d 100644 --- a/src/Modules/Windows-Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Windows-Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -1,6 +1,6 @@ @{ GUID="1DA87E53-152B-403E-98DC-74D7B4D63D59" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="3.1.0.0" diff --git a/src/Modules/Windows-Full/PSScheduledJob/PSScheduledJob.psd1 b/src/Modules/Windows-Full/PSScheduledJob/PSScheduledJob.psd1 index a8ed0ab830d..d2831607ee4 100644 --- a/src/Modules/Windows-Full/PSScheduledJob/PSScheduledJob.psd1 +++ b/src/Modules/Windows-Full/PSScheduledJob/PSScheduledJob.psd1 @@ -6,7 +6,7 @@ ModuleVersion = '1.1.0.0' GUID = '50cdb55f-5ab7-489f-9e94-4ec21ff51e59' -Author = 'Microsoft Corporation' +Author = 'PowerShell' CompanyName = 'Microsoft Corporation' diff --git a/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 b/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 index 4c5246ff53a..44a39ed0885 100644 --- a/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 +++ b/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + <# .Synopsis Registers or unregisters the PowerShell ETW manifest diff --git a/src/ResGen/Program.cs b/src/ResGen/Program.cs index 8bc235b14a0..1dd69f15386 100644 --- a/src/ResGen/Program.cs +++ b/src/ResGen/Program.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Collections.Generic; using System.IO; using System.Text; diff --git a/src/System.Management.Automation/AssemblyInfo.cs b/src/System.Management.Automation/AssemblyInfo.cs index b652d90d536..265370dbe36 100644 --- a/src/System.Management.Automation/AssemblyInfo.cs +++ b/src/System.Management.Automation/AssemblyInfo.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Runtime.CompilerServices; using System.Reflection; using System.Resources; diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index bbc4f565c28..2d73ba752fb 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if CORECLR diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 4a21405f653..7d5dee725e6 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Runtime.InteropServices; @@ -661,7 +660,6 @@ public static bool IsHardLink(ref IntPtr handle) return false; } - public static bool IsHardLink(FileSystemInfo fs) { if (!fs.Exists || (fs.Attributes & FileAttributes.Directory) == FileAttributes.Directory) diff --git a/src/System.Management.Automation/CoreCLR/CorePsStub.cs b/src/System.Management.Automation/CoreCLR/CorePsStub.cs index 3170b545884..d8ca4a0a3ac 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsStub.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsStub.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -739,7 +738,6 @@ internal enum SystemEnforcementMode } } - #if UNIX // Porting note: Tracing is absolutely not available on Linux @@ -978,7 +976,6 @@ public bool WriteMessage(string message, Guid instanceId) return false; } - /// /// /// diff --git a/src/System.Management.Automation/CoreCLR/EventResource.cs b/src/System.Management.Automation/CoreCLR/EventResource.cs index 9ff6f38d402..2adf60428e8 100755 --- a/src/System.Management.Automation/CoreCLR/EventResource.cs +++ b/src/System.Management.Automation/CoreCLR/EventResource.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if UNIX /* This code was generated by the tools\ResxGen\ResxGen.ps1 run against PowerShell-Core-Instrumentation.man. diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index 8aac81ca451..b66740b4835 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using Microsoft.Management.Infrastructure; using Microsoft.Management.Infrastructure.Generic; using Microsoft.Management.Infrastructure.Serialization; @@ -2738,7 +2741,6 @@ internal static string MapTypeToMofType(Type type, String memberName, String cla } } - bool supported = false; bool missingDefaultConstructor = false; if (type.GetTypeInfo().IsValueType) @@ -3731,7 +3733,6 @@ function Test-DependsOn } } - if($null -ne $value['ExclusiveResources']) { # make sure the references are well-formed @@ -3899,7 +3900,6 @@ function Test-DependsOn } } - # Generate the MOF text for this resource instance. # when generate mof text for OMI_ConfigurationDocument we handle below two cases: # 1. we will add versioning related property based on meta configuration instance already process @@ -3926,4 +3926,3 @@ function Test-DependsOn } } - diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs index ebbb08a5e82..07277a8cd46 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs index 6a733afd4d8..712977f765a 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs index 6e7d3d7eebb..7e083ef66d9 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs index 317cd605172..b68e036edc6 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs index f2db072630b..0eede35767e 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs index b92f990b9c4..b29fb2c5dad 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs index 3e1fb82f9df..e9f8842ee9a 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs index e19d0dc9a55..682acddb14d 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs index 03dd42b3eb2..ef0a79e12a6 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs index 05f07cb6c55..cfb6d5aa4b7 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs index cec51adf5d1..d11b1538edb 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs index 736f5339997..80658c30c36 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -31,7 +30,6 @@ internal void ThrowTerminatingError(ErrorRecord errorRecord) private PSCmdlet _command; } - /// /// helper class to invoke a command in a secondary pipeline. /// NOTE: this implementation does not return any error messages @@ -67,7 +65,6 @@ internal void AddNamedParameter(string parameterName, object parameterValue) false)); } - /// /// send an object to the pipeline /// @@ -232,7 +229,6 @@ protected virtual void WriteObjectCall(object value) /// internal ImplementationCommandBase implementation = null; - #region IDisposable Implementation /// @@ -377,7 +373,6 @@ internal void CreateTerminatingErrorContext() /// internal WriteObjectCallback WriteObjectCall; - #region IDisposable Implementation /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs index 14ca8b34fdf..136a91cb59c 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; @@ -377,7 +376,6 @@ private void WriteErrorRecords(List errorRecordList) } } - internal override void EndProcessing() { // need to pop all the contexts, in case the transmission sequence @@ -447,7 +445,6 @@ private void WriteFormatStartData(PSObject so) this.WriteObject(startFormat); } - /// /// write a payplad object by properly wrapping it into /// a FormatEntry object @@ -503,7 +500,6 @@ internal ScriptBlock CreateScriptBlock(string scriptText) return scriptBlock; } - private MshExpressionFactory _expressionFactory; #endregion @@ -531,7 +527,6 @@ public class OuterFormatShapeCommandBase : FrontEndCommandBase [Parameter] public object GroupBy { get; set; } = null; - /// /// optional, non positional parameter /// @@ -556,7 +551,6 @@ public SwitchParameter ShowError } internal Nullable showErrorsAsMessages = null; - /// /// optional, non positional parameter /// @@ -636,7 +630,6 @@ internal MshParameter ProcessGroupByParameter() return null; } - #endregion /// @@ -803,7 +796,6 @@ public SwitchParameter Wrap } private Nullable _multiLine = null; - #endregion internal override FormattingCommandLineParameters GetCommandLineParameters() { @@ -840,4 +832,3 @@ internal override FormattingCommandLineParameters GetCommandLineParameters() } } - diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs index 74ad087336f..34d71e3199d 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -403,7 +402,6 @@ internal override object Verify(object val, } } - /// /// definitions for hash table keys /// @@ -427,7 +425,6 @@ internal static class FormatParameterDefinitionKeys internal const string DepthEntryKey = "depth"; } - internal class FormatGroupByParameterDefinition : CommandParameterDefinition { protected override void SetEntries() diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index bb64bde1db0..5ef046b61a0 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Specialized; @@ -119,7 +118,6 @@ private void DrainCache() } } - private bool ProcessObject(PSObject so) { object o = _formatObjectDeserializer.Deserialize(so); @@ -214,7 +212,6 @@ protected override void InternalDispose() } } - /// /// enum describing the state for the output finite state machine /// @@ -241,14 +238,12 @@ private enum FormattingState /// private FormattingState _currentFormattingState = FormattingState.Reset; - /// /// instance of a command wrapper to execute the /// default formatter when needed /// private CommandWrapper _command; - /// /// enumeration to drive the preprocessing stage /// @@ -471,7 +466,6 @@ private void ProcessGroupStart(FormatMessagesContextManager.OutputContext c) //Console.WriteLine("ProcessGroupStart"); GroupOutputContext goc = (GroupOutputContext)c; - if (goc.Data.groupingEntry != null) { _lo.WriteLine(""); @@ -613,7 +607,6 @@ private ShapeInfo ShapeInfoOnFormatContext } } - /// /// retrieve the active FormatOutputContext on the stack /// by walking up to the top of the stack @@ -634,7 +627,6 @@ private FormatOutputContext FormatContext } } - /// /// context manager instance to guide the message traversal /// @@ -792,7 +784,6 @@ private FormattingHint RetrieveFormattingHint() private FormatObjectDeserializer _formatObjectDeserializer; - /// /// context for the outer scope of the format sequence /// @@ -862,7 +853,6 @@ internal virtual void ProcessPayload(FormatEntryData fed) { } /// internal GroupStartData Data { get; } = null; - protected OutCommandInner InnerCommand { get; } } @@ -1082,7 +1072,6 @@ internal static string[] GetValues(ListViewEntry lve) return retVal; } - /// /// write the headers /// @@ -1228,7 +1217,6 @@ private void WriteStringBuffer() _buffer.Reset(); } - /// /// helper class to accumulate the display values so that when the end /// of a line is reached, a full line can be composed @@ -1320,7 +1308,6 @@ internal override void Initialize() this.InnerCommand._lo.ColumnNumber); } - /// /// write a row into the list /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs index 56687b2ae7c..38fc778f582 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.Internal.Format { diff --git a/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs index 210754dbe2b..ba922a7c315 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -147,7 +146,6 @@ private void WriteToScreen() firstLineIndentation = 0; } - // compute the first line indentation or hanging int firstLineWidth = _textColumns - rightIndentation - leftIndentation; int followingLinesWidth = firstLineWidth; @@ -224,7 +222,6 @@ private void WriteToScreen() private const int maxRecursionDepth = 50; } - internal sealed class IndentationManager { private sealed class IndentationStackFrame : IDisposable @@ -288,7 +285,6 @@ internal int FirstLineIndentation } } - private int ComputeRightIndentation() { int val = 0; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs index 2cca282bf39..de48f5e09fa 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Globalization; @@ -48,8 +47,6 @@ public FormatTableLoadException(string message) : base(message) SetDefaultErrorRecord(); } - - /// /// This constructor takes a localized message and an inner exception. /// @@ -270,7 +267,6 @@ internal TypeInfoDataBaseManager FormatDBManager get { return _formatDBMgr; } } - /// /// Adds the to the current FormatTable's file list. /// The FormatTable will not reflect the change until Update is called. diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs index a48c9bac7f3..a27319cd65f 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -40,7 +39,6 @@ internal class TooManyErrorsException : TypeInfoDataBaseLoaderException internal int errorCount; } - /// /// entry logged by the loader and made available to external consumers /// @@ -74,7 +72,6 @@ internal enum EntryType { Error, Trace }; internal bool failToLoadFile = false; } - /// /// logger object used by the loader (class XmlLoaderBase) to write log entries. /// It logs to a memory buffer and (optionally) to a text file @@ -165,7 +162,6 @@ internal bool HasErrors private bool _hasErrors = false; } - /// /// base class providing XML loading basic functionality (stack management and logging facilities) /// NOTE: you need to implement to load an actual XML document and traverse it as see fit @@ -677,7 +673,6 @@ protected string FilePath } } - protected void SetDatabaseLoadingInfo(XmlFileLoadInfo info) { _loadingInfo.fileDirectory = info.fileDirectory; @@ -711,7 +706,6 @@ protected DatabaseLoadingInfo LoadingInfo protected DisplayResourceManagerCache displayResourceManagerCache; - internal bool VerifyStringResources { get; } = true; private int _maxNumberOfErrors = 30; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs index bb3e60a368a..865af22db51 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Microsoft.PowerShell.Commands.Internal.Format; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs index db4b84f55dd..b22c84d093e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information @@ -41,7 +40,6 @@ internal sealed partial class TypeInfoDataBase internal ViewDefinitionsSection viewDefinitionsSection = new ViewDefinitionsSection(); internal FormatControlDefinitionHolder formatControlDefinitionHolder = new FormatControlDefinitionHolder(); - /// /// cache for resource strings in format.ps1xml /// @@ -59,7 +57,6 @@ internal sealed class DatabaseLoadingInfo } #endregion - #region Default Settings #if _LATER @@ -121,7 +118,6 @@ internal bool MultilineTables } private bool? _multilineTables; - internal FormatErrorPolicy formatErrorPolicy = new FormatErrorPolicy(); internal ShapeSelectionDirectives shapeSelectionDirectives = new ShapeSelectionDirectives(); internal List enumerableExpansionDirectiveList = new List(); @@ -185,7 +181,6 @@ internal bool ShowErrorsInFormattedOutput internal string formatErrorStringInFormattedOutput = "#FMTERR"; } - internal sealed class ShapeSelectionDirectives { internal int PropertyCountForTable @@ -229,7 +224,6 @@ internal sealed class EnumerableExpansionDirective #endregion - #region Type Groups Definitions internal sealed class TypeGroupsSection @@ -261,10 +255,8 @@ internal sealed class TypeGroupReference : TypeOrGroupReference { } - #endregion - #region Elementary Tokens internal abstract class FormatToken @@ -365,7 +357,6 @@ internal sealed class FieldFormattingDirective #endregion Elementary Tokens - #region Control Definitions: common data /// @@ -453,7 +444,6 @@ internal sealed class ControlDefinition #endregion - #region View Definitions: common data internal sealed class ViewDefinitionsSection { @@ -477,7 +467,6 @@ internal sealed class GroupBy } - internal sealed class StartGroup { /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs index fc6e3f71720..d4ed74e97cf 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands.Internal.Format { diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs index 642b1d5b899..5c049e7167e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs index acad22df755..146da136c3e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs index 7bebf09eda4..7dd3eac2c01 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs index 6a74c5b9b30..c0dcee30016 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information @@ -68,7 +67,6 @@ internal override ControlBase Copy() } } - /// /// information about the table header /// NOTE: if an instance of this class is present, the list must not be empty diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs index c5560edf1f8..3e4ed05b2bb 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // this file contains the data structures for the in memory database // containing display and formatting information diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs index c4f4e237fdc..2fba81a4f81 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs index 838ed276f19..1bc4f8bbb0a 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs index 3467716071a..f5127d028f2 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -29,7 +28,6 @@ internal static bool Evaluate(PSObject obj, MshExpression ex, out MshExpressionR } } - /// /// helper object holding a generic object and the related /// "applies to" object. @@ -210,7 +208,6 @@ private int MatchTypeIndex(string typeName, PSObject currentObject, MshExpressio return BestMatchIndexUndefined; } - private bool MatchCondition(PSObject currentObject, MshExpression ex) { if (ex == null) @@ -225,7 +222,6 @@ private bool MatchCondition(PSObject currentObject, MshExpression ex) return retVal; } - private MshExpressionFactory _expressionFactory; private TypeInfoDataBase _db; private Collection _typeNameHierarchy; @@ -334,7 +330,6 @@ internal static FormatShape GetShapeFromPropertyCount(TypeInfoDataBase db, int p return FormatShape.List; } - internal static ViewDefinition GetViewByShapeAndType(MshExpressionFactory expressionFactory, TypeInfoDataBase db, FormatShape shape, Collection typeNames, string viewName) { @@ -561,7 +556,6 @@ private static ViewDefinition GetDefaultView(MshExpressionFactory expressionFact return result; } - private static bool IsOutOfBandView(ViewDefinition vd) { return (vd.mainControl is ComplexControlBody || vd.mainControl is ListControlBody) && vd.outOfBand; @@ -619,7 +613,6 @@ internal static AppliesTo GetAllApplicableTypes(TypeInfoDataBase db, AppliesTo a return retVal; } - internal static TypeGroupDefinition FindGroupDefinition(TypeInfoDataBase db, string groupName) { foreach (TypeGroupDefinition tgd in db.typeGroupSection.typeGroupDefinitionList) diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs index 1e2b3edb761..2a7a2bccbf1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Concurrent; @@ -32,7 +31,6 @@ internal XmlFileLoadInfo(string dir, string path, ConcurrentBag errors, internal string psSnapinName; } - /// /// class to load the XML document into data structures. /// It encapsulates the file format specific code @@ -167,7 +165,6 @@ private static class XMLStringValues // processing pre-validated type / formatting information. private bool _suppressValidation = false; - /// /// entry point for the loader algorithm /// @@ -1102,7 +1099,6 @@ private FormatToken LoadFormatTokenFromObjectModel(CustomItemBase item, int view return cpt; } - var frame = (CustomItemFrame)item; var frameToken = new FrameToken { @@ -1301,7 +1297,6 @@ private EnumerableExpansionDirective LoadEnumerableExpansionDirective(XmlNode di #endregion - #region Type Groups Loading private void LoadTypeGroups(TypeInfoDataBase db, XmlNode typeGroupsNode) @@ -1393,7 +1388,6 @@ private void LoadTypeGroupTypeRefs(XmlNode typesNode, TypeGroupDefinition typeGr #endregion - #region AppliesTo Loading private AppliesTo LoadAppliesToSection(XmlNode appliesToNode, bool allowSelectionCondition) @@ -1557,7 +1551,6 @@ private TypeOrGroupReference LoadSelectionConditionNode(XmlNode selectionConditi } } - if (typeFound && typeGroupFound) { //Error at XPath {0} in file {1}: Cannot have SelectionSetName and TypeName at the same time. @@ -1690,7 +1683,6 @@ private GroupBy LoadGroupBySection(XmlNode groupByNode) return groupBy; } - // failure: expression is mandatory //Error at XPath {0} in file {1}: An expression is expected. this.ReportError(StringUtil.Format(FormatAndOutXmlLoadingStrings.ExpectExpression, ComputeCurrentXPath(), FilePath)); @@ -1698,7 +1690,6 @@ private GroupBy LoadGroupBySection(XmlNode groupByNode) } } - private TextToken LoadLabel(XmlNode textNode) { using (this.StackFrame(textNode)) @@ -1806,7 +1797,6 @@ private StringResourceReference LoadResourceAttributes(XmlAttributeCollection at // success in loading resource.loadingInfo = this.LoadingInfo; - // optional pre-load and binding verification if (this.VerifyStringResources) { @@ -2187,4 +2177,3 @@ internal ControlBase Control } } - diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs index cb1fe4b71b5..70986f79b71 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -297,7 +296,6 @@ private bool LoadPropertyBaseHelper(XmlNode propertyBaseNode, PropertyTokenBase } } // foreach - if (expressionNodeFound) { // we add only if we encountered one, since it's not mandatory diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs index 6c2bdf898c6..c303ba16d60 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Xml; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs index de895ffd890..a582dfbfba9 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs index 4e1052281cb..8313adabdd8 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation; @@ -44,8 +43,6 @@ private void LoadViewDefinitions(TypeInfoDataBase db, XmlNode viewDefinitionsNod } } - - private ViewDefinition LoadView(XmlNode viewNode, int index) { using (this.StackFrame(viewNode, index)) diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs index 38e1706b3a6..9151bfb65e2 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Xml; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs index 23081707058..6ba01682f1d 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs index 24f9badc412..51b3e7ed920 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; @@ -34,7 +33,6 @@ internal class FormatMessagesContextManager internal GroupEndCallback ge = null; internal PayloadCallback payload = null; - /// /// The current output context, as determined by the /// sequence of formatting messages in the object stream @@ -126,7 +124,6 @@ internal void Process(object o) } } - /// /// access the active context (top of the stack). It can be null. /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs index 18841851b48..b6e0e0936f3 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -217,7 +215,6 @@ internal GroupStartData GenerateGroupStartData(PSObject firstObjectInGroup, int } } - FormatEntry fe = new FormatEntry(); startGroup.groupingEntry.formatValueList.Add(fe); @@ -272,7 +269,6 @@ internal bool UpdateGroupingKeyValue(PSObject so) return _groupingManager.UpdateGroupingKeyValue(so); } - internal GroupEndData GenerateGroupEndData() { return new GroupEndData(); @@ -308,7 +304,6 @@ internal bool IsObjectApplicable(Collection typeNames) return result; } - private GroupingInfoManager _groupingManager = null; protected bool AutoSize @@ -397,7 +392,6 @@ protected bool EvaluateDisplayCondition(PSObject so, ExpressionToken conditionTo return retVal; } - internal FormatErrorManager ErrorManager { get { return _errorManager; } @@ -405,7 +399,6 @@ internal FormatErrorManager ErrorManager private FormatErrorManager _errorManager; - #region helpers protected FormatPropertyField GenerateFormatPropertyField(List formatTokenList, PSObject so, int enumerationLimit) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs index e657ea86099..2b0e7a96171 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -272,7 +271,6 @@ private void ExecuteFormatTokenList(TraversalInfo level, } } - // if the token is has a formatting string, it's a leaf node, // do the formatting and we will be done if (cpt.control == null || cpt.control is FieldControlBody) @@ -493,7 +491,6 @@ private void DisplayRawObject(PSObject so, List formatValueList) } } - formatValueList.Add(fpf); formatValueList.Add(new FormatNewLine()); } @@ -562,7 +559,6 @@ private void ProcessActiveAssociationList(PSObject so, } } - // extract the optional max depth TraversalInfo level = currentLevel; if (a.OriginatingParameter != null) diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs index f90d04d1dc2..04f3a0fe06d 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -60,7 +59,6 @@ internal override void PrepareForRemoteObjects(PSObject so) fpt.expression = new ExpressionToken(RemotingConstants.ComputerNameNoteProperty, false); cnListItemDefinition.formatTokenList.Add(fpt); - _listBody.defaultEntryDefinition.itemDefinitionList.Add(cnListItemDefinition); } } diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs index 23450e53734..bc502f3a43e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -272,7 +271,6 @@ private TableHeaderInfo GenerateTableHeaderInfoFromProperties(PSObject so) return thi; } - private bool HideHeaders { get diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs index b7b2d7df749..5f3af4cb9b1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -24,7 +23,6 @@ internal override FormatStartData GenerateStartData(PSObject so) WideViewHeaderInfo wideViewHeaderInfo = new WideViewHeaderInfo(); startFormat.shapeInfo = wideViewHeaderInfo; - if (!this.AutoSize) { // autosize overrides columns diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs index adca8c0bc42..750f4a3b0ae 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -71,7 +70,6 @@ internal sealed class FormatViewManager private static PSTraceSource s_formatViewBindingTracer = PSTraceSource.GetTracer("FormatViewBinding", "Format view binding", false); #endregion tracer - private static string PSObjectTypeName(PSObject so) { // if so is not null, its TypeNames will not be null @@ -360,7 +358,6 @@ internal ViewGenerator ViewGenerator } } - private static ViewGenerator SelectViewGeneratorFromViewDefinition( TerminatingErrorContext errorContext, MshExpressionFactory expressionFactory, @@ -447,8 +444,6 @@ private static ViewGenerator SelectViewGeneratorFromProperties(FormatShape shape return viewGenerator; } - - /// /// the view generator that produced data for a selected shape /// @@ -588,7 +583,6 @@ internal static FormatEntryData GenerateOutOfBandObjectAsToString(PSObject so) } } - /// /// Helper class to manage the logging of errors resulting from /// evaluations of MshExpression instances @@ -715,7 +709,6 @@ private static ErrorRecord GenerateErrorRecord(FormattingError error) return errorRecord; } - private FormatErrorPolicy _formatErrorPolicy; /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs index b679bb9ddfa..f027c7fa9e0 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs index 7660eb45f48..81bb6397341 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // This file contains the definitions for the objects // used in the communication protocol between formatting // and output commands. the format/xxx commands instantiate @@ -24,7 +24,6 @@ using System.Collections.Generic; - namespace Microsoft.PowerShell.Commands.Internal.Format { #region Root of Class Hierarchy @@ -50,7 +49,6 @@ internal abstract partial class FormatInfoData public abstract string ClassId2e4f51ef21dd47e99d3c952918aff9cd { get; } } - #endregion #region Top Level Messages @@ -243,7 +241,6 @@ internal sealed partial class TableColumnInfo : FormatInfoData public string propertyName = null; } - internal sealed class ListViewHeaderInfo : ShapeInfo { internal const string CLSID = "830bdcb24c1642258724e441512233a4"; @@ -258,7 +255,6 @@ internal sealed class ComplexViewHeaderInfo : ShapeInfo public override string ClassId2e4f51ef21dd47e99d3c952918aff9cd { get { return CLSID; } } } - #endregion #region Formatting Entries Classes diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs index 869f1e919c9..1aed8ae6376 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Reflection; @@ -9,7 +8,6 @@ using System.Management.Automation; using System.Management.Automation.Internal; - namespace Microsoft.PowerShell.Commands.Internal.Format { /// @@ -49,7 +47,6 @@ fid is GroupEndData || return false; } - // check the type of the object by // 1) verifying the type name information // 2) trying to access the property containing CLSID information @@ -410,7 +407,6 @@ internal static FormatInfoData CreateInstance(PSObject so, FormatObjectDeseriali return fid; } - // returns null on failure private static FormatInfoData CreateInstance(string clsid, FormatObjectDeserializer deserializer) { @@ -480,8 +476,6 @@ private static void CreateInstanceError(Exception e, string clsid, FormatObjectD private static readonly Dictionary> s_constructors; } - - internal static class FormatInfoDataListDeserializer where T : FormatInfoData { private static void ReadListHelper(IEnumerable en, List lst, FormatObjectDeserializer deserializer) @@ -506,7 +500,6 @@ internal static void ReadList(PSObject so, string property, List lst, FormatO } } - #region Formatting Objects Deserializer internal abstract partial class FormatInfoData diff --git a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs index 0919fa17a20..b4fd10892d9 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Management.Automation; @@ -149,7 +148,6 @@ internal abstract class LineOutput /// internal delegate void DoPlayBackCall(); - /// /// if RequiresBuffering = true, this call will be made to /// start the playback diff --git a/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs index 83fa285d323..52ad545bde3 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Specialized; using System.Diagnostics; diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs index cd4adf2c332..9a75268bdb4 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Specialized; @@ -24,7 +23,6 @@ internal sealed class OutputManagerInner : ImplementationCommandBase internal static PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutputManagerInner", "OutputManagerInner"); #endregion tracer - #region LineOutput internal LineOutput LineOutput { @@ -123,7 +121,6 @@ protected override void InternalDispose() } } - /// /// instance of the pipeline manager object /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs index 46c15e02e59..a501e518be6 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics; @@ -37,7 +36,6 @@ internal OutputGroupQueue(FormattedObjectsCache.ProcessCachedGroupNotification c _groupingDuration = groupingDuration; } - /// /// add an object to the cache /// @@ -326,7 +324,6 @@ internal List Drain() return retVal; } - /// /// front end queue (if present, cache ALL, if not, bypass) /// diff --git a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs index 27cfa6d5a8c..abd9f0a60bb 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Specialized; using System.Management.Automation.Internal; @@ -68,7 +67,6 @@ internal static int ComputeWideViewBestItemsPerRowFit(int stringLen, int screenC } } - /// /// Initialize the table specifying the width of each column /// @@ -214,7 +212,6 @@ internal void GenerateRow(string[] values, LineOutput lo, bool multiLine, int[] } } - if (multiLine) { string[] lines = GenerateTableRow(values, currentAlignment, lo.DisplayCells); @@ -246,7 +243,6 @@ private string[] GenerateTableRow(string[] values, int[] alignment, DisplayCells if (validColumnCount == 0) return null; - StringCollection[] scArray = new StringCollection[validColumnCount]; for (int k = 0; k < scArray.Length; k++) { @@ -334,7 +330,6 @@ private StringCollection GenerateMultiLineRowField(string val, int k, int alignm return sc; } - private string GenerateRow(string[] values, int[] alignment, DisplayCells dc) { StringBuilder sb = new StringBuilder(); @@ -367,7 +362,6 @@ private string GenerateRow(string[] values, int[] alignment, DisplayCells dc) return sb.ToString(); } - private static string GenerateRowField(string val, int width, int alignment, DisplayCells dc) { // make sure the string does not have any embedded in it diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs index 37b42baf771..fdc09b81754 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Text; @@ -605,7 +604,6 @@ internal sealed class MshExpressionError : FormattingError internal MshExpressionResult result; } - internal sealed class StringFormatError : FormattingError { internal string formatString; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index 956892e4592..1c27af3c1dd 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -10,7 +9,6 @@ using System.Text; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.PowerShell.Commands.Internal.Format { /// @@ -195,7 +193,6 @@ internal static bool FindPartialMatch(string key, string normalizedKey) return false; } - #region Error Processing private static void ProcessAmbiguousKey(TerminatingErrorContext invocationContext, @@ -221,7 +218,6 @@ private static void ProcessIllegalKey(TerminatingErrorContext invocationContext, internal List hashEntries = new List(); } - /// /// engine to process a generic object[] from the command line and /// generate a list of MshParameter objects , given the metadata provided by @@ -248,7 +244,6 @@ internal static void ThrowParameterBindingException(TerminatingErrorContext invo invocationContext.ThrowTerminatingError(errorRecord); } - internal ParameterProcessor(CommandParameterDefinition p) { _paramDef = p; @@ -337,7 +332,6 @@ private Hashtable VerifyHashTable(IDictionary hash, TerminatingErrorContext invo // now the key is verified, need to check the type bool matchType = false; - if (def.AllowedTypes == null || def.AllowedTypes.Length == 0) { // we match on any type, it will be up to the entry to further check @@ -412,7 +406,6 @@ private void VerifyAndNormalizeParameter(MshParameter parameter, #region Error Processing - private static void ProcessUnknownParameterType(TerminatingErrorContext invocationContext, object actualObject, Type[] allowedTypes) { string allowedTypesList = CatenateTypeArray(allowedTypes); @@ -493,7 +486,6 @@ private static void ProcessMissingMandatoryKey(TerminatingErrorContext invocatio ParameterProcessor.ThrowParameterBindingException(invocationContext, "DictionaryKeyMandatoryEntry", msg); } - #endregion #region Utilities diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs index e571c5a00a4..09a0cbcbd93 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -35,7 +34,6 @@ internal MshResolvedExpressionParameterAssociation(MshParameter parameter, MshEx internal MshParameter OriginatingParameter { get; } } - internal static class AssociationManager { internal static List SetupActiveProperties(List rawMshParameterList, diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs index 6def0a76b3b..41976170a4b 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -31,7 +30,6 @@ internal MshExpressionResult(object res, MshExpression re, Exception e) internal Exception Exception { get; } = null; } - internal class MshExpression { /// @@ -268,7 +266,6 @@ private MshExpressionResult GetValue(PSObject target, bool eatExceptions) } } - // private members private string _stringValue; private bool _isResolved = false; diff --git a/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs b/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs index 5d4c05dd51f..29ae8ae8ac2 100644 --- a/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs +++ b/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation; using Microsoft.PowerShell.Commands.Internal.Format; @@ -23,4 +22,3 @@ public FormatDefaultCommand() } } - diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs index 48081074267..c6ed4bd3712 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // NOTE: define this if you want to test the output on US machine and ASCII // characters @@ -136,9 +135,6 @@ internal override int GetTailSplitLength(string str, int offset, int displayCell private PSHostRawUserInterface _rawUserInterface; } - - - /// /// Implementation of the LineOutput interface on top of Console and RawConsole /// @@ -259,7 +255,6 @@ internal ConsoleLineOutput(PSHostUserInterface hostConsole, bool paging, Termina _prompt = new PromptHandler(promptString, this); } - PSHostRawUserInterface raw = _console.RawUI; if (raw != null) { diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs index 823c5b5ea61..5b97235db3e 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Commands { diff --git a/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs b/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs index a72e34844ab..1731a205dfd 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -31,7 +30,6 @@ public object LineOutput private object _lineOutput = null; - /// /// set inner command /// @@ -92,6 +90,3 @@ private void ProcessWrongTypeLineOutput(object obj) } } - - - diff --git a/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs index 9247b13fff5..d6a39a7058b 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs index 110d3a53ce4..226ee1edd19 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs index b5599516327..46c384eff2d 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs index fa7d0ce519d..a3eb67c12df 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace Microsoft.PowerShell.Cmdletization { diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs index 2dc843d567f..dbf58e240d8 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs b/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs index 5f796332538..2bc67139a33 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs index a244064ebc5..10a7fa9517b 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -917,7 +916,6 @@ private static void EnsureOrderOfPositionalParameters( } } - private const string StaticCommonParameterSetTemplate = "{1}"; //"{0}::{1}"; private const string StaticMethodParameterSetTemplate = "{0}"; //"{1}::{0}"; @@ -2196,7 +2194,6 @@ internal void ReportExportedCommands(PSModuleInfo moduleInfo, string prefix) _cmdletizationMetadata.Class.StaticCmdlets.Select(c => c.CmdletMetadata)); } - foreach (CommonCmdletMetadata cmdletMetadata in cmdletMetadatas) { if (cmdletMetadata.Aliases != null) diff --git a/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs b/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs index c5a9695e258..b438ec82c0c 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // TODO/FIXME: move this to Microsoft.PowerShell.Cim namespace (and move in source depot folder as well) diff --git a/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.objectModel.autogen.cs b/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.objectModel.autogen.cs index c9f404c87ee..aa4290a08c9 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.objectModel.autogen.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.objectModel.autogen.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable //------------------------------------------------------------------------------ // @@ -16,7 +18,6 @@ namespace Microsoft.PowerShell.Cmdletization.Xml { using System.Xml.Serialization; - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")] [System.Diagnostics.DebuggerStepThroughAttribute()] diff --git a/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.xmlSerializer.autogen.cs b/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.xmlSerializer.autogen.cs index a0143cac911..ab4f378aa8f 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.xmlSerializer.autogen.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/xml/CoreCLR/cmdlets-over-objects.xmlSerializer.autogen.cs @@ -1,9 +1,10 @@ -#if CORECLR +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #if CORECLR #pragma warning disable - namespace Microsoft.PowerShell.Cmdletization.Xml { @@ -26,7 +27,6 @@ internal class XmlSerializationReader1 // 3. ReadTypedPrimitive(XmlQualifiedName type) and ReadTypedNull(XmlQualifiedName type). See the comments // in them for more information. - #region "Constructor" internal XmlSerializationReader1(XmlReader reader) @@ -59,7 +59,6 @@ internal XmlSerializationReader1(XmlReader reader) #endregion "Constructor" - #region "Field Definition" XmlReader _r; @@ -145,7 +144,6 @@ internal XmlSerializationReader1(XmlReader reader) #endregion "Field Definition" - #region "Property Definition" internal XmlReader Reader @@ -197,7 +195,6 @@ protected XmlDocument Document #endregion "Property Definition" - #region "Method Definition" internal void InitPrimitiveIDs() @@ -534,7 +531,6 @@ protected object ReadTypedNull(XmlQualifiedName type) #endregion "Method Definition" - #endregion Copy_From_XmlSerializationReader public object Read50_PowerShellMetadata() @@ -6334,6 +6330,3 @@ internal object Deserialize(XmlReader reader) } } #endif - - -#endif diff --git a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.objectModel.autogen.cs b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.objectModel.autogen.cs index b1236bc59a0..d6f90a3c61d 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.objectModel.autogen.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.objectModel.autogen.cs @@ -1,4 +1,7 @@ -// PLEASE DO NOT EDIT THIS FILE BY HAND!!! +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// PLEASE DO NOT EDIT THIS FILE BY HAND!!! // // This file has been generated // by D:\bluedev\admin\monad\src\cimSupport\cmdletization\xml\generate.ps1 @@ -24,7 +27,6 @@ namespace Microsoft.PowerShell.Cmdletization.Xml { using System.Xml.Serialization; - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929")] [System.SerializableAttribute()] diff --git a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xmlSerializer.autogen.cs b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xmlSerializer.autogen.cs index eb89c9f371a..59efd97fafa 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xmlSerializer.autogen.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xmlSerializer.autogen.cs @@ -1,4 +1,7 @@ -// PLEASE DO NOT EDIT THIS FILE BY HAND!!! +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// PLEASE DO NOT EDIT THIS FILE BY HAND!!! // // This file has been generated // by D:\bluedev\admin\monad\src\cimSupport\cmdletization\xml\generate.ps1 @@ -8,11 +11,8 @@ #pragma warning disable #if _DYNAMIC_XMLSERIALIZER_COMPILATION - - #endif - namespace Microsoft.PowerShell.Cmdletization.Xml { [System.CodeDom.Compiler.GeneratedCodeAttribute("sgen", "4.0")] diff --git a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs index 9623adb1af3..465d83a93e6 100644 --- a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs +++ b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/AliasInfo.cs b/src/System.Management.Automation/engine/AliasInfo.cs index 2095b707248..87aeeb51c6e 100644 --- a/src/System.Management.Automation/engine/AliasInfo.cs +++ b/src/System.Management.Automation/engine/AliasInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -354,7 +353,6 @@ internal void SetOptions(ScopedItemOptions newOptions, bool force) /// public string Description { get; set; } = String.Empty; - /// /// If ResolvedCommand returns null, this property will /// return the name of the command that could not be resolved. diff --git a/src/System.Management.Automation/engine/ApplicationInfo.cs b/src/System.Management.Automation/engine/ApplicationInfo.cs index c5f0a0e8fe1..1cfe74881a0 100644 --- a/src/System.Management.Automation/engine/ApplicationInfo.cs +++ b/src/System.Management.Automation/engine/ApplicationInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs b/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs index 95dd97d768c..a761e2fd00e 100644 --- a/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs +++ b/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Linq; diff --git a/src/System.Management.Automation/engine/Attributes.cs b/src/System.Management.Automation/engine/Attributes.cs index d96a4284510..29edbb2e5f1 100644 --- a/src/System.Management.Automation/engine/Attributes.cs +++ b/src/System.Management.Automation/engine/Attributes.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -484,7 +483,6 @@ internal OutputTypeAttribute(string typeName) Type = new[] { new PSTypeName(typeName) }; } - /// /// Construct the attribute from an array of System.Type /// @@ -810,7 +808,6 @@ public sealed class PSDefaultValueAttribute : ParsingBaseAttribute public string Help { get; set; } } - /// /// Specify that the member is hidden for the purposes of cmdlets like Get-Member and /// that the member is not displayed by default by Format-* cmdlets. @@ -875,7 +872,6 @@ protected override void ValidateElement(object element) } } - /// /// Initializes a new instance of the ValidateLengthAttribute class /// @@ -1420,7 +1416,6 @@ protected override void Validate(object arguments, EngineIntrinsics engineIntrin IEnumerable ie; IEnumerator ienumerator; - if (arguments == null || arguments == AutomationNull.Value) { // treat a nul list the same as an empty list diff --git a/src/System.Management.Automation/engine/AutomationEngine.cs b/src/System.Management.Automation/engine/AutomationEngine.cs index 0b8d6770194..279bab545ab 100644 --- a/src/System.Management.Automation/engine/AutomationEngine.cs +++ b/src/System.Management.Automation/engine/AutomationEngine.cs @@ -1,13 +1,11 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Management.Automation.Host; using System.Management.Automation.Language; using System.Management.Automation.Runspaces; - namespace System.Management.Automation { /// @@ -31,7 +29,6 @@ internal class AutomationEngine /// internal CommandDiscovery CommandDiscovery { get; } - /// /// The principal constructor that most hosts will use when creating /// an instance of the automation engine. It allows you to pass in an diff --git a/src/System.Management.Automation/engine/AutomationNull.cs b/src/System.Management.Automation/engine/AutomationNull.cs index 95e1571927e..0d3c432ef21 100644 --- a/src/System.Management.Automation/engine/AutomationNull.cs +++ b/src/System.Management.Automation/engine/AutomationNull.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/engine/COM/ComAdapter.cs b/src/System.Management.Automation/engine/COM/ComAdapter.cs index afe2e2c585e..2683fb7f01d 100644 --- a/src/System.Management.Automation/engine/COM/ComAdapter.cs +++ b/src/System.Management.Automation/engine/COM/ComAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -8,7 +7,6 @@ using System.ComponentModel; using Microsoft.PowerShell; - namespace System.Management.Automation { /// @@ -50,7 +48,6 @@ protected override IEnumerable GetTypeNameHierarchy(object obj) } } - /// /// Returns null if memberName is not a member in the adapter or /// the corresponding PSMemberInfo @@ -161,7 +158,6 @@ protected override object PropertyGet(PSProperty property) return prop.GetValue(property.baseObject); } - /// /// Sets the value of a property coming from a previous call to DoGetProperty /// @@ -174,10 +170,6 @@ protected override void PropertySet(PSProperty property, object setValue, bool c prop.SetValue(property.baseObject, setValue); } - - - - /// /// Returns true if the property is settable /// @@ -189,7 +181,6 @@ protected override bool PropertyIsSettable(PSProperty property) return prop.IsSettable; } - /// /// Returns true if the property is gettable /// @@ -201,7 +192,6 @@ protected override bool PropertyIsGettable(PSProperty property) return prop.IsGettable; } - /// /// Returns the name of the type corresponding to the property /// @@ -214,7 +204,6 @@ protected override string PropertyType(PSProperty property, bool forDisplay) return forDisplay ? ToStringCodeMethods.Type(prop.Type) : prop.Type.FullName; } - /// /// get the property signature. /// @@ -226,10 +215,8 @@ protected override string PropertyToString(PSProperty property) return prop.ToString(); } - #region Methods - /// /// Called after a non null return from GetMethodData to try to call /// the method with the arguments diff --git a/src/System.Management.Automation/engine/COM/ComDispatch.cs b/src/System.Management.Automation/engine/COM/ComDispatch.cs index 9432d52e75d..92d2d7d2d97 100644 --- a/src/System.Management.Automation/engine/COM/ComDispatch.cs +++ b/src/System.Management.Automation/engine/COM/ComDispatch.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using COM = System.Runtime.InteropServices.ComTypes; diff --git a/src/System.Management.Automation/engine/COM/ComInvoker.cs b/src/System.Management.Automation/engine/COM/ComInvoker.cs index 9aaafb00f3c..d29fc8df7df 100644 --- a/src/System.Management.Automation/engine/COM/ComInvoker.cs +++ b/src/System.Management.Automation/engine/COM/ComInvoker.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Reflection; diff --git a/src/System.Management.Automation/engine/COM/ComMethod.cs b/src/System.Management.Automation/engine/COM/ComMethod.cs index bc8919fe783..194328bfe4a 100644 --- a/src/System.Management.Automation/engine/COM/ComMethod.cs +++ b/src/System.Management.Automation/engine/COM/ComMethod.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using System.Collections.ObjectModel; @@ -56,7 +55,6 @@ internal void AddFuncDesc(int index) _methods.Add(index); } - /// /// Returns the different method overloads signatures. /// @@ -65,7 +63,6 @@ internal Collection MethodDefinitions() { Collection result = new Collection(); - foreach (int index in _methods) { IntPtr pFuncDesc; diff --git a/src/System.Management.Automation/engine/COM/ComProperty.cs b/src/System.Management.Automation/engine/COM/ComProperty.cs index 033afc0819c..70d2b556bfb 100644 --- a/src/System.Management.Automation/engine/COM/ComProperty.cs +++ b/src/System.Management.Automation/engine/COM/ComProperty.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using System.Collections.ObjectModel; @@ -24,7 +23,6 @@ internal class ComProperty private int _getterIndex; private COM.ITypeInfo _typeInfo; - /// /// Initializes a new instance of ComProperty. /// @@ -112,7 +110,6 @@ private int GetFuncDescIndex() /// internal bool IsParameterized { get; private set; } = false; - /// /// Returns the number of parameters in this property. /// This is applicable only for parameterized properties. @@ -141,7 +138,6 @@ internal bool IsSettable /// internal bool IsGettable { get; private set; } = false; - /// /// Get value of this property /// @@ -216,8 +212,6 @@ internal object GetValue(Object target, Object[] arguments) return null; } - - /// /// Sets value of this property. /// @@ -298,7 +292,6 @@ internal void SetValue(Object target, Object setValue, Object[] arguments) } } - /// /// Updates the COM property with setter and getter information. /// diff --git a/src/System.Management.Automation/engine/COM/ComTypeInfo.cs b/src/System.Management.Automation/engine/COM/ComTypeInfo.cs index 58462333a9e..6f356e74f3f 100644 --- a/src/System.Management.Automation/engine/COM/ComTypeInfo.cs +++ b/src/System.Management.Automation/engine/COM/ComTypeInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; @@ -35,7 +34,6 @@ internal class ComTypeInfo private COM.ITypeInfo _typeinfo = null; private Guid _guid = Guid.Empty; - /// /// Constructor /// @@ -52,7 +50,6 @@ internal ComTypeInfo(COM.ITypeInfo info) } } - /// /// Collection of properties in the COM object. /// @@ -139,7 +136,6 @@ private void Initialize() } } - /// /// Get the typeinfo interface for the given comobject. /// @@ -175,7 +171,6 @@ internal static ComTypeInfo GetDispatchTypeInfo(object comObject) return result; } - private void AddProperty(string strName, COM.FUNCDESC funcdesc, int index) { ComProperty prop; @@ -206,7 +201,6 @@ private void AddMethod(string strName, int index) } } - /// /// Get TypeAttr for the given type information. /// @@ -238,7 +232,6 @@ internal static COM.FUNCDESC GetFuncDesc(COM.ITypeInfo typeinfo, int index) return funcdesc; } - /// /// /// @@ -268,7 +261,6 @@ internal static COM.ITypeInfo GetDispatchTypeInfoFromCustomInterfaceTypeInfo(COM return dispinfo; } - /// /// Get the IDispatch Typeinfo from CoClass typeinfo. /// diff --git a/src/System.Management.Automation/engine/COM/ComUtil.cs b/src/System.Management.Automation/engine/COM/ComUtil.cs index c493adccbd9..070c92e73b5 100644 --- a/src/System.Management.Automation/engine/COM/ComUtil.cs +++ b/src/System.Management.Automation/engine/COM/ComUtil.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using System.Management.Automation.ComInterop; @@ -97,7 +96,6 @@ internal static string GetMethodSignatureFromFuncDesc(COM.ITypeInfo typeinfo, CO return builder.ToString(); } - /// /// Gets the name of the method or property defined by funcdesc /// diff --git a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs index fc7a0072569..8cb4feb4404 100644 --- a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -25,7 +24,6 @@ private ChildItemCmdletProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // CmdletProviderIntrinsics private - /// /// Constructs a facade over the "real" session state API /// @@ -387,7 +385,6 @@ internal object GetChildItemsDynamicParameters( return _sessionState.GetChildItemsDynamicParameters(path, recurse, context); } // GetChildItemsDynamicParameters - #endregion GetChildItems #region GetChildNames @@ -900,7 +897,6 @@ internal bool HasChild( return _sessionState.HasChildItems(path, context); } // HasChildItems - #endregion HasChildItems #endregion Public methods diff --git a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs index a72f220d9d3..49aefe667ad 100644 --- a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; using System.Management.Automation.Internal; @@ -25,7 +24,6 @@ private ProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // ProviderIntrinsics private - /// /// Constructs a facade over the "real" session state API /// diff --git a/src/System.Management.Automation/engine/CmdletInfo.cs b/src/System.Management.Automation/engine/CmdletInfo.cs index e0585b020d1..832a4614abd 100644 --- a/src/System.Management.Automation/engine/CmdletInfo.cs +++ b/src/System.Management.Automation/engine/CmdletInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs index 6fd6062c966..184e8fcd002 100644 --- a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs +++ b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -91,7 +90,6 @@ internal CmdletParameterBinderController( #endregion ctor - #region helper_methods /// @@ -276,24 +274,20 @@ internal void BindCommandLineParametersNoValidation(Collection /// Process all valid parameter sets, and filter out those that don't take any pipeline input /// @@ -404,7 +397,6 @@ private void ApplyDefaultParameterBinding(string bindingStage, bool isDynamic) return; } - /// /// Bind the default parameter value pairs /// @@ -519,7 +511,6 @@ private PSObject WrapBindingState() return result; } - /// /// Get all qualified default parameter value pairs based on the /// given currentParameterSetFlag. @@ -869,7 +860,6 @@ private void GetDefaultParameterValuePairsHelper( } } - /// /// Verify if all arguments from the command line are bound. /// @@ -1446,7 +1436,6 @@ internal override bool BindParameter( return result; } - /// /// Binds the specified argument to the specified parameter using the appropriate /// parameter binder. @@ -1590,7 +1579,6 @@ private bool BindParameter( return result; } - /// /// Binds the remaining arguments to an unbound ValueFromRemainingArguments parameter (Varargs) /// @@ -1715,7 +1703,6 @@ private void HandleRemainingArguments() } } // HandleRemainingArguments - /// /// Determines if the cmdlet supports dynamic parameters. If it does, /// the dynamic parameter bindable object is retrieved and the unbound @@ -2120,7 +2107,6 @@ private Collection GetMissingMandatoryParameters } } - if (!latchOnToDefault) { // If only the all set takes pipeline input then latch on to the @@ -2849,7 +2835,6 @@ private void ThrowAmbiguousParameterSetException(uint parameterSetFlags, MergedC ParameterBinderStrings.AmbiguousParameterSet, "AmbiguousParameterSet"); - // Trace the parameter sets still active uint currentParameterSet = 1; @@ -3016,10 +3001,8 @@ internal bool HandleUnboundMandatoryParameters( // Create a collection to store the prompt descriptions of unbound mandatory parameters - Collection fieldDescriptionList = CreatePromptDataStructures(missingMandatoryParameters); - Dictionary parameters = PromptForMissingMandatoryParameters( fieldDescriptionList, @@ -3272,7 +3255,6 @@ private static string BuildLabel(string parameterName, StringBuilder usedHotKeys return label.ToString(); } - /// /// Gets the parameter set name for the current parameter set. /// @@ -3830,7 +3812,6 @@ private bool InvokeAndBindDelayBindScriptBlock(PSObject inputToOperateOn, out bo // different parameters depending on the type of the incoming pipeline // object. - // Loop through each of the delay bind script blocks and invoke them. // Bind the result to the associated parameter @@ -3915,7 +3896,6 @@ private bool InvokeAndBindDelayBindScriptBlock(PSObject inputToOperateOn, out bo newValue = output[0]; } - // Create a new CommandParameterInternal for the output of the script block. var newArgument = CommandParameterInternal.CreateParameterWithArgument( argument.ParameterAst, argument.ParameterName, "-" + argument.ParameterName + ":", @@ -3963,10 +3943,8 @@ private static int ValidParameterSetCount(uint parameterSetFlags) return result; } - #endregion helper_methods - #region private_members /// @@ -4818,4 +4796,3 @@ private static int SkipWhiteSpace(int index, string key) } } - diff --git a/src/System.Management.Automation/engine/CodeMethods.cs b/src/System.Management.Automation/engine/CodeMethods.cs index 41207e6560e..3585a6af238 100644 --- a/src/System.Management.Automation/engine/CodeMethods.cs +++ b/src/System.Management.Automation/engine/CodeMethods.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs index 1dc962894fa..092f19791a0 100644 --- a/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs index 63862c32dd8..eebd8769059 100644 --- a/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs b/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs index 8f02f894d5e..35cfacd076b 100644 --- a/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs +++ b/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs b/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs index fe585885a79..cc2fc8bff0a 100644 --- a/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs +++ b/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ComInterop/ComBinder.cs b/src/System.Management.Automation/engine/ComInterop/ComBinder.cs index f29a0ed5919..1ed522a9ade 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComBinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs b/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs index dcd0bddc553..4a5cbf7105d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs index d3a05741b5f..b437fdf7eac 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs b/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs index 5bc812c2368..5a2368bf321 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs index 2c89c19df11..2ee835aff9b 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs b/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs index 0c07aa382b2..f55323c55e7 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs b/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs index 34201592240..d5c4ea01bad 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs b/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs index f406ac042ff..e7cd946d596 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs index bb4275a9b4d..1968d042632 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComHresults.cs b/src/System.Management.Automation/engine/ComInterop/ComHresults.cs index 32ef9ffae18..632d2d06515 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComHresults.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComHresults.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComInterop.cs b/src/System.Management.Automation/engine/ComInterop/ComInterop.cs index 3f4b5f9b66c..a0ae37725c8 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInterop.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInterop.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs b/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs index d46b69393e4..3be7fdbd528 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs index 2d2e2ba6f09..c3aaf40bbbd 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 @@ -265,7 +264,6 @@ private Expression GenerateTryBlock() } } - // // Call Invoke // diff --git a/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs index a4a59237110..8adc529cbbd 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs index e2c068c1574..b29924a43f3 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComObject.cs b/src/System.Management.Automation/engine/ComInterop/ComObject.cs index 56dee24f82a..6e35772878d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs index 6a77be6c0e0..94095742040 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs b/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs index 1a25ca4b101..4b405b85af3 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -72,7 +71,6 @@ public static void CheckThrowException(int hresult, ref ExcepInfo excepInfo, Com // http://msdn.microsoft.com/en-us/library/aa912367.aspx argErr = ((uint)args.Length) - argErr - 2; - // One or more of the arguments could not be coerced. Type destinationType = null; @@ -377,7 +375,6 @@ private static MethodInfo Create_ConvertByrefToPtr() return type.CreateType().GetMethod("ConvertByrefToPtr"); } - #region Generated Convert ByRef Delegates // *** BEGIN GENERATED CODE *** @@ -821,7 +818,6 @@ private static IDispatchInvokeDelegate Create_IDispatchInvoke(bool returnResult) #endregion } - internal static class NativeMethods { [System.Runtime.Versioning.ResourceExposure(System.Runtime.Versioning.ResourceScope.None)] diff --git a/src/System.Management.Automation/engine/ComInterop/ComType.cs b/src/System.Management.Automation/engine/ComInterop/ComType.cs index dcb78c02444..7adb8026dad 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComType.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComType.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs index c9a9f256f86..75fc9ed3e92 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs index 36de3e94ef8..78a57c49426 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -31,7 +30,6 @@ internal ComTypeDesc(ITypeInfo typeInfo, ComType memberType, ComTypeLibDesc type TypeLib = typeLibDesc; } - internal static ComTypeDesc FromITypeInfo(ComTypes.ITypeInfo typeInfo, ComTypes.TYPEATTR typeAttr) { if (typeAttr.typekind == ComTypes.TYPEKIND.TKIND_COCLASS) diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs index 1b8e08a9333..12634f01990 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs index c6c958aa039..e5e400fc62c 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs index 6b55866bbab..e2ae7ab65e6 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs index c211328d808..5e8ce696cb1 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs index 13f2240719b..ebb79e4b829 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs index 2d685a3dfe4..08f6be519a5 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs index c58b3ddb0ea..29cf290256f 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs index a37ea0effcf..cfcd60d480a 100644 --- a/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs index 1613f8640da..39e18316b3d 100644 --- a/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/DispCallable.cs b/src/System.Management.Automation/engine/ComInterop/DispCallable.cs index fcbce35eca7..a12f6bd3bb4 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispCallable.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispCallable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs index 54fdc53a8e8..43d6ea67bc9 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs index 08b95e3da36..ebfdb4868a6 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs index b25996031c2..784401399f9 100644 --- a/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/Errors.cs b/src/System.Management.Automation/engine/ComInterop/Errors.cs index 3b1024fc5d3..abe1775e6e8 100644 --- a/src/System.Management.Automation/engine/ComInterop/Errors.cs +++ b/src/System.Management.Automation/engine/ComInterop/Errors.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.ComInterop { diff --git a/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs b/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs index 048eb869a41..95a2285bf80 100644 --- a/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs +++ b/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/Helpers.cs b/src/System.Management.Automation/engine/ComInterop/Helpers.cs index ba3af47c0ef..353a89fe74b 100644 --- a/src/System.Management.Automation/engine/ComInterop/Helpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/Helpers.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !CLR2 using System.Linq.Expressions; diff --git a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs index 65812089b63..8f7b4c85070 100644 --- a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs index 74f5e383441..1069fccb60e 100644 --- a/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 @@ -145,7 +144,6 @@ public override DynamicMetaObject BindGetMember(GetMemberBinder binder) return base.BindGetMember(binder); } - private DynamicMetaObject BindGetMember(ComMethodDesc method, bool canReturnCallables) { if (method.IsDataMember) diff --git a/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs b/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs index f41af694c08..6ad943edcc7 100644 --- a/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !CLR2 using System.Linq.Expressions; diff --git a/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs index f4a7e2aac0e..fda43e814be 100644 --- a/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs index 3f1539ed638..1050f0695f5 100644 --- a/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs b/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs index 26aa920051f..a5b772373a2 100644 --- a/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs +++ b/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !CLR2 #else diff --git a/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs index e47a08cb0e7..89291cd5cfa 100644 --- a/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 @@ -46,7 +45,6 @@ internal override Expression MarshalToRef(Expression parameter) { parameter = Marshal(parameter); - // Marshal.StringToBSTR(parameter) return Expression.Call( typeof(Marshal).GetMethod("StringToBSTR"), diff --git a/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs index 91998b05083..e43956280d6 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs index 412aa96c2cb..cd9d2501c5b 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs index 1312e875a55..72032d65b66 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs b/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs index a8ccd09ee62..1a4a949b804 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !CLR2 #else @@ -135,7 +134,6 @@ internal static MethodInfo FindConversionOperator(MethodInfo[] methods, Type typ return null; } - //CONFORMING private static bool IsIdentityConversion(Type source, Type destination) { diff --git a/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs index b2ee61a17ad..2b10d677250 100644 --- a/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -54,7 +53,6 @@ internal override Expression MarshalToRef(Expression parameter) ); } - internal override Expression UnmarshalFromRef(Expression value) { // value == IntPtr.Zero ? null : Marshal.GetObjectForIUnknown(value); diff --git a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs index f95cace3ba3..6bbe838fb42 100644 --- a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs +++ b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -253,7 +252,6 @@ private static void CheckForAmbiguousMatch(Type argumentType, List comp typeNames += typeName; } - throw Error.AmbiguousConversion(argumentType.Name, typeNames); } @@ -488,7 +486,6 @@ private VariantBuilder GetVariantBuilder(Type argumentType) return new VariantBuilder(varEnum, argBuilder); } - // This helper is called when we are looking for a ByVal marshalling // In a ByVal case we can take into account conversions or IConvertible if all other // attempts to find marshalling type failed diff --git a/src/System.Management.Automation/engine/ComInterop/Variant.cs b/src/System.Management.Automation/engine/ComInterop/Variant.cs index b0ddecb82f9..829b67f0d37 100644 --- a/src/System.Management.Automation/engine/ComInterop/Variant.cs +++ b/src/System.Management.Automation/engine/ComInterop/Variant.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -828,12 +827,10 @@ public void SetAsByrefDispatch(ref IntPtr value) _typeUnion._unionTypes._byref = UnsafeMethods.ConvertIntPtrByrefToPtr(ref value); } - // *** END GENERATED CODE *** #endregion - // VT_VARIANT public Object AsVariant diff --git a/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs index caf9a0c5c65..980f239f23f 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 @@ -48,7 +47,6 @@ internal override Expression MarshalToRef(Expression parameter) ); } - internal override Expression UnmarshalFromRef(Expression value) { // value == IntPtr.Zero ? null : Marshal.GetObjectForNativeVariant(value); diff --git a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs index b2af22aa9ba..a1c8bf0e04f 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs b/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs index f8177844c3f..958c6739542 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !SILVERLIGHT // ComObject @@ -138,7 +137,6 @@ internal Expression Clear() return null; } - switch (_targetComType) { case VarEnum.VT_EMPTY: diff --git a/src/System.Management.Automation/engine/CommandBase.cs b/src/System.Management.Automation/engine/CommandBase.cs index 6732409b6e2..d582278ed62 100644 --- a/src/System.Management.Automation/engine/CommandBase.cs +++ b/src/System.Management.Automation/engine/CommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Language; @@ -222,7 +221,6 @@ internal virtual void DoStopProcessing() #endregion Override - /// /// throws if the pipeline is stopping /// @@ -258,7 +256,6 @@ internal void InternalDispose(bool isDisposing) } } - namespace System.Management.Automation { #region ActionPreference diff --git a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs index 814f671f265..1c77c5b4951 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs index 7dbee431f2e..091523b8ae2 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -96,7 +94,6 @@ private static bool IsCursorOutsideOfExtent(IScriptPosition cursor, IScriptExten return cursor.Offset < extent.StartOffset || cursor.Offset > extent.EndOffset; } - internal CompletionContext CreateCompletionContext(PowerShell powerShell) { var typeInferenceContext = new TypeInferenceContext(powerShell); @@ -167,7 +164,6 @@ private static Token InterstingTokenBeforeCursorOrDefault(IEnumerable tok return tokens.LastOrDefault(token => IsCursorAfterExtent(cursorPosition, token.Extent) && IsInterestingToken(token)); } - private static Ast GetLastAstAtCursor(ScriptBlockAst scriptBlockAst, IScriptPosition cursorPosition) { var asts = AstSearcher.FindAll(scriptBlockAst, ast => IsCursorRightAfterExtent(cursorPosition, ast.Extent), searchNestedScriptBlocks: true); diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 39a9860df95..4a1363c91c8 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -2352,7 +2350,6 @@ private static ScriptBlock GetCustomArgumentCompleter( return null; } - private static bool InvokeScriptArgumentCompleter( ScriptBlock scriptBlock, string commandName, @@ -3194,7 +3191,6 @@ private static void NativeCompletionProviderCommands(CompletionContext context, var providerName = context.WordToComplete ?? string.Empty; var quote = HandleDoubleAndSingleQuote(ref providerName); - if (!providerName.EndsWith("*", StringComparison.Ordinal)) { providerName += "*"; @@ -3806,7 +3802,6 @@ private static void NativeCompletionTypeName(CompletionContext context, List /// Find the positional argument at the specific position from the parsed argument list /// @@ -5312,7 +5307,6 @@ private static bool IsConstructor(object member) return false; } - #endregion Members #region Types diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs index 2109c6b2d0e..e282c8dca35 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs @@ -1,11 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -// Implements CompletionResult. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { @@ -196,7 +190,6 @@ public CompletionResult(string completionText, string listItemText, CompletionRe _resultType = resultType; } - /// /// Initializes a new instance of this class internally if the result out of TabExpansion is a string. /// diff --git a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs index 337a2dde206..a50d3e3215f 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -9,7 +7,6 @@ using System.Linq; using System.Management.Automation.Language; - namespace System.Management.Automation { /// diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index 5954739f62d..7e44b051dbf 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Linq; diff --git a/src/System.Management.Automation/engine/CommandDiscovery.cs b/src/System.Management.Automation/engine/CommandDiscovery.cs index 395078354a6..0012e6c1c56 100644 --- a/src/System.Management.Automation/engine/CommandDiscovery.cs +++ b/src/System.Management.Automation/engine/CommandDiscovery.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -511,7 +510,6 @@ internal static void VerifyElevatedPrivileges(ExternalScriptInfo scriptInfo) } } - #region comment out RequiresNetFrameworkVersion feature 8/10/2010 /* * The "#requires -NetFrameworkVersion" feature is CUT OFF. @@ -538,7 +536,6 @@ internal static void VerifyNetFrameworkVersion(ExternalScriptInfo scriptInfo) */ #endregion - /// /// used to determine compatibility between the versions in the requires statement and /// the installed version. The version can be PSSnapin or msh @@ -1004,7 +1001,6 @@ internal static Collection AutoloadSpecifiedModule(string moduleNa return matchingModules; } - private static CommandInfo InvokeCommandNotFoundHandler(string commandName, ExecutionContext context, string originalCommandName, CommandOrigin commandOrigin) { CommandInfo result = null; @@ -1341,7 +1337,6 @@ internal void UnregisterLookupCommandInfoAction(string currentAction, string com private HashSet _activeCommandNotFound = new HashSet(StringComparer.OrdinalIgnoreCase); private HashSet _activePostCommand = new HashSet(StringComparer.OrdinalIgnoreCase); - /// /// Gets a CommandPathSearch constructed with the specified patterns and /// using the PATH as the lookup directories @@ -1508,7 +1503,6 @@ private static void InitPathExtCache(string pathExt) private static string[] s_cachedPathExtCollection; private static string[] s_cachedPathExtCollectionWithPs1; - /// /// Gets the cmdlet information for the specified name. /// @@ -1865,4 +1859,3 @@ internal class CommandDiscoveryEventSource : EventSource } } - diff --git a/src/System.Management.Automation/engine/CommandInfo.cs b/src/System.Management.Automation/engine/CommandInfo.cs index 5f3f60db556..d62bb016a86 100644 --- a/src/System.Management.Automation/engine/CommandInfo.cs +++ b/src/System.Management.Automation/engine/CommandInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -11,7 +10,6 @@ using System.Runtime.ExceptionServices; using Microsoft.PowerShell.Commands; - namespace System.Management.Automation { /// @@ -77,7 +75,6 @@ public enum CommandTypes /// Workflow = 0x0080, - /// /// A Configuration /// @@ -294,7 +291,6 @@ internal void SetCommandType(CommandTypes newType) /// public abstract string Definition { get; } - /// /// This is required for renaming aliases, functions, and filters /// @@ -658,7 +654,6 @@ public ReadOnlyCollection ParameterSets /// internal string Prefix { get; set; } = ""; - /// /// Create a copy of commandInfo for GetCommandCommand so that we can generate parameter /// sets based on an argument list (so we can get the dynamic parameters.) diff --git a/src/System.Management.Automation/engine/CommandMetadata.cs b/src/System.Management.Automation/engine/CommandMetadata.cs index d9ddfb3cf2e..e9db54d3187 100644 --- a/src/System.Management.Automation/engine/CommandMetadata.cs +++ b/src/System.Management.Automation/engine/CommandMetadata.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -1020,7 +1019,6 @@ internal string GetBeginBlock() commandOrigin = ""; } - if (_wrappedAnyCmdlet) { result = string.Format(CultureInfo.InvariantCulture, @" diff --git a/src/System.Management.Automation/engine/CommandParameter.cs b/src/System.Management.Automation/engine/CommandParameter.cs index ecd23002eda..6b2fb317bf5 100644 --- a/src/System.Management.Automation/engine/CommandParameter.cs +++ b/src/System.Management.Automation/engine/CommandParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/engine/CommandPathSearch.cs b/src/System.Management.Automation/engine/CommandPathSearch.cs index b53a665fdbb..a61560ded66 100644 --- a/src/System.Management.Automation/engine/CommandPathSearch.cs +++ b/src/System.Management.Automation/engine/CommandPathSearch.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -152,7 +151,6 @@ private void ResolveCurrentDirectoryInLookupPaths() _lookupPaths[index]); } - // Note, if the directory resolves to multiple paths, only the first is used. if (!String.IsNullOrEmpty(resolvedPath)) diff --git a/src/System.Management.Automation/engine/CommandProcessor.cs b/src/System.Management.Automation/engine/CommandProcessor.cs index 9fec56133d5..7302b72c52a 100644 --- a/src/System.Management.Automation/engine/CommandProcessor.cs +++ b/src/System.Management.Automation/engine/CommandProcessor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -11,7 +10,6 @@ using Microsoft.PowerShell.Commands; using Dbg = System.Management.Automation.Diagnostics; - namespace System.Management.Automation { /// @@ -409,7 +407,6 @@ internal override void ProcessRecord() /// private bool _bailInNextCall; - /// /// Populates the parameters specified from the pipeline. /// @@ -856,4 +853,3 @@ internal override bool IsHelpRequested(out string helpTarget, out HelpCategory h } } - diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index f691b6d73e8..a2219ace10c 100644 --- a/src/System.Management.Automation/engine/CommandProcessorBase.cs +++ b/src/System.Management.Automation/engine/CommandProcessorBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index 5c0dc3418d2..d585dd004d1 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -396,7 +395,6 @@ private CommandInfo ProcessPathSearchState() return currentMatch; } - /// /// Gets the CommandInfo representing the current command match. /// @@ -422,7 +420,6 @@ CommandInfo IEnumerator.Current } } // Current - object IEnumerator.Current { get @@ -630,7 +627,6 @@ private CommandInfo GetInfoFromPath(string path) break; } - if ((_commandTypes & CommandTypes.Application) != 0) { // Anything else is treated like an application @@ -1356,7 +1352,6 @@ private static CanDoPathLookupResult CanDoPathLookup(string possiblePath) return result; } // CanDoPathLookup - /// /// The command name to search for /// diff --git a/src/System.Management.Automation/engine/CommonCommandParameters.cs b/src/System.Management.Automation/engine/CommonCommandParameters.cs index b1af3628221..5de830fa3bb 100644 --- a/src/System.Management.Automation/engine/CommonCommandParameters.cs +++ b/src/System.Management.Automation/engine/CommonCommandParameters.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/CompiledCommandParameter.cs b/src/System.Management.Automation/engine/CompiledCommandParameter.cs index 4a90b0849cf..3f879d6d1a9 100644 --- a/src/System.Management.Automation/engine/CompiledCommandParameter.cs +++ b/src/System.Management.Automation/engine/CompiledCommandParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -702,4 +701,3 @@ internal ParameterCollectionTypeInformation(Type type) } } - diff --git a/src/System.Management.Automation/engine/ConfigurationInfo.cs b/src/System.Management.Automation/engine/ConfigurationInfo.cs index 4b02416c208..e8b98ec46f1 100644 --- a/src/System.Management.Automation/engine/ConfigurationInfo.cs +++ b/src/System.Management.Automation/engine/ConfigurationInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs index e115e69cedb..05b0c0fc5d9 100644 --- a/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -26,7 +25,6 @@ private ContentCmdletProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // CmdletProviderIntrinsics private - /// /// Constructs a facade over the "real" session state API /// diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index bec80b891a4..4fbb5f662df 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; @@ -586,7 +585,6 @@ internal string BaseMethodToString(PSMethod method) } #endregion method - #region parameterized property internal string BaseParameterizedPropertyType(PSParameterizedProperty property) { @@ -692,9 +690,6 @@ internal void BaseParameterizedPropertySet(PSParameterizedProperty property, obj } } - - - internal string BaseParameterizedPropertyToString(PSParameterizedProperty property) { try @@ -878,7 +873,6 @@ private static int CompareOverloadCandidates(OverloadCandidate candidate1, Overl return 1; } - // Apply tie breaking rules, related to specificity of parameters betterCount = CompareTypeSpecificity(candidate1, candidate2); } @@ -2652,7 +2646,6 @@ private void InitSetter() Expression.Convert(value, property.PropertyType)), parameter, value).Compile(); } - internal MemberInfo member; internal GetterDelegate getterDelegate @@ -4355,7 +4348,6 @@ protected override void PropertySet(PSProperty property, object setValue, bool c throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns true if the property is settable /// @@ -4367,7 +4359,6 @@ protected override bool PropertyIsSettable(PSProperty property) throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns true if the property is gettable /// @@ -4379,7 +4370,6 @@ protected override bool PropertyIsGettable(PSProperty property) throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns the name of the type corresponding to the property's value /// @@ -4579,7 +4569,6 @@ protected override ConsolidatedString GetInternedTypeNameHierarchy(object obj) /// collection where the properties will be added protected abstract void DoAddAllProperties(object obj, PSMemberInfoInternalCollection members) where T : PSMemberInfo; - /// /// Returns null if memberName is not a member in the adapter or /// the corresponding PSMemberInfo @@ -4619,7 +4608,6 @@ protected override T GetMember(object obj, string memberName) return null; } - /// /// Retrieves all the members available in the object. /// The adapter implementation is encouraged to cache all properties/methods available @@ -4964,7 +4952,6 @@ protected override string PropertyType(PSProperty property, bool forDisplay) } #endregion virtual - /// /// Auxiliary in GetProperty to perform case sensitive and case insensitive searches /// in the child nodes @@ -5090,7 +5077,6 @@ protected override bool PropertyIsGettable(PSProperty property) return true; } - /// /// Returns the value from a property coming from a previous call to DoGetProperty /// diff --git a/src/System.Management.Automation/engine/Credential.cs b/src/System.Management.Automation/engine/Credential.cs index 0e01281c72e..be9d5fc5e16 100644 --- a/src/System.Management.Automation/engine/Credential.cs +++ b/src/System.Management.Automation/engine/Credential.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 @@ -239,7 +238,6 @@ private PSCredential() private NetworkCredential _netCred; - /// /// Returns an equivalent NetworkCredential object for this /// PSCredential. @@ -272,7 +270,6 @@ public NetworkCredential GetNetworkCredential() return _netCred; } - /// /// Provides an explicit cast to get a NetworkCredential /// from this PSCredential. diff --git a/src/System.Management.Automation/engine/CultureVariable.cs b/src/System.Management.Automation/engine/CultureVariable.cs index ee64ec9211d..ff042f7e893 100644 --- a/src/System.Management.Automation/engine/CultureVariable.cs +++ b/src/System.Management.Automation/engine/CultureVariable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/DataStoreAdapter.cs b/src/System.Management.Automation/engine/DataStoreAdapter.cs index 5d05b874779..e672d56577f 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapter.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 @@ -50,7 +49,6 @@ public string CurrentLocation } } // CurrentLocation - /// /// The current working directory for the virtual drive /// as a relative path from Root diff --git a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs index 127e7798b6a..c3e849cb483 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -37,7 +36,6 @@ public class ProviderInfo /// private SessionState _sessionState; - /// /// Gets the name of the provider. /// @@ -338,7 +336,6 @@ internal ProviderInfo( { } - /// /// Constructor for the ProviderInfo class. /// @@ -681,4 +678,3 @@ internal PSNoteProperty GetNotePropertyForProviderCmdlets(string name) } // class ProviderInfo } // namespace System.Management.Automation - diff --git a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs index 4e63b0f96b7..bcbca6e2d92 100644 --- a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs +++ b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs @@ -1,9 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - using System.Collections; using System.Collections.Generic; using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/DriveInterfaces.cs b/src/System.Management.Automation/engine/DriveInterfaces.cs index ed40ef004a6..d1963c65352 100644 --- a/src/System.Management.Automation/engine/DriveInterfaces.cs +++ b/src/System.Management.Automation/engine/DriveInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -25,7 +24,6 @@ private DriveManagementIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // DriveManagementIntrinsics private - /// /// Constructs a Drive management facade /// diff --git a/src/System.Management.Automation/engine/DriveNames.cs b/src/System.Management.Automation/engine/DriveNames.cs index 4c0ec5e6eaf..d271f8945cc 100644 --- a/src/System.Management.Automation/engine/DriveNames.cs +++ b/src/System.Management.Automation/engine/DriveNames.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/DscResourceInfo.cs b/src/System.Management.Automation/engine/DscResourceInfo.cs index 79ca58f1db2..22847667147 100644 --- a/src/System.Management.Automation/engine/DscResourceInfo.cs +++ b/src/System.Management.Automation/engine/DscResourceInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -124,7 +121,6 @@ public void UpdateProperties(IList properties) // HelpFile } - /// /// Contains a DSC resource property information /// diff --git a/src/System.Management.Automation/engine/DscResourceSearcher.cs b/src/System.Management.Automation/engine/DscResourceSearcher.cs index 87e5106e3ae..2d52c492e97 100644 --- a/src/System.Management.Automation/engine/DscResourceSearcher.cs +++ b/src/System.Management.Automation/engine/DscResourceSearcher.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -147,7 +146,6 @@ private DscResourceInfo GetNextDscResource() _context ); - resourceInfo.FriendlyName = resource.FriendlyName; resourceInfo.CompanyName = resource.CompanyName; diff --git a/src/System.Management.Automation/engine/EngineIntrinsics.cs b/src/System.Management.Automation/engine/EngineIntrinsics.cs index 1b4d2738cbc..d8d97c59f29 100644 --- a/src/System.Management.Automation/engine/EngineIntrinsics.cs +++ b/src/System.Management.Automation/engine/EngineIntrinsics.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using Dbg = System.Management.Automation; diff --git a/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs b/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs index 0a5e5e9f288..d88f59e2760 100644 --- a/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs +++ b/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Text; diff --git a/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs b/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs index 3f9d88fc87e..d890c3ce49f 100644 --- a/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs +++ b/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Text; diff --git a/src/System.Management.Automation/engine/ErrorPackage.cs b/src/System.Management.Automation/engine/ErrorPackage.cs index 44c275e6886..b108a459c18 100644 --- a/src/System.Management.Automation/engine/ErrorPackage.cs +++ b/src/System.Management.Automation/engine/ErrorPackage.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -927,7 +926,6 @@ private string BuildMessage( } // class ErrorDetails - /// /// Represents an error. /// @@ -1058,8 +1056,6 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte } #endregion Serialization - - #region Remoting /// diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index 590da2eb901..b279481ef49 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma warning disable 1634, 1691 using System.Collections; @@ -237,7 +237,6 @@ protected internal virtual void ProcessNewEvent(PSEventArgs newEvent, bool proce [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] public abstract PSEventSubscriber SubscribeEvent(object source, string eventName, string sourceIdentifier, PSObject data, PSEventReceivedEventHandler handlerDelegate, bool supportEvent, bool forwardEvent); - /// /// Subscribes to an event on an object. /// @@ -317,7 +316,6 @@ internal virtual PSEventSubscriber SubscribeEvent(object source, return SubscribeEvent(source, eventName, sourceIdentifier, data, handlerDelegate, supportEvent, forwardEvent, maxTriggerCount); } - /// /// Unsubscribes from an event on an object. /// @@ -537,7 +535,6 @@ public override PSEventSubscriber SubscribeEvent(Object source, string eventName return SubscribeEvent(source, eventName, sourceIdentifier, data, handlerDelegate, supportEvent, forwardEvent, 0); } - /// /// Subscribes to an event on an object. /// @@ -578,7 +575,6 @@ public override PSEventSubscriber SubscribeEvent(Object source, string eventName return subscriber; } - #region OnIdleProcessing private Timer _timer = null; @@ -843,7 +839,6 @@ private void ProcessNewSubscriber(PSEventSubscriber subscriber, Object source, s } } - /// /// Unsubscribes from an event on an object. /// @@ -856,7 +851,6 @@ public override void UnsubscribeEvent(PSEventSubscriber subscriber) UnsubscribeEvent(subscriber, false); } - /// /// Unsubscribes from an event on an object. /// @@ -1338,7 +1332,6 @@ private void InvokeAction(EventAction nextAction, out bool addActionBack) } } - internal bool IsExecutingEventAction { get { return (_processingAction != null); } @@ -1982,7 +1975,6 @@ private PSEngineEvent() { } internal static readonly HashSet EngineEvents = new HashSet(StringComparer.OrdinalIgnoreCase) { Exiting, OnIdle, OnScriptBlockInvoke }; } - /// /// Represents a subscriber to an event /// @@ -2107,7 +2099,6 @@ private ScriptBlock CreateBoundScriptBlock(ScriptBlock scriptAction) /// public PSEventReceivedEventHandler HandlerDelegate { get; } = null; - /// /// Get the flag that marks this event as a supporting event /// @@ -2189,7 +2180,6 @@ internal void OnPSEventUnsubscribed(Object sender, PSEventUnsubscribedEventArgs } } - /// /// The generic event handler from which specific event handlers extend. When possible, /// add functionality to this class instead of the IL generated by the GenerateEventHandler() @@ -2429,7 +2419,6 @@ internal PSEventArgs(string computerName, Guid runspaceId, int eventIdentifier, /// public delegate void PSEventReceivedEventHandler(Object sender, PSEventArgs e); - /// /// The event arguments associated with unsubscribing from an event /// @@ -2458,7 +2447,6 @@ internal PSEventUnsubscribedEventArgs(PSEventSubscriber eventSubscriber) /// public delegate void PSEventUnsubscribedEventHandler(Object sender, PSEventUnsubscribedEventArgs e); - /// /// This class contains the collection of events received by the /// execution context. @@ -2651,7 +2639,6 @@ public override bool HasMoreData } private bool _moreData = false; - /// /// Location in which this job is running /// diff --git a/src/System.Management.Automation/engine/ExecutionContext.cs b/src/System.Management.Automation/engine/ExecutionContext.cs index e67e8fcb394..889044b9b4f 100644 --- a/src/System.Management.Automation/engine/ExecutionContext.cs +++ b/src/System.Management.Automation/engine/ExecutionContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -399,8 +398,6 @@ internal LocationGlobber LocationGlobber #region Engine State - - /// /// The state for current engine that is running. /// @@ -572,7 +569,6 @@ internal CommandProcessorBase CreateCommand(string command, bool dotSource) /// Reference to command discovery internal CommandProcessorBase CurrentCommandProcessor { get; set; } - /// /// Redirect to the CommandDiscovery in the engine. /// @@ -585,7 +581,6 @@ internal CommandDiscovery CommandDiscovery } } - /// /// Interface that should be used for interaction with host /// @@ -605,7 +600,6 @@ internal InternalHost InternalHost get { return EngineHostInterface; } } - /// /// Interface to the public API for the engine /// diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs index e9271edffb4..c5c226a79de 100644 --- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs +++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Management.Automation.Internal; @@ -54,7 +53,6 @@ internal ExtendedTypeSystemException(string errorId, Exception innerException, s SetErrorId(errorId); } - #region Serialization /// /// Initializes a new instance of ExtendedTypeSystemException with serialization parameters @@ -71,7 +69,6 @@ protected ExtendedTypeSystemException(SerializationInfo info, StreamingContext c } // ExtendedTypeSystemException - /// /// Defines the exception thrown for Method related errors /// @@ -123,7 +120,6 @@ internal MethodException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of MethodException with serialization parameters @@ -189,7 +185,6 @@ internal MethodInvocationException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of MethodInvocationException with serialization parameters @@ -253,7 +248,6 @@ internal GetValueException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of GetValueException with serialization parameters @@ -270,7 +264,6 @@ protected GetValueException(SerializationInfo info, StreamingContext context) } // GetValueException - /// /// Defines the exception thrown for errors getting the value of properties /// @@ -319,7 +312,6 @@ internal PropertyNotFoundException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of GetValueException with serialization parameters @@ -383,7 +375,6 @@ internal GetValueInvocationException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of GetValueInvocationException with serialization parameters @@ -445,7 +436,6 @@ internal SetValueException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of SetValueException with serialization parameters @@ -507,7 +497,6 @@ internal SetValueInvocationException(string errorId, Exception innerException, { } - #region Serialization /// /// Initializes a new instance of SetValueInvocationException with serialization parameters @@ -618,4 +607,3 @@ public ErrorRecord ErrorRecord } } - diff --git a/src/System.Management.Automation/engine/ExternalScriptInfo.cs b/src/System.Management.Automation/engine/ExternalScriptInfo.cs index 399ec441a4a..6b21e8a7581 100644 --- a/src/System.Management.Automation/engine/ExternalScriptInfo.cs +++ b/src/System.Management.Automation/engine/ExternalScriptInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Text; diff --git a/src/System.Management.Automation/engine/ExtraAdapter.cs b/src/System.Management.Automation/engine/ExtraAdapter.cs index 6df54ba872d..a53f73545f3 100644 --- a/src/System.Management.Automation/engine/ExtraAdapter.cs +++ b/src/System.Management.Automation/engine/ExtraAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/FilterInfo.cs b/src/System.Management.Automation/engine/FilterInfo.cs index 7492b320ff8..918cf9ac498 100644 --- a/src/System.Management.Automation/engine/FilterInfo.cs +++ b/src/System.Management.Automation/engine/FilterInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/FunctionInfo.cs b/src/System.Management.Automation/engine/FunctionInfo.cs index 7786655552f..2414c20090d 100644 --- a/src/System.Management.Automation/engine/FunctionInfo.cs +++ b/src/System.Management.Automation/engine/FunctionInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 369fc9deed2..34a065c2ff0 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -898,7 +897,6 @@ private bool FindCommandForName(SearchResolutionOptions options, string commandN } } - // Only for this case, the loop should exit // Get-Command Foo if (isPattern || All || TotalCount != -1 || _isCommandTypeSpecified || _isModuleSpecified || _isFullyQualifiedModuleSpecified) @@ -912,7 +910,6 @@ private bool FindCommandForName(SearchResolutionOptions options, string commandN } } while (true); - if (All) { // Get additional matching commands from module tables. diff --git a/src/System.Management.Automation/engine/GetEvent_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/GetEvent_Types_Ps1Xml.cs index 783dfd098c1..184ab8933ef 100644 --- a/src/System.Management.Automation/engine/GetEvent_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/GetEvent_Types_Ps1Xml.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/src/System.Management.Automation/engine/ICommandRuntime.cs b/src/System.Management.Automation/engine/ICommandRuntime.cs index ef6bdc2cff8..cd792a2da56 100644 --- a/src/System.Management.Automation/engine/ICommandRuntime.cs +++ b/src/System.Management.Automation/engine/ICommandRuntime.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; @@ -519,7 +518,6 @@ public interface ICommandRuntime PSTransactionContext CurrentPSTransaction { get; } #endregion Transaction Support - #region Misc #region ThrowTerminatingError /// diff --git a/src/System.Management.Automation/engine/InformationRecord.cs b/src/System.Management.Automation/engine/InformationRecord.cs index e6bee00af5c..a5fd7b59849 100644 --- a/src/System.Management.Automation/engine/InformationRecord.cs +++ b/src/System.Management.Automation/engine/InformationRecord.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Collections.Generic; @@ -246,7 +245,6 @@ public class HostInformationMessage /// public ConsoleColor? BackgroundColor { get; set; } - /// /// Returns a string-based representation of the host information message /// diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 9cdd6656c2f..51f25e23e67 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -141,7 +140,6 @@ protected ConstrainedSessionStateEntry(string name, SessionStateEntryVisibility public SessionStateEntryVisibility Visibility { get; set; } } - /// /// Command class so that all the commands can derive off this one. /// Adds the flexibility of adding additional derived class, @@ -450,7 +448,6 @@ public SessionStateCmdletEntry(string name, Type implementingType, string helpFi CommandType = CommandTypes.Cmdlet; } - /// /// /// @@ -514,7 +511,6 @@ internal SessionStateProviderEntry(string name, Type implementingType, string he HelpFileName = helpFileName; } - /// /// Shallow-clone this object... /// @@ -975,7 +971,6 @@ public Collection Attributes private Collection _attributes; } - /// /// /// @@ -1158,7 +1153,6 @@ public void Clear() } } - /// /// This overload exists so that we can remove items based on the item name, rather than /// its position in the collection. The type argument can be null but we'll throw an error if @@ -1596,7 +1590,6 @@ public static InitialSessionState CreateDefault() return ss.Clone(); } - /// /// Creates the default PowerShell one with default cmdlets, provider etc. /// The default cmdlets, provider, etc are loaded via Modules @@ -1720,7 +1713,6 @@ public InitialSessionState Clone() return ss; } - /// /// Want to get away from SnapIn and console file. Have modules and assemblies instead. /// Specify the registered SnapIn name or name collection @@ -4889,7 +4881,6 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt { "Microsoft.WSMan.Management", "Microsoft.WSMan.Management"}, }; - // The list of engine modules that we will not allow users to remove internal static HashSet ConstantEngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) { @@ -4902,7 +4893,6 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt "System.Management.Automation", }; - internal static string GetNestedModuleDllName(string moduleName) { string result = null; diff --git a/src/System.Management.Automation/engine/InternalCommands.cs b/src/System.Management.Automation/engine/InternalCommands.cs index 40a1804f4a6..63e4c063f72 100644 --- a/src/System.Management.Automation/engine/InternalCommands.cs +++ b/src/System.Management.Automation/engine/InternalCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq.Expressions; @@ -123,7 +122,6 @@ public ScriptBlock[] RemainingScripts #endregion ScriptBlockSet - #region PropertyAndMethodSet /// @@ -154,7 +152,6 @@ public object[] ArgumentList #endregion PropertyAndMethodSet - /// /// Execute the begin scriptblock at the start of processing /// @@ -719,7 +716,6 @@ internal static ErrorRecord GenerateNameParameterError(string paraName, string r return errorRecord; } - /// /// Execute the end scriptblock when the pipeline is complete /// @@ -783,7 +779,6 @@ public ScriptBlock FilterScript } } - private string _property; /// /// The property to retrieve value @@ -825,7 +820,6 @@ public string Property get { return _property; } } - private object _convertedValue; private object _value = true; private bool _valueNotSpecified = true; @@ -1640,8 +1634,6 @@ private ReadOnlyPSMemberInfoCollection GetMatchMembers() } } - - /// /// Implements a cmdlet that sets the script debugging options. /// @@ -1836,6 +1828,5 @@ protected override void EndProcessing() } #endregion Set-StrictMode - #endregion Built-in cmdlets that are used by or require direct access to the engine. } \ No newline at end of file diff --git a/src/System.Management.Automation/engine/InvocationInfo.cs b/src/System.Management.Automation/engine/InvocationInfo.cs index 2852eb5886e..d104584d65e 100644 --- a/src/System.Management.Automation/engine/InvocationInfo.cs +++ b/src/System.Management.Automation/engine/InvocationInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs index 3c14e8ee58b..74fdd57cb56 100644 --- a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -25,7 +24,6 @@ private ItemCmdletProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // CmdletProviderIntrinsics private - /// /// Constructs a facade over the "real" session state API /// @@ -777,7 +775,6 @@ public void Invoke(string path) _sessionState.InvokeDefaultAction(new string[] { path }, false); } // InvokeDefaultAction - /// /// Invokes the default action of the item(s) at the specified path(s). /// @@ -827,7 +824,6 @@ public void Invoke(string[] path, bool literalPath) _sessionState.InvokeDefaultAction(path, literalPath); } // InvokeDefaultAction - /// /// Invokes the default action for the item at the specified path. /// @@ -1225,7 +1221,6 @@ public Collection New( return _sessionState.NewItem(new string[] { path }, name, itemTypeName, content, false); } // NewItem - /// /// Creates a new item at the given path. /// @@ -1296,7 +1291,6 @@ public Collection New( return _sessionState.NewItem(path, name, itemTypeName, content, force); } // NewItem - /// /// Creates a new item at the given path. /// @@ -1999,7 +1993,6 @@ public Collection Move(string path, string destination) return _sessionState.MoveItem(new string[] { path }, destination, false, false); } // MoveItem - /// /// Moves the item at the specified path to the specified destination. /// @@ -2070,7 +2063,6 @@ public Collection Move(string[] path, string destination, bool force, return _sessionState.MoveItem(path, destination, force, literalPath); } // MoveItem - /// /// Moves the item at the specified path to the specified destination. /// diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 2be6567140a..27aa00c00f3 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -457,7 +456,6 @@ public static bool IsObjectEnumerable(object obj) return IsTypeEnumerable(PSObject.Base(obj)?.GetType()); } - /// /// Retrieves the IEnumerable of obj or null if the language does not consider obj to be IEnumerable /// @@ -537,7 +535,6 @@ private static GetEnumerableDelegate CalculateGetEnumerable(Type objectType) return LanguagePrimitives.ReturnNullEnumerable; } - private static readonly CallSite> s_getEnumeratorSite = CallSite>.Create(PSEnumerableBinder.Get()); @@ -809,7 +806,6 @@ public static int Compare(object first, object second, bool ignoreCase, IFormatP } } - string firstString = first as string; if (firstString != null) @@ -1231,7 +1227,6 @@ internal static bool IsCimIntrinsicScalarType(Type type) return false; } - /// /// Verifies if type is one of the boolean types /// @@ -3212,7 +3207,6 @@ private static Delegate ConvertScriptBlockToDelegate(object valueToConvert, valueToConvert.ToString(), resultType.ToString(), exception.Message); } - private static Delegate ConvertPSMethodInfoToDelegate(object valueToConvert, Type resultType, bool recurse, @@ -3884,7 +3878,6 @@ private static object ConvertNumericIConvertible(object valueToConvert, } } - private class ConvertCheckingForCustomConverter { internal PSConverter tryfirstConverter; @@ -4190,7 +4183,6 @@ internal static ConversionRank GetConversionRank(Type fromType, Type toType) private static Type[] s_realTypes = new Type[] { typeof(Single), typeof(Double), typeof(Decimal) }; - internal static void RebuildConversionCache() { lock (s_converterCache) diff --git a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs index c7fa0334a7b..15518567e32 100644 --- a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs +++ b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -220,7 +219,6 @@ protected override PSMemberInfoInternalCollection GetMembers(object obj) return returnValue; } - /// /// Called after a non null return from GetMember to try to call /// the method with the arguments @@ -704,7 +702,6 @@ private Object AuxillaryInvokeMethod(ManagementObject obj, WMIMethodCacheEntry m Diagnostics.Assert(parameterList.Length == verifiedArguments.Length, "The number of parameters and arguments should match"); - // we should not cache inParameters as we are updating // inParameters object with argument values..Caching will // have side effects in this scenario like we have to clear @@ -889,7 +886,6 @@ protected abstract void AddAllMethods(ManagementBaseObject wmiObject, protected abstract object InvokeManagementMethod(ManagementObject wmiObject, string methodName, ManagementBaseObject inParams); - /// /// Get a method object given method name /// @@ -903,7 +899,6 @@ protected abstract object InvokeManagementMethod(ManagementObject wmiObject, protected abstract T GetManagementObjectMethod(ManagementBaseObject wmiObject, string methodName) where T : PSMemberInfo; - /// /// Returns null if propertyName is not a property in the adapter or /// the corresponding PSProperty with its adapterData set to information @@ -915,7 +910,6 @@ protected abstract T GetManagementObjectMethod(ManagementBaseObject wmiObject protected abstract PSProperty DoGetProperty(ManagementBaseObject wmiObject, string propertyName); - #endregion #region Private Data @@ -1110,7 +1104,6 @@ protected override PSProperty DoGetProperty(ManagementBaseObject wmiObject, stri // ignore the exception. } - return null; } diff --git a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs index abd35ea65e6..be186a12a35 100644 --- a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs +++ b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -162,7 +161,6 @@ internal Collection AddMetadataForBinder( return result; } - /// /// The next available parameter set bit. This number increments but the parameter /// set bit is really 1 shifted left this number of times. This number also acts @@ -403,7 +401,6 @@ internal string GetParameterSetName(uint parameterSet) return result; } // GetParameterSetName - /// /// Helper function to retrieve the name of the parameter /// which defined an alias. @@ -479,7 +476,6 @@ internal MergedCompiledCommandParameter GetMatchingParameter( name = name.Substring(1); } - // First try to match the bindable parameters foreach (string parameterName in _bindableParameters.Keys) @@ -697,7 +693,6 @@ public override string ToString() } } - /// /// This enum is used in the MergedCompiledCommandParameter class /// to associate a particular CompiledCommandParameter with the diff --git a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs index 318596290cd..270b4678ac1 100644 --- a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs +++ b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs index 06ae7ca0a95..9dda14d5f4c 100644 --- a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs +++ b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs b/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs index ab54f34d08e..c6e2a6216d0 100644 --- a/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs index 5b3a7f8219a..a1bce6c9a27 100644 --- a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -125,7 +124,6 @@ public sealed class GetModuleCommand : ModuleCmdletBase, IDisposable #region Remote discovery - private IEnumerable GetAvailableViaPsrpSessionCore(string[] moduleNames, Runspace remoteRunspace) { Dbg.Assert(remoteRunspace != null, "Caller should verify remoteRunspace != null"); diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index 90d8308e2c7..d9a418314bc 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 6d703e93624..db474b4e1a0 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -938,7 +937,6 @@ private IEnumerable GetModuleForRootedPaths(string[] modulePaths, //Now we resolve the possible paths in case it is relative path/path contains wildcards var modulePathCollection = GetResolvedPathCollection(modulePath, this.Context); - if (modulePathCollection != null) { foreach (string resolvedModulePath in modulePathCollection) @@ -1064,7 +1062,6 @@ private Dictionary> GetAvailableLocallyModulesCore(st return modules; } - /// /// Get a list of all modules /// which can be imported just by specifying a non rooted file name of the module @@ -2090,7 +2087,6 @@ internal PSModuleInfo LoadModuleManifest( Array.Clear(tmpNestedModules, 0, tmpNestedModules.Length); } - // Set the private data member for the module if the manifest contains // this member object privateData = null; @@ -2942,7 +2938,6 @@ internal PSModuleInfo LoadModuleManifest( } } - if (actualRootModuleIsXaml) { manifestInfo.SetModuleType(ModuleType.Workflow); @@ -3349,7 +3344,6 @@ internal PSModuleInfo LoadModuleManifest( } } - if (newManifestInfo.DeclaredVariableExports == null || newManifestInfo.DeclaredVariableExports.Count == 0) { @@ -4210,7 +4204,6 @@ private static PSModuleInfo ImportRequiredModule(ExecutionContext context, Modul powerShell.AddParameter("Version", requiredModule.Version); } - powerShell.Invoke(); if (powerShell.Streams.Error != null && powerShell.Streams.Error.Count > 0) { @@ -4963,7 +4956,6 @@ internal static string GetResolvedPath(string filePath, ExecutionContext context Collection filePaths; - if (context != null && context.EngineSessionState != null && context.EngineSessionState.IsProviderLoaded(context.ProviderNames.FileSystem)) { try @@ -5001,7 +4993,6 @@ internal static Collection GetResolvedPathCollection(string filePath, Ex Collection filePaths; - if (context != null && context.EngineSessionState != null && context.EngineSessionState.IsProviderLoaded(context.ProviderNames.FileSystem)) { try @@ -5157,7 +5148,6 @@ internal void RemoveModule(PSModuleInfo module, string moduleNameInRemoveModuleC Context.EngineSessionState.RemoveCmdletEntry(keyToRemove, true); } - // Remove any providers imported by this module. Providers are always imported into // the top level session state. Only binary modules can import providers. if (module.ModuleType == ModuleType.Binary) @@ -6352,7 +6342,6 @@ private BinaryAnalysisResult GetCmdletsFromBinaryModuleImplementation(string pat } } - private static void AnalyzeSnapinDomainHelper() { String path = (string)AppDomain.CurrentDomain.GetData("PathToProcess"); @@ -7567,7 +7556,6 @@ private static void ImportFunctionsOrWorkflows(FunctionInfo func, SessionStateIn } } - private static void SetCommandVisibility(bool isImportModulePrivate, CommandInfo command) { if (isImportModulePrivate) diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index 1a71b3b619c..8b754371749 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.IO; diff --git a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs index 0b7fb6f99ff..7e854fa9dfe 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation.Language; @@ -215,8 +214,6 @@ public override string ToString() return moduleSpecString; } - - /// /// Parse the specified string into a ModuleSpecification object /// diff --git a/src/System.Management.Automation/engine/Modules/ModuleUtils.cs b/src/System.Management.Automation/engine/Modules/ModuleUtils.cs index c295f3af366..c3203888516 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleUtils.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Globalization; diff --git a/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs index 68aff2813ba..a01342d985d 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index 981c9b19af4..3f73906a0d3 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq; diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index 77780ca7ef4..8f1c3316efd 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -539,7 +538,6 @@ public Dictionary ExportedFunctions } } - private bool IsScriptModuleFile(string path) { var ext = System.IO.Path.GetExtension(path); @@ -821,7 +819,6 @@ internal List CompiledExports private readonly List _compiledExports = new List(); - /// /// Add AliasInfo to the fixed exports list... /// @@ -840,7 +837,6 @@ internal void AddExportedAlias(AliasInfo aliasInfo) /// internal List CompiledAliasExports { get; } = new List(); - /// /// FileList /// @@ -1504,7 +1500,6 @@ public static void ClearAppDomainLevelModulePathCache() s_appdomainModulePathCache.Clear(); } - #if DEBUG /// /// A method available in debug mode providing access to the module path cache. @@ -1614,7 +1609,6 @@ public enum ModuleAccessMode Constant = 2 } - /// /// An EqualityComparer to compare 2 PSModuleInfo instances. 2 PSModuleInfos are /// considered equal if their Name,Guid and Version are equal. diff --git a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs index 30862775561..e5f3fc842a5 100644 --- a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs +++ b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs b/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs index 7f735e44ad9..3dd8d3ac926 100644 --- a/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs index 00eaba100d4..0178f4220a1 100644 --- a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs +++ b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Globalization; diff --git a/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs index a884a447ead..39cf4b94e67 100644 --- a/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/MshCmdlet.cs b/src/System.Management.Automation/engine/MshCmdlet.cs index 6a9085eb75d..171198b8296 100644 --- a/src/System.Management.Automation/engine/MshCmdlet.cs +++ b/src/System.Management.Automation/engine/MshCmdlet.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 43672e3116e..efbdd4d7a74 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -1,9 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -1891,7 +1889,6 @@ public bool ShouldContinue( return DoShouldContinue(query, caption, false, true, ref yesToAll, ref noToAll); } - private bool DoShouldContinue( string query, string caption, @@ -2320,7 +2317,6 @@ public void Dispose() private Thread _wasPermittedToWriteThread = null; } // AllowWrite - /// /// Stores the exception to be returned from /// PipelineProcessor.SynchronousExecute, @@ -2488,7 +2484,6 @@ internal void SetupInformationVariable() SetupVariable(VariableStreamKind.Information, this.InformationVariable, ref _informationVarList); } // SetupWarningVariable - internal void SetupVariable(VariableStreamKind streamKind, string variableName, ref IList varList) { if (String.IsNullOrEmpty(variableName)) @@ -2579,7 +2574,6 @@ internal void _WriteObjectSkipAllowCheck(object sendToPipeline) this.OutputPipe.Add(sendToPipeline); } - // NOTICE-2004/06/08-JonN 959638 // Use this variant to skip the ThrowIfWriteNotPermitted check /// @@ -2872,7 +2866,6 @@ internal void _WriteErrorSkipAllowCheck(ErrorRecord errorRecord, ActionPreferenc #region Preference - // These are a set of preference variables which affect the inner // workings of the command and when what information will get output. // See "User Feedback Mechanisms - Note.doc" for details. @@ -2915,8 +2908,6 @@ internal ConfirmImpact ConfirmPreference } } - - private bool _isDebugPreferenceSet = false; private ActionPreference _debugPreference = InitialSessionState.defaultDebugPreference; private bool _isDebugPreferenceCached = false; @@ -2951,7 +2942,6 @@ internal ActionPreference DebugPreference return ActionPreference.SilentlyContinue; } - if (!_isDebugPreferenceCached) { bool defaultUsed = false; @@ -3047,7 +3037,6 @@ internal ActionPreference WarningPreference return ActionPreference.Continue; // Debug:$false and Verbose:$false ignored - if (!_isWarningPreferenceCached) { bool defaultUsed = false; @@ -3137,7 +3126,6 @@ internal SwitchParameter UseTransaction internal bool UseTransactionFlagSet { get; private set; } = false; - //This is used so that people can tell whether the debug switch was specified. This // Is useful in the Cmdlet-calling-Cmdlet case where you'd like the underlying Cmdlet to // have the same switches. @@ -3303,7 +3291,6 @@ internal ActionPreference InformationPreference private bool _isInformationPreferenceCached = false; - internal PagingParameters PagingParameters { get; set; } #endregion Preference @@ -3715,4 +3702,4 @@ internal void RemoveVariableListsInPipe() } } } -} \ No newline at end of file +} diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index 126de7325a3..223208a9213 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Management.Automation.Language; @@ -167,7 +166,6 @@ internal void SetValueNoConversion(object setValue) thisAsProperty.SetAdaptedValue(setValue, false); } - /// /// Initializes a new instance of an PSMemberInfo derived class /// @@ -620,7 +618,6 @@ public override string ToString() return returnValue.ToString(); } - /// /// Called from TypeTableUpdate before SetSetterFromTypeTable is called /// @@ -861,7 +858,6 @@ public override bool IsGettable } } - /// /// Gets and Sets the value of this member /// @@ -1241,7 +1237,6 @@ public override string ToString() return returnValue.ToString(); } - internal object noteValue; /// @@ -1408,7 +1403,6 @@ public override string ToString() return returnValue.ToString(); } - internal PSVariable _variable; /// @@ -2164,7 +2158,6 @@ internal void SetCodeReference(Type type, string methodName) } } - /// /// Used from TypeTable /// @@ -2231,7 +2224,6 @@ public override PSMemberTypes MemberType } } - /// /// Invokes CodeReference method and returns its results. /// @@ -2346,7 +2338,6 @@ public ScriptBlock Script } } - /// /// Initializes a new instance of PSScriptMethod /// @@ -3042,7 +3033,6 @@ internal static PSMethod Create(string name, Adapter adapter, object baseObje } } - /// /// Used to access parameterized properties from the BaseObject /// @@ -3062,7 +3052,6 @@ public override string ToString() return this.adapter.BaseParameterizedPropertyToString(this); } - internal Adapter adapter; internal object adapterData; internal object baseObject; @@ -3150,7 +3139,6 @@ public void InvokeSet(object valueToSet, params object[] arguments) this.adapter.BaseParameterizedPropertySet(this, valueToSet, arguments); } - /// /// Returns a collection of the definitions for this property /// @@ -3366,7 +3354,6 @@ public bool InheritMembers } } - /// /// Gets the internal member collection /// @@ -3898,7 +3885,6 @@ internal static WildcardPattern GetNamePattern(string name) return null; } - /// /// Returns all members in memberList matching name and memberTypes /// @@ -4040,7 +4026,6 @@ public abstract T this[string name] /// for invalid arguments internal abstract ReadOnlyPSMemberInfoCollection Match(string name, PSMemberTypes memberTypes, MshMemberMatchOptions matchOptions); - #endregion Match internal static bool IsReservedName(string name) @@ -4054,7 +4039,6 @@ internal static bool IsReservedName(string name) #region IEnumerable - /// /// Gets the general enumerator for this collection /// @@ -4453,7 +4437,6 @@ public override IEnumerator GetEnumerator() #region CollectionEntry - internal class CollectionEntry where T : PSMemberInfo { internal delegate PSMemberInfoInternalCollection GetMembersDelegate(PSObject obj); @@ -4585,7 +4568,6 @@ private void GenerateAllReservedMembers() internal Collection> Collections { get; } - private PSObject _mshOwner; private PSMemberSet _memberSetOwner; @@ -4668,7 +4650,6 @@ public override void Add(T member, bool preValidated) ExtendedTypeSystem.CannotAddPropertyOrMethod); } - if (_memberSetOwner != null && _memberSetOwner.IsReservedMember) { throw new ExtendedTypeSystemException("CannotAddToReservedNameMemberset", @@ -4812,7 +4793,6 @@ public override void Remove(string name) _memberSetOwner.InternalMembers.Remove(name); } - /// /// Method which checks if the is reserved and if so /// it will ensure that the particular reserved member is loaded into the @@ -4854,7 +4834,6 @@ private void EnsureReservedMemberIsLoaded(string name) } } - /// /// Returns the name corresponding to name or null if it is not present /// @@ -4934,7 +4913,6 @@ public override T this[string name] } } - private PSMemberInfoInternalCollection GetIntegratedMembers(MshMemberMatchOptions matchOptions) { using (PSObject.memberResolution.TraceScope("Generating the total list of members")) @@ -5014,7 +4992,6 @@ private PSMemberInfoInternalCollection GetIntegratedMembers(MshMemberMatchOpt } } - /// /// Returns all members in the collection matching name /// @@ -5185,7 +5162,6 @@ void IEnumerator.Reset() _current = null; } - /// /// Not supported /// diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index c4651c8a1ef..1e3589a0b21 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -587,7 +586,6 @@ internal static PSObject ConstructPSObjectFromSerializationInfo(SerializationInf /// private object _immediateBaseObject; - private WeakReference _typeTable; /// @@ -735,7 +733,6 @@ internal static bool HasInstanceMembers(object obj, out PSMemberInfoInternalColl #endregion instance fields - #endregion fields #region properties @@ -809,7 +806,6 @@ public PSMemberInfoCollection Methods } private PSMemberInfoIntegratingCollection _methods; - /// /// Gets the object we are directly wrapping. /// @@ -1584,7 +1580,6 @@ public virtual PSObject Copy() returnValue._immediateBaseObject = CopyValueType(returnValue._immediateBaseObject); } - // needToReAddInstanceMembersAndTypeNames = returnValue will have a different key (different from "this") returned from GetKeyForResurrectionTables bool needToReAddInstanceMembersAndTypeNames = !object.ReferenceEquals(GetKeyForResurrectionTables(this), GetKeyForResurrectionTables(returnValue)); if (needToReAddInstanceMembersAndTypeNames) @@ -1755,7 +1750,6 @@ internal void AddOrSetProperty(PSNoteProperty property) /// public const string BaseObjectMemberSetName = "psbase"; - /// /// The PSObject's properties /// @@ -1852,8 +1846,6 @@ internal static object GetNoteSettingValue(PSMemberSet settings, string noteName return note.Value; } - - internal int GetSerializationDepth(TypeTable backupTypeTable) { int result = 0; diff --git a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs index 6a7af45f14f..7274d876551 100644 --- a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs +++ b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.ComponentModel; using System.Management.Automation.Runspaces; - namespace System.Management.Automation { /// @@ -96,7 +94,6 @@ public class PSObjectPropertyDescriptor : PropertyDescriptor internal event EventHandler SettingValueException; internal event EventHandler GettingValueException; - internal PSObjectPropertyDescriptor(string propertyName, Type propertyType, bool isReadOnly, AttributeCollection propertyAttributes) : base(propertyName, Utils.EmptyArray()) { @@ -702,7 +699,6 @@ public PSObjectTypeDescriptionProvider() { } - /// /// Retrieves a to provide information about the properties for an object of the type . /// @@ -751,4 +747,3 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object } } - diff --git a/src/System.Management.Automation/engine/MshReference.cs b/src/System.Management.Automation/engine/MshReference.cs index c22377905a2..00532b6222c 100644 --- a/src/System.Management.Automation/engine/MshReference.cs +++ b/src/System.Management.Automation/engine/MshReference.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Dynamic; using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/engine/MshSecurityException.cs b/src/System.Management.Automation/engine/MshSecurityException.cs index 6b48bfdc322..3a33abe5830 100644 --- a/src/System.Management.Automation/engine/MshSecurityException.cs +++ b/src/System.Management.Automation/engine/MshSecurityException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs index 336c2f59326..19f1f7cdb2a 100644 --- a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs +++ b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; @@ -138,4 +137,3 @@ public override string ToString() } } - diff --git a/src/System.Management.Automation/engine/NativeCommand.cs b/src/System.Management.Automation/engine/NativeCommand.cs index 63bea73314f..883bc6e1f9a 100644 --- a/src/System.Management.Automation/engine/NativeCommand.cs +++ b/src/System.Management.Automation/engine/NativeCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs index a3df920e77e..4b0b2d9afa7 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Microsoft.PowerShell.Commands; using System.Collections; diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs index f8beed2b91d..fca59bdfc44 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; @@ -96,4 +95,3 @@ internal override Collection BindParameters(Collection } } - diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index c51e730495f..8968fa74c03 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma warning disable 1634, 1691 using System.Diagnostics; @@ -102,7 +102,6 @@ internal static MinishellStream ToMinishellStream(string stream) } } - /// /// An output object from the child process. /// If it's from the error stream isError will be true @@ -767,7 +766,6 @@ internal override void Complete() } } - #region Process cleanup with Child Process cleanup /// @@ -1223,7 +1221,6 @@ private void CalculateIORedirection(out bool redirectOutput, out bool redirectEr } } - // See if the error output stream has been redirected, either through an explicit 2> foo.txt or // my merging error into output through 2>&1. if (CommandRuntime.ErrorMergeTo != MshCommandRuntime.MergeDataStream.Output) @@ -1933,7 +1930,6 @@ internal static class ConsoleVisibility [DllImport("kernel32.dll", SetLastError = true)] internal static extern bool AllocConsole(); - /// /// Called to save the foreground window before allocating a hidden console window /// @@ -2103,7 +2099,6 @@ PSObject serializedRemoteInvocationInfo _serializedRemoteInvocationInfo = serializedRemoteInvocationInfo; } - #region ISerializable Members /// diff --git a/src/System.Management.Automation/engine/NullString.cs b/src/System.Management.Automation/engine/NullString.cs index ef7ccc84b5b..b6acafa5813 100644 --- a/src/System.Management.Automation/engine/NullString.cs +++ b/src/System.Management.Automation/engine/NullString.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Language { diff --git a/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs b/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs index dd6450f3969..b6803819d1a 100644 --- a/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs +++ b/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -31,7 +30,6 @@ public string SourceIdentifier } private string _sourceIdentifier = Guid.NewGuid().ToString(); - /// /// Parameter for any action to be invoked when the event arrives /// diff --git a/src/System.Management.Automation/engine/PSClassInfo.cs b/src/System.Management.Automation/engine/PSClassInfo.cs index fbfd436bcec..03bab13b3c8 100644 --- a/src/System.Management.Automation/engine/PSClassInfo.cs +++ b/src/System.Management.Automation/engine/PSClassInfo.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -54,7 +51,6 @@ public void UpdateMembers(IList members) public string HelpFile { get; internal set; } = String.Empty; } - /// /// Contains a class field information /// @@ -88,4 +84,4 @@ internal PSClassMemberInfo(string name, string memberType, string defaultValue) /// public string DefaultValue { get; private set; } } -} \ No newline at end of file +} diff --git a/src/System.Management.Automation/engine/PSClassSearcher.cs b/src/System.Management.Automation/engine/PSClassSearcher.cs index 90f28ee7223..970dc68ccbb 100644 --- a/src/System.Management.Automation/engine/PSClassSearcher.cs +++ b/src/System.Management.Automation/engine/PSClassSearcher.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/PSConfiguration.cs b/src/System.Management.Automation/engine/PSConfiguration.cs index 8861e676c44..73028fb128f 100644 --- a/src/System.Management.Automation/engine/PSConfiguration.cs +++ b/src/System.Management.Automation/engine/PSConfiguration.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Text; diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 55e30b350e4..335cd678c05 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Reflection; @@ -226,7 +225,6 @@ internal static string RegistryVersionKey } } - internal static string GetRegistryVersionKeyForSnapinDiscovery(string majorVersion) { int tempMajorVersion = 0; diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index 94b15552f6c..983683e0b6a 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; @@ -112,7 +111,6 @@ internal ParameterBinderBase( _isTranscribing = context.EngineHostInterface.UI.IsTranscribing; } - /// /// Constructs the parameter binder with the specified type metadata. The binder is only valid /// for a single instance of a bindable object and only for the duration of a command. @@ -1129,7 +1127,6 @@ private object CoerceTypeAsNeeded( boType = argumentType; } - if (boType == typeof(bool)) { if (LanguagePrimitives.IsBooleanType(toType)) @@ -1199,7 +1196,6 @@ private object CoerceTypeAsNeeded( break; } - // NTRAID#Windows OS Bugs-1009284-2004/05/05-JeffJon // Need to handle other collection types here as well diff --git a/src/System.Management.Automation/engine/ParameterBinderController.cs b/src/System.Management.Automation/engine/ParameterBinderController.cs index d4f78e0eb78..72f9fd01697 100644 --- a/src/System.Management.Automation/engine/ParameterBinderController.cs +++ b/src/System.Management.Automation/engine/ParameterBinderController.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -446,7 +445,6 @@ internal virtual bool BindParameter( ParameterBinderStrings.ParameterAlreadyBound, "ParameterAlreadyBound"); - throw bindingException; } @@ -635,7 +633,6 @@ out ParameterBindingException outgoingBindingException throw bindingException; } - if (positionalParameterDictionary.Count > 0) { int unboundArgumentsIndex = 0; @@ -902,7 +899,6 @@ out ParameterBindingException bindingException return result; } - /// /// Generate elaborated binding exception so that the user will know the default binding might cause the failure /// @@ -941,7 +937,6 @@ protected void ThrowElaboratedBindingException(ParameterBindingException pbex) throw newBindingException; } - private static CommandParameterInternal GetNextPositionalArgument( List unboundArgumentsCollection, Collection nonPositionalArguments, diff --git a/src/System.Management.Automation/engine/ParameterInfo.cs b/src/System.Management.Automation/engine/ParameterInfo.cs index e6505370027..602f52d4858 100644 --- a/src/System.Management.Automation/engine/ParameterInfo.cs +++ b/src/System.Management.Automation/engine/ParameterInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -138,7 +137,6 @@ private void SetAttributes(IList attributeMetadata) Attributes = new ReadOnlyCollection(processedAttributes); } - private void SetParameterSetData(ParameterSetSpecificMetadata parameterMetadata) { IsMandatory = parameterMetadata.IsMandatory; diff --git a/src/System.Management.Automation/engine/ParameterSetInfo.cs b/src/System.Management.Automation/engine/ParameterSetInfo.cs index f34c269f90f..bcbbc31f6b7 100644 --- a/src/System.Management.Automation/engine/ParameterSetInfo.cs +++ b/src/System.Management.Automation/engine/ParameterSetInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/ParameterSetPromptingData.cs b/src/System.Management.Automation/engine/ParameterSetPromptingData.cs index 1df11b5e591..9c698082f3c 100644 --- a/src/System.Management.Automation/engine/ParameterSetPromptingData.cs +++ b/src/System.Management.Automation/engine/ParameterSetPromptingData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; @@ -57,7 +56,6 @@ internal Dictionary PipelineableMandatoryByPropertyNameParameters { get; } = new Dictionary(); - /// /// Gets the parameters that do not take pipeline input and are mandatory in this parameter set /// diff --git a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs index 2dde7499cd0..c699ced3873 100644 --- a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs +++ b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { @@ -133,7 +132,6 @@ internal bool ValueFromPipelineByPropertyName /// internal string HelpMessageResourceId { get; } = null; - /// /// Gets or sets the value that tells whether this parameter set /// data is for the "all" parameter set @@ -220,9 +218,7 @@ internal string GetHelpMessage(Cmdlet cmdlet) return helpInfo; } - private ParameterAttribute _attribute; } // ParameterSetSpecificMetadata } - diff --git a/src/System.Management.Automation/engine/PathInterfaces.cs b/src/System.Management.Automation/engine/PathInterfaces.cs index c116ac3ea59..771e758aa84 100644 --- a/src/System.Management.Automation/engine/PathInterfaces.cs +++ b/src/System.Management.Automation/engine/PathInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -1182,7 +1181,6 @@ internal string ParseParent( return _sessionState.GetParentPath(path, root, context, false); } // GetParentPath - /// /// Gets the parent path of the specified path. /// Allow to use FileSystem as the default provider when the @@ -1335,7 +1333,6 @@ internal string ParseChildName( return _sessionState.GetChildName(path, context, false); } // ParseChildName - /// /// Gets the child name of the specified path. /// Allow to use FileSystem as the default provider when the diff --git a/src/System.Management.Automation/engine/Pipe.cs b/src/System.Management.Automation/engine/Pipe.cs index 340adb41bad..27ee2b46415 100644 --- a/src/System.Management.Automation/engine/Pipe.cs +++ b/src/System.Management.Automation/engine/Pipe.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -448,7 +447,6 @@ private void AddToPipe(object obj) } } - /// /// Writes a set of objects to the pipe. This could recursively /// call to the downstream cmdlet, or write the objects to the diff --git a/src/System.Management.Automation/engine/PositionalCommandParameter.cs b/src/System.Management.Automation/engine/PositionalCommandParameter.cs index 0d8261e24dc..8ef2fb8cb7f 100644 --- a/src/System.Management.Automation/engine/PositionalCommandParameter.cs +++ b/src/System.Management.Automation/engine/PositionalCommandParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/ProcessCodeMethods.cs b/src/System.Management.Automation/engine/ProcessCodeMethods.cs index 3349a1fcdfc..8f9c76794fc 100644 --- a/src/System.Management.Automation/engine/ProcessCodeMethods.cs +++ b/src/System.Management.Automation/engine/ProcessCodeMethods.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Diagnostics; using System.Management.Automation; using System.Runtime.InteropServices; diff --git a/src/System.Management.Automation/engine/ProgressRecord.cs b/src/System.Management.Automation/engine/ProgressRecord.cs index 630407434bb..de0d30e2c3d 100644 --- a/src/System.Management.Automation/engine/ProgressRecord.cs +++ b/src/System.Management.Automation/engine/ProgressRecord.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using Dbg = System.Management.Automation.Diagnostics; @@ -104,8 +103,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the Id of the activity for which this record is a subordinate. @@ -145,8 +142,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the description of the activity for which progress is being reported. @@ -177,8 +172,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the current status of the operation, e.g., "35 of 50 items Copied." or "95% completed." or "100 files purged." @@ -203,8 +196,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the current operation of the many required to accomplish the activity (such as "copying foo.txt"). Normally displayed @@ -229,8 +220,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the estimate of the percentage of total work for the activity that is completed. Typically displayed as a progress bar. @@ -261,8 +250,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the estimate of time remaining until this activity is completed. This can be based upon a measurement of time since @@ -293,8 +280,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Gets and sets the type of record represented by this instance. @@ -320,8 +305,6 @@ internal ProgressRecord(ProgressRecord other) } } - - /// /// /// Overrides @@ -497,7 +480,6 @@ internal static int GetPercentageComplete(DateTime startTime, TimeSpan expectedD #region Serialization / deserialization for remoting - /// /// Creates a ProgressRecord object from a PSObject property bag. /// PSObject has to be in the format returned by ToPSObjectForRemoting method. @@ -559,8 +541,6 @@ internal PSObject ToPSObjectForRemoting() #endregion } //ProgressRecord - - /// /// /// Defines two types of progress record that refer to the beginning (or middle) and end of an operation. diff --git a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs index 5efb3046105..4bc16ed00cc 100644 --- a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -25,7 +24,6 @@ private PropertyCmdletProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // CmdletProviderIntrinsics private - /// /// Constructs a facade over the "real" session state API /// @@ -371,7 +369,6 @@ public Collection Set( return _sessionState.SetProperty(new string[] { path }, propertyValue, false, false); } // SetProperty - /// /// Sets the specified properties on the specified item(s) /// @@ -436,7 +433,6 @@ public Collection Set( return _sessionState.SetProperty(path, propertyValue, force, literalPath); } // SetProperty - /// /// Sets the specified properties on the specified item(s) /// @@ -1615,7 +1611,6 @@ public Collection Copy( false, false); } // CopyProperty - /// /// Copies a property on the specified item(s) /// @@ -1700,7 +1695,6 @@ public Collection Copy( literalPath); } // CopyProperty - /// /// Copies a property on the specified item(s) /// @@ -1928,7 +1922,6 @@ public Collection Move( false); } // MoveProperty - /// /// Moves a property on the specified item(s) /// @@ -2017,7 +2010,6 @@ public Collection Move( literalPath); } // MoveProperty - /// /// Moves a property on the specified item(s) /// diff --git a/src/System.Management.Automation/engine/ProviderInterfaces.cs b/src/System.Management.Automation/engine/ProviderInterfaces.cs index 46e288cbb38..7be21c3b883 100644 --- a/src/System.Management.Automation/engine/ProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -53,7 +52,6 @@ internal CmdletProviderManagementIntrinsics(SessionStateInternal sessionState) #region Public methods - /// /// Gets the specified provider(s). /// diff --git a/src/System.Management.Automation/engine/ProviderNames.cs b/src/System.Management.Automation/engine/ProviderNames.cs index 59199cd9a63..2443827378f 100644 --- a/src/System.Management.Automation/engine/ProviderNames.cs +++ b/src/System.Management.Automation/engine/ProviderNames.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/ProxyCommand.cs b/src/System.Management.Automation/engine/ProxyCommand.cs index 362dc23b00f..8d36b4f9d6b 100644 --- a/src/System.Management.Automation/engine/ProxyCommand.cs +++ b/src/System.Management.Automation/engine/ProxyCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Text; diff --git a/src/System.Management.Automation/engine/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/PseudoParameterBinder.cs index 344818f0ffc..e089b74543f 100644 --- a/src/System.Management.Automation/engine/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/PseudoParameterBinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/PseudoParameters.cs b/src/System.Management.Automation/engine/PseudoParameters.cs index b7a40740e4b..50b8ff4ef2e 100644 --- a/src/System.Management.Automation/engine/PseudoParameters.cs +++ b/src/System.Management.Automation/engine/PseudoParameters.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/QuestionMarkVariable.cs b/src/System.Management.Automation/engine/QuestionMarkVariable.cs index ab9f25b0f66..aef42ddae60 100644 --- a/src/System.Management.Automation/engine/QuestionMarkVariable.cs +++ b/src/System.Management.Automation/engine/QuestionMarkVariable.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs index 9b0991deaa2..6d47c93b865 100644 --- a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs +++ b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Linq.Expressions; diff --git a/src/System.Management.Automation/engine/RunspaceConfigurationEntry.cs b/src/System.Management.Automation/engine/RunspaceConfigurationEntry.cs index c90388e0e2b..774944fd10e 100644 --- a/src/System.Management.Automation/engine/RunspaceConfigurationEntry.cs +++ b/src/System.Management.Automation/engine/RunspaceConfigurationEntry.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -102,7 +101,6 @@ internal RunspaceConfigurationEntry(string name, PSSnapInInfo psSnapin) PSSnapIn = psSnapin; } - /// /// Gets name of configuration entry /// @@ -528,5 +526,4 @@ internal enum UpdateAction } } - #pragma warning restore 56506 \ No newline at end of file diff --git a/src/System.Management.Automation/engine/ScopedItemSearcher.cs b/src/System.Management.Automation/engine/ScopedItemSearcher.cs index b7e951450ce..51b80461da9 100644 --- a/src/System.Management.Automation/engine/ScopedItemSearcher.cs +++ b/src/System.Management.Automation/engine/ScopedItemSearcher.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; @@ -77,7 +76,6 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() return this; } - /// /// Moves the enumerator to the next matching scoped item. /// @@ -132,7 +130,6 @@ T IEnumerator.Current } } - public object Current { get @@ -141,14 +138,11 @@ public object Current } } - - public void Reset() { InitializeScopeEnumerator(); } - public void Dispose() { _current = default(T); @@ -261,7 +255,6 @@ private void InitializeScopeEnumerator() #endregion private members } // class ScopedItemSearcher - /// /// The scope searcher for variables /// @@ -398,7 +391,6 @@ public FunctionScopeItemSearcher( private readonly CommandOrigin _origin; - /// /// Derived classes override this method to return their /// particular type of scoped item. @@ -434,7 +426,6 @@ protected override bool GetScopeItem( script = scope.GetFunction(_name); - if (script != null) { bool isPrivate; diff --git a/src/System.Management.Automation/engine/ScriptCommand.cs b/src/System.Management.Automation/engine/ScriptCommand.cs index 6c4e3f4d1a9..e74842906e4 100644 --- a/src/System.Management.Automation/engine/ScriptCommand.cs +++ b/src/System.Management.Automation/engine/ScriptCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs index 9f1151f4197..e14f0616f7a 100644 --- a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs +++ b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ScriptInfo.cs b/src/System.Management.Automation/engine/ScriptInfo.cs index 95e756826ff..9d5cac12ab8 100644 --- a/src/System.Management.Automation/engine/ScriptInfo.cs +++ b/src/System.Management.Automation/engine/ScriptInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs index 6a8fb2fe828..86f81b0d8ab 100644 --- a/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Security.AccessControl; @@ -26,7 +25,6 @@ private SecurityDescriptorCmdletProviderIntrinsics() "This constructor should never be called. Only the constructor that takes an instance of SessionState should be called."); } // CmdletProviderIntrinsics private - /// /// Initializes a new instance of the SecurityDescriptorCmdletProviderIntrinsics /// class, using the Cmdlet parameter to obtain access to the SessionState APIs. @@ -217,7 +215,6 @@ public ObjectSecurity NewFromPath(string path, AccessControlSections includeSect return _sessionState.NewSecurityDescriptorFromPath(path, includeSections); } // NewSecurityDescriptor - /// /// Creates a new SecurityDescriptor from the specified provider and of the given type, /// including only the specified AccessControlSections. diff --git a/src/System.Management.Automation/engine/SecurityManagerBase.cs b/src/System.Management.Automation/engine/SecurityManagerBase.cs index 4cea5e16922..d1760df8e87 100644 --- a/src/System.Management.Automation/engine/SecurityManagerBase.cs +++ b/src/System.Management.Automation/engine/SecurityManagerBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; using System.Management.Automation.Host; @@ -91,7 +90,6 @@ internal void ShouldRunInternal(CommandInfo commandInfo, return; #else - #if DEBUG // If we are debugging, let the unit tests swap the file from beneath us if(commandInfo.CommandType == CommandTypes.ExternalScript) diff --git a/src/System.Management.Automation/engine/SerializationStrings.cs b/src/System.Management.Automation/engine/SerializationStrings.cs index 9cc1ecd970d..ae0d0db7a36 100644 --- a/src/System.Management.Automation/engine/SerializationStrings.cs +++ b/src/System.Management.Automation/engine/SerializationStrings.cs @@ -1,7 +1,5 @@ - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/SessionState.cs b/src/System.Management.Automation/engine/SessionState.cs index 51a631afe38..97dc1b51bef 100644 --- a/src/System.Management.Automation/engine/SessionState.cs +++ b/src/System.Management.Automation/engine/SessionState.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Language; using System.Security; @@ -78,7 +77,6 @@ internal SessionStateInternal(SessionStateInternal parent, bool linkToGlobal, Ex // that uses variables qualified by script: it works. GlobalScope.ScriptScope = GlobalScope; - if (parent != null) { GlobalScope.Parent = parent.GlobalScope; @@ -123,7 +121,6 @@ internal void InitializeSessionStateInternalSpecialVariables(bool clearVariables PSVariable errorvariable = new PSVariable("Error", new ArrayList(), ScopedItemOptions.Constant); GlobalScope.SetVariable(errorvariable.Name, errorvariable, false, false, this, fastPath: true); - // Set variable $PSDefaultParameterValues Collection attributes = new Collection(); attributes.Add(new ArgumentTypeConverterAttribute(typeof(System.Management.Automation.DefaultParameterDictionary))); @@ -134,7 +131,6 @@ internal void InitializeSessionStateInternalSpecialVariables(bool clearVariables GlobalScope.SetVariable(psDefaultParameterValuesVariable.Name, psDefaultParameterValuesVariable, false, false, this, fastPath: true); } - #endregion Constructor #region Private data @@ -235,7 +231,6 @@ internal SessionStateEntryVisibility CheckScriptVisibility(string scriptPath) /// public List Applications { get; } = new List(new string[] { "*" }); - /// /// List of functions/filters to export from this session state object... /// @@ -535,7 +530,6 @@ internal ProviderInvocationException NewProviderInvocationException( return NewProviderInvocationException(resourceId, resourceStr, provider, path, e, true); } - /// /// Constructs a new instance of a ProviderInvocationException /// using the specified data diff --git a/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs b/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs index 57e79c33bfa..b8dc2ef34f3 100644 --- a/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs @@ -1,12 +1,10 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation; - namespace System.Management.Automation { /// @@ -118,7 +116,6 @@ internal IDictionary GetAliasTableAtScope(string scopeID) /// internal List ExportedAliases { get; } = new List(); - /// /// Gets the value of the specified alias from the alias table. /// @@ -142,7 +139,6 @@ internal AliasInfo GetAlias(string aliasName, CommandOrigin origin) return null; } - // Use the scope enumerator to find the alias using the // appropriate scoping rules @@ -620,7 +616,6 @@ internal void RemoveAlias(string aliasName, bool force) AliasInfo alias = scope.GetAlias(aliasName); - if (alias != null) { // Make sure the alias isn't private or if it is that the current @@ -666,4 +661,3 @@ internal IEnumerable GetAliasesByCommandName(string command) } // SessionStateInternal class } - diff --git a/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs b/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs index 320a23a20e8..41e16ee2b1b 100644 --- a/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using Dbg = System.Management.Automation; - namespace System.Management.Automation { /// @@ -275,7 +273,6 @@ internal void RemoveCmdlet(string name, int index, bool force, CommandOrigin ori CmdletInfo cmdletInfo = scope.GetCmdlet(name); - if (cmdletInfo != null) { // Make sure the cmdlet isn't private or if it is that the current @@ -355,4 +352,3 @@ internal void RemoveCmdletEntry(string name, bool force) } // SessionStateInternal class } - diff --git a/src/System.Management.Automation/engine/SessionStateContainer.cs b/src/System.Management.Automation/engine/SessionStateContainer.cs index 3541a1d9bf3..5fb0f888fe2 100644 --- a/src/System.Management.Automation/engine/SessionStateContainer.cs +++ b/src/System.Management.Automation/engine/SessionStateContainer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; @@ -144,7 +143,6 @@ internal bool ItemExists( out provider, out providerInstance); - foreach (string providerPath in providerPaths) { result = ItemExists(providerInstance, providerPath, context); @@ -207,7 +205,6 @@ internal bool ItemExists( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -369,7 +366,6 @@ private object ItemExistsDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -562,7 +558,6 @@ private bool IsValidPath( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -709,7 +704,6 @@ internal bool IsItemContainer( out provider, out providerInstance); - foreach (string providerPath in providerPaths) { result = IsItemContainer(providerInstance, providerPath, context); @@ -1096,7 +1090,6 @@ internal void RemoveItem( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1308,7 +1301,6 @@ private object RemoveItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1570,7 +1562,6 @@ internal void GetChildItems( ContainerCmdletProvider unused = GetContainerProviderInstance(provider); } - bool getChildrenBecauseNoGlob = !LocationGlobber.StringContainsGlobCharacters(path); // If we are doing recursion and we have include or exclude // filters the recursion must be done manually. @@ -1727,7 +1718,6 @@ private void GetChildItems( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1950,7 +1940,6 @@ private void ProcessPathItems( context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -1979,7 +1968,6 @@ private void ProcessPathItems( newContext.WriteErrorsToContext(context); childNameObjects = newContext.GetAccumulatedObjects(); - // The code above initially retrieves all of the containers so that it doesn't limit the recursion, // but then emits the non-matching container further down. The public API doesn't support a way to // differentiate the two, so we need to do a diff. @@ -2330,7 +2318,6 @@ private object GetChildItemsDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -2558,7 +2545,6 @@ internal void GetChildNames( context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -2606,7 +2592,6 @@ internal void GetChildNames( return; } - if ((!pathContainsGlobCharacters || recurse) && IsItemContainer(providerInstance, providerPath, context)) { // Since the path contained glob characters or we are recursing and the @@ -2985,7 +2970,6 @@ private void GetChildNames( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3173,7 +3157,6 @@ private object GetChildNamesDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3414,7 +3397,6 @@ private void RenameItem( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3582,7 +3564,6 @@ private object RenameItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3878,7 +3859,6 @@ internal void NewItem( } } // NewItem - /// /// Creates a new item at the specified path. /// @@ -3931,7 +3911,6 @@ private void NewItemPrivate( path != null, "Caller should validate path before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3962,7 +3941,6 @@ private void NewItemPrivate( } } // NewItem - /// /// Gets the dynamic parameters for the new-item cmdlet. /// @@ -4109,7 +4087,6 @@ private object NewItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -4412,7 +4389,6 @@ private bool HasChildItems( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -4922,7 +4898,6 @@ private void CopyItem( context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -5399,7 +5374,6 @@ private bool isValidSession(PSSession session, CmdletProviderContext context, ou #endregion ContainerCmdletProvider accessors } // SessionStateInternal class - /// /// Defines the action to be taken for Navigation cmdlets /// diff --git a/src/System.Management.Automation/engine/SessionStateContent.cs b/src/System.Management.Automation/engine/SessionStateContent.cs index fc62fce44fd..ad808ea75b0 100644 --- a/src/System.Management.Automation/engine/SessionStateContent.cs +++ b/src/System.Management.Automation/engine/SessionStateContent.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -1163,4 +1162,3 @@ private object ClearContentDynamicParameters( #pragma warning restore 56500 - diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 1350d57700a..6506db4e6be 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -25,7 +24,6 @@ internal sealed partial class SessionStateInternal /// private PSDriveInfo _currentDrive; - #region NewDrive /// @@ -223,7 +221,6 @@ internal void NewDrive(PSDriveInfo drive, string scopeID, CmdletProviderContext throw; } - if (ProvidersCurrentWorkingDrive[drive.Provider] == null) { // Set the new drive as the current @@ -413,7 +410,6 @@ internal object NewDriveDynamicParameters(string providerId, CmdletProviderConte return null; } - DriveCmdletProvider provider = GetDriveProviderInstance(providerId); object result = null; @@ -772,7 +768,6 @@ private PSDriveInfo AutomountFileSystemDrive(System.IO.DriveInfo systemDriveInfo // want to let errors find their way out. If there are any // failures we just don't mount the drive. - MshLog.LogProviderHealthEvent( this.ExecutionContext, this.ExecutionContext.ProviderNames.FileSystem, @@ -923,7 +918,6 @@ private bool ValidateOrRemoveAutoMountedDrive(PSDriveInfo drive, SessionStateSco { } - scope.RemoveDrive(drive); } } @@ -963,7 +957,6 @@ private bool IsAStaleVhdMountedDrive(PSDriveInfo drive) { char driveChar = Convert.ToChar(drive.Name, CultureInfo.InvariantCulture); - if (Char.ToUpperInvariant(driveChar) >= 'A' && Char.ToUpperInvariant(driveChar) <= 'Z') { DriveInfo systemDriveInfo = new DriveInfo(drive.Name); @@ -1277,7 +1270,6 @@ internal void RemoveDrive( SessionStateScope scope = GetScopeByID(scopeID); scope.RemoveDrive(drive); - // If the drive is the current drive for the provider, remove // it from the current drive list. @@ -1381,7 +1373,6 @@ private bool CanRemoveDrive(PSDriveInfo drive, CmdletProviderContext context) e); } - if (result != null) { // Make sure the provider didn't try to pull a fast one on us @@ -1440,7 +1431,6 @@ internal Collection Drives(string scope) driveNames.Add(drive.Name.Substring(0, 1)); } - foreach (SessionStateScope lookupScope in scopeEnumerator) { foreach (PSDriveInfo drive in lookupScope.Drives) @@ -1466,8 +1456,6 @@ internal Collection Drives(string scope) driveTable.Remove(drive.Name); } - - if (driveIsValid && !driveTable.ContainsKey(drive.Name)) { driveTable[drive.Name] = drive; diff --git a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs index 4c15dfc2fed..a45aa8d2c40 100644 --- a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -386,7 +385,6 @@ internal object NewPropertyDynamicParameters( return null; } // NewPropertyDynamicParameters - /// /// Gets the dynamic parameters for the new-itemproperty cmdlet. /// @@ -800,7 +798,6 @@ internal object RemovePropertyDynamicParameters( return null; } // RemovePropertyDynamicParameters - /// /// Gets the dynamic parameters for the remove-itemproperty cmdlet. /// @@ -857,7 +854,6 @@ private object RemovePropertyDynamicParameters( context != null, "Caller should validate context before calling this method"); - object result = null; try { @@ -1669,7 +1665,6 @@ internal void MoveProperty( } } // MoveProperty - /// /// Moves the property from one item to another /// @@ -1936,7 +1931,6 @@ private object MovePropertyDynamicParameters( context != null, "Caller should validate context before calling this method"); - object result = null; try @@ -2153,7 +2147,6 @@ internal void RenameProperty( } } // RenameProperty - /// /// Renames the property of the item at the specified path. /// diff --git a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs index 1387543d285..b7c92b7587b 100644 --- a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -8,7 +7,6 @@ using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace System.Management.Automation { /// @@ -546,7 +544,6 @@ internal FunctionInfo SetFunction( options |= ScopedItemOptions.Private; } - FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, @@ -636,7 +633,6 @@ internal FunctionInfo SetFunction( options |= ScopedItemOptions.Private; } - FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, diff --git a/src/System.Management.Automation/engine/SessionStateItem.cs b/src/System.Management.Automation/engine/SessionStateItem.cs index 2869d702c44..a2f72764ed1 100644 --- a/src/System.Management.Automation/engine/SessionStateItem.cs +++ b/src/System.Management.Automation/engine/SessionStateItem.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -208,7 +207,6 @@ private void GetItemPrivate( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -363,7 +361,6 @@ private object GetItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -598,7 +595,6 @@ private void SetItem( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -762,7 +758,6 @@ private object SetItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -989,7 +984,6 @@ private void ClearItemPrivate( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1144,7 +1138,6 @@ private object ClearItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1358,7 +1351,6 @@ private void InvokeDefaultActionPrivate( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1513,7 +1505,6 @@ private object InvokeDefaultActionDynamicParameters( context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); diff --git a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs index 9c512b40b92..e304d2d219f 100644 --- a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 @@ -9,7 +8,6 @@ using System.Management.Automation.Provider; using Dbg = System.Management.Automation; - namespace System.Management.Automation { /// @@ -1068,5 +1066,3 @@ internal PathInfoStack SetDefaultLocationStack(string stackName) } // SessionStateInternal class } - - diff --git a/src/System.Management.Automation/engine/SessionStateNavigation.cs b/src/System.Management.Automation/engine/SessionStateNavigation.cs index 42a934ffd55..bf27edbe16f 100644 --- a/src/System.Management.Automation/engine/SessionStateNavigation.cs +++ b/src/System.Management.Automation/engine/SessionStateNavigation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -113,7 +112,6 @@ internal string GetParentPath( return GetParentPath(path, root, context, false); } - /// /// Gets the path to the parent object for the given object. /// Allow to use FileSystem as the default provider when the @@ -451,7 +449,6 @@ internal string GetParentPath( context != null, "Caller should validate context before calling this method"); - NavigationCmdletProvider navigationCmdletProvider = GetNavigationProviderInstance(providerInstance, false); @@ -678,17 +675,14 @@ internal string NormalizeRelativePath( // 1. Test for the drive root ending with a path separator. bool driveRootEndsWithPathSeparator = IsPathSeparator(drive.Root[drive.Root.Length - 1]); - // 2. Test for the path starting with the drive root followed by a path separator int indexAfterDriveRoot = drive.Root.Length; bool pathStartsWithDriveRootAndPathSeparator = indexAfterDriveRoot < path.Length && IsPathSeparator(path[indexAfterDriveRoot]); - // 3. Test for the drive root exactly matching the path. // Since we know the path starts with the drive root then they are equal if the lengths are equal. bool pathEqualsDriveRoot = drive.Root.Length == path.Length; - if (driveRootEndsWithPathSeparator || pathStartsWithDriveRootAndPathSeparator || pathEqualsDriveRoot) { workingPath = path; @@ -704,7 +698,6 @@ internal string NormalizeRelativePath( } } // NormalizeRelativePath - /// /// Tests the specified character for equality with one of the powershell path separators and /// returns true if it matches. @@ -774,7 +767,6 @@ internal string NormalizeRelativePath( // Get an instance of the provider - Provider.CmdletProvider providerInstance = GetProviderInstance(provider); NavigationCmdletProvider navigationCmdletProvider = providerInstance as NavigationCmdletProvider; @@ -1025,7 +1017,6 @@ internal string MakePath( // Get an instance of the provider - Provider.CmdletProvider providerInstance = provider.CreateInstance(); return MakePath(providerInstance, parent, child, context); @@ -1345,7 +1336,6 @@ private string GetChildName( context != null, "Caller should validate context before calling this method"); - CmdletProvider providerInstance = provider.CreateInstance(); return GetChildName(providerInstance, path, context, true); @@ -1738,7 +1728,6 @@ private void MoveItemPrivate( context != null, "Caller should validate context before calling this method"); - NavigationCmdletProvider navigationCmdletProvider = GetNavigationProviderInstance(providerInstance, false); @@ -1905,7 +1894,6 @@ private object MoveItemDynamicParameters( context != null, "Caller should validate context before calling this method"); - NavigationCmdletProvider navigationCmdletProvider = GetNavigationProviderInstance(providerInstance, false); diff --git a/src/System.Management.Automation/engine/SessionStateProperty.cs b/src/System.Management.Automation/engine/SessionStateProperty.cs index 385385018bb..a43153553b2 100644 --- a/src/System.Management.Automation/engine/SessionStateProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateProperty.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -806,7 +805,6 @@ private object SetPropertyDynamicParameters( context != null, "Caller should validate context before calling this method"); - object result = null; try { diff --git a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs index 62012a4db0e..4608c005aee 100644 --- a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -123,7 +122,6 @@ private ProviderInfo AddProvider(Type implementingType, string name, string help return provider; } - /// /// Determines the appropriate provider for the drive and then calls the NewDrive /// method of that provider. @@ -1232,7 +1230,6 @@ internal ProviderInfo NewProvider(ProviderInfo provider) throw sessionStateException; } - // Make sure we are able to create an instance of the provider. // Note, this will also set the friendly name if the user didn't // specify one. diff --git a/src/System.Management.Automation/engine/SessionStatePublic.cs b/src/System.Management.Automation/engine/SessionStatePublic.cs index ad8d3d83d9e..707f588b5e2 100644 --- a/src/System.Management.Automation/engine/SessionStatePublic.cs +++ b/src/System.Management.Automation/engine/SessionStatePublic.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Runspaces; @@ -71,7 +70,6 @@ internal SessionState(ExecutionContext context, bool createAsChild, bool linkToG _sessionState.PublicSessionState = this; } // SessionState - /// /// Construct a new session state object... /// diff --git a/src/System.Management.Automation/engine/SessionStateScope.cs b/src/System.Management.Automation/engine/SessionStateScope.cs index 7e24039a168..e542da6480f 100644 --- a/src/System.Management.Automation/engine/SessionStateScope.cs +++ b/src/System.Management.Automation/engine/SessionStateScope.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -535,7 +534,6 @@ internal PSVariable SetVariable(string name, object value, bool asValue, bool fo } } - _variables[name] = variable; variable.SessionState = sessionState; return variable; @@ -935,7 +933,6 @@ internal AliasInfo SetAliasValue( throw e; } - // Ensure we are not trying to set the alias to constant as this can only be // done at creation time. @@ -989,7 +986,6 @@ internal AliasInfo SetAliasValue( return result; } // SetAliasValue - /// /// Sets an alias to the given value. /// @@ -1021,7 +1017,6 @@ internal AliasInfo SetAliasItem(AliasInfo aliasToSet, bool force, CommandOrigin aliasToSet != null, "The caller should verify the aliasToSet"); - var aliasInfos = GetAliases(); AliasInfo aliasInfo; if (aliasInfos.TryGetValue(aliasToSet.Name, out aliasInfo)) diff --git a/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs b/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs index b6be9c55175..2c7850f179d 100644 --- a/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; diff --git a/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs b/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs index b81e26ae486..dd04b54a23b 100644 --- a/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs +++ b/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs index 2df21f9b154..eb9929fff33 100644 --- a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs +++ b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Provider; @@ -57,7 +56,6 @@ internal static ISecurityDescriptorCmdletProvider GetPermissionProviderInstance( #region GetSecurityDescriptor - /// /// Gets the security descriptor from the specified item. /// diff --git a/src/System.Management.Automation/engine/SessionStateStrings.cs b/src/System.Management.Automation/engine/SessionStateStrings.cs index 73108816663..1f4d6010e4b 100644 --- a/src/System.Management.Automation/engine/SessionStateStrings.cs +++ b/src/System.Management.Automation/engine/SessionStateStrings.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/SessionStateUtils.cs b/src/System.Management.Automation/engine/SessionStateUtils.cs index 5f555c5ebe0..a11c25421af 100644 --- a/src/System.Management.Automation/engine/SessionStateUtils.cs +++ b/src/System.Management.Automation/engine/SessionStateUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs index 333e2dd132e..ab419c2ac00 100644 --- a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -143,7 +142,6 @@ internal object GetVariableValue(string name) return resultItem; } // GetVariableValue - /// /// Get a variable out of session state. This interface supports /// the "namespace:name" syntax so you can do things like @@ -849,7 +847,6 @@ internal object GetVariableValueAtScope(string name, string scopeID) false); } - if (readers == null || readers.Count == 0) { // The drive was found but the path was wrong or something so return null. @@ -1403,7 +1400,6 @@ internal object SetVariable( false); } - if (writers == null || writers.Count == 0) { ItemNotFoundException itemNotFound = diff --git a/src/System.Management.Automation/engine/ShellVariable.cs b/src/System.Management.Automation/engine/ShellVariable.cs index 974bdb49d35..d2362689d67 100644 --- a/src/System.Management.Automation/engine/ShellVariable.cs +++ b/src/System.Management.Automation/engine/ShellVariable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Language; using System.Management.Automation.Runspaces; @@ -148,7 +147,6 @@ internal PSVariable( _description = description; } - /// /// Constructs a variable with the given name, value, options, and attributes /// @@ -248,7 +246,6 @@ public virtual string Description } private string _description = String.Empty; - internal void DebuggerCheckVariableRead() { var context = SessionState != null @@ -420,7 +417,6 @@ public Collection Attributes } private PSVariableAttributeCollection _attributes; - /// /// Checks if the given value meets the validation attribute constraints on the PSVariable. /// @@ -734,7 +730,6 @@ internal object CopyMutableValues(object o) return _copyMutableValueSite.Target.Invoke(_copyMutableValueSite, o); } - internal void WrapValue() { if (!this.IsConstant) diff --git a/src/System.Management.Automation/engine/SpecialVariables.cs b/src/System.Management.Automation/engine/SpecialVariables.cs index fb9fbd9a526..f1a2c32315a 100644 --- a/src/System.Management.Automation/engine/SpecialVariables.cs +++ b/src/System.Management.Automation/engine/SpecialVariables.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; @@ -214,7 +213,6 @@ internal static class SpecialVariables internal const string PSSessionApplicationName = "PSSessionApplicationName"; internal static readonly VariablePath PSSessionApplicationNameVarPath = new VariablePath("global:" + PSSessionApplicationName); - #region AllScope variables created in every session internal const string ExecutionContext = "ExecutionContext"; @@ -228,7 +226,6 @@ internal static class SpecialVariables internal const string PSEdition = "PSEdition"; internal const string ShellId = "ShellId"; - internal static List AllScopeSessionVariables = new List { ExecutionContext, diff --git a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs index 73326087939..c3b64c3c66a 100644 --- a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs +++ b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/TransactedString.cs b/src/System.Management.Automation/engine/TransactedString.cs index 73f67018219..c337ccf8d1d 100644 --- a/src/System.Management.Automation/engine/TransactedString.cs +++ b/src/System.Management.Automation/engine/TransactedString.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Transactions; diff --git a/src/System.Management.Automation/engine/TransactionManager.cs b/src/System.Management.Automation/engine/TransactionManager.cs index 3abeb718c57..798d3a76968 100644 --- a/src/System.Management.Automation/engine/TransactionManager.cs +++ b/src/System.Management.Automation/engine/TransactionManager.cs @@ -1,8 +1,7 @@ -#pragma warning disable 1634, 1691 +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +#pragma warning disable 1634, 1691 using System.Collections.Generic; using System.Transactions; @@ -744,4 +743,3 @@ public void Dispose(bool disposing) } } - diff --git a/src/System.Management.Automation/engine/TypeMetadata.cs b/src/System.Management.Automation/engine/TypeMetadata.cs index ad6df66cadc..352ea45aac2 100644 --- a/src/System.Management.Automation/engine/TypeMetadata.cs +++ b/src/System.Management.Automation/engine/TypeMetadata.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -1319,7 +1318,6 @@ private void ConstructCompiledParametersUsingRuntimeDefinedParameters( } } // ConstructCompiledParametersUsingRuntimeDefinedParameters - /// /// Compiles the parameter using reflection against the CLR type. /// diff --git a/src/System.Management.Automation/engine/TypeTable.cs b/src/System.Management.Automation/engine/TypeTable.cs index 3b9f958bf92..4025850d6b1 100644 --- a/src/System.Management.Automation/engine/TypeTable.cs +++ b/src/System.Management.Automation/engine/TypeTable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; @@ -1541,8 +1540,6 @@ public TypeTableLoadException(string message) SetDefaultErrorRecord(); } - - /// /// This constructor takes a localized message and an inner exception. /// @@ -1988,7 +1985,6 @@ public PropertySetData PropertySerializationSet } } - // They are of NoteProperty private string _serializationMethod; private Type _targetTypeForDeserialization; @@ -2531,7 +2527,6 @@ internal override void Process(ConcurrentBag errors, string typeName, PS #endregion TypeData - /// /// A class that keeps the information from types.ps1xml files in a cache table /// @@ -2748,7 +2743,6 @@ private static bool GetCheckMemberType(ConcurrentBag errors, string type return false; } - /// /// Issue appropriate errors and remove members as necessary if: /// - The serialization settings do not fall into one of the combinations of the table below @@ -3177,7 +3171,6 @@ private static void ProcessStandardMembers(ConcurrentBag errors, string } } - private void ProcessTypeDataToAdd(ConcurrentBag errors, TypeData typeData) { string typeName = typeData.TypeName; @@ -3559,7 +3552,6 @@ internal PSMemberInfoInternalCollection GetMembers(ConsolidatedString type return PSObject.TransformMemberInfoCollection(GetMembers(types)); } - private PSMemberInfoInternalCollection GetMembers(ConsolidatedString types) { if ((types == null) || string.IsNullOrEmpty(types.Key)) diff --git a/src/System.Management.Automation/engine/TypesV3_Ps1Xml.cs b/src/System.Management.Automation/engine/TypesV3_Ps1Xml.cs index 36aecab308f..e12ad850a53 100644 --- a/src/System.Management.Automation/engine/TypesV3_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypesV3_Ps1Xml.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/src/System.Management.Automation/engine/Types_Ps1Xml.cs b/src/System.Management.Automation/engine/Types_Ps1Xml.cs index 0103c2df6ef..2599cf59581 100644 --- a/src/System.Management.Automation/engine/Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/Types_Ps1Xml.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Collections.Generic; using System.Management.Automation; using System.Reflection; diff --git a/src/System.Management.Automation/engine/UserFeedbackParameters.cs b/src/System.Management.Automation/engine/UserFeedbackParameters.cs index 657d0b4fede..240f908de9c 100644 --- a/src/System.Management.Automation/engine/UserFeedbackParameters.cs +++ b/src/System.Management.Automation/engine/UserFeedbackParameters.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 3659d0c4cdd..5b108a97978 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Security; using System.Runtime.InteropServices; @@ -363,7 +362,6 @@ internal static bool IsWinPEHost() return false; } - #region Versioning related methods /// @@ -1041,7 +1039,6 @@ internal static void NativeEnumerateDirectory(string directory, out List } } - internal static bool IsReservedDeviceName(string destinationPath) { #if !UNIX @@ -1198,7 +1195,6 @@ internal static string GetPowerShellAssemblyStrongName(string assemblyName) return assemblyName; } - /// /// If a mutex is abandoned, in our case, it is ok to proceed /// @@ -1302,7 +1298,6 @@ internal static Encoding GetEncoding(string path) return Encoding.ASCII; } - // BigEndianUTF32 encoding is possible, but requires creation internal static Encoding BigEndianUTF32Encoding = new UTF32Encoding(bigEndian: true, byteOrderMark: true); // [System.Text.Encoding]::GetEncodings() | Where-Object { $_.GetEncoding().GetPreamble() } | diff --git a/src/System.Management.Automation/engine/VariableAttributeCollection.cs b/src/System.Management.Automation/engine/VariableAttributeCollection.cs index 86dfa5396df..e8bbeb56ac1 100644 --- a/src/System.Management.Automation/engine/VariableAttributeCollection.cs +++ b/src/System.Management.Automation/engine/VariableAttributeCollection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/VariableInterfaces.cs b/src/System.Management.Automation/engine/VariableInterfaces.cs index a3fbe14cd32..2c5e11fa3a2 100644 --- a/src/System.Management.Automation/engine/VariableInterfaces.cs +++ b/src/System.Management.Automation/engine/VariableInterfaces.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; diff --git a/src/System.Management.Automation/engine/VariablePath.cs b/src/System.Management.Automation/engine/VariablePath.cs index d5675a8de36..151339f2fd6 100644 --- a/src/System.Management.Automation/engine/VariablePath.cs +++ b/src/System.Management.Automation/engine/VariablePath.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/WinRT/IInspectable.cs b/src/System.Management.Automation/engine/WinRT/IInspectable.cs index c218472b6a3..8177dcb2ff0 100644 --- a/src/System.Management.Automation/engine/WinRT/IInspectable.cs +++ b/src/System.Management.Automation/engine/WinRT/IInspectable.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using System.Reflection; diff --git a/src/System.Management.Automation/engine/WorkflowInfo.cs b/src/System.Management.Automation/engine/WorkflowInfo.cs index 3966c2c06f9..29122721485 100644 --- a/src/System.Management.Automation/engine/WorkflowInfo.cs +++ b/src/System.Management.Automation/engine/WorkflowInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/cmdlet.cs b/src/System.Management.Automation/engine/cmdlet.cs index ba66798d5e7..df54de53df6 100644 --- a/src/System.Management.Automation/engine/cmdlet.cs +++ b/src/System.Management.Automation/engine/cmdlet.cs @@ -1,8 +1,7 @@ -#pragma warning disable 1634, 1691 +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +#pragma warning disable 1634, 1691 using System.Collections; using System.Diagnostics.CodeAnalysis; @@ -13,8 +12,6 @@ using System.Management.Automation.Internal; using Dbg = System.Management.Automation.Diagnostics; - - namespace System.Management.Automation { /// @@ -58,7 +55,6 @@ public static HashSet CommonParameters } ); - /// /// Lists the common parameters that are added by the PowerShell engine when a cmdlet defines /// additional capabilities (SupportsShouldProcess, SupportsTransactions) @@ -78,7 +74,6 @@ public static HashSet OptionalCommonParameters } ); - /// /// Is this command stopping? /// @@ -1172,7 +1167,6 @@ public bool ShouldProcess( } } - #endregion ShouldProcess #region ShouldContinue diff --git a/src/System.Management.Automation/engine/debugger/Breakpoint.cs b/src/System.Management.Automation/engine/debugger/Breakpoint.cs index 5c3da3d7d61..734e0057174 100644 --- a/src/System.Management.Automation/engine/debugger/Breakpoint.cs +++ b/src/System.Management.Automation/engine/debugger/Breakpoint.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.IO; @@ -422,8 +421,6 @@ internal bool TrySetBreakpoint(string scriptFile, FunctionContext functionContex couldBeInNestedScriptBlock = false; } - - int sequencePointIndex; var sequencePoint = FindSequencePoint(functionContext, Line, Column, out sequencePointIndex); if (sequencePoint != null) diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index 9d787e214ea..034612b9397 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Diagnostics; diff --git a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs index 3b33c4458d2..d3804aab09a 100644 --- a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs +++ b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using Dbg = System.Management.Automation.Diagnostics; @@ -63,7 +62,6 @@ public bool CompletedSynchronously } } - /// /// Gets an indication whether the asynchronous operation has completed. /// diff --git a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs index 72b9e860869..f0499133c38 100644 --- a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs @@ -1,12 +1,8 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; - - namespace System.Management.Automation.Host { /// @@ -132,8 +128,6 @@ class ChoiceDescription } } - - /// /// /// Gets and sets the help message for this field. @@ -174,5 +168,3 @@ class ChoiceDescription } } - - diff --git a/src/System.Management.Automation/engine/hostifaces/Command.cs b/src/System.Management.Automation/engine/hostifaces/Command.cs index c08209fbb31..e4b3566b2d3 100644 --- a/src/System.Management.Automation/engine/hostifaces/Command.cs +++ b/src/System.Management.Automation/engine/hostifaces/Command.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -558,7 +557,6 @@ CommandOrigin origin #region Serialization / deserialization for remoting - /// /// Creates a Command object from a PSObject property bag. /// PSObject has to be in the format returned by ToPSObjectForRemoting method. @@ -642,7 +640,6 @@ internal PSObject ToPSObjectForRemoting(Version psRPVersion) commandAsPSObject.Properties.Add(new PSNoteProperty(RemoteDataNameStrings.MergeUnclaimedPreviousCommandResults, this.MergeUnclaimedPreviousCommandResults)); - if (psRPVersion != null && psRPVersion >= RemotingConstants.ProtocolVersionWin10RTM) { @@ -713,7 +710,6 @@ internal PSObject ToPSObjectForRemoting(Version psRPVersion) return commandAsPSObject; } - #endregion #region Win Blue Extensions diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index c948a2f205c..a622c84fa91 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; @@ -79,7 +78,6 @@ RunspaceState expectedState _currentState = currentState; } - #region ISerializable Members // 2005/04/20-JonN No need to implement GetObjectData diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs index 094d0189d04..3081041fd93 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; @@ -276,13 +275,11 @@ private void CoreOpen(bool syncCall) #endif } - /// /// Derived class's open implementation /// protected abstract void OpenHelper(bool syncCall); - #endregion open #region close @@ -417,7 +414,6 @@ private void CoreClose(bool syncCall) CloseHelper(syncCall); } - /// /// Derived class's close implementation /// @@ -741,7 +737,6 @@ protected void SetRunspaceState(RunspaceState state) this.SetRunspaceState(state, null); } - /// /// Raises events for changes in runspace state. /// @@ -953,7 +948,6 @@ internal bool WaitForFinishofPipelines() } } - /// /// Stops all the running pipelines /// @@ -1510,7 +1504,6 @@ internal ProviderIntrinsics InvokeProvider } } - /// /// Protected methods to be implemented by derived class. /// This does the actual work of setting variable. diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs index 6a95c8865a3..fcf3aac5fb9 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Diagnostics.CodeAnalysis; @@ -290,7 +289,6 @@ public static RunspacePool CreateRunspacePool(int minRunspaces, int maxRunspaces maxRunspaces, initialSessionState, host); } - #endregion #region RunspacePool - remote Factory diff --git a/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs b/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs index 3c8634e1d00..96b9898bca4 100644 --- a/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Globalization; @@ -63,7 +62,6 @@ internal DefaultHost(CultureInfo currentCulture, CultureInfo currentUICulture) #endregion properties - #region methods /// diff --git a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs index 8d02deab24f..a5cf51f29e2 100644 --- a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation.Diagnostics; @@ -13,8 +11,6 @@ //using System.Management.Automation; //using System.Reflection; - - namespace System.Management.Automation.Host { /// @@ -71,7 +67,6 @@ public string Name } } - /// /// /// Sets the ParameterTypeName, ParameterTypeFullName, and ParameterAssemblyFullName as a single operation. @@ -102,8 +97,6 @@ public string Name SetParameterAssemblyFullName(parameterType.AssemblyQualifiedName); } - - /// /// /// Gets the short name of the parameter's type. @@ -140,8 +133,6 @@ public string Name } } - - /// /// /// Gets the full string name of the parameter's type. @@ -173,7 +164,6 @@ public string Name } } - /// /// /// Gets the full name of the assembly containing the type identified by ParameterTypeFullName or ParameterTypeName @@ -206,8 +196,6 @@ public string Name } } - - /// /// /// A short, human-presentable message to describe and identify the field. If supplied, a typical implementation of @@ -256,8 +244,6 @@ public string Name } } - - /// /// /// Gets and sets the help message for this field. @@ -296,7 +282,6 @@ public string Name } } - /// /// /// Gets and sets whether a value must be supplied for this field @@ -387,8 +372,6 @@ public string Name parameterTypeName = nameOfType; } - - /// /// /// For use by remoting serialization. @@ -413,8 +396,6 @@ public string Name parameterTypeFullName = fullNameOfType; } - - /// /// /// For use by remoting serialization. @@ -501,5 +482,3 @@ internal bool IsFromRemoteHost } } - - diff --git a/src/System.Management.Automation/engine/hostifaces/History.cs b/src/System.Management.Automation/engine/hostifaces/History.cs index 7fa640a1f0e..785c34a89e3 100644 --- a/src/System.Management.Automation/engine/hostifaces/History.cs +++ b/src/System.Management.Automation/engine/hostifaces/History.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -13,7 +12,6 @@ using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell.Commands { /// @@ -137,13 +135,10 @@ public override string ToString() } } - #endregion public #region internal - - /// /// Cleared status of an entry /// @@ -160,8 +155,6 @@ internal bool Cleared } } - - /// /// Sets Id /// @@ -232,8 +225,6 @@ internal void SetCommand(string command) /// private DateTime _endTime; - - /// /// Flag indicating an entry is present/cleared /// @@ -256,7 +247,6 @@ public HistoryInfo Clone() #endregion } - /// /// This class implements history and provides APIs for adding and fetching /// entries from history @@ -377,8 +367,6 @@ internal HistoryInfo GetEntry(long id) } } - - /// /// Get count HistoryEntries /// @@ -400,7 +388,6 @@ internal HistoryInfo[] GetEntries(long id, long count, SwitchParameter newest) throw PSTraceSource.NewArgumentNullException("newest"); } - if (count == -1 || count > _countEntriesAdded || count > _countEntriesInBuffer) count = _countEntriesInBuffer; @@ -558,7 +545,6 @@ internal HistoryInfo[] GetEntries(long id, long count, SwitchParameter newest) }// end lock }// end function - /// /// Get History Entries based on the WildCard Pattern value. /// If passed 0, returns all the values, else return on the basis of count. @@ -647,9 +633,6 @@ internal HistoryInfo[] GetEntries(WildcardPattern wildcardpattern, long count, S } } - - - /// /// Clears the history entry from buffer for a given id. /// @@ -683,7 +666,6 @@ internal void ClearEntry(long id) } } - /// /// gets the total number of entries added /// @@ -694,7 +676,6 @@ internal int Buffercapacity() return _capacity; } - #endregion internal #region private @@ -856,7 +837,6 @@ private void IncrementCountOfEntriesInBuffer() _countEntriesInBuffer++; } - /// /// Get the current history size /// @@ -906,7 +886,6 @@ private int GetHistorySize() /// private long _countEntriesAdded; - /// /// Private object for synchronization /// @@ -923,7 +902,6 @@ internal long GetNextHistoryId() } } - /// /// This class Implements the get-history command /// @@ -982,7 +960,6 @@ public int Count } } - /// /// Implements the Processing() method for show/History command /// @@ -1112,7 +1089,6 @@ public string Id #endregion - /// /// Implements the BeginProcessing() method for eval/History command /// @@ -1195,7 +1171,6 @@ protected override void EndProcessing() //do nothing } - // Items invoked as History should act as though they were submitted by the user - so should still come from // the runspace itself. For this reason, it is insufficient to just use the InvokeScript method on the Cmdlet class. using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace)) @@ -1365,7 +1340,6 @@ private HistoryInfo GetHistoryEntryToInvoke(History history) return entry; } - /// /// Id of history entry to execute. /// @@ -1412,7 +1386,6 @@ private void ReplaceHistoryString(HistoryInfo entry) } } - /// /// This class Implements the add-history command /// @@ -1460,7 +1433,6 @@ void BeginProcessing() lpl.AddHistoryEntryFromAddHistoryCmdlet(); } - /// /// override for ProcessRecord /// @@ -1667,7 +1639,6 @@ private static } } - /// /// This Class implements the Clear History cmdlet /// @@ -1728,7 +1699,6 @@ public string[] CommandLine private string[] _commandline = null; - /// /// Clears the specified number of history entries /// @@ -1924,7 +1894,6 @@ private void ClearHistoryByID() } } - /// /// Clears the session history based on the Commandline parameter /// takes no parameters @@ -1989,7 +1958,6 @@ private void ClearHistoryByCmdLine() } } - /// /// Clears the session history based on the input parameter /// id of the entry to be cleared @@ -2057,7 +2025,6 @@ private void ClearHistoryEntries(long id, int count, string cmdline, SwitchParam return; }//end function - /// /// history obj /// @@ -2072,4 +2039,3 @@ private void ClearHistoryEntries(long id, int count, string cmdline, SwitchParam } } - diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index e5f8688bae4..5fe16acd369 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -87,7 +90,6 @@ internal static PSObject GetDollarProfile(string allUsersAllHosts, string allUse return returnValue; } - /// /// Gets an array of commands that can be run sequentially to set $profile and run the profile commands. /// @@ -459,7 +461,6 @@ internal static ArrayList GetSuggestion(HistoryInfo lastHistory, Object lastErro } } - return returnSuggestions; } @@ -641,7 +642,6 @@ internal static PSCredential CredUIPromptForCredential( credUiInfo.cbSize = Marshal.SizeOf(credUiInfo); credUiInfo.hwndParent = parentHWND; - CREDUI_FLAGS flags = CREDUI_FLAGS.DO_NOT_PERSIST; // Set some of the flags if they have not requested a domain credential diff --git a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs index 9ed6e675e53..f779dce3dd8 100644 --- a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs +++ b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs index 26253e07d38..8bcbfc2f3cc 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Management.Automation.Remoting; @@ -593,7 +592,6 @@ internal bool IsHostRefSet get { return _externalHostRef.IsOverridden; } } - internal ExecutionContext Context { get; } internal PSHost ExternalHost diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs index 652693cbb7a..b7db5343626 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs @@ -1,15 +1,11 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - - namespace System.Management.Automation.Internal.Host { internal @@ -23,8 +19,6 @@ class InternalHostRawUserInterface : PSHostRawUserInterface _parentHost = parentHost; } - - internal void ThrowNotInteractive() @@ -41,8 +35,6 @@ class InternalHostRawUserInterface : PSHostRawUserInterface throw e; } - - /// /// /// See base class @@ -79,8 +71,6 @@ public override } } - - /// /// /// See base class @@ -118,8 +108,6 @@ public override } } - - /// /// /// See base class @@ -157,8 +145,6 @@ public override } } - - /// /// /// See base class @@ -196,8 +182,6 @@ public override } } - - /// /// /// See base class @@ -235,8 +219,6 @@ public override } } - - /// /// /// See base class @@ -274,8 +256,6 @@ public override } } - - /// /// /// See base class @@ -313,8 +293,6 @@ public override } } - - /// /// /// See base class @@ -343,8 +321,6 @@ public override } } - - /// /// /// See base class @@ -373,8 +349,6 @@ public override } } - - /// /// /// See base class @@ -416,8 +390,6 @@ public override return result; } - - /// /// /// See base class @@ -440,8 +412,6 @@ public override _externalRawUI.FlushInputBuffer(); } - - /// /// /// See base class @@ -470,8 +440,6 @@ public override } } - - /// /// /// See base class @@ -509,8 +477,6 @@ public override } } - - /// /// /// See base class @@ -534,8 +500,6 @@ public override _externalRawUI.SetBufferContents(origin, contents); } - - /// /// /// See base class @@ -564,8 +528,6 @@ public override _externalRawUI.SetBufferContents(r, fill); } - - /// /// /// See base class @@ -590,8 +552,6 @@ public override return _externalRawUI.GetBufferContents(r); } - - /// /// /// See base class @@ -668,7 +628,6 @@ public override int LengthInBufferCells(string str, int offset) return _externalRawUI.LengthInBufferCells(str, offset); } - /// /// /// diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index 9be358ee6c3..cf69c0077ae 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Language; using System.Management.Automation.Host; @@ -127,8 +124,6 @@ public override return result; } - - /// /// /// See base class @@ -171,8 +166,6 @@ public override return result; } - - /// /// /// See base class @@ -204,8 +197,6 @@ public override _externalUI.Write(value); } - - /// /// /// See base class @@ -241,8 +232,6 @@ public override _externalUI.Write(foregroundColor, backgroundColor, value); } - - /// /// /// See base class @@ -269,8 +258,6 @@ public override _externalUI.WriteLine(); } - - /// /// /// See base class @@ -302,8 +289,6 @@ public override _externalUI.WriteLine(value); } - - public override void WriteErrorLine(string value) @@ -321,8 +306,6 @@ public override _externalUI.WriteErrorLine(value); } - - /// /// /// See base class @@ -358,8 +341,6 @@ public override _externalUI.WriteLine(foregroundColor, backgroundColor, value); } - - /// /// /// See base class @@ -406,7 +387,6 @@ internal void WriteDebugInfoBuffers(DebugRecord record) } } - /// /// Helper function for WriteDebugLine /// @@ -514,8 +494,6 @@ internal PSInformationalBuffers GetInformationalMessageBuffers() WriteDebugRecord(new DebugRecord(message)); } - - /// /// /// Ask the user whether to continue/stop or break to a nested prompt. @@ -596,8 +574,6 @@ internal PSInformationalBuffers GetInformationalMessageBuffers() return shouldContinue; } - - /// /// /// See base class @@ -633,8 +609,6 @@ public override _externalUI.WriteProgress(sourceId, record); } - - /// /// /// See base class @@ -857,9 +831,6 @@ public override return result; } - - - /// /// /// See base class diff --git a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs index 237fa4ec0c7..399334e1b2c 100644 --- a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs +++ b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs index e9c66ea9106..54737851650 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; @@ -296,7 +295,6 @@ internal TranscriptionData TranscriptionData } private TranscriptionData _transcriptionData = null; - private JobRepository _jobRepository; /// /// List of jobs in this runspace @@ -1190,7 +1188,6 @@ protected override ProviderIntrinsics DoInvokeProvider } } - #endregion SessionStateProxy #region IDisposable Members @@ -1569,7 +1566,6 @@ protected RunspaceOpenModuleLoadException(SerializationInfo info, StreamingConte { } - /// /// Populates a with the /// data needed to serialize the RunspaceOpenModuleLoadException object. @@ -1592,6 +1588,3 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont #endregion Helper Class } - - - diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index 2cac96bb84f..5ed6faaff38 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics; using System.Collections.Generic; @@ -82,7 +81,6 @@ internal LocalPipeline(LocalRunspace runspace, InitStreams(); } - /// /// Copy constructor to support cloning /// @@ -1063,7 +1061,6 @@ private void AddHistoryEntry(bool skipIfLocked) } } - private long _historyIdForThisPipeline = -1; /// /// This method is called Add-History cmdlet to add history entry. @@ -1117,9 +1114,6 @@ internal override void SetHistoryString(string historyString) #region TLS - - - /// /// Gets the execution context in the thread local storage of current /// thread diff --git a/src/System.Management.Automation/engine/hostifaces/MshHost.cs b/src/System.Management.Automation/engine/hostifaces/MshHost.cs index 1ad99b0313d..486e0822a24 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHost.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; using System.Diagnostics.CodeAnalysis; @@ -86,8 +85,6 @@ public abstract string Name get; } - - /// /// /// Gets the version of the hosting application. This value should remain invariant for a particular build of the @@ -109,8 +106,6 @@ public abstract System.Version Version get; } - - /// /// /// Gets a GUID that uniquely identifies this instance of the host. The value should remain invariant for the lifetime of @@ -123,8 +118,6 @@ public abstract System.Guid InstanceId get; } - - /// /// /// Gets the hosting application's implementation of the @@ -150,8 +143,6 @@ public abstract System.Management.Automation.Host.PSHostUserInterface UI get; } - - /// /// /// Gets the host's culture: the culture that the runspace should use to set the CurrentCulture on new threads @@ -174,8 +165,6 @@ public abstract System.Globalization.CultureInfo CurrentCulture get; } - - /// /// /// Gets the host's UI culture: the culture that the runspace and cmdlets should use to do resource loading. @@ -194,8 +183,6 @@ public abstract System.Globalization.CultureInfo CurrentUICulture get; } - - /// /// /// Request by the engine to end the current engine runspace (to shut down and terminate the host's root runspace). @@ -218,8 +205,6 @@ public abstract System.Globalization.CultureInfo CurrentUICulture public abstract void SetShouldExit(int exitCode); - - /// /// /// Instructs the host to interrupt the currently running pipeline and start a new, "nested" input loop, where an input @@ -247,8 +232,6 @@ public abstract System.Globalization.CultureInfo CurrentUICulture public abstract void EnterNestedPrompt(); - - /// /// /// Causes the host to end the currently running input loop. If the input loop was created by a prior call to @@ -269,8 +252,6 @@ public abstract System.Globalization.CultureInfo CurrentUICulture public abstract void ExitNestedPrompt(); - - /// /// /// Used to allow the host to pass private data through a Runspace to cmdlets running inside that Runspace's @@ -310,8 +291,6 @@ public virtual PSObject PrivateData } } - - /// /// /// Called by the engine to notify the host that it is about to execute a "legacy" command line application. A legacy @@ -350,8 +329,6 @@ public virtual PSObject PrivateData public abstract void NotifyBeginApplication(); - - /// /// /// Called by the engine to notify the host that the execution of a legacy command has completed. diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs index 843cfb7ae5a..09d1491d2ff 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; @@ -14,8 +12,6 @@ namespace System.Management.Automation.Host // I would have preferred to make these nested types within PSHostRawUserInterface, but that // is evidently discouraged by the .net design guidelines. - - /// /// /// Represents an (x,y) coordinate pair @@ -54,7 +50,6 @@ public int Y set { y = value; } } - /// /// /// Initializes a new instance of the Coordinates class and defines the X and Y values. @@ -77,8 +72,6 @@ public int Y this.y = y; } - - /// /// /// Overrides @@ -97,8 +90,6 @@ public override return String.Format(CultureInfo.InvariantCulture, "{0},{1}", X, Y); } - - /// /// /// Overrides @@ -130,8 +121,6 @@ public override return result; } - - /// /// /// Overrides @@ -196,8 +185,6 @@ public override return result; } - - /// /// /// Compares two instances for equality @@ -228,8 +215,6 @@ public static return result; } - - /// /// /// Compares two instances for inequality @@ -259,8 +244,6 @@ public static } } - - /// /// /// Represents a width and height pair @@ -299,7 +282,6 @@ public int Height set { height = value; } } - /// /// /// Initialize a new instance of the Size class and defines the Width and Height values. @@ -322,8 +304,6 @@ public int Height this.height = height; } - - /// /// /// Overloads @@ -499,8 +479,6 @@ public static } } - - /// /// /// Governs the behavior of @@ -546,8 +524,6 @@ public static IncludeKeyUp = 0x0008 } - - /// /// /// Defines the states of Control Key @@ -613,8 +589,6 @@ enum ControlKeyStates EnhancedKey = 0x0100 } - - /// /// /// Represents information of a keystroke @@ -864,9 +838,6 @@ public static } } - - - /// /// /// Represents a rectangular region of the screen. @@ -988,7 +959,6 @@ public int Bottom this.bottom = bottom; } - /// /// /// Initializes a new instance of the Rectangle class and defines the Left, Top, Right, and Bottom values @@ -1017,8 +987,6 @@ public int Bottom { } - - /// /// /// Overloads @@ -1199,8 +1167,6 @@ public static } } - - /// /// /// Represents a character, a foregroundColor color, and background color @@ -1306,7 +1272,6 @@ public BufferCellType BufferCellType this.bufferCellType = bufferCellType; } - /// /// /// Overloads @@ -1325,7 +1290,6 @@ public override return string.Format(CultureInfo.InvariantCulture, "'{0}' {1} {2} {3}", Character, ForegroundColor, BackgroundColor, BufferCellType); } - /// /// /// Overrides @@ -1488,9 +1452,6 @@ public enum #endregion Ancillary types - - - /// /// /// Defines the lowest-level user interface functions that an interactive application hosting an MSH @@ -1524,8 +1485,6 @@ class PSHostRawUserInterface // do nothing } - - /// /// /// Gets or sets the color used to render characters on the screen buffer. Each character cell in the screen buffer can @@ -1547,8 +1506,6 @@ public abstract set; } - - /// /// /// Gets or sets the color used to render the background behind characters on the screen buffer. Each character cell in @@ -1565,8 +1522,6 @@ public abstract set; } - - /// /// /// Gets or sets the cursor position in the screen buffer. The view window always adjusts it's location over the screen @@ -1595,8 +1550,6 @@ public abstract set; } - - /// /// /// Gets or sets position of the view window relative to the screen buffer, in characters. (0,0) is the upper left of the screen @@ -1616,8 +1569,6 @@ public abstract set; } - - /// /// /// Gets or sets the cursor size as a percentage 0..100. @@ -1633,8 +1584,6 @@ public abstract set; } - - /// /// /// Gets or sets the current size of the screen buffer, measured in character cells. @@ -1654,8 +1603,6 @@ public abstract set; } - - /// /// /// Gets or sets the current view window size, measured in character cells. The window size cannot be larger than the @@ -1676,8 +1623,6 @@ public abstract set; } - - /// /// /// Gets the size of the largest window possible for the current buffer, current font, and current display hardware. @@ -1708,8 +1653,6 @@ public abstract get; } - - /// /// /// Gets the largest window possible for the current font and display hardware, ignoring the current buffer dimensions. In @@ -1736,8 +1679,6 @@ public abstract get; } - - /// /// /// Reads a key stroke from the keyboard device, blocking until a keystroke is typed. @@ -1766,8 +1707,6 @@ public abstract return ReadKey(ReadKeyOptions.IncludeKeyDown); } - - /// /// /// Reads a key stroke from the keyboard device, blocking until a keystroke is typed. @@ -1806,8 +1745,6 @@ public abstract KeyInfo ReadKey(ReadKeyOptions options); - - /// /// /// Resets the keyboard input buffer. @@ -1821,8 +1758,6 @@ public abstract void FlushInputBuffer(); - - /// /// /// A non-blocking call to examine if a keystroke is waiting in the input buffer. @@ -1844,8 +1779,6 @@ public abstract get; } - - /// /// /// Gets or sets the titlebar text of the current view window. @@ -1860,8 +1793,6 @@ public abstract set; } - - /// /// /// Copies the array into the screen buffer at the @@ -1892,8 +1823,6 @@ public abstract void SetBufferContents(Coordinates origin, BufferCell[,] contents); - - /// /// /// Copies a given character to all of the character cells in the screen buffer with the indicated colors. @@ -1947,8 +1876,6 @@ public abstract void SetBufferContents(Rectangle rectangle, BufferCell fill); - - /// /// /// Extracts a rectangular region of the screen buffer. @@ -1996,8 +1923,6 @@ public abstract BufferCell[,] GetBufferContents(Rectangle rectangle); - - /// /// /// Scroll a region of the screen buffer. diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index bac5cdd0124..9a23b9896e5 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Text; @@ -1032,7 +1031,6 @@ internal List Transcripts internal string PromptText { get; set; } } - // Holds options for PowerShell transcription internal class TranscriptionOption : IDisposable { @@ -1293,4 +1291,3 @@ internal static int DetermineChoicePicked(string response, Collection /// Invoke the pipeline, synchronously, returning the results as an array of /// objects. @@ -745,4 +742,3 @@ protected virtual } } - diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index f6c5bb988ee..51cc2b38d3b 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -1136,7 +1135,6 @@ public PowerShell AddCommand(CommandInfo commandInfo) return this; } - /// /// Add a parameter to the last added command. /// For example, to construct a command string "get-process | select-object -property name" @@ -2635,7 +2633,6 @@ public void Invoke(IEnumerable input, IList output) Invoke(input, output, null); } - /// /// Invoke the synchronously and collect /// output data into the buffer @@ -3097,7 +3094,6 @@ private IAsyncResult BeginBatchInvoke(PSDataCollection return _batchAsyncResult; } - /// /// Batch invocation callback /// @@ -4260,7 +4256,6 @@ private void CoreInvokeHelper(PSDataCollection input, P Dbg.Assert(null != rsToUse, "Nested PowerShell can only work on a Runspace"); - // Perform work on the current thread. Nested Pipeline // should be invoked from the same thread that the parent // pipeline is executing in. diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs index a13c97a8a2e..2d2846b03d9 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.ComponentModel; using System.Globalization; @@ -9,7 +8,6 @@ using System.Text; using System.Diagnostics; - namespace System.Management.Automation.Runspaces { /// diff --git a/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs b/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs index 17001670df0..d8b717ff84f 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; using DWORD = System.UInt32; - namespace System.Management.Automation.Runspaces { /// diff --git a/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs b/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs index 3ee11cfd8ad..5469e83f263 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { @@ -159,6 +158,3 @@ protected virtual void Dispose(bool disposing) } } - - - diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs index 33966d90579..c5274140507 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using PSHost = System.Management.Automation.Host.PSHost; @@ -74,7 +73,6 @@ RunspacePoolState expectedState _currentState = currentState; } - #region ISerializable Members // No need to implement GetObjectData diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs index 4b1096c40de..f7ac95f810d 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Tracing; diff --git a/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs b/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs index 17d17cb90f4..41626e9cc32 100644 --- a/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs +++ b/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs index 90a6b90c17f..89a9c57dea6 100644 --- a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs +++ b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Runspaces { @@ -566,7 +565,6 @@ internal override void InvokeAsyncAndDisconnect() #region concurrent pipeline check - private bool _performNestedCheck = true; /// @@ -1019,7 +1017,6 @@ private RunspaceBase RunspaceBase } } - /// /// Object used for synchronization /// diff --git a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs index 9bf1630c92b..cb4a29eba68 100644 --- a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs +++ b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs @@ -1,11 +1,11 @@ /* **************************************************************************** * - * Copyright (c) Microsoft Corporation. + * Copyright (c) Microsoft Corporation. * - * This source code is subject to terms and conditions of the Apache License, Version 2.0. A - * copy of the license can be found in the License.html file at the root of this distribution. If - * you cannot locate the Apache License, Version 2.0, please send an email to - * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * This source code is subject to terms and conditions of the Apache License, Version 2.0. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Apache License, Version 2.0, please send an email to + * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Apache License, Version 2.0. * * You must not remove this notice, or any other, from this software. @@ -227,27 +227,27 @@ public override string ToString() } /// - /// This instruction implements a goto expression that can jump out of any expression. - /// It pops values (arguments) from the evaluation stack that the expression tree nodes in between - /// the goto expression and the target label node pushed and not consumed yet. - /// A goto expression can jump into a node that evaluates arguments only if it carries - /// a value and jumps right after the first argument (the carried value will be used as the first argument). - /// Goto can jump into an arbitrary child of a BlockExpression since the block doesn't accumulate values + /// This instruction implements a goto expression that can jump out of any expression. + /// It pops values (arguments) from the evaluation stack that the expression tree nodes in between + /// the goto expression and the target label node pushed and not consumed yet. + /// A goto expression can jump into a node that evaluates arguments only if it carries + /// a value and jumps right after the first argument (the carried value will be used as the first argument). + /// Goto can jump into an arbitrary child of a BlockExpression since the block doesn't accumulate values /// on evaluation stack as its child expressions are being evaluated. - /// + /// /// Goto needs to execute any finally blocks on the way to the target label. /// - /// { + /// { /// f(1, 2, try { g(3, 4, try { goto L } finally { ... }, 6) } finally { ... }, 7, 8) - /// L: ... + /// L: ... /// } /// - /// The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). - /// The jump needs to execute both finally blocks, the first one on stack level 4 the - /// second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, + /// The goto expression here jumps to label L while having 4 items on evaluation stack (1, 2, 3 and 4). + /// The jump needs to execute both finally blocks, the first one on stack level 4 the + /// second one on stack level 2. So, it needs to jump the first finally block, pop 2 items from the stack, /// run second finally block and pop another 2 items from the stack and set instruction pointer to label L. - /// - /// Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and + /// + /// Goto also needs to rethrow ThreadAbortException iff it jumps out of a catch handler and /// the current thread is in "abort requested" state. /// internal sealed class GotoInstruction : IndexedBranchInstruction @@ -260,9 +260,9 @@ internal sealed class GotoInstruction : IndexedBranchInstruction // TODO: We can remember hasValue in label and look it up when calculating stack balance. That would save some cache. private readonly bool _hasValue; - // The values should technically be Consumed = 1, Produced = 1 for gotos that target a label whose continuation depth + // The values should technically be Consumed = 1, Produced = 1 for gotos that target a label whose continuation depth // is different from the current continuation depth. This is because we will consume one continuation from the _continuations - // and at meantime produce a new _pendingContinuation. However, in case of forward gotos, we don't not know that is the + // and at meantime produce a new _pendingContinuation. However, in case of forward gotos, we don't not know that is the // case until the label is emitted. By then the consumed and produced stack information is useless. // The important thing here is that the stack balance is 0. public override int ConsumedContinuations { get { return 0; } } @@ -339,7 +339,7 @@ public override int Run(InterpretedFrame frame) if (_hasFinally) { - // Push finally. + // Push finally. frame.PushContinuation(_labelIndex); } int prevInstrIndex = frame.InstructionIndex; @@ -535,10 +535,10 @@ private EnterExceptionHandlerInstruction(bool hasValue) _hasValue = hasValue; } - // If an exception is throws in try-body the expression result of try-body is not evaluated and loaded to the stack. + // If an exception is throws in try-body the expression result of try-body is not evaluated and loaded to the stack. // So the stack doesn't contain the try-body's value when we start executing the handler. - // However, while emitting instructions try block falls thru the catch block with a value on stack. - // We need to declare it consumed so that the stack state upon entry to the handler corresponds to the real + // However, while emitting instructions try block falls thru the catch block with a value on stack. + // We need to declare it consumed so that the stack state upon entry to the handler corresponds to the real // stack depth after throw jumped to this catch block. public override int ConsumedStack { get { return _hasValue ? 1 : 0; } } @@ -563,7 +563,7 @@ internal sealed class LeaveExceptionHandlerInstruction : IndexedBranchInstructio private readonly bool _hasValue; - // The catch block yields a value if the body is non-void. This value is left on the stack. + // The catch block yields a value if the body is non-void. This value is left on the stack. public override int ConsumedStack { get { return _hasValue ? 1 : 0; } @@ -617,7 +617,7 @@ public override int ConsumedStack get { return 1; } } - // While emitting instructions a non-void try-fault expression is expected to produce a value. + // While emitting instructions a non-void try-fault expression is expected to produce a value. public override int ProducedStack { get { return _hasValue ? 1 : 0; } @@ -639,7 +639,6 @@ public override int Run(InterpretedFrame frame) } } - internal sealed class ThrowInstruction : Instruction { internal static readonly ThrowInstruction Throw = new ThrowInstruction(true, false); @@ -735,7 +734,7 @@ public override int Run(InterpretedFrame frame) // // The first is okay, it just means we take longer to compile. // The second we explicitly guard against inside of Compile(). - // + // // We can't miss 0. The first thread that writes -1 must have read 0 and hence start compilation. if (unchecked(_compilationThreshold--) == 0) { diff --git a/src/System.Management.Automation/engine/interpreter/DivInstruction.cs b/src/System.Management.Automation/engine/interpreter/DivInstruction.cs index 3a4039bcc9b..292e5e5c810 100644 --- a/src/System.Management.Automation/engine/interpreter/DivInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/DivInstruction.cs @@ -16,7 +16,6 @@ using System.Diagnostics; using System.Reflection; - namespace System.Management.Automation.Interpreter { internal abstract class DivInstruction : Instruction diff --git a/src/System.Management.Automation/engine/interpreter/DynamicInstructionN.cs b/src/System.Management.Automation/engine/interpreter/DynamicInstructionN.cs index 0459902698e..daa941971b9 100644 --- a/src/System.Management.Automation/engine/interpreter/DynamicInstructionN.cs +++ b/src/System.Management.Automation/engine/interpreter/DynamicInstructionN.cs @@ -15,7 +15,6 @@ using System.Runtime.CompilerServices; - namespace System.Management.Automation.Interpreter { internal sealed partial class DynamicInstructionN : Instruction diff --git a/src/System.Management.Automation/engine/interpreter/DynamicInstructions.Generated.cs b/src/System.Management.Automation/engine/interpreter/DynamicInstructions.Generated.cs index 32c317038d7..ca17ef48dae 100644 --- a/src/System.Management.Automation/engine/interpreter/DynamicInstructions.Generated.cs +++ b/src/System.Management.Automation/engine/interpreter/DynamicInstructions.Generated.cs @@ -13,7 +13,6 @@ * * ***************************************************************************/ - using System; using System.Linq; using System.Reflection; @@ -496,10 +495,8 @@ public override string ToString() { } } - // *** END GENERATED CODE *** #endregion - } diff --git a/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs b/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs index e986a441cd6..e1acba3ec4b 100644 --- a/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs @@ -13,7 +13,6 @@ * * ***************************************************************************/ - using System.Runtime.CompilerServices; namespace System.Management.Automation.Interpreter diff --git a/src/System.Management.Automation/engine/interpreter/InstructionFactory.cs b/src/System.Management.Automation/engine/interpreter/InstructionFactory.cs index 98e8545277a..35c26526fc3 100644 --- a/src/System.Management.Automation/engine/interpreter/InstructionFactory.cs +++ b/src/System.Management.Automation/engine/interpreter/InstructionFactory.cs @@ -13,13 +13,11 @@ * * ***************************************************************************/ - using System.Collections.Concurrent; using BigInt = System.Numerics.BigInteger; using System.Runtime.CompilerServices; using System.Threading; - namespace System.Management.Automation.Interpreter { internal abstract class InstructionFactory diff --git a/src/System.Management.Automation/engine/interpreter/InstructionList.cs b/src/System.Management.Automation/engine/interpreter/InstructionList.cs index cddf8dab6d8..afd472aace9 100644 --- a/src/System.Management.Automation/engine/interpreter/InstructionList.cs +++ b/src/System.Management.Automation/engine/interpreter/InstructionList.cs @@ -1056,7 +1056,6 @@ public void EmitDynamic.Factory(binder)); } - // *** END GENERATED CODE *** #endregion diff --git a/src/System.Management.Automation/engine/interpreter/LabelInfo.cs b/src/System.Management.Automation/engine/interpreter/LabelInfo.cs index 970a757a20e..2bcf53ece86 100644 --- a/src/System.Management.Automation/engine/interpreter/LabelInfo.cs +++ b/src/System.Management.Automation/engine/interpreter/LabelInfo.cs @@ -326,7 +326,6 @@ internal bool CanJumpInto } } - internal bool ContainsTarget(LabelTarget target) { if (_labels == null) diff --git a/src/System.Management.Automation/engine/interpreter/LightCompiler.cs b/src/System.Management.Automation/engine/interpreter/LightCompiler.cs index 09236a3ec5d..2dac5e8ee64 100644 --- a/src/System.Management.Automation/engine/interpreter/LightCompiler.cs +++ b/src/System.Management.Automation/engine/interpreter/LightCompiler.cs @@ -366,7 +366,6 @@ private Interpreter MakeInterpreter(string lambdaName) return new Interpreter(lambdaName, _locals, GetBranchMapping(), _instructions.ToArray(), debugInfos, _compilationThreshold); } - private void CompileConstantExpression(Expression expr) { var node = (ConstantExpression)expr; @@ -1352,7 +1351,6 @@ private bool EndsWithRethrow(Expression expr) return false; } - // TODO: remove (replace by true fault support) private void CompileAsVoidRemoveRethrow(Expression expr) { @@ -1645,7 +1643,6 @@ private void CompileMemberExpression(Expression expr) return; } - throw new System.NotImplementedException(); } @@ -1702,7 +1699,6 @@ private void CompileExtensionExpression(Expression expr) } } - private void CompileDebugInfoExpression(Expression expr) { var node = (DebugInfoExpression)expr; @@ -1732,7 +1728,6 @@ private void CompileRuntimeVariablesExpression(Expression expr) _instructions.EmitNewRuntimeVariables(node.Variables.Count); } - private void CompileLambdaExpression(Expression expr) { var node = (LambdaExpression)expr; diff --git a/src/System.Management.Automation/engine/interpreter/LightLambda.Generated.cs b/src/System.Management.Automation/engine/interpreter/LightLambda.Generated.cs index d2169e3ff82..fae037ab9f0 100644 --- a/src/System.Management.Automation/engine/interpreter/LightLambda.Generated.cs +++ b/src/System.Management.Automation/engine/interpreter/LightLambda.Generated.cs @@ -13,7 +13,6 @@ * * ***************************************************************************/ - using System; using System.Runtime.CompilerServices; using System.Reflection; diff --git a/src/System.Management.Automation/engine/interpreter/LightLambda.cs b/src/System.Management.Automation/engine/interpreter/LightLambda.cs index f883509412b..ec907b326d8 100644 --- a/src/System.Management.Automation/engine/interpreter/LightLambda.cs +++ b/src/System.Management.Automation/engine/interpreter/LightLambda.cs @@ -273,7 +273,6 @@ internal void RunVoidRef2(ref T0 arg0, ref T1 arg1) } } - public object Run(params object[] arguments) { if (_compiled != null || TryGetCompiled()) diff --git a/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs b/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs index 31ede7fbb02..31a18ba2cb3 100644 --- a/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs +++ b/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs @@ -236,7 +236,6 @@ protected override Expression VisitExtension(Expression node) return Visit(node.ReduceExtensions()); } - #region MergedRuntimeVariables /// diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index 1100ce9e3c4..a68f801bd08 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Diagnostics; @@ -675,7 +674,6 @@ internal class ThreadLocal private static readonly StorageInfo[] s_updating = Automation.Utils.EmptyArray(); // a marker used when updating the array private readonly bool _refCounted; - public ThreadLocal() { } diff --git a/src/System.Management.Automation/engine/lang/codegen.cs b/src/System.Management.Automation/engine/lang/codegen.cs index 6e20600406e..e463091ace7 100644 --- a/src/System.Management.Automation/engine/lang/codegen.cs +++ b/src/System.Management.Automation/engine/lang/codegen.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/lang/interface/PSParseError.cs b/src/System.Management.Automation/engine/lang/interface/PSParseError.cs index c29e49856ef..e3be59b5bee 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSParseError.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSParseError.cs @@ -1,9 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /********************************************************************++ - Copyright (c) Microsoft Corporation. All rights reserved. Project: PowerShell - Contents: PowerShell error interface for syntax editors Classes: System.Management.Automation.PSParseError diff --git a/src/System.Management.Automation/engine/lang/interface/PSParser.cs b/src/System.Management.Automation/engine/lang/interface/PSParser.cs index 1ea3b176ef9..47a4b45a148 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSParser.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSParser.cs @@ -1,9 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /********************************************************************++ - Copyright (c) Microsoft Corporation. All rights reserved. Project: PowerShell - Contents: PowerShell parser interface for syntax editors Classes: System.Management.Automation.PSParser diff --git a/src/System.Management.Automation/engine/lang/interface/PSToken.cs b/src/System.Management.Automation/engine/lang/interface/PSToken.cs index ee9c4566b5f..9990f6a6adb 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSToken.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSToken.cs @@ -1,9 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /********************************************************************++ - Copyright (c) Microsoft Corporation. All rights reserved. Project: PowerShell - Contents: PowerShell token interface for syntax editors Classes: System.Management.Automation.PSToken diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 1be5c02a347..4ae6da2a757 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -949,7 +948,6 @@ internal static object IsNotOperator(ExecutionContext context, IScriptExtent err return BoolToObject(!rType.IsInstanceOfType(lval)); } - /// /// Implementation of the PowerShell -like operator /// @@ -1310,9 +1308,6 @@ internal static string GetTypeFullName(object obj) return mshObj.InternalTypeNames[0]; } - - - /// /// Launch a method on an object. This will handle .NET native methods, COM /// methods and ScriptBlock notes. Native methods currently take precedence over notes... diff --git a/src/System.Management.Automation/engine/lang/scriptblock.cs b/src/System.Management.Automation/engine/lang/scriptblock.cs index 5c4a5fef5cf..2b6d72ae0c2 100644 --- a/src/System.Management.Automation/engine/lang/scriptblock.cs +++ b/src/System.Management.Automation/engine/lang/scriptblock.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -1245,7 +1244,6 @@ private void Dispose(bool disposing) #endregion IDispose } - /// /// Defines the exception thrown when conversion from ScriptBlock to PowerShell is forbidden /// (i.e. when the script block has undeclared variables or more than one statement) @@ -1300,7 +1298,6 @@ internal ScriptBlockToPowerShellNotSupportedException( this.SetErrorId(errorId); } - #region Serialization /// /// Initializes a new instance of ScriptBlockToPowerShellNotSupportedException with serialization parameters diff --git a/src/System.Management.Automation/engine/parser/AstVisitor.cs b/src/System.Management.Automation/engine/parser/AstVisitor.cs index de4255de363..41d476f332c 100644 --- a/src/System.Management.Automation/engine/parser/AstVisitor.cs +++ b/src/System.Management.Automation/engine/parser/AstVisitor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/parser/CharTraits.cs b/src/System.Management.Automation/engine/parser/CharTraits.cs index be5b90d0778..a686e3e4a5b 100644 --- a/src/System.Management.Automation/engine/parser/CharTraits.cs +++ b/src/System.Management.Automation/engine/parser/CharTraits.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Language { diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 9c3175fa8e1..7478d763871 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -419,8 +418,6 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo RestrictedLanguageChecker_EnsureUtilityModuleLoaded = typeof(RestrictedLanguageChecker).GetMethod(nameof(RestrictedLanguageChecker.EnsureUtilityModuleLoaded), staticFlags); - - internal static readonly ConstructorInfo ReturnException_ctor = typeof(ReturnException).GetConstructor(instanceFlags, null, CallingConventions.Standard, new Type[] { typeof(object) }, null); diff --git a/src/System.Management.Automation/engine/parser/ConstantValues.cs b/src/System.Management.Automation/engine/parser/ConstantValues.cs index 8f6f0df41db..c81e0b2713e 100644 --- a/src/System.Management.Automation/engine/parser/ConstantValues.cs +++ b/src/System.Management.Automation/engine/parser/ConstantValues.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Diagnostics; diff --git a/src/System.Management.Automation/engine/parser/DebugViewWriter.cs b/src/System.Management.Automation/engine/parser/DebugViewWriter.cs index 7b5868ca46c..edc91ebdfb2 100644 --- a/src/System.Management.Automation/engine/parser/DebugViewWriter.cs +++ b/src/System.Management.Automation/engine/parser/DebugViewWriter.cs @@ -13,7 +13,6 @@ * * ***************************************************************************/ - #if ENABLE_BINDER_DEBUG_LOGGING using System.Linq.Expressions; @@ -1115,7 +1114,6 @@ protected override Expression VisitDebugInfo(DebugInfoExpression node) { return node; } - private void DumpLabel(LabelTarget target) { Out(String.Format(CultureInfo.CurrentCulture, ".LabelTarget {0}:", GetLabelTargetName(target))); } diff --git a/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs b/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs index 2179b73595a..3ea19ad3a48 100644 --- a/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs +++ b/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/GlobalAssemblyCache.cs b/src/System.Management.Automation/engine/parser/GlobalAssemblyCache.cs index 27345674487..f16f64f54ad 100644 --- a/src/System.Management.Automation/engine/parser/GlobalAssemblyCache.cs +++ b/src/System.Management.Automation/engine/parser/GlobalAssemblyCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/PSType.cs b/src/System.Management.Automation/engine/parser/PSType.cs index 91ee67d9afa..8cfd53815ba 100644 --- a/src/System.Management.Automation/engine/parser/PSType.cs +++ b/src/System.Management.Automation/engine/parser/PSType.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index b347cbd3e03..3de24603421 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -120,7 +119,6 @@ public static ScriptBlockAst ParseFile(string fileName, out Token[] tokens, out } private string _keywordModuleName; - /// /// Parse input that does not come from a file. /// @@ -552,7 +550,6 @@ internal void NoteV3FeatureUsed() //_v3FeatureUsed = true; } - internal void RequireStatementTerminator() { var terminatorToken = PeekToken(); @@ -1865,7 +1862,6 @@ private StatementAst StatementRule() } } - switch (token.Kind) { case TokenKind.If: @@ -2825,7 +2821,6 @@ private StatementAst ConfigurationStatementRule(IEnumerable custom Runspaces.Runspace.DefaultRunspace.ExecutionContext.Engine.EngineParser = currentParser; } - Token lCurly = NextToken(); if (lCurly.Kind != TokenKind.LCurly) { @@ -2857,7 +2852,6 @@ private StatementAst ConfigurationStatementRule(IEnumerable custom return new ErrorStatementAst(ExtentOf(startExtent, endErrorStatement), configurationToken); } - #region "Add Configuration Keywords" // If the configuration name is a constant string, then diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index c5aa366b7e0..445f554900e 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Globalization; diff --git a/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs b/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs index 62defcc9a58..25239f547c7 100644 --- a/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs +++ b/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/parser/SafeValues.cs b/src/System.Management.Automation/engine/parser/SafeValues.cs index ed1924382de..92f0a913051 100644 --- a/src/System.Management.Automation/engine/parser/SafeValues.cs +++ b/src/System.Management.Automation/engine/parser/SafeValues.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.IO; diff --git a/src/System.Management.Automation/engine/parser/SemanticChecks.cs b/src/System.Management.Automation/engine/parser/SemanticChecks.cs index 86394e5ba06..8656cb6d9c1 100644 --- a/src/System.Management.Automation/engine/parser/SemanticChecks.cs +++ b/src/System.Management.Automation/engine/parser/SemanticChecks.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -13,7 +12,6 @@ using Microsoft.PowerShell; using Microsoft.PowerShell.DesiredStateConfiguration.Internal; - namespace System.Management.Automation.Language { internal class SemanticChecks : AstVisitor2, IAstPostVisitHandler @@ -265,7 +263,6 @@ private static string GetValidNamedAttributeProperties(Type attributeType) return string.Join(", ", propertyNames); } - public override AstVisitAction VisitParameter(ParameterAst parameterAst) { bool isClassMethod = parameterAst.Parent.Parent is FunctionMemberAst; @@ -1252,7 +1249,6 @@ public override AstVisitAction VisitDynamicKeywordStatement(DynamicKeywordStatem return AstVisitAction.Continue; } - public override AstVisitAction VisitPropertyMember(PropertyMemberAst propertyMemberAst) { if (propertyMemberAst.PropertyType != null) diff --git a/src/System.Management.Automation/engine/parser/SymbolResolver.cs b/src/System.Management.Automation/engine/parser/SymbolResolver.cs index cc8dc8f92ee..7e078c76c29 100644 --- a/src/System.Management.Automation/engine/parser/SymbolResolver.cs +++ b/src/System.Management.Automation/engine/parser/SymbolResolver.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Collections.Generic; @@ -679,7 +678,6 @@ public void PostVisit(Ast ast) ast.Accept(_symbolResolvePostActionVisitor); } - internal static string GetModuleQualifiedName(string namespaceName, string typeName) { const char NAMESPACE_SEPARATOR = '.'; diff --git a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs index 7369607174a..b488a4cbd5a 100644 --- a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs +++ b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs @@ -1,4 +1,7 @@ -using System.Collections; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -188,7 +191,6 @@ internal IList GetMembersByInferredType(PSTypeName typename, bool isStat return results; } - internal void AddMembersByInferredTypesClrType(PSTypeName typename, bool isStatic, Func filter, Func filterToCall, List results) { if (CurrentTypeDefinitionAst == null || CurrentTypeDefinitionAst.Type != typename.Type) @@ -304,7 +306,6 @@ internal void AddMembersByInferredTypeDefinitionAst(PSTypeName typename, bool is results.AddRange(GetMembersByInferredType(new PSTypeName(typeof(object)), isStatic, filterToCall)); } - internal void AddMembersByInferredTypeCimType(PSTypeName typename, List results, Func filterToCall) { string cimNamespace; @@ -924,7 +925,7 @@ private IEnumerable InferTypesFromForeachCommand(PseudoBindingInfo p foreach (var t in InferTypes(previousPipelineElement)) { var memberName = (((AstPair)argument).Argument as StringConstantExpressionAst)?.Value; - + if (memberName != null) { var members = _context.GetMembersByInferredType(t, false, null); @@ -1009,17 +1010,17 @@ private IEnumerable InferTypesFrom(MemberExpressionAst memberExpress if (memberAsStringConst == null) return Utils.EmptyArray(); - var exprType = GetExpressionType(expression, isStatic); + var exprType = GetExpressionType(expression, isStatic); if (exprType == null || exprType.Length == 0) { return Utils.EmptyArray(); } - + var res = new List(10); bool isInvokeMemberExpressionAst = memberExpressionAst is InvokeMemberExpressionAst; var maybeWantDefaultCtor = isStatic && isInvokeMemberExpressionAst - && memberAsStringConst.Value.EqualsOrdinalIgnoreCase("new"); + && memberAsStringConst.Value.EqualsOrdinalIgnoreCase("new"); // We use a list of member names because we might discover aliases properties // and if we do, we'll add to the list. @@ -1369,7 +1370,6 @@ private IEnumerable InferTypeFrom(VariableExpressionAst variableExpr yield break; } - // Look for our variable as a parameter or on the lhs of an assignment - hopefully we'll find either // a type constraint or at least we can use the rhs to infer the type. @@ -1458,7 +1458,6 @@ private IEnumerable InferTypeFrom(VariableExpressionAst variableExpr } } - PSTypeName evalTypeName; if (_context.TryGetRepresentativeTypeNameFromExpressionSafeEval(variableExpressionAst, out evalTypeName)) { diff --git a/src/System.Management.Automation/engine/parser/TypeResolver.cs b/src/System.Management.Automation/engine/parser/TypeResolver.cs index 1728c2f812e..3cbc539ee19 100644 --- a/src/System.Management.Automation/engine/parser/TypeResolver.cs +++ b/src/System.Management.Automation/engine/parser/TypeResolver.cs @@ -1,8 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - -// for fxcop +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs index f89c3b83575..8f6e40af6ee 100644 --- a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs +++ b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 36f660c0fef..811b802c1d2 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // This file contains all of the publicly visible parts of the PowerShell abstract syntax tree. @@ -2735,7 +2734,6 @@ public UsingStatementAst(IScriptExtent extent, UsingStatementKind kind, StringCo SetParent(Alias); } - /// /// Construct a using module statement that aliases an item with module specification as hashtable. /// @@ -6061,7 +6059,6 @@ internal override AstVisitAction InternalVisit(AstVisitor visitor) #endregion Visitors } - /// /// Defines types of configuration document /// @@ -6184,7 +6181,6 @@ internal override AstVisitAction InternalVisit(AstVisitor visitor) #endregion Visitors - #region Internal methods/properties internal Token LCurlyToken { get; set; } @@ -9416,7 +9412,6 @@ public override Ast Copy() // Indicates that this ast was constructed as part of a schematized object instead of just a plain hash literal. internal bool IsSchemaElement { get; set; } - #region Visitors internal override object Accept(ICustomAstVisitor visitor) diff --git a/src/System.Management.Automation/engine/parser/token.cs b/src/System.Management.Automation/engine/parser/token.cs index 4d4940cc302..76a8a1f5299 100644 --- a/src/System.Management.Automation/engine/parser/token.cs +++ b/src/System.Management.Automation/engine/parser/token.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index c951d1f996a..1a1045afc5a 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Microsoft.PowerShell.Commands; using Microsoft.PowerShell.DesiredStateConfiguration.Internal; @@ -358,7 +357,6 @@ public Dictionary Parameters public Func SemanticCheck { get; set; } } - internal static class DynamicKeywordExtension { internal static bool IsMetaDSCResource(this DynamicKeyword keyword) @@ -681,7 +679,6 @@ internal void Initialize(string fileName, string input, List tokenList) _positionHelper.LineStartMap = lineStartMap.ToArray(); } - internal TokenizerState StartNestedScan(UnscannedSubExprToken nestedText) { TokenizerState ts = new TokenizerState @@ -775,7 +772,6 @@ internal static bool IsKeyword(string str) return false; } - internal void SkipNewlines(bool skipSemis, bool v3) { // We normally don't create any tokens here, but the V2 tokenizer api returns newline tokens, @@ -2953,7 +2949,6 @@ private Token CheckOperatorInCommandMode(char c1, char c2, TokenKind tokenKind) return NewToken(tokenKind); } - private Token ScanGenericToken(char firstChar) { var sb = GetStringBuilder(); diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index 1d009797821..787a925e246 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index 31ee5d8dfb4..67a69770f53 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs index ed2c05091cd..3f8a69ebb8e 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs index 11e3b2e52b9..78d605b92c5 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 4119000e265..ce757b16f76 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -259,7 +258,6 @@ internal JobStateInfo(JobStateInfo jobStateInfo) Reason = jobStateInfo.Reason; } - #endregion constructors #region public_properties @@ -1730,7 +1728,6 @@ internal PSRemotingJob(PSSession[] remoteRunspaceInfos, this(remoteRunspaceInfos, runspaceHelpers, remoteCommand, 0, name) { } - /// /// Internal constructor for initializing PSRemotingJob using /// computer names @@ -2193,7 +2190,6 @@ public override bool HasMoreData } } - private bool _stopIsCalled = false; /// /// Stop Job diff --git a/src/System.Management.Automation/engine/remoting/client/Job2.cs b/src/System.Management.Automation/engine/remoting/client/Job2.cs index 03b603a6078..47cc9e1e6b5 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job2.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job2.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Collections.Generic; @@ -1881,7 +1880,6 @@ internal static bool ComputeJobStateFromChildJobStates(string traceClassName, Jo return false; } - // Ignore state changes which are not resulting in state change to finished. // State will be Running once at least one child is running. if ((e.JobStateInfo.State != JobState.Completed && e.JobStateInfo.State != JobState.Failed) && e.JobStateInfo.State != JobState.Stopped) diff --git a/src/System.Management.Automation/engine/remoting/client/JobManager.cs b/src/System.Management.Automation/engine/remoting/client/JobManager.cs index 2d7862a9318..068fd76edd2 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobManager.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -616,7 +615,6 @@ private List GetFilteredJobs( } } - return allJobs; } diff --git a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs index 4424e4fa547..84901eb9a7c 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/remoting/client/PSProxyJob.cs b/src/System.Management.Automation/engine/remoting/client/PSProxyJob.cs index e1d8be0b1b2..6e839139a4f 100644 --- a/src/System.Management.Automation/engine/remoting/client/PSProxyJob.cs +++ b/src/System.Management.Automation/engine/remoting/client/PSProxyJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -675,7 +674,6 @@ public static ICollection Create(Runspace runspace, Hashtable filter return Create(runspace, filter, null, null, receiveImmediately); } - /// /// Queries the runspace for jobs and constructs a collection of job proxies to interact with them. /// @@ -1359,7 +1357,6 @@ private void DoRemove(object state) AssignRunspaceOrRunspacePool(powershell); - // set the commands for the powershell powershell.Commands.AddCommand("Remove-Job").AddParameter("InstanceId", _remoteJobInstanceId); diff --git a/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs b/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs index d0cd4dd1830..8125842ffd7 100644 --- a/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs +++ b/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs index 705eaa49be4..b8f8e380388 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Globalization; @@ -873,7 +872,6 @@ protected override IAsyncResult CoreOpen(bool isAsync, AsyncCallback callback, _openAsyncResult = asyncResult; - // send a message using the data structure handler to open the RunspacePool // on the remote server DataStructureHandler.CreateRunspacePoolAndOpenAsync(); diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs index ebc5040c507..219268ebff2 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs index d2199a65938..6afed699508 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Tracing; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs index 3f1d865ef23..e7bf878bb97 100644 --- a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs +++ b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs index b9740d7506f..550bed7dd26 100644 --- a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs +++ b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs index a717ba21959..c966574494e 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Management.Automation.Internal; @@ -134,8 +133,6 @@ internal Version ServerProtocolVersion } } - - private RemoteRunspacePoolInternal _remoteRunspacePool; /// @@ -233,7 +230,6 @@ internal ClientRemoteSessionImpl(RemoteRunspacePoolInternal rsPool, #region connect/close - /// /// Creates a Remote Session Asynchronously. /// @@ -607,4 +603,3 @@ public void Dispose(bool disposing) } } - diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index 1ccc951f89e..68a654937d3 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Collections.Generic; @@ -441,7 +440,6 @@ internal ClientRemoteSessionDSHandlerStateMachine() _stateMachineHandle[(int)RemoteSessionState.EstablishedAndKeySent, (int)RemoteSessionEvent.KeyReceiveFailed] += SetStateToClosedHandler; // _stateMachineHandle[(int)RemoteSessionState.EstablishedAndKeyRequested, (int)RemoteSessionEvent.KeySendFailed] += SetStateToClosedHandler; - //TODO: All these are potential unexpected state transitions.. should have a way to track these calls.. // should atleast put a dbg assert in this handler for (int i = 0; i < _stateMachineHandle.GetLength(0); i++) @@ -610,7 +608,6 @@ private void DoCreateSession(object sender, RemoteSessionStateMachineEventArgs a } } - /// /// This is the handler for ConnectSession event of the FSM. This is the beginning of everything /// else. From this moment on, the FSM will proceeds step by step to eventually reach diff --git a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs index 51207d42c28..5971e768237 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; using System.Management.Automation.Internal; @@ -948,7 +946,6 @@ private void HandleHostCallReceived(object sender, RemoteDataEventArgs /// Does the cleanup necessary on pipeline completion /// diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs index a13b0a90e1e..050705f6d50 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; using System.Management.Automation.Host; @@ -1013,7 +1012,6 @@ public override Pipeline CreatePipeline() return CoreCreatePipeline(null, false, false); } - /// /// Create a pipeline from a command string /// diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs index 98089ff1ebc..6e7bf9e65e2 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs index 77d39aa2238..2daf976fdb9 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Remoting.Client; diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs index 0fac991e7a6..4870bda0958 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; using System.Management.Automation.Runspaces; @@ -230,7 +229,6 @@ private void HandleCloseComplete(object sender, EventArgs args) _stateMachine.RaiseEvent(closeCompletedArg); } - #endregion close #region negotiation diff --git a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs index d68f5506d10..5af18f536b6 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -224,7 +223,6 @@ public AuthenticationMechanism Authentication } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -245,7 +243,6 @@ public string CertificateThumbprint } private string _thumbprint; - /// /// Port specifies the alternate port to be used in case the /// default ports are not used for the transport mechanism @@ -262,7 +259,6 @@ public string CertificateThumbprint [ValidateRange((Int32)1, (Int32)UInt16.MaxValue)] public Int32 Port { get; set; } - /// /// This parameter suggests that the transport scheme to be used for /// remote connections is useSSL instead of the default http.Since @@ -275,7 +271,6 @@ public string CertificateThumbprint [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SSL")] public SwitchParameter UseSSL { get; set; } - /// /// Extended session options. Used in this cmdlet to set server disconnect options. /// @@ -285,7 +280,6 @@ public string CertificateThumbprint [Parameter(ParameterSetName = ConnectPSSessionCommand.ConnectionUriGuidParameterSet)] public PSSessionOption SessionOption { get; set; } - /// /// Allows the user of the cmdlet to specify a throttling value /// for throttling the number of remote operations that can diff --git a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs index f550f163ca4..05ef4ced068 100644 --- a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs +++ b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -1163,7 +1162,6 @@ private string ConstructPluginContent(out string srcConfigFilePath, out string d tempValue); } - if (sessionType == PSSessionType.Workflow && !isUseSharedProcessSpecified) { UseSharedProcess = true; @@ -1393,7 +1391,6 @@ internal static void CollectShouldProcessParameters(PSCmdlet cmdlet, out bool wh } } - /// /// Checks if the current thread is running elevated. If not, throws an error. /// @@ -2998,7 +2995,6 @@ public sealed class SetPSSessionConfigurationCommand : PSSessionConfigurationCom // To Escape } -- }} // To Escape " -- "" - private const string getSessionTypeFormat = @"(get-item 'WSMan::localhost\Plugin\{0}\InitializationParameters\sessiontype' -ErrorAction SilentlyContinue).Value"; private const string getCurrentIdleTimeoutmsFormat = @"(Get-Item 'WSMan:\localhost\Plugin\{0}\Quotas\IdleTimeoutms').Value"; private const string getAssemblyNameDataFormat = @"(Get-Item 'WSMan:\localhost\Plugin\{0}\InitializationParameters\assemblyname').Value"; @@ -3045,7 +3041,6 @@ public sealed class SetPSSessionConfigurationCommand : PSSessionConfigurationCom Set-SessionPluginIdleTimeoutQuotas $args[0] $args[1] $args[2] "; - private const string setSessionConfigurationOptionsSbFormat = @" function Set-SessionPluginOptions([hashtable] $options) {{ if ($options[""UsedSharedProcess""]) {{ @@ -3519,7 +3514,6 @@ protected override void ProcessRecord() File.Copy(_configFilePath, destPath, true); } - string shellNotFoundErrorMsg = StringUtil.Format(RemotingErrorIdStrings.CSCmdsShellNotFound, shellName); string shellNotPowerShellMsg = StringUtil.Format(RemotingErrorIdStrings.CSCmdsShellNotPowerShellBased, shellName); string shellForPowerShellCoreMsg = StringUtil.Format(RemotingErrorIdStrings.CSCmdsPowerShellCoreShellNotModifiable, shellName); @@ -3553,7 +3547,6 @@ protected override void ProcessRecord() accessModeSpecified ? AccessMode : PSSessionConfigurationAccessMode.Disabled, }); - errorList = (ArrayList)Context.DollarErrorVariable; if (errorList.Count > errorCountBefore) @@ -5419,7 +5412,6 @@ public sealed class GetPSSessionCapabilityCommand : PSCmdlet [Parameter()] public SwitchParameter Full { get; set; } - /// /// protected override void BeginProcessing() diff --git a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs index 449c4011f3d..c01c94af936 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs index 78b48f48198..17c521aabaa 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index 227f6168d78..39b7b0962f3 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/commands/GetJob.cs b/src/System.Management.Automation/engine/remoting/commands/GetJob.cs index b906542a2ad..02baf4e507a 100644 --- a/src/System.Management.Automation/engine/remoting/commands/GetJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/GetJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Management.Automation; @@ -78,7 +77,6 @@ public class GetJobCommand : JobCmdletBase [Parameter(ParameterSetName = JobCmdletBase.CommandParameterSet)] public int Newest { get; set; } - /// /// SessionId for which job /// need to be obtained diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs index 30c1fb5b25a..ae427f6ec85 100644 --- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -597,7 +596,6 @@ public override SwitchParameter AllowRedirection } } - /// /// Extended Session Options for controlling the session creation. Use /// "New-WSManSessionOption" cmdlet to supply value for this parameter. diff --git a/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs b/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs index f99e6a20439..d97d9aee814 100644 --- a/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs +++ b/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs index 065f37b379a..fdda2b96e35 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System; using System.IO; using System.Collections; @@ -2029,4 +2032,4 @@ internal static string CombineHashTableOrStringArray(object[] values, StreamWrit } #endregion -} \ No newline at end of file +} diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs index 0823bc7cad8..2362fbe61a1 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs index 7ee8ffc0511..3252832cf66 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; @@ -128,7 +127,6 @@ public AuthenticationMechanism ProxyAuthentication /// public PSCredential ProxyCredential { get; set; } - /// /// When connecting over HTTPS, the client does not validate that the server /// certificate is signed by a trusted certificate authority (CA). Use only when diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 4672fb541c5..b7fa3ffd81c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq; @@ -997,7 +996,6 @@ private static string GetSSHConnectionStringParameter(object param) throw new PSArgumentException(RemotingErrorIdStrings.InvalidSSHConnectionParameter); } - /// /// Validates parameter value and returns as integer /// @@ -1168,7 +1166,6 @@ public virtual Object[] ArgumentList } private Object[] _args; - /// /// Indicates that if a job/command is invoked remotely the connection should be severed /// right have invocation of job/command. @@ -1842,7 +1839,6 @@ internal void OnRunspacePSEventReceived(object sender, PSEventArgs e) /// internal List Operations { get; } = new List(); - /// /// Closes the input streams on all the pipelines /// @@ -2034,7 +2030,6 @@ protected override void BeginProcessing() } } - #endregion Overrides #region "Get PowerShell instance" @@ -2214,7 +2209,6 @@ private System.Management.Automation.PowerShell ConvertToPowerShell() #region "UsingExpression Utilities" - /// /// Get the converted script for a remote PSv2 end /// diff --git a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs index a4540fd23d4..d24cf678d52 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs index 9733a601c62..4014863e5d3 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs index 3d256fe253b..4db5dbb1aee 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs index 1f814cd9ed7..8c9c6b6e194 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -88,7 +87,6 @@ public class ReceivePSSessionCommand : PSRemotingCmdlet [ValidateNotNullOrEmpty] public PSSession Session { get; set; } - /// /// Session Id of PSSession object to receive data from. /// @@ -99,7 +97,6 @@ public class ReceivePSSessionCommand : PSRemotingCmdlet ParameterSetName = ReceivePSSessionCommand.IdParameterSet)] public Int32 Id { get; set; } - /// /// Computer name to receive session data from. /// @@ -199,7 +196,6 @@ public SwitchParameter AllowRedirection [ValidateNotNullOrEmpty] public Guid InstanceId { get; set; } - /// /// Name of PSSession object to receive data from. /// @@ -215,7 +211,6 @@ public SwitchParameter AllowRedirection [ValidateNotNullOrEmpty] public string Name { get; set; } - /// /// Determines how running command output is returned on client. /// @@ -243,7 +238,6 @@ public SwitchParameter AllowRedirection [ValidateNotNullOrEmpty] public string JobName { get; set; } = string.Empty; - /// /// Specifies the credentials of the user to impersonate in the /// remote machine. If this parameter is not specified then the @@ -266,7 +260,6 @@ public PSCredential Credential } private PSCredential _psCredential; - /// /// Use basic authentication to authenticate the user. /// @@ -286,7 +279,6 @@ public AuthenticationMechanism Authentication } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -307,7 +299,6 @@ public string CertificateThumbprint } private string _thumbprint; - /// /// Port specifies the alternate port to be used in case the /// default ports are not used for the transport mechanism @@ -324,7 +315,6 @@ public string CertificateThumbprint [ValidateRange((Int32)1, (Int32)UInt16.MaxValue)] public Int32 Port { get; set; } - /// /// This parameter suggests that the transport scheme to be used for /// remote connections is useSSL instead of the default http.Since diff --git a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs index a26c947ab34..3543071d6e7 100644 --- a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs b/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs index 06c3c85cf8c..e0d82ce17e6 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs index fd468499dfb..86b19b0e991 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs index 829d69b110c..7091c85b552 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs b/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs index e80f7d1b331..ebb78185b58 100644 --- a/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -100,7 +99,6 @@ public SwitchParameter Wait } private bool _wait = false; - #endregion Parameters #region Overrides diff --git a/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs b/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs index f575206786a..ad837c3b7b9 100644 --- a/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs +++ b/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -103,7 +102,6 @@ protected override void ProcessRecord() string scriptName; scriptInfo = DISCUtils.GetScriptInfoForFile(this.Context, filePath, out scriptName); - Hashtable configTable = null; try diff --git a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs index 9d6ff32aabe..866355a8c4f 100644 --- a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs index 2c5a4672b6d..8458f6a0b3d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.ObjectModel; @@ -207,7 +206,6 @@ public PSCredential Credential } private PSCredential _psCredential; - /// /// Use basic authentication to authenticate the user. /// @@ -227,7 +225,6 @@ public AuthenticationMechanism Authentication } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -248,7 +245,6 @@ public string CertificateThumbprint } private string _thumbprint; - /// /// Port specifies the alternate port to be used in case the /// default ports are not used for the transport mechanism @@ -265,7 +261,6 @@ public string CertificateThumbprint [ValidateRange((Int32)1, (Int32)UInt16.MaxValue)] public Int32 Port { get; set; } - /// /// This parameter suggests that the transport scheme to be used for /// remote connections is useSSL instead of the default http.Since @@ -289,7 +284,6 @@ public string CertificateThumbprint [Parameter(ParameterSetName = GetPSSessionCommand.ConnectionUriInstanceIdParameterSet)] public Int32 ThrottleLimit { get; set; } = 0; - /// /// Filters returned remote runspaces based on runspace state. /// @@ -305,7 +299,6 @@ public string CertificateThumbprint [Parameter(ParameterSetName = GetPSSessionCommand.VMNameInstanceIdParameterSet)] public SessionFilterState State { get; set; } - /// /// Session options. /// diff --git a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs index 21ccb5fe99b..9cc14e2afa4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; @@ -15,7 +14,6 @@ using System.Threading; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell.Commands { /// diff --git a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs index eff6d69aed9..48744a3d944 100644 --- a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs +++ b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; diff --git a/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs index 5ee1ea92225..8870806597b 100644 --- a/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs b/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs index 8bd4b8fe0d5..bd35d055901 100644 --- a/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs +++ b/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Runspaces; - namespace System.Management.Automation { /// diff --git a/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs b/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs index 996a1793833..a33777339dc 100644 --- a/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs +++ b/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs b/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs index d6abab8e3e8..3a97495d8bd 100644 --- a/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs +++ b/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Threading; diff --git a/src/System.Management.Automation/engine/remoting/common/Indexer.cs b/src/System.Management.Automation/engine/remoting/common/Indexer.cs index 5387386967e..2aa502507e5 100644 --- a/src/System.Management.Automation/engine/remoting/common/Indexer.cs +++ b/src/System.Management.Automation/engine/remoting/common/Indexer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs b/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs index 2ab00025256..6ad0dbd581e 100644 --- a/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs +++ b/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs b/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs index 0088f2f136f..05164306f5f 100644 --- a/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs +++ b/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs b/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs index 1c1728d5e52..7e632415e3c 100644 --- a/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs +++ b/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs index 1f6e49e34a8..61a717de16c 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Tracing; using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs index a2452581a73..1eac7c36029 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Tracing; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index a7aa0f3124e..f9580a9db4e 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Net; using System.Net.Sockets; @@ -247,7 +246,6 @@ public int OpenTimeout internal const int DefaultTimeout = -1; internal const int InfiniteTimeout = 0; - /// /// The duration (in ms) for which PowerShell should wait before it times out on cancel operations /// (close runspace or stop powershell). For instance, when the user hits ctrl-C, @@ -714,7 +712,6 @@ public PSCredential ProxyCredential } } - /// /// When connecting over HTTPS, the client does not validate that the server /// certificate is signed by a trusted certificate authority (CA). Use only when diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs index 8773def9aa9..9ed8cc76a67 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs index e5ea2c5c3e4..69314b706bf 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs index 3fddda979b3..418724d8dd7 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Tracing; using System.Threading; @@ -788,8 +787,6 @@ internal static RemoteDataObject GenerateRunspacePoolInitData( dataAsPSObject); } - - /// /// This method generates a Remoting data structure handler message for /// modifying the maxrunspaces of the specified runspace pool on the server diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs index 3ccc625612b..3170577b5dd 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs index fd9ccc85034..1199b6afc35 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs index 69863ade1b9..8392630da82 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs index 48e13f2b1df..099218f862b 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using Dbg = System.Management.Automation.Diagnostics; @@ -127,7 +126,6 @@ internal static RemoteDataObject CreateFrom(RemotingDestination destination, return new RemoteDataObject(destination, dataType, runspacePoolId, powerShellId, data); } - /// /// Creates a RemoteDataObject by deserializing . /// diff --git a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs index 8208b3a8aff..a0812e55278 100644 --- a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs +++ b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -418,7 +417,6 @@ internal static int GetBlobLength(byte[] fragmentBytes, int startIndex) } } - /// /// A stream used to store serialized data. This stream holds serialized data in the /// form of fragments. Every "fragment size" data will hold a blob identifying the fragment. diff --git a/src/System.Management.Automation/engine/remoting/common/misc.cs b/src/System.Management.Automation/engine/remoting/common/misc.cs index 863b00c7169..93bb13b532d 100644 --- a/src/System.Management.Automation/engine/remoting/common/misc.cs +++ b/src/System.Management.Automation/engine/remoting/common/misc.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Remoting; using Dbg = System.Management.Automation.Diagnostics; @@ -36,7 +35,6 @@ internal RemoteSessionNegotiationEventArgs(RemoteSessionCapability remoteSession internal RemoteDataObject RemoteData { get; set; } } - /// /// This event arg is designed to contain generic data received from the other side of the connection. /// It can be used for both the client side and for the server side. @@ -289,7 +287,6 @@ internal RemoteSessionStateInfo(RemoteSessionStateInfo sessionStateInfo) Reason = sessionStateInfo.Reason; } - #endregion Constructors #region Public_Properties diff --git a/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs b/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs index b686d7d9792..3e243cb57a7 100644 --- a/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs +++ b/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Runspaces; using System.Text; diff --git a/src/System.Management.Automation/engine/remoting/common/remotesession.cs b/src/System.Management.Automation/engine/remoting/common/remotesession.cs index 43a26a440ee..e0d6ff4687c 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotesession.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotesession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs index 4a307b767bd..1c7af327103 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Management.Automation.Internal; @@ -254,7 +253,6 @@ internal enum PSRemotingErrorId : uint IPCExceptionLaunchingProcess = 2107, } - /// /// This static class defines the resource base name used by remoting errors. /// It also provides a convenience method to get the localized strings. @@ -368,7 +366,6 @@ protected PSRemotingDataStructureException(SerializationInfo info, StreamingCont { } - #endregion Constructors /// @@ -381,7 +378,6 @@ private void SetDefaultErrorRecord() } } - /// /// This exception is used by remoting code to indicate an error condition in network operations. /// @@ -414,8 +410,6 @@ public PSRemotingTransportException(string message) SetDefaultErrorRecord(); } - - /// /// This constructor takes a localized message and an inner exception. /// diff --git a/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs b/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs index f987027c1d9..df0c8ba9299 100644 --- a/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs +++ b/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Threading; @@ -165,7 +164,6 @@ internal void RaiseRunspaceDebugStopEvent(System.Management.Automation.Runspaces RunspaceDebugStop.SafeInvoke(this, new StartRunspaceDebugProcessingEventArgs(runspace)); } - #endregion } // IThrottleOperation diff --git a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs index 25b9bb0b455..c258bfddaa6 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs @@ -1,6 +1,6 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + /* * Common file that contains interface definitions for generic server and client * transport managers. @@ -1210,7 +1210,6 @@ internal virtual void SendStopSignal() } } - namespace System.Management.Automation.Remoting.Server { /// diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 1d450d7c9dd..bd3260c690e 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -18,7 +17,6 @@ using Dbg = System.Management.Automation.Diagnostics; using System.Collections; - namespace System.Management.Automation.Remoting { /// @@ -204,7 +202,6 @@ private static Nullable GetIntValueInBytes(string optionValueInMB) return result; } - /// /// Creates the struct from initialization parameters xml. /// diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index ebacbb6ce72..01c67b8eaed 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /* * Common file that contains implementation for both server and client transport @@ -376,7 +375,6 @@ private static void ProcessElement(XmlReader xmlReader, DataProcessingDelegates #endregion } - /// /// A wrapper around TextWriter to allow for synchronized writing to a stream. /// Synchronization is required to avoid collision when multiple TransportManager's diff --git a/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs b/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs index dc8acb41f51..ec555207545 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /* * Contains definition for PSSenderInfo, PSPrincipal, PSIdentity which are diff --git a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs index 44dfdac2546..544a58c145d 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Xml; diff --git a/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs b/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs index 552668fba40..5fa03c68733 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Management.Automation.Internal; @@ -793,7 +792,6 @@ internal Nullable MaximumReceivedObjectSize } } - /// /// Prepares receive data streams for a reconnection /// @@ -805,7 +803,6 @@ internal void PrepareForStreamConnect() } } - /// /// This might be needed only for ServerCommandTransportManager case /// where the command is run in the same thread that runs ProcessRawData diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs index 2fcd0a2f889..5047bb1b243 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using System.Runtime.InteropServices; @@ -619,7 +618,6 @@ internal enum WSManDataType : uint WSMAN_DATA_TYPE_DWORD = 4 }; - [StructLayout(LayoutKind.Sequential)] internal class WSManDataStruct { @@ -787,7 +785,6 @@ internal int BufferLength set { _bufferLength = value; } } - private string _text; internal string Text { @@ -1246,7 +1243,6 @@ internal WSManCommandArgSet(byte[] firstArgument) this.argsCount = 0; } - /// /// Free resources. /// @@ -2544,7 +2540,6 @@ internal static extern void WSManConnectShellEx(IntPtr wsManSessionHandle, IntPtr asyncCallback, [In, Out] ref IntPtr shellOperationHandle); - /// /// /// @@ -2569,7 +2564,6 @@ internal static extern void WSManReconnectShellEx(IntPtr wsManSessionHandle, int flags, IntPtr asyncCallback); - [DllImport(WSManNativeApi.WSManClientApiDll, EntryPoint = "WSManReconnectShellCommand", SetLastError = false, CharSet = CharSet.Unicode)] internal static extern void WSManReconnectShellCommandEx(IntPtr wsManCommandHandle, int flags, @@ -2611,7 +2605,6 @@ internal static extern void WSManRunShellCommandEx(IntPtr shellOperationHandle, IntPtr asyncCallback, ref IntPtr commandOperationHandle); - [DllImport(WSManNativeApi.WSManClientApiDll, EntryPoint = "WSManConnectShellCommand", SetLastError = false, CharSet = CharSet.Unicode)] internal static extern void WSManConnectShellCommandEx(IntPtr shellOperationHandle, int flags, @@ -2622,7 +2615,6 @@ internal static extern void WSManConnectShellCommandEx(IntPtr shellOperationHand IntPtr asyncCallback, ref IntPtr commandOperationHandle); - /// /// Registers a callback with WSMan to receive output from the remote end. /// If commandOperationHandle is null, then the receive callback is registered @@ -2733,7 +2725,6 @@ internal static extern void WSManCloseCommand(IntPtr cmdHandle, int flags, IntPtr asyncCallback); - /// /// Sends a signal. If is null, then the signal will /// be sent to shell. @@ -2904,7 +2895,6 @@ internal static extern int WSManPluginOperationComplete( int errorCode, [MarshalAs(UnmanagedType.LPWStr)] string extendedInformation); - internal enum WSManFlagReceive : int { /// diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs index 1abef92b3bc..01e7460d81e 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs @@ -1,8 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ---------------------------------------------------------------------- -// -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Entry points for managed PowerShell plugin worker used to // host powershell in a WSMan service. // ---------------------------------------------------------------------- @@ -400,7 +398,6 @@ internal void CreateShell( p); } - mgdShellSession.registeredShutDownWaitHandle = ThreadPool.RegisterWaitForSingleObject( eventWaitHandle, new WaitOrTimerCallback(WSManPluginManagedEntryWrapper.PSPluginOperationShutdownCallback), diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs index 226438e2172..2e0241c5465 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs @@ -1,8 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ---------------------------------------------------------------------- -// -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Entry points for managed PowerShell plugin worker used to // host powershell in a WSMan service. // ---------------------------------------------------------------------- diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs index d8d98c2d8e3..b94b433a9f1 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs @@ -1,8 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ---------------------------------------------------------------------- -// -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Entry points for managed PowerShell plugin worker used to // host powershell in a WSMan service. // ---------------------------------------------------------------------- diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs index 923c65894fa..2b22ba87d6b 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs @@ -1,8 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ---------------------------------------------------------------------- -// -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Entry points for managed PowerShell plugin worker used to // host powershell in a WSMan service. // ---------------------------------------------------------------------- @@ -412,4 +410,4 @@ private void OnPowershellGuidReported(object src, System.EventArgs args) this.PowerShellGuidObserver -= new System.EventHandler(this.OnPowershellGuidReported); } } -} // namespace System.Management.Automation.Remoting \ No newline at end of file +} // namespace System.Management.Automation.Remoting diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index bc9c88859f8..18723c3eb16 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /* * Common file that contains implementation for both server and client transport @@ -125,7 +124,6 @@ internal static TransportErrorOccuredEventArgs ConstructTransportErrorEventArgs( //as part of command TM operations (could be returned because of RC retries under the hood) //Not worth to handle these cases separately as there are very corner scenarios, but need to make sure wsmanSessionTM is not referenced - // Destination server is reporting that URI redirect is required for this user. if ((errorStruct.errorCode == WSManNativeApi.ERROR_WSMAN_REDIRECT_REQUESTED) && (wsmanSessionTM != null)) { @@ -364,7 +362,6 @@ internal CompletionEventArgs(CompletionNotification notification) private int _connectionRetryCount; - private const string resBaseName = "remotingerroridstrings"; // Robust connections maximum retry time value in milliseconds. @@ -822,7 +819,6 @@ internal void SetWSManSessionOption(WSManNativeApi.WSManSessionOption option, st internal bool SupportsDisconnect { get; private set; } - internal override void DisconnectAsync() { Dbg.Assert(!isClosed, "object already disposed"); @@ -2626,7 +2622,6 @@ internal WSManAPIDataCommon() _outputStreamSet = new WSManNativeApi.WSManStreamIDSet_ManToUn( new string[] { WSManNativeApi.WSMAN_STREAM_ID_STDOUT }); - // startup options common to all connections WSManNativeApi.WSManOption protocolStartupOption = new WSManNativeApi.WSManOption(); protocolStartupOption.name = RemoteDataNameStrings.PS_STARTUP_PROTOCOL_VERSION_NAME; diff --git a/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs b/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs index 85c3beeb9b3..c83194af873 100644 --- a/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs +++ b/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs index 75fc934800f..f6bb4c6c902 100644 --- a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs +++ b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Tracing; using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs b/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs index 19e0c78ecd2..04493179209 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Remoting.Server; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs index 765bd6c6658..58053275289 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Security.Principal; using System.Management.Automation.Runspaces; @@ -9,7 +8,6 @@ using System.Management.Automation.Internal; using System.Threading; - namespace System.Management.Automation { /// diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs index 5cfe0c0e538..f15fb2ec884 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using System.Management.Automation.Remoting.Server; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs index 9f5abf2238e..7dedde2edc1 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs index 663b76b342e..a5d1769e45b 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs index 4d2661c53e9..0b0e46cc05f 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index 7cf5643e2c9..cc7e3bf645b 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -93,7 +92,6 @@ private Dictionary _associatedShells #region Constructors - #if CORECLR // No ApartmentState In CoreCLR /// /// Creates the runspace pool driver diff --git a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs index 1dcf430923c..6bf974adb18 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs index 01e48b022b8..2c0c31cb288 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs b/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs index d09127c86be..6f0fecc89a0 100644 --- a/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs +++ b/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Remoting.WSMan { diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs index ada9ba95ab6..02d0a649693 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs index e87557155f4..4596da52c38 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Collections.Generic; @@ -56,7 +55,6 @@ private Queue _processPendingEventsQueue #region Constructors - /// /// This constructor instantiates a FSM object for the server side to control the remote connection. /// It initializes the event handling matrix with event handlers. @@ -128,8 +126,6 @@ internal ServerRemoteSessionDSHandlerStateMachine(ServerRemoteSession session) _stateMachineHandle[(int)RemoteSessionState.EstablishedAndKeyExchanged, (int)RemoteSessionEvent.KeyRequested] += DoKeyExchange; // _stateMachineHandle[(int)RemoteSessionState.EstablishedAndKeyExchanged, (int)RemoteSessionEvent.KeyReceiveFailed] += DoKeyExchange; // - - for (int i = 0; i < _stateMachineHandle.GetLength(0); i++) { for (int j = 0; j < _stateMachineHandle.GetLength(1); j++) diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs index 88010ddb3e2..b5cd7f5724e 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs index a2d9604d14c..84bf5890892 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs @@ -1,6 +1,5 @@ -/********************************************************************++ - * Copyright (c) Microsoft Corporation. All rights reserved. - * --********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Remoting.Server; diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index 536350cc661..d35d139ed40 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -20,7 +19,6 @@ using System.Threading; using System.Xml; - namespace System.Management.Automation.Language { // Item1 - member name @@ -851,7 +849,6 @@ public override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObje BindingRestrictions.GetInstanceRestriction(target.Expression, AutomationNull.Value))).WriteToDebugLog(this); } - var enumerable = PSEnumerableBinder.IsEnumerable(target); if (enumerable == null) { @@ -3746,7 +3743,6 @@ internal static void InvalidateCache() } } - internal static DynamicMetaObject ThrowNoConversion(DynamicMetaObject target, Type toType, DynamicMetaObjectBinder binder, int currentVersion, params DynamicMetaObject[] args) { @@ -3884,7 +3880,6 @@ internal static void InvalidateCache() } } - public override DynamicMetaObject FallbackGetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion) { if (!target.HasValue || indexes.Any(mo => !mo.HasValue)) @@ -4644,7 +4639,6 @@ private DynamicMetaObject SetIndexArray(DynamicMetaObject target, PSConvertBinder.ThrowNoConversion(indexes[0], typeof(int), this, _version, target, value); } - var elementType = target.LimitType.GetElementType(); var valueExpr = PSGetIndexBinder.ConvertIndex(value, elementType); if (valueExpr == null) @@ -7237,7 +7231,6 @@ internal static void InvalidateCache() } } - internal PSCreateInstanceBinder(CallInfo callInfo, PSMethodInvocationConstraints constraints, bool publicTypeOnly) : base(callInfo) { diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index 6b69f89d997..c85086cd677 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Concurrent; @@ -39,7 +38,6 @@ internal enum ScriptBlockClauseToInvoke ProcessBlockOnly, } - internal class CompiledScriptBlockData { internal CompiledScriptBlockData(IParameterMetadataProvider ast, bool isFilter) diff --git a/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs b/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs index 5c44e281e28..88207bd9422 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ReSharper disable UnusedMember.Global diff --git a/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs b/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs index 28cab722d0c..61c28727364 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index df5fc5f837d..0f915303f1b 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; @@ -2465,7 +2464,6 @@ internal static object Where(IEnumerator enumerator, ScriptBlock expressionSB, W rest.Add(Current(enumerator)); } - return rest.ToArray(); } @@ -2644,7 +2642,6 @@ internal static object Where(IEnumerator enumerator, ScriptBlock expressionSB, W return matches; } - /// /// Implements the ForEach() operator. /// @@ -3217,7 +3214,6 @@ internal static IEnumerator GetGenericEnumerator(IEnumerable enumerable) } } - /// /// A routine used to advance an enumerator and catch errors that might occur /// performing the operation diff --git a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs index a1957f7732a..4040389f36d 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // ReSharper disable UnusedMember.Global // ReSharper disable RedundantCast diff --git a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs index c513cc569da..da826201a8b 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs b/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs index 402257788c5..d1d1f71399a 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Linq; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs index 774dfc834f7..c9888d1108b 100644 --- a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs +++ b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/scriptparameterbinder.cs b/src/System.Management.Automation/engine/scriptparameterbinder.cs index 3d40f11d344..3ba86fcf86e 100644 --- a/src/System.Management.Automation/engine/scriptparameterbinder.cs +++ b/src/System.Management.Automation/engine/scriptparameterbinder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs index cde402ebbd3..0d316b12972 100644 --- a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs +++ b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index feadb81279f..4da7501687c 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -1060,7 +1059,6 @@ int depth return false; } - /// /// /// @@ -2504,7 +2502,6 @@ internal static void WriteUri(InternalSerializer serializer, string streamName, WriteEncodedString(serializer, streamName, property, Convert.ToString(source, CultureInfo.InvariantCulture), entry); } - /// /// Serialize string as item or property /// @@ -2869,7 +2866,6 @@ private static string EncodeString(string s, int indexOfFirstEncodableCharacter) return new String(result, 0, rlen); } - /// /// Writes element string in monad namespace /// @@ -3760,7 +3756,6 @@ private void ReadTypeNames(PSObject dso) ); dso.InternalTypeNames = new ConsolidatedString(typeNames); - //Skip the node Skip(); } diff --git a/src/System.Management.Automation/help/AliasHelpInfo.cs b/src/System.Management.Automation/help/AliasHelpInfo.cs index da026404d97..debc0a575be 100644 --- a/src/System.Management.Automation/help/AliasHelpInfo.cs +++ b/src/System.Management.Automation/help/AliasHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; // for fxcop diff --git a/src/System.Management.Automation/help/AliasHelpProvider.cs b/src/System.Management.Automation/help/AliasHelpProvider.cs index e6c268d2dfa..e98b1353939 100644 --- a/src/System.Management.Automation/help/AliasHelpProvider.cs +++ b/src/System.Management.Automation/help/AliasHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/BaseCommandHelpInfo.cs b/src/System.Management.Automation/help/BaseCommandHelpInfo.cs index 9c0c8b3c409..f2d67f192cd 100644 --- a/src/System.Management.Automation/help/BaseCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/BaseCommandHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; diff --git a/src/System.Management.Automation/help/CabinetAPI.cs b/src/System.Management.Automation/help/CabinetAPI.cs index a28dcf990e3..994b704c9e1 100644 --- a/src/System.Management.Automation/help/CabinetAPI.cs +++ b/src/System.Management.Automation/help/CabinetAPI.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; @@ -64,7 +63,6 @@ protected virtual void Dispose(bool disposing) #endregion } - /// /// Abstract class which defines a CabinetExtractor loader. An implementation /// of this class will be instantiated onetime from the C++/CLI diff --git a/src/System.Management.Automation/help/CabinetNativeApi.cs b/src/System.Management.Automation/help/CabinetNativeApi.cs index 4c3521e20bf..309dfb59b56 100644 --- a/src/System.Management.Automation/help/CabinetNativeApi.cs +++ b/src/System.Management.Automation/help/CabinetNativeApi.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Runtime.InteropServices; diff --git a/src/System.Management.Automation/help/CommandHelpProvider.cs b/src/System.Management.Automation/help/CommandHelpProvider.cs index 4c0967338f9..1de757edce3 100644 --- a/src/System.Management.Automation/help/CommandHelpProvider.cs +++ b/src/System.Management.Automation/help/CommandHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; @@ -891,7 +890,6 @@ private MamlCommandHelpInfo GetFromCommandCacheByRemovingPrefix(string helpIdent Microsoft.PowerShell.Commands.ModuleCmdletBase.RemovePrefixFromCommandName(cmdInfo.Name, cmdInfo.Prefix), cmdInfo.HelpCategory) as MamlCommandHelpInfo; - if (null != originalHelpInfo) { result = originalHelpInfo.Copy(); @@ -1330,7 +1328,6 @@ internal virtual CommandSearcher GetCommandSearcherForSearch(string pattern, Exe CommandTypes.Cmdlet, context); - return searcher; } diff --git a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs index 610bdb5795c..9ef8f0e635e 100644 --- a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs +++ b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/help/DefaultHelpProvider.cs b/src/System.Management.Automation/help/DefaultHelpProvider.cs index 4586a78a400..3391a73efd4 100644 --- a/src/System.Management.Automation/help/DefaultHelpProvider.cs +++ b/src/System.Management.Automation/help/DefaultHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/DscResourceHelpProvider.cs b/src/System.Management.Automation/help/DscResourceHelpProvider.cs index ab363ca5e17..ab1df27e6c9 100644 --- a/src/System.Management.Automation/help/DscResourceHelpProvider.cs +++ b/src/System.Management.Automation/help/DscResourceHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs index df48e634250..bc0f3ce4703 100644 --- a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs +++ b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 diff --git a/src/System.Management.Automation/help/HelpCommands.cs b/src/System.Management.Automation/help/HelpCommands.cs index 95951fd17cb..2015d34665b 100644 --- a/src/System.Management.Automation/help/HelpCommands.cs +++ b/src/System.Management.Automation/help/HelpCommands.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/help/HelpCommentsParser.cs b/src/System.Management.Automation/help/HelpCommentsParser.cs index 99226dba1a3..317620d1b2b 100644 --- a/src/System.Management.Automation/help/HelpCommentsParser.cs +++ b/src/System.Management.Automation/help/HelpCommentsParser.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; @@ -1088,7 +1087,6 @@ private static List GetParameterComments(Language.Token[] tokens, IParam } } - int n = -1; result.Add(GetSection(commentLines, ref n)); } diff --git a/src/System.Management.Automation/help/HelpErrorTracer.cs b/src/System.Management.Automation/help/HelpErrorTracer.cs index 913913466cc..41face7da16 100644 --- a/src/System.Management.Automation/help/HelpErrorTracer.cs +++ b/src/System.Management.Automation/help/HelpErrorTracer.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/help/HelpFileHelpInfo.cs b/src/System.Management.Automation/help/HelpFileHelpInfo.cs index 257dabb14da..fe1338009cb 100644 --- a/src/System.Management.Automation/help/HelpFileHelpInfo.cs +++ b/src/System.Management.Automation/help/HelpFileHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/help/HelpFileHelpProvider.cs b/src/System.Management.Automation/help/HelpFileHelpProvider.cs index cfccf547731..da282fa7f07 100644 --- a/src/System.Management.Automation/help/HelpFileHelpProvider.cs +++ b/src/System.Management.Automation/help/HelpFileHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; diff --git a/src/System.Management.Automation/help/HelpInfo.cs b/src/System.Management.Automation/help/HelpInfo.cs index f73baefd1a7..d225d227605 100644 --- a/src/System.Management.Automation/help/HelpInfo.cs +++ b/src/System.Management.Automation/help/HelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/help/HelpNotFoundException.cs b/src/System.Management.Automation/help/HelpNotFoundException.cs index e1b4b9a55b7..a1152431559 100644 --- a/src/System.Management.Automation/help/HelpNotFoundException.cs +++ b/src/System.Management.Automation/help/HelpNotFoundException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 diff --git a/src/System.Management.Automation/help/HelpProvider.cs b/src/System.Management.Automation/help/HelpProvider.cs index 4675113e04c..86b5fe042ae 100644 --- a/src/System.Management.Automation/help/HelpProvider.cs +++ b/src/System.Management.Automation/help/HelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpProviderWithCache.cs b/src/System.Management.Automation/help/HelpProviderWithCache.cs index 895a4515ca5..261015364d5 100644 --- a/src/System.Management.Automation/help/HelpProviderWithCache.cs +++ b/src/System.Management.Automation/help/HelpProviderWithCache.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpProviderWithFullCache.cs b/src/System.Management.Automation/help/HelpProviderWithFullCache.cs index 81221cf37c4..6aa264cb804 100644 --- a/src/System.Management.Automation/help/HelpProviderWithFullCache.cs +++ b/src/System.Management.Automation/help/HelpProviderWithFullCache.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpRequest.cs b/src/System.Management.Automation/help/HelpRequest.cs index fab35c51f5d..c38b1e157ed 100644 --- a/src/System.Management.Automation/help/HelpRequest.cs +++ b/src/System.Management.Automation/help/HelpRequest.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/help/HelpSystem.cs b/src/System.Management.Automation/help/HelpSystem.cs index d12f7e32048..92674f32dbf 100644 --- a/src/System.Management.Automation/help/HelpSystem.cs +++ b/src/System.Management.Automation/help/HelpSystem.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/MUIFileSearcher.cs b/src/System.Management.Automation/help/MUIFileSearcher.cs index 7e12f26cdbb..17f31ff2562 100644 --- a/src/System.Management.Automation/help/MUIFileSearcher.cs +++ b/src/System.Management.Automation/help/MUIFileSearcher.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; diff --git a/src/System.Management.Automation/help/MamlClassHelpInfo.cs b/src/System.Management.Automation/help/MamlClassHelpInfo.cs index 4bc7c03db3e..08214518ae0 100644 --- a/src/System.Management.Automation/help/MamlClassHelpInfo.cs +++ b/src/System.Management.Automation/help/MamlClassHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Xml; diff --git a/src/System.Management.Automation/help/MamlCommandHelpInfo.cs b/src/System.Management.Automation/help/MamlCommandHelpInfo.cs index d122a91a12f..94f2465ff14 100644 --- a/src/System.Management.Automation/help/MamlCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/MamlCommandHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Xml; @@ -146,7 +145,6 @@ private string Notes } } - #endregion #region Component, Role, Features diff --git a/src/System.Management.Automation/help/MamlNode.cs b/src/System.Management.Automation/help/MamlNode.cs index 2bf558910e7..e49177a6e27 100644 --- a/src/System.Management.Automation/help/MamlNode.cs +++ b/src/System.Management.Automation/help/MamlNode.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/help/MamlUtil.cs b/src/System.Management.Automation/help/MamlUtil.cs index 29fe3c165b4..7ddf462176f 100644 --- a/src/System.Management.Automation/help/MamlUtil.cs +++ b/src/System.Management.Automation/help/MamlUtil.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Help; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/PSClassHelpProvider.cs b/src/System.Management.Automation/help/PSClassHelpProvider.cs index ec418adfd86..8572bb4da26 100644 --- a/src/System.Management.Automation/help/PSClassHelpProvider.cs +++ b/src/System.Management.Automation/help/PSClassHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs b/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs index b092467768a..1c9d43cf9a2 100644 --- a/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/help/ProviderContext.cs b/src/System.Management.Automation/help/ProviderContext.cs index 993376789cf..985f32c0a08 100644 --- a/src/System.Management.Automation/help/ProviderContext.cs +++ b/src/System.Management.Automation/help/ProviderContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Provider; using System.Xml; diff --git a/src/System.Management.Automation/help/ProviderHelpInfo.cs b/src/System.Management.Automation/help/ProviderHelpInfo.cs index 6ec2faa4d34..1061eac0f85 100644 --- a/src/System.Management.Automation/help/ProviderHelpInfo.cs +++ b/src/System.Management.Automation/help/ProviderHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Xml; @@ -153,7 +152,6 @@ internal override PSObject FullHelp } } - /// /// Returns true if help content in help info matches the /// pattern contained in . diff --git a/src/System.Management.Automation/help/ProviderHelpProvider.cs b/src/System.Management.Automation/help/ProviderHelpProvider.cs index 7323aeba6cf..6465b300882 100644 --- a/src/System.Management.Automation/help/ProviderHelpProvider.cs +++ b/src/System.Management.Automation/help/ProviderHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections; @@ -119,7 +118,6 @@ internal override IEnumerable ExactMatchHelp(HelpRequest helpRequest) } } - private static string GetProviderAssemblyPath(ProviderInfo providerInfo) { if (providerInfo == null) diff --git a/src/System.Management.Automation/help/RemoteHelpInfo.cs b/src/System.Management.Automation/help/RemoteHelpInfo.cs index 4e581a98cb2..5c766d7b398 100644 --- a/src/System.Management.Automation/help/RemoteHelpInfo.cs +++ b/src/System.Management.Automation/help/RemoteHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/help/SaveHelpCommand.cs b/src/System.Management.Automation/help/SaveHelpCommand.cs index 4329fa25b8a..b5c66e639d6 100644 --- a/src/System.Management.Automation/help/SaveHelpCommand.cs +++ b/src/System.Management.Automation/help/SaveHelpCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -99,7 +98,6 @@ public string[] LiteralPath #endregion - #region Implementation /// @@ -269,7 +267,6 @@ internal override bool ProcessModuleWithCulture(UpdatableHelpModuleInfo module, return true; } - bool installed = false; foreach (string path in resolvedPaths) diff --git a/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs b/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs index 8501b963d78..ceecd86b548 100644 --- a/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs +++ b/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/help/SyntaxHelpInfo.cs b/src/System.Management.Automation/help/SyntaxHelpInfo.cs index 4e2081dbe2d..44fc51b8d30 100644 --- a/src/System.Management.Automation/help/SyntaxHelpInfo.cs +++ b/src/System.Management.Automation/help/SyntaxHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs index d3cabf516e2..9e08244eb99 100644 --- a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs +++ b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Linq; diff --git a/src/System.Management.Automation/help/UpdatableHelpInfo.cs b/src/System.Management.Automation/help/UpdatableHelpInfo.cs index 467de5a53f1..e49eb2b5cc0 100644 --- a/src/System.Management.Automation/help/UpdatableHelpInfo.cs +++ b/src/System.Management.Automation/help/UpdatableHelpInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; using System.Globalization; diff --git a/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs b/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs index c525ed0cf51..9c246698d68 100644 --- a/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs +++ b/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Diagnostics; diff --git a/src/System.Management.Automation/help/UpdatableHelpSystem.cs b/src/System.Management.Automation/help/UpdatableHelpSystem.cs index cadd34fa5e6..8e499020294 100644 --- a/src/System.Management.Automation/help/UpdatableHelpSystem.cs +++ b/src/System.Management.Automation/help/UpdatableHelpSystem.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Collections.ObjectModel; @@ -220,7 +219,6 @@ internal UpdatableHelpProgressEventArgs(string moduleName, UpdatableHelpCommandT /// internal int ProgressPercent { get; } - /// /// Module name /// @@ -675,7 +673,6 @@ internal UpdatableHelpInfo CreateHelpInfo(string xml, string moduleName, Guid mo } } - if (!String.IsNullOrEmpty(currentCulture) && helpInfo.HelpContentUriCollection.Count == 0) { // throw exception diff --git a/src/System.Management.Automation/help/UpdatableHelpUri.cs b/src/System.Management.Automation/help/UpdatableHelpUri.cs index c8c4286505c..25ddb4d85c9 100644 --- a/src/System.Management.Automation/help/UpdatableHelpUri.cs +++ b/src/System.Management.Automation/help/UpdatableHelpUri.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Globalization; using System.Diagnostics; diff --git a/src/System.Management.Automation/help/UpdateHelpCommand.cs b/src/System.Management.Automation/help/UpdateHelpCommand.cs index a7eca22ee38..f962fad270c 100644 --- a/src/System.Management.Automation/help/UpdateHelpCommand.cs +++ b/src/System.Management.Automation/help/UpdateHelpCommand.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Management.Automation; @@ -107,7 +106,6 @@ public string[] LiteralPath } private bool _isLiteralPath = false; - /// /// Scans paths recursively /// diff --git a/src/System.Management.Automation/logging/LogContext.cs b/src/System.Management.Automation/logging/LogContext.cs index 97af8b6d7ad..7d9c3fe5954 100644 --- a/src/System.Management.Automation/logging/LogContext.cs +++ b/src/System.Management.Automation/logging/LogContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/logging/LogProvider.cs b/src/System.Management.Automation/logging/LogProvider.cs index c5445c010e9..7cd6dde11e7 100644 --- a/src/System.Management.Automation/logging/LogProvider.cs +++ b/src/System.Management.Automation/logging/LogProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Text; diff --git a/src/System.Management.Automation/logging/MshLog.cs b/src/System.Management.Automation/logging/MshLog.cs index 354da12f6b6..0ed8ed64d9a 100644 --- a/src/System.Management.Automation/logging/MshLog.cs +++ b/src/System.Management.Automation/logging/MshLog.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs b/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs index 084f6f2b12e..207930cbd0b 100644 --- a/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs +++ b/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/namespaces/AliasProvider.cs b/src/System.Management.Automation/namespaces/AliasProvider.cs index b8c6557dfcc..aeec55d3036 100644 --- a/src/System.Management.Automation/namespaces/AliasProvider.cs +++ b/src/System.Management.Automation/namespaces/AliasProvider.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Dbg = System.Management.Automation; @@ -125,7 +123,6 @@ protected override object SetItemDynamicParameters(string path, object value) #region protected members - /// /// Gets a alias from session state /// @@ -370,7 +367,6 @@ public ScopedItemOptions Options } private ScopedItemOptions _options; - /// /// Determines if the Options parameter was set. /// diff --git a/src/System.Management.Automation/namespaces/ContainerProviderBase.cs b/src/System.Management.Automation/namespaces/ContainerProviderBase.cs index b67a2f9f46f..c7bfd492266 100644 --- a/src/System.Management.Automation/namespaces/ContainerProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ContainerProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Management.Automation.Internal; @@ -209,7 +208,6 @@ internal virtual bool ConvertPath( return ConvertPath(path, filter, ref updatedPath, ref updatedFilter); } - /// /// Gives the provider to attach additional parameters to /// the get-childitem -name cmdlet. @@ -309,7 +307,6 @@ internal object RenameItemDynamicParameters( return RenameItemDynamicParameters(path, newName); } // RenameItemDynamicParameters - /// /// Internal wrapper for the New protected method. It is called instead /// of the protected method that is overridden by derived classes so that the @@ -455,7 +452,6 @@ internal object RemoveItemDynamicParameters( return RemoveItemDynamicParameters(path, recurse); } // RemoveItemDynamicParameters - /// /// Internal wrapper for the HasChildItems protected method. It is called instead /// of the protected method that is overridden by derived classes so that the @@ -530,7 +526,6 @@ internal void CopyItem( CopyItem(path, copyPath, recurse); } // CopyItem - /// /// Gives the provider to attach additional parameters to /// the copy-item cmdlet. @@ -711,7 +706,6 @@ protected virtual object GetChildItemsDynamicParameters(string path, bool recurs } } // GetChildItemsDynamicParameters - /// /// Gets names of the children of the specified path. /// @@ -840,7 +834,6 @@ protected virtual object GetChildNamesDynamicParameters(string path) } } // GetChildNamesDynamicParameters - /// /// Renames the item at the specified path to the new name provided. /// @@ -1126,7 +1119,6 @@ protected virtual bool HasChildItems(string path) } } - /// /// Copies an item at the specified path to an item at the . /// diff --git a/src/System.Management.Automation/namespaces/CoreCommandContext.cs b/src/System.Management.Automation/namespaces/CoreCommandContext.cs index 3ecbd9c5163..a5183f68523 100644 --- a/src/System.Management.Automation/namespaces/CoreCommandContext.cs +++ b/src/System.Management.Automation/namespaces/CoreCommandContext.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -330,7 +329,6 @@ internal CmdletProviderContext( /// private bool _force; - /// /// The command which defines the context. This should not be /// made visible to anyone and should only be set through the @@ -343,7 +341,6 @@ internal CmdletProviderContext( /// internal CommandOrigin Origin { get; } = CommandOrigin.Internal; - /// /// This defines the default behavior for the WriteError method. /// If it is true, a call to this method will result in an immediate call @@ -545,7 +542,6 @@ public PSTransactionContext CurrentPSTransaction } #endregion Transaction Support - /// /// Gets or sets the Force property that is passed to providers. /// @@ -1276,4 +1272,3 @@ internal bool HasIncludeOrExclude } // CmdletProviderContext } - diff --git a/src/System.Management.Automation/namespaces/DriveProviderBase.cs b/src/System.Management.Automation/namespaces/DriveProviderBase.cs index 323bcaeddf7..a94f1ce4d32 100644 --- a/src/System.Management.Automation/namespaces/DriveProviderBase.cs +++ b/src/System.Management.Automation/namespaces/DriveProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using Dbg = System.Management.Automation; @@ -225,7 +224,6 @@ protected virtual PSDriveInfo RemoveDrive(PSDriveInfo drive) } // TraceMethod } // RemoveDrive - /// /// Gives the provider the ability to map drives after initialization. /// @@ -264,4 +262,3 @@ protected virtual Collection InitializeDefaultDrives() #endregion DriveCmdletProvider } // namespace System.Management.Automation - diff --git a/src/System.Management.Automation/namespaces/EnvironmentProvider.cs b/src/System.Management.Automation/namespaces/EnvironmentProvider.cs index 5f4dcf71db8..6be3c301435 100644 --- a/src/System.Management.Automation/namespaces/EnvironmentProvider.cs +++ b/src/System.Management.Automation/namespaces/EnvironmentProvider.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Dbg = System.Management.Automation; @@ -69,7 +67,6 @@ protected override Collection InitializeDefaultDrives() #region protected members - /// /// Gets a environment variable from session state /// diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index 7402e52bf9b..ae20178e831 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -375,7 +374,6 @@ public FileSystemContentReaderWriter( _usingDelimiter = true; } - /// /// Reads the specified number of characters or a lines from the file. /// diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 904bbf83cf2..0b332eeb5c6 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; @@ -60,7 +59,6 @@ public sealed partial class FileSystemProvider : NavigationCmdletProvider, // to copy an item onto itself. private const string SelfCopyDataKey = "SelfCopy"; - /// /// An instance of the PSTraceSource class used for trace output /// using "FileSystemProvider" as the category. @@ -101,7 +99,6 @@ private static string NormalizePath(string path) return path.Replace(StringLiterals.AlternatePathSeparator, StringLiterals.DefaultPathSeparator); } // NormalizePath - /// /// Checks if the item exist at the specified path. if it exists then creates /// appropriate directoryinfo or fileinfo object. @@ -331,7 +328,6 @@ public string GetHelpMaml(string helpItemName, string path) #region CmdletProvider members - /// /// Starts the File System provider. This method sets the Home for the /// provider to providerInfo.Home if specified, and %USERPROFILE% @@ -631,7 +627,6 @@ private PSDriveInfo WinRemoveDrive(PSDriveInfo drive) driveName = drive.Root; } - // You need to actually remove the drive. int code = NativeMethods.WNetCancelConnection2(driveName, flags, true); @@ -1005,7 +1000,6 @@ protected override Collection InitializeDefaultDrives() return results; } // InitializeDefaultDrives - #endregion DriveCmdletProvider methods #region ItemCmdletProvider methods @@ -1041,7 +1035,6 @@ protected override bool IsValidPath(string path) return false; } - //Normalize the path path = NormalizePath(path); path = EnsureDriveIsRooted(path); @@ -1407,7 +1400,6 @@ protected override void GetChildItems( } // GetChildItems #endregion GetChildItems - #region GetChildNames /// /// Gets the path names for all children of the specified @@ -1752,7 +1744,6 @@ private void Dir( }// foreach }// foreach - bool isFilterHiddenSpecified = false; // "Hidden" is specified somewhere in the expression bool isSwitchFilterHiddenSpecified = false; // "Hidden" is specified somewhere in the parameters @@ -2130,7 +2121,6 @@ protected override void NewItem( fileMode = FileMode.Create; } - string action = FileSystemProviderStrings.NewItemActionFile; string resource = StringUtil.Format(FileSystemProviderStrings.NewItemActionTemplate, path); @@ -2537,7 +2527,6 @@ private enum ItemType HardLink }; - private static ItemType GetItemType(string input) { ItemType itemType = ItemType.Unknown; @@ -2733,7 +2722,6 @@ private bool CreateIntermediateDirectories(string path) return result; } // CreateIntermediateDirectories - #endregion NewItem #region RemoveItem @@ -3354,7 +3342,6 @@ protected override object ItemExistsDynamicParameters(string path) } } // ItemExistsDynamicParameters - #endregion ItemExists #region HasChildItems @@ -4849,7 +4836,6 @@ private static bool IsAbsolutePath(string path) return result; } - private static bool IsUNCPath(string path) { return path.StartsWith("\\\\", StringComparison.Ordinal); @@ -4966,7 +4952,6 @@ protected override string NormalizeRelativePath( throw PSTraceSource.NewArgumentException("path"); } - if (basePath == null) { basePath = String.Empty; @@ -5578,7 +5563,6 @@ private string CreateNormalizedRelativePathFromStack(Stack normalizedPat return leafElement; } // CreateNormalizedRelativePathFromStack - /// /// Gets the name of the leaf element of the specified path. /// @@ -5743,13 +5727,11 @@ protected override void MoveItem( destination = MakePath(destination, dir.Name); } - // Get the confirmation text string action = FileSystemProviderStrings.MoveItemActionDirectory; string resource = StringUtil.Format(FileSystemProviderStrings.MoveItemResourceFileTemplate, dir.FullName, destination); - // Confirm the move with the user if (ShouldProcess(resource, action)) { @@ -5783,7 +5765,6 @@ protected override void MoveItem( string resource = StringUtil.Format(FileSystemProviderStrings.MoveItemResourceFileTemplate, file.FullName, destination); - // Confirm the move with the user if (ShouldProcess(resource, action)) @@ -7751,7 +7732,6 @@ public SwitchParameter Raw } // DelimiterSpecified } // class FileSystemContentReaderDynamicParameters - /// /// Provides the dynamic parameters for test-path on the file system. /// @@ -9753,7 +9733,6 @@ function PSGetPathDirAndFiles return $op }} - # # Call helper function based on bound parameter set # diff --git a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs index 22f07c89cf5..7e894632876 100644 --- a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs +++ b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; diff --git a/src/System.Management.Automation/namespaces/FunctionProvider.cs b/src/System.Management.Automation/namespaces/FunctionProvider.cs index 0ec824c5362..c81caa237bf 100644 --- a/src/System.Management.Automation/namespaces/FunctionProvider.cs +++ b/src/System.Management.Automation/namespaces/FunctionProvider.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Dbg = System.Management.Automation; @@ -400,7 +398,6 @@ public ScopedItemOptions Options } private ScopedItemOptions _options = ScopedItemOptions.None; - /// /// Determines if the Options parameter was set. /// diff --git a/src/System.Management.Automation/namespaces/IContentProvider.cs b/src/System.Management.Automation/namespaces/IContentProvider.cs index dee126fffad..fb908a44014 100644 --- a/src/System.Management.Automation/namespaces/IContentProvider.cs +++ b/src/System.Management.Automation/namespaces/IContentProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Provider { diff --git a/src/System.Management.Automation/namespaces/IContentReader.cs b/src/System.Management.Automation/namespaces/IContentReader.cs index 359bb89f551..0597b1990a0 100644 --- a/src/System.Management.Automation/namespaces/IContentReader.cs +++ b/src/System.Management.Automation/namespaces/IContentReader.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.IO; diff --git a/src/System.Management.Automation/namespaces/IContentWriter.cs b/src/System.Management.Automation/namespaces/IContentWriter.cs index 03e89f6829f..e5720c71db5 100644 --- a/src/System.Management.Automation/namespaces/IContentWriter.cs +++ b/src/System.Management.Automation/namespaces/IContentWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.IO; diff --git a/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs b/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs index 274b147b3d5..058aa5bdb3a 100644 --- a/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs +++ b/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Provider { diff --git a/src/System.Management.Automation/namespaces/IPermissionProvider.cs b/src/System.Management.Automation/namespaces/IPermissionProvider.cs index 29b6f33aad0..08dab58e8d7 100644 --- a/src/System.Management.Automation/namespaces/IPermissionProvider.cs +++ b/src/System.Management.Automation/namespaces/IPermissionProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Security.AccessControl; diff --git a/src/System.Management.Automation/namespaces/IPropertiesProvider.cs b/src/System.Management.Automation/namespaces/IPropertiesProvider.cs index 47f92c7fb7e..9e260bb8379 100644 --- a/src/System.Management.Automation/namespaces/IPropertiesProvider.cs +++ b/src/System.Management.Automation/namespaces/IPropertiesProvider.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; @@ -223,4 +222,3 @@ object ClearPropertyDynamicParameters( #endregion IPropertyCmdletProvider } // namespace System.Management.Automation - diff --git a/src/System.Management.Automation/namespaces/ItemProviderBase.cs b/src/System.Management.Automation/namespaces/ItemProviderBase.cs index 9dff69f286c..07f3f8dedb4 100644 --- a/src/System.Management.Automation/namespaces/ItemProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ItemProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; @@ -208,7 +207,6 @@ internal object ClearItemDynamicParameters( return ClearItemDynamicParameters(path); } // ClearItemDynamicParameters - /// /// Internal wrapper for the InvokeDefaultAction protected method. It is called instead /// of the protected method that is overridden by derived classes so that the @@ -399,7 +397,6 @@ internal string[] ExpandPath(string path, CmdletProviderContext context) #endregion internal methods - #region Protected methods /// diff --git a/src/System.Management.Automation/namespaces/LocationGlobber.cs b/src/System.Management.Automation/namespaces/LocationGlobber.cs index 5afeb0cd228..584e2d904c2 100644 --- a/src/System.Management.Automation/namespaces/LocationGlobber.cs +++ b/src/System.Management.Automation/namespaces/LocationGlobber.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -837,7 +836,6 @@ internal Collection GetGlobbedProviderPathsFromMonadPath( context.Drive = drive; } - Collection paths = new Collection(); foreach (PathInfo currentPath in @@ -1051,10 +1049,8 @@ internal Collection GetGlobbedProviderPathsFromProviderPath( } } // GetGlobbedProviderPathsFromProviderPath - #endregion Provider path to provider paths globbing - #region Path manipulation /// @@ -1113,7 +1109,6 @@ internal string GetProviderPath(string path) return GetProviderPath(path, out provider); } // GetProviderPath - /// /// Gets a provider specific path when given an Msh path without resolving the /// glob characters. @@ -1725,7 +1720,6 @@ internal bool IsAbsolutePath(string path, out string driveName) bool result = false; - if (_sessionState.Drive.Current != null) { driveName = _sessionState.Drive.Current.Name; @@ -1846,7 +1840,6 @@ private static string RemoveGlobEscaping(string path) #region Path manipulation methods - /// /// Determines if the given drive name is a "special" name defined /// by the shell. For instance, "default", "current", "global", and "scope[##]" are scopes @@ -2156,7 +2149,6 @@ CmdletProviderContext context string driveRoot = drive.Root.Replace(StringLiterals.AlternatePathSeparator, StringLiterals.DefaultPathSeparator); driveRoot = driveRoot.TrimEnd(StringLiterals.DefaultPathSeparator); - // Keep on lopping off children until the the remaining path // is the drive root. while ((!String.IsNullOrEmpty(providerPath)) && @@ -2395,7 +2387,6 @@ internal string GenerateRelativePath( continue; } - // Process the current directory symbol "." if (path.Equals(currentDirSymbol, StringComparison.OrdinalIgnoreCase)) @@ -2563,7 +2554,6 @@ private string GetProviderSpecificPath( return result; } // GetProviderSpecificPath - /// /// Parses the provider-qualified path into the provider name and /// the provider-internal path. @@ -2614,7 +2604,6 @@ private static string ParseProviderPath(string path, out string providerId) return result; } // ParseProviderPath - #endregion Path manipulation methods #endregion private fields and methods @@ -3329,7 +3318,6 @@ internal static string GetDriveQualifiedPath(string path, PSDriveInfo drive) throw PSTraceSource.NewArgumentNullException("path"); } - if (drive == null) { throw PSTraceSource.NewArgumentNullException("drive"); @@ -3481,7 +3469,6 @@ internal static string GetProviderQualifiedPath(string path, ProviderInfo provid throw PSTraceSource.NewArgumentNullException("path"); } - if (provider == null) { throw PSTraceSource.NewArgumentNullException("provider"); @@ -3671,7 +3658,6 @@ private List GenerateNewPSPathsWithGlobLeaf( context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -3712,7 +3698,6 @@ private List GenerateNewPSPathsWithGlobLeaf( continue; } - // Loop through each child to see if they match the glob expression foreach (PSObject childObject in childNamesObjectArray) @@ -3800,7 +3785,6 @@ private List GenerateNewPSPathsWithGlobLeaf( childPath = GetMshQualifiedPath(childPath, drive); } - if (_sessionState.Internal.ItemExists(childPath, context)) { s_tracer.WriteLine("Adding child path to dirs {0}", childPath); @@ -3812,7 +3796,6 @@ private List GenerateNewPSPathsWithGlobLeaf( } // foreach (dir in currentDirs) } // if (StringContainsGlobCharacters(leafElement)) - return newDirs; } // GenerateNewPSPathsWithGlobLeaf @@ -4210,7 +4193,6 @@ internal Collection ExpandGlobPath( return result; } // ExpandGlobPath - /// /// Generates a collection of containers and/or leaves that are children of the containers /// in the currentDirs parameter and match the glob expression in the @@ -4316,7 +4298,6 @@ internal List GenerateNewPathsWithGlobLeaf( context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -4416,7 +4397,6 @@ internal List GenerateNewPathsWithGlobLeaf( context); } - if (provider.ItemExists(childPath, context)) { s_tracer.WriteLine("Adding child path to dirs {0}", childPath); @@ -4429,7 +4409,6 @@ internal List GenerateNewPathsWithGlobLeaf( } // foreach (dir in currentDirs) } // if (StringContainsGlobCharacters(leafElement)) - return newDirs; } // GenerateNewPathsWithGlobLeaf diff --git a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs index 46eca2d3d00..14f6ed59fd4 100644 --- a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs +++ b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Management.Automation.Internal; @@ -661,7 +660,6 @@ internal string ContractRelativePath( } basePath = basePath.TrimEnd(StringLiterals.DefaultPathSeparator); - // See if the base and the path are already the same. We resolve this to // ..\Leaf, since resolving "." to "." doesn't offer much information. if (String.Equals(normalizedPath, normalizedBasePath, StringComparison.OrdinalIgnoreCase) && @@ -854,7 +852,6 @@ protected virtual string GetChildName(string path) } } // GetChildName - /// /// Determines if the item specified by the path is a container. /// @@ -887,7 +884,6 @@ protected virtual bool IsItemContainer(string path) } } - /// /// Moves the item specified by path to the specified destination. /// @@ -964,7 +960,6 @@ protected virtual object MoveItemDynamicParameters( } } // MoveItemDynamicParameters - #endregion Protected methods #region private members diff --git a/src/System.Management.Automation/namespaces/PathInfo.cs b/src/System.Management.Automation/namespaces/PathInfo.cs index 2643dbd94b8..bb370a00507 100644 --- a/src/System.Management.Automation/namespaces/PathInfo.cs +++ b/src/System.Management.Automation/namespaces/PathInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; @@ -110,7 +109,6 @@ public override string ToString() { string result = _path; - if (_drive == null || _drive.Hidden) { diff --git a/src/System.Management.Automation/namespaces/ProviderBase.cs b/src/System.Management.Automation/namespaces/ProviderBase.cs index 69ba4aaa608..a299513149d 100644 --- a/src/System.Management.Automation/namespaces/ProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -1052,7 +1051,6 @@ internal object GetContentReaderDynamicParameters( return contentProvider.GetContentReaderDynamicParameters(path); } // GetContentReaderDynamicParameters - /// /// Internal wrapper for the GetContentWriter protected method. This method will /// only be called if the provider implements the IContentCmdletProvider interface. @@ -1124,7 +1122,6 @@ internal object GetContentWriterDynamicParameters( return contentProvider.GetContentWriterDynamicParameters(path); } // GetContentWriterDynamicParameters - /// /// Internal wrapper for the ClearContent protected method. This method will /// only be called if the provider implements the IContentCmdletProvider interface. @@ -1192,7 +1189,6 @@ internal object ClearContentDynamicParameters( return contentProvider.ClearContentDynamicParameters(path); } // ClearContentDynamicParameters - #endregion IContentCmdletProvider method wrappers #endregion internal members @@ -1330,7 +1326,6 @@ public CommandInvocationIntrinsics InvokeCommand Context != null, "The context should always be set"); - return new CommandInvocationIntrinsics(Context.ExecutionContext); } // TraceProperty } // get @@ -1782,7 +1777,6 @@ public void WriteWarning(string text) } } // WriteVerbose - /// public void WriteProgress(ProgressRecord progressRecord) { @@ -1801,7 +1795,6 @@ public void WriteProgress(ProgressRecord progressRecord) } } // WriteProgress - /// public void WriteDebug(string text) { @@ -1988,7 +1981,6 @@ private PSObject WrapOutputInPSObject( string childName = navProvider.GetChildName(path, Context); - result.AddOrSetProperty("PSChildName", childName); providerBaseTracer.WriteLine("Attaching {0} = {1}", "PSChildName", childName); } @@ -2137,7 +2129,6 @@ public void WriteError(ErrorRecord errorRecord) #endregion User feedback mechanisms - #endregion protected members } // CmdletProvider diff --git a/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs b/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs index 8f7ec8e2f9f..aa0906e5add 100644 --- a/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs +++ b/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Security.AccessControl; @@ -14,7 +13,6 @@ public abstract partial class CmdletProvider { #region ISecurityDescriptorCmdletProvider method wrappers - /// /// Internal wrapper for the GetSecurityDescriptor protected method. This method will /// only be called if the provider implements the ISecurityDescriptorCmdletProvider interface. @@ -56,7 +54,6 @@ internal void GetSecurityDescriptor( permissionProvider.GetSecurityDescriptor(path, sections); } // GetSecurityDescriptor - /// /// Internal wrapper for the SetSecurityDescriptor protected method. This method will /// only be called if the provider implements the ISecurityDescriptorCmdletProvider interface. diff --git a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs index cfdbc770576..df3c474386d 100644 --- a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs +++ b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Provider { diff --git a/src/System.Management.Automation/namespaces/RegistryProvider.cs b/src/System.Management.Automation/namespaces/RegistryProvider.cs index 681cc600415..c614c153b1b 100644 --- a/src/System.Management.Automation/namespaces/RegistryProvider.cs +++ b/src/System.Management.Automation/namespaces/RegistryProvider.cs @@ -1,7 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Collections.ObjectModel; @@ -229,7 +228,6 @@ protected override void GetItem(string path) WriteRegistryItemObject(result, path); } // GetItem - /// /// Sets registry values at to the specified. /// @@ -811,7 +809,6 @@ private static string EscapeSpecialChars(string path) return result.ToString(); } // EscapeSpecialChars - /// /// Escapes the characters in the registry key name that are used by globbing and /// path. @@ -929,7 +926,6 @@ protected override void RenameItem( } // ShouldProcess } // RenameItem - /// /// Creates a new registry key or value at the specified . /// @@ -1366,7 +1362,6 @@ protected override void CopyItem( key.Close(); } // CopyItem - private bool CopyRegistryKey( IRegistryWrapper key, string path, @@ -1428,7 +1423,6 @@ private bool CopyRegistryKey( string destinationPath = MakePath(destinationParent, destinationName); - // Confirm the copy item with the user string action = RegistryProviderStrings.CopyKeyAction; @@ -1968,8 +1962,6 @@ public void SetProperty( key.Close(); } // SetProperty - - /// /// Gives the provider a chance to attach additional parameters to the /// get-itemproperty cmdlet. @@ -2072,7 +2064,6 @@ public void ClearProperty( } } - #region Unimplemented methods /// @@ -2101,7 +2092,6 @@ public object GetPropertyDynamicParameters( return null; } - /// /// Gives the provider a chance to attach additional parameters to the /// clear-itemproperty cmdlet. @@ -2363,7 +2353,6 @@ public void RemoveProperty( WriteErrorIfPerfectMatchNotFound(hadAMatch, path, propertyName); } - /// /// Renames a property of the item at the specified . /// @@ -2452,7 +2441,6 @@ public void RenameProperty( key.Close(); } - /// /// Copies a property of the item at the specified to a new property on the /// destination . @@ -2558,7 +2546,6 @@ public void CopyProperty( key.Close(); } - /// /// Moves a property on an item specified by . /// @@ -2664,7 +2651,6 @@ public void MoveProperty( destinationKey.Close(); } - /// /// Gets the parent path of the given . /// @@ -2767,7 +2753,6 @@ private static string EnsureDriveIsRooted(string path) return result; } - #region Unimplemented methods /// @@ -2934,7 +2919,6 @@ public object MovePropertyDynamicParameters( #endregion IDynamicPropertyCmdletProvider - #region Private members private void CopyProperty( @@ -3081,7 +3065,6 @@ private void GetFilteredRegistryKeyProperties(string path, throw PSTraceSource.NewArgumentException("path"); } - filteredCollection = new Collection(); key = GetRegkeyForPathWriteIfError(path, writeAccess); @@ -3181,7 +3164,6 @@ private void GetFilteredRegistryKeyProperties(string path, } // foreach } - private void WriteErrorIfPerfectMatchNotFound(bool hadAMatch, string path, string requestedValueName) { if (!hadAMatch && !WildcardPattern.ContainsWildcardCharacters(requestedValueName)) @@ -3782,7 +3764,6 @@ private void SetRegistryValue(IRegistryWrapper key, string propertyName, object SetRegistryValue(key, propertyName, value, kind, path, true); } - /// /// Sets or creates a registry value on a key. /// @@ -3884,7 +3865,6 @@ private void SetRegistryValue( } } // SetRegistryValue - /// /// helper to wrap property values when sent to the pipeline into an PSObject; /// it adds the name of the property as a note. diff --git a/src/System.Management.Automation/namespaces/RegistrySecurity.cs b/src/System.Management.Automation/namespaces/RegistrySecurity.cs index 96bbcb00569..f4778219d55 100644 --- a/src/System.Management.Automation/namespaces/RegistrySecurity.cs +++ b/src/System.Management.Automation/namespaces/RegistrySecurity.cs @@ -1,7 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Management.Automation; diff --git a/src/System.Management.Automation/namespaces/RegistryWrapper.cs b/src/System.Management.Automation/namespaces/RegistryWrapper.cs index b6dfe795e4e..0ba6d7d8042 100644 --- a/src/System.Management.Automation/namespaces/RegistryWrapper.cs +++ b/src/System.Management.Automation/namespaces/RegistryWrapper.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + /* * The registry wrapper provides a common interface to both the transacted * and non-transacted registry APIs. It is used exclusively by the registry provider @@ -15,7 +15,6 @@ using System.Management.Automation.Provider; using Microsoft.PowerShell.Commands.Internal; - namespace Microsoft.PowerShell.Commands { internal interface IRegistryWrapper diff --git a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs index 4a0f4f706dc..2bfa089d455 100644 --- a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs +++ b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // NOTE: A vast majority of this code was copied from BCL in diff --git a/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs b/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs index 9699241da55..023ddf55d5c 100644 --- a/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs +++ b/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma warning disable 1634, 1691 namespace Microsoft.PowerShell.Commands.Internal @@ -11,7 +11,6 @@ namespace Microsoft.PowerShell.Commands.Internal using Microsoft.Win32.SafeHandles; using System.Management.Automation; - [Guid("79427A2B-F895-40e0-BE79-B57DC82ED231"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IKernelTransaction { diff --git a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs index 617825157e5..74b2358f904 100644 --- a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs +++ b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -128,7 +127,6 @@ internal virtual object GetValueOfItem(object item) return value; } // GetValueOfItem - /// /// Determines if the item can be renamed. Derived classes that need /// to perform a check should override this method. @@ -1146,7 +1144,6 @@ public void ClearContent(string path) #endregion } // SessionStateProviderBase - /// /// The content reader/writer for all providers deriving from SessionStateProviderBase /// diff --git a/src/System.Management.Automation/namespaces/StackInfo.cs b/src/System.Management.Automation/namespaces/StackInfo.cs index e362f35b1b2..a1ba37086e4 100644 --- a/src/System.Management.Automation/namespaces/StackInfo.cs +++ b/src/System.Management.Automation/namespaces/StackInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/namespaces/TransactedRegistry.cs b/src/System.Management.Automation/namespaces/TransactedRegistry.cs index 87e03cad77b..a0cf6fc851b 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistry.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistry.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // NOTE: A vast majority of this code was copied from BCL in @@ -13,7 +15,6 @@ namespace Microsoft.PowerShell.Commands.Internal using System.Runtime.Versioning; using System.Diagnostics.CodeAnalysis; - /** * Registry encapsulation. Contains members representing all top level system * keys. diff --git a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs index ea523a238cf..9ece1e4e247 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs @@ -1,4 +1,5 @@ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // NOTE: A vast majority of this code was copied from BCL in @@ -50,7 +51,6 @@ There might possibly be an interaction with yet a third registry key as well. */ - using BCLDebug = System.Diagnostics.Debug; namespace Microsoft.PowerShell.Commands.Internal @@ -69,7 +69,6 @@ namespace Microsoft.PowerShell.Commands.Internal using System.Transactions; using System.Diagnostics.CodeAnalysis; - // Putting this in a separate internal class to avoid OACR warning DoNotDeclareReadOnlyMutableReferenceTypes. internal sealed class BaseRegistryKeys { @@ -137,7 +136,6 @@ public sealed class TransactedRegistryKey : MarshalByRefObject, IDisposable private System.Transactions.Transaction _myTransaction; private SafeTransactionHandle _myTransactionHandle; - // This is a wrapper around RegOpenKeyTransacted that implements a workaround // to TxF bug number 181242 After calling RegOpenKeyTransacted, it calls RegQueryInfoKey. // If that call fails with ERROR_INVALID_TRANSACTION, we have possibly run into bug 181242. To workaround @@ -1288,7 +1286,6 @@ internal Object InternalGetValue(String name, Object defaultValue, bool doNotExp return data; } - /// /// Retrieves the registry data type of the value associated with the specified name. /// Utilizes Transaction.Current for its transaction. @@ -1712,7 +1709,6 @@ internal static String FixupName(String name) return sb.ToString(); } - private static void FixupPath(StringBuilder path) { int length = path.Length; diff --git a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs index 69738ff3980..dc794b61a6e 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // NOTE: A vast majority of this code was copied from BCL in @@ -116,7 +118,6 @@ public RegistryRights RegistryRights } } - /// /// Represents a set of access rights to be audited for a user or group. This class cannot be inherited. /// @@ -167,7 +168,6 @@ public RegistryRights RegistryRights } } - /// /// Represents the Windows access control security for a registry key. This class cannot be inherited. /// This class is specifically to be used with TransactedRegistryKey. diff --git a/src/System.Management.Automation/namespaces/VariableProvider.cs b/src/System.Management.Automation/namespaces/VariableProvider.cs index accf720aa6a..702c78cdc5c 100644 --- a/src/System.Management.Automation/namespaces/VariableProvider.cs +++ b/src/System.Management.Automation/namespaces/VariableProvider.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using Dbg = System.Management.Automation; @@ -69,7 +67,6 @@ protected override Collection InitializeDefaultDrives() return drives; } // InitializeDefaultDrives - #endregion DriveCmdletProvider overrides #region protected members diff --git a/src/System.Management.Automation/namespaces/Win32Native.cs b/src/System.Management.Automation/namespaces/Win32Native.cs index 3dfbdf4563c..ca8e6c29a1f 100644 --- a/src/System.Management.Automation/namespaces/Win32Native.cs +++ b/src/System.Management.Automation/namespaces/Win32Native.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // NOTE: A vast majority of this code was copied from BCL in // Namespace: Microsoft.Win32 @@ -266,7 +268,6 @@ internal enum SECURITY_IMPERSONATION_LEVEL : short internal const int MUTEX_MODIFY_STATE = 0x00000001; internal const int MUTEX_ALL_ACCESS = 0x001F0001; - internal const int LMEM_FIXED = 0x0000; internal const int LMEM_ZEROINIT = 0x0040; internal const int LPTR = (LMEM_FIXED | LMEM_ZEROINIT); @@ -367,7 +368,6 @@ public long ToTicks() internal uint ftTimeHigh; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct KERB_S4U_LOGON { @@ -531,7 +531,6 @@ internal unsafe struct MEMORY_BASIC_INFORMATION internal const String SECUR32 = "secur32.dll"; internal const String MSCORWKS = "mscorwks.dll"; - internal const String LSTRCPY = "lstrcpy"; internal const String LSTRCPYN = "lstrcpyn"; internal const String LSTRLEN = "lstrlen"; @@ -539,11 +538,9 @@ internal unsafe struct MEMORY_BASIC_INFORMATION internal const String LSTRLENW = "lstrlenW"; internal const String MOVEMEMORY = "RtlMoveMemory"; - // From WinBase.h internal const int SEM_FAILCRITICALERRORS = 1; - [DllImport( ADVAPI32, EntryPoint = "GetSecurityDescriptorLength", @@ -587,15 +584,11 @@ internal static extern DWORD SetSecurityInfoByHandle( byte[] dacl, byte[] sacl); - [DllImport(KERNEL32, SetLastError = true)] [ResourceExposure(ResourceScope.None)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] internal static extern IntPtr LocalFree(IntPtr handle); - - - internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // WinBase.h internal static readonly IntPtr NULL = IntPtr.Zero; @@ -821,8 +814,6 @@ internal static extern int RegCreateKeyTransacted(SafeRegistryHandle hKey, Strin out SafeRegistryHandle hkResult, out int lpdwDisposition, SafeTransactionHandle hTransaction, IntPtr pExtendedParameter); - - private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index d5f51dc0218..a66539b09b4 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -1,8 +1,5 @@ -#pragma warning disable 1634, 1691 - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56523 @@ -147,7 +144,6 @@ internal static Signature SignFile(SigningOption option, intptrAlgorithm, 0); - // If we couldn't find an OID for the hash // algorithm, it was invalid. if (oidPtr == IntPtr.Zero) diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index fea05cfe09c..65681161268 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -1,9 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - using Dbg = System.Management.Automation; using System; using System.Text; diff --git a/src/System.Management.Automation/security/CredentialParameter.cs b/src/System.Management.Automation/security/CredentialParameter.cs index 127adaa9cb4..118bd8d9a2e 100644 --- a/src/System.Management.Automation/security/CredentialParameter.cs +++ b/src/System.Management.Automation/security/CredentialParameter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 @@ -72,7 +71,6 @@ public override object Transform(EngineIntrinsics engineIntrinsics, object input string caption = null; string prompt = null; - caption = CredentialAttributeStrings.CredentialAttribute_Prompt_Caption; prompt = CredentialAttributeStrings.CredentialAttribute_Prompt; diff --git a/src/System.Management.Automation/security/MshSignature.cs b/src/System.Management.Automation/security/MshSignature.cs index 61b8e569918..a3de69cf00b 100644 --- a/src/System.Management.Automation/security/MshSignature.cs +++ b/src/System.Management.Automation/security/MshSignature.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; using System.Management.Automation.Internal; @@ -9,7 +7,6 @@ using System.ComponentModel; using DWORD = System.UInt32; - namespace System.Management.Automation { internal static class Win32Errors @@ -309,7 +306,6 @@ private void Init(string filePath, filePath); } - private static SignatureStatus GetSignatureStatusFromWin32Error(DWORD error) { SignatureStatus isc = SignatureStatus.UnknownError; diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index ea30e395cf0..7489e8b24e6 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; diff --git a/src/System.Management.Automation/security/SecurityManager.cs b/src/System.Management.Automation/security/SecurityManager.cs index 19dcfdbe13b..068fd97e892 100644 --- a/src/System.Management.Automation/security/SecurityManager.cs +++ b/src/System.Management.Automation/security/SecurityManager.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Dbg = System.Management.Automation; using System; @@ -596,7 +595,6 @@ protected internal override bool ShouldRun(CommandInfo commandInfo, allowRun = true; break; - case CommandTypes.Function: case CommandTypes.Filter: case CommandTypes.Workflow: @@ -703,7 +701,6 @@ private RunPromptDecision AuthenticodePrompt(string path, break; - // // if the publisher is not trusted, we prompt and // ask the user if s/he wants to allow it to run @@ -759,7 +756,6 @@ private Collection GetAuthenticodePromptChoices() string alwaysRun = Authenticode.Choice_AlwaysRun; string alwaysRunHelp = Authenticode.Choice_AlwaysRun_Help; - choices.Add(new ChoiceDescription(neverRun, neverRunHelp)); choices.Add(new ChoiceDescription(doNotRun, doNotRunHelp)); choices.Add(new ChoiceDescription(runOnce, runOnceHelp)); @@ -779,7 +775,6 @@ private Collection GetRemoteFilePromptChoices() string suspend = Authenticode.Choice_Suspend; string suspendHelp = Authenticode.Choice_Suspend_Help; - choices.Add(new ChoiceDescription(doNotRun, doNotRunHelp)); choices.Add(new ChoiceDescription(runOnce, runOnceHelp)); choices.Add(new ChoiceDescription(suspend, suspendHelp)); @@ -789,4 +784,3 @@ private Collection GetRemoteFilePromptChoices() } } - diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 625590e74df..ecc4f0f40f7 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56523 @@ -212,7 +211,6 @@ internal static ExecutionPolicy GetExecutionPolicy(string shellId) return ExecutionPolicy.Restricted; } - private static bool? _hasGpScriptParent; /// @@ -972,7 +970,6 @@ internal enum CertificatePurpose } } - namespace System.Management.Automation { using System.Security.Cryptography.Pkcs; @@ -1457,7 +1454,6 @@ private void ProcessResolvedCertificates(ResolutionPurpose purpose, ListHAMSICONTEXT__* [DllImportAttribute("amsi.dll", EntryPoint = "AmsiUninitialize", CallingConvention = CallingConvention.StdCall)] internal static extern void AmsiUninitialize(System.IntPtr amsiContext); - /// Return Type: HRESULT->LONG->int ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* ///amsiSession: HAMSISESSION* [DllImportAttribute("amsi.dll", EntryPoint = "AmsiOpenSession", CallingConvention = CallingConvention.StdCall)] internal static extern int AmsiOpenSession(System.IntPtr amsiContext, ref System.IntPtr amsiSession); - /// Return Type: void ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* ///amsiSession: HAMSISESSION->HAMSISESSION__* [DllImportAttribute("amsi.dll", EntryPoint = "AmsiCloseSession", CallingConvention = CallingConvention.StdCall)] internal static extern void AmsiCloseSession(System.IntPtr amsiContext, System.IntPtr amsiSession); - /// Return Type: HRESULT->LONG->int ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* ///buffer: PVOID->void* @@ -1772,7 +1764,6 @@ internal static extern int AmsiScanBuffer( System.IntPtr amsiContext, System.IntPtr buffer, uint length, [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string contentName, System.IntPtr amsiSession, ref AMSI_RESULT result); - /// Return Type: HRESULT->LONG->int ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* ///string: LPCWSTR->WCHAR* diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index 7e486e6ef69..2200eb450da 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -1,8 +1,5 @@ -#pragma warning disable 1634, 1691 - -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56523 @@ -36,7 +33,6 @@ internal partial class NativeConstants /// SAFER_TOKEN_MAKE_INERT -> 0x00000004 public const int SAFER_TOKEN_MAKE_INERT = 4; - /// SAFER_CRITERIA_IMAGEPATH -> 0x00001 public const int SAFER_CRITERIA_IMAGEPATH = 1; @@ -92,7 +88,6 @@ internal partial class NativeConstants internal const int MAX_PATH = 260; } - /// /// pinvoke methods from crypt32.dll /// @@ -128,7 +123,6 @@ internal static extern IntPtr CertEnumCertificatesInStore(IntPtr storeHandle, IntPtr certContext); - /// /// signature of cert find function /// @@ -171,8 +165,6 @@ internal enum CertStoreFlags CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE = 9 << 16, } - - [DllImport("crypt32.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern bool CertGetEnhancedKeyUsage(IntPtr pCertContext, // PCCERT_CONTEXT @@ -521,7 +513,6 @@ internal enum CryptUIFlags // other flags not used }; - [StructLayout(LayoutKind.Sequential)] internal struct CRYPTUI_WIZ_DIGITAL_SIGN_INFO { @@ -601,7 +592,6 @@ internal static CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO siex.pszHashAlg = hashAlgorithm; } - return siex; } @@ -682,7 +672,6 @@ internal static extern IntPtr CryptFindOIDInfo( System.IntPtr pvKey, uint dwGroupId); - [ArchitectureSensitive] internal static DWORD GetCertChoiceFromSigningOption( SigningOption option) @@ -1850,7 +1839,6 @@ internal static extern IntPtr LoadLibraryExW( IntPtr reserved, uint Flags); - [DllImport(PinvokeDllNames.FreeLibrary, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool FreeLibrary( IntPtr Module); diff --git a/src/System.Management.Automation/security/wldpNativeMethods.cs b/src/System.Management.Automation/security/wldpNativeMethods.cs index e79c1678f3a..fdbd28346cf 100644 --- a/src/System.Management.Automation/security/wldpNativeMethods.cs +++ b/src/System.Management.Automation/security/wldpNativeMethods.cs @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Management.Automation.Internal; using Microsoft.Win32; using System.Runtime.InteropServices; @@ -167,7 +170,6 @@ private static SystemEnforcementMode GetWldpPolicy(string path, SafeHandle handl } private static SystemEnforcementMode? s_cachedWldpSystemPolicy = null; - private static SystemEnforcementMode GetAppLockerPolicy(string path, SafeHandle handle) { SaferPolicy result = SaferPolicy.Disallowed; @@ -393,8 +395,6 @@ private static SystemEnforcementMode GetDebugLockdownPolicy(string path) } private static bool s_hadMissingWldpAssembly = false; - - /// /// Gets lockdown policy as applied to a COM object /// @@ -560,7 +560,6 @@ internal class WldpNativeMethods [DllImportAttribute("wldp.dll", EntryPoint = "WldpGetLockdownPolicy")] internal static extern int WldpGetLockdownPolicy(ref WLDP_HOST_INFORMATION pHostInformation, ref uint pdwLockdownState, uint dwFlags); - /// Return Type: HRESULT->LONG->int /// rclsid: IID* /// pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION* @@ -578,4 +577,4 @@ internal static extern int SHGetKnownFolderPath( out IntPtr pszPath); } } -} \ No newline at end of file +} diff --git a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs index eee78a4205a..1d6160a57b7 100644 --- a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Text; diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index 56784516778..74f0a1170a5 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Collections.ObjectModel; @@ -61,7 +60,6 @@ internal static class RegistryStrings internal const string MshSnapin_VendorResource = "VendorIndirect"; internal const string MshSnapin_LogPipelineExecutionDetails = "LogPipelineExecutionDetails"; - //Name of default mshsnapins internal const string CoreMshSnapinName = "Microsoft.PowerShell.Core"; internal const string HostMshSnapinName = "Microsoft.PowerShell.Host"; @@ -358,7 +356,6 @@ internal RegistryKey MshSnapinKey } } - internal void LoadIndirectResources() { using (RegistryStringResourceIndirect resourceReader = RegistryStringResourceIndirect.GetResourceIndirectReader()) @@ -415,8 +412,6 @@ internal void LoadIndirectResources(RegistryStringResourceIndirect resourceReade } } - - internal PSSnapInInfo Clone() { PSSnapInInfo cloned = new PSSnapInInfo(Name, @@ -430,7 +425,6 @@ internal PSSnapInInfo Clone() return cloned; } - /// /// Returns true if the PSSnapIn Id is valid. A PSSnapIn is valid iff it contains only /// "Alpha Numeric","-","_","." characters. @@ -469,8 +463,6 @@ internal static void VerifyPSSnapInFormatThrowIfError(string psSnapinId) } } - - /// /// Internal class to read information about a mshsnapin /// @@ -573,7 +565,6 @@ bool MeetsVersionFormat(string version) return r; } - /// /// Reads all registered mshsnapin for specified psVersion /// @@ -642,7 +633,6 @@ private static Collection ReadAll(RegistryKey monadRootKey, string return mshsnapins; } - /// /// Read mshsnapin for specified mshsnapinId and psVersion /// @@ -684,8 +674,6 @@ internal static PSSnapInInfo Read(string psVersion, string mshsnapinId) return ReadOne(mshsnapinRoot, mshsnapinId); } - - /// /// Reads the mshsnapin info for a specific key under specific monad version /// @@ -1268,7 +1256,6 @@ public DefaultPSSnapInInformation(string sName, new DefaultPSSnapInInformation("Microsoft.PowerShell.Core", "System.Management.Automation", null, "CoreMshSnapInResources,Description", "CoreMshSnapInResources,Vendor"); - /// /// /// @@ -1326,4 +1313,3 @@ private static IList DefaultMshSnapins } } - diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs index c3ac0e252d8..179d9f76153 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Reflection; diff --git a/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs b/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs index 5843ec7308a..1e10b2e4eb7 100644 --- a/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs +++ b/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/utils/BackgroundDispatcher.cs b/src/System.Management.Automation/utils/BackgroundDispatcher.cs index 724ce27bb39..6b28170ffad 100644 --- a/src/System.Management.Automation/utils/BackgroundDispatcher.cs +++ b/src/System.Management.Automation/utils/BackgroundDispatcher.cs @@ -1,8 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/utils/ClrFacade.cs b/src/System.Management.Automation/utils/ClrFacade.cs index 1aca451d08c..cb24f0a37a1 100644 --- a/src/System.Management.Automation/utils/ClrFacade.cs +++ b/src/System.Management.Automation/utils/ClrFacade.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Diagnostics; diff --git a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs index 41fdfed9efd..a57925ba6b8 100644 --- a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs +++ b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Text; @@ -491,8 +490,6 @@ public string RequiresShellPath #region Private - - private static string BuildMessage( string commandName, Collection missingItems, diff --git a/src/System.Management.Automation/utils/CommandProcessorExceptions.cs b/src/System.Management.Automation/utils/CommandProcessorExceptions.cs index ece59d5a15a..f0bda376570 100644 --- a/src/System.Management.Automation/utils/CommandProcessorExceptions.cs +++ b/src/System.Management.Automation/utils/CommandProcessorExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/CoreProviderCmdlets.cs b/src/System.Management.Automation/utils/CoreProviderCmdlets.cs index 591de52d813..95ba7188624 100644 --- a/src/System.Management.Automation/utils/CoreProviderCmdlets.cs +++ b/src/System.Management.Automation/utils/CoreProviderCmdlets.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs index 2a6acccd556..c29cb7c31cd 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Text; using System.Security; @@ -138,7 +137,6 @@ public static extern bool CryptEncrypt(PSSafeCryptKey hKey, ref int pdwDataLen, int dwBufLen); - /// Return Type: BOOL->int ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int ///hHash: HCRYPTHASH->ULONG_PTR->unsigned int @@ -171,7 +169,6 @@ public static extern bool CryptExportKey(PSSafeCryptKey hKey, byte[] pbData, ref uint pdwDataLen); - /// Return Type: BOOL->int ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int ///pbData: BYTE* @@ -188,7 +185,6 @@ public static extern bool CryptImportKey(PSSafeCryptProvHandle hProv, uint dwFlags, ref PSSafeCryptKey phKey); - /// Return Type: BOOL->int ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int ///pdwReserved: DWORD* @@ -1101,7 +1097,6 @@ protected SecureString DecryptSecureStringCore(String encryptedString) #region Internal Methods - /// /// Encrypt a secure string /// diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 126314d7d38..583d3282e17 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Globalization; diff --git a/src/System.Management.Automation/utils/ExecutionExceptions.cs b/src/System.Management.Automation/utils/ExecutionExceptions.cs index c80c9e038ea..d846144d98a 100644 --- a/src/System.Management.Automation/utils/ExecutionExceptions.cs +++ b/src/System.Management.Automation/utils/ExecutionExceptions.cs @@ -1,11 +1,9 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma warning disable 1634, 1691 #pragma warning disable 56506 - using System.Runtime.Serialization; using System.Diagnostics.CodeAnalysis; using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/utils/ExtensionMethods.cs b/src/System.Management.Automation/utils/ExtensionMethods.cs index 783f7b6909e..e36d698a82c 100644 --- a/src/System.Management.Automation/utils/ExtensionMethods.cs +++ b/src/System.Management.Automation/utils/ExtensionMethods.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Linq; diff --git a/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs b/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs index 9af3de5e71d..efdf60c06ca 100644 --- a/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs +++ b/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.IO; using System.Collections.Generic; @@ -199,5 +198,3 @@ internal static void ThrowExceptionOnError( } } - - diff --git a/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs b/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs index 42facc45013..5abc98bedaf 100644 --- a/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs +++ b/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs @@ -1,11 +1,5 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -// Implements GraphicalHostReflectionWrapper -// -//----------------------------------------------------------------------- +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/utils/HostInterfacesExceptions.cs b/src/System.Management.Automation/utils/HostInterfacesExceptions.cs index f5fdbb88d8d..50bfa4cae89 100644 --- a/src/System.Management.Automation/utils/HostInterfacesExceptions.cs +++ b/src/System.Management.Automation/utils/HostInterfacesExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Management.Automation.Internal; @@ -49,7 +48,6 @@ class HostException : RuntimeException SetDefaultErrorRecord(); } - /// /// /// Initializes a new instance of the HostException class and defines the error message and @@ -190,7 +188,6 @@ class PromptingException : HostException SetDefaultErrorRecord(); } - /// /// /// Initializes a new instance of the PromptingException class and defines the error message and diff --git a/src/System.Management.Automation/utils/IObjectReader.cs b/src/System.Management.Automation/utils/IObjectReader.cs index 5962ce5a65b..02616bda786 100644 --- a/src/System.Management.Automation/utils/IObjectReader.cs +++ b/src/System.Management.Automation/utils/IObjectReader.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Threading; using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/IObjectWriter.cs b/src/System.Management.Automation/utils/IObjectWriter.cs index b33282bacbf..9f077077877 100644 --- a/src/System.Management.Automation/utils/IObjectWriter.cs +++ b/src/System.Management.Automation/utils/IObjectWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Runspaces { @@ -191,4 +190,3 @@ public override int Write(object obj, bool enumerateCollection) } } - diff --git a/src/System.Management.Automation/utils/MetadataExceptions.cs b/src/System.Management.Automation/utils/MetadataExceptions.cs index 5253113fe62..d9f9b942125 100644 --- a/src/System.Management.Automation/utils/MetadataExceptions.cs +++ b/src/System.Management.Automation/utils/MetadataExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Runtime.Serialization; @@ -55,7 +54,6 @@ public MetadataException(string message, Exception innerException) : base(messag SetErrorCategory(ErrorCategory.MetadataError); } - internal MetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : base(StringUtil.Format(resourceStr, arguments), innerException) { @@ -82,10 +80,8 @@ public class ValidationMetadataException : MetadataException internal const string ValidateRangeGreaterThanMaxRangeFailure = "ValidateRangeGreaterThanMaxRangeFailure"; internal const string ValidateRangeSmallerThanMinRangeFailure = "ValidateRangeSmallerThanMinRangeFailure"; - internal const string ValidateFailureResult = "ValidateFailureResult"; - internal const string ValidatePatternFailure = "ValidatePatternFailure"; internal const string ValidateScriptFailure = "ValidateScriptFailure"; @@ -125,7 +121,6 @@ public ValidationMetadataException(string message) : this(message, false) { } /// the exceptions's inner exception public ValidationMetadataException(string message, Exception innerException) : base(message, innerException) { } - internal ValidationMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : base(errorId, innerException, resourceStr, arguments) { @@ -190,7 +185,6 @@ public ArgumentTransformationMetadataException(string message) : base(message) { /// the exceptions's inner exception public ArgumentTransformationMetadataException(string message, Exception innerException) : base(message, innerException) { } - internal ArgumentTransformationMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : base(errorId, innerException, resourceStr, arguments) { @@ -228,7 +222,6 @@ public ParsingMetadataException(string message) : base(message) { } /// the exceptions's inner exception public ParsingMetadataException(string message, Exception innerException) : base(message, innerException) { } - internal ParsingMetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : base(errorId, innerException, resourceStr, arguments) { diff --git a/src/System.Management.Automation/utils/MshArgumentException.cs b/src/System.Management.Automation/utils/MshArgumentException.cs index 9be5db46b12..25b643df1fb 100644 --- a/src/System.Management.Automation/utils/MshArgumentException.cs +++ b/src/System.Management.Automation/utils/MshArgumentException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshArgumentNullException.cs b/src/System.Management.Automation/utils/MshArgumentNullException.cs index ac439801f62..a1bafc6a2fc 100644 --- a/src/System.Management.Automation/utils/MshArgumentNullException.cs +++ b/src/System.Management.Automation/utils/MshArgumentNullException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs index 3bf01bf663c..5389bb60f6b 100644 --- a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs +++ b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshInvalidOperationException.cs b/src/System.Management.Automation/utils/MshInvalidOperationException.cs index a05810a5fc0..46a1ce7684a 100644 --- a/src/System.Management.Automation/utils/MshInvalidOperationException.cs +++ b/src/System.Management.Automation/utils/MshInvalidOperationException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshNotImplementedException.cs b/src/System.Management.Automation/utils/MshNotImplementedException.cs index f5ab26deaa9..d27afc36b67 100644 --- a/src/System.Management.Automation/utils/MshNotImplementedException.cs +++ b/src/System.Management.Automation/utils/MshNotImplementedException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshNotSupportedException.cs b/src/System.Management.Automation/utils/MshNotSupportedException.cs index 93cc9754604..bb2641b31c8 100644 --- a/src/System.Management.Automation/utils/MshNotSupportedException.cs +++ b/src/System.Management.Automation/utils/MshNotSupportedException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshObjectDisposedException.cs b/src/System.Management.Automation/utils/MshObjectDisposedException.cs index 0a83ba5db21..73fabe371dd 100644 --- a/src/System.Management.Automation/utils/MshObjectDisposedException.cs +++ b/src/System.Management.Automation/utils/MshObjectDisposedException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.Serialization; using System.Security.Permissions; diff --git a/src/System.Management.Automation/utils/MshTraceSource.cs b/src/System.Management.Automation/utils/MshTraceSource.cs index 8d2f5c888fc..0fe78e7a469 100644 --- a/src/System.Management.Automation/utils/MshTraceSource.cs +++ b/src/System.Management.Automation/utils/MshTraceSource.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #define TRACE using System.Reflection; @@ -230,7 +230,6 @@ internal static PSTraceSource GetNewTraceSource( #region TraceFlags.New*Exception methods/helpers - /// /// Traces the Message and StackTrace properties of the exception /// and returns the new exception. This is not allowed to call other @@ -537,7 +536,6 @@ internal static PSArgumentOutOfRangeException NewArgumentOutOfRangeException( return e; } - /// /// Traces the Message and StackTrace properties of the exception /// and returns the new exception. This variant uses the default diff --git a/src/System.Management.Automation/utils/ObjectReader.cs b/src/System.Management.Automation/utils/ObjectReader.cs index d5594fc42d2..8b481ed757d 100644 --- a/src/System.Management.Automation/utils/ObjectReader.cs +++ b/src/System.Management.Automation/utils/ObjectReader.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/utils/ObjectStream.cs b/src/System.Management.Automation/utils/ObjectStream.cs index cc70e79af5f..e3389b4be80 100644 --- a/src/System.Management.Automation/utils/ObjectStream.cs +++ b/src/System.Management.Automation/utils/ObjectStream.cs @@ -1,7 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ - +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/utils/ObjectWriter.cs b/src/System.Management.Automation/utils/ObjectWriter.cs index 35fc754f5d7..1ed4087bee1 100644 --- a/src/System.Management.Automation/utils/ObjectWriter.cs +++ b/src/System.Management.Automation/utils/ObjectWriter.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation.Internal { diff --git a/src/System.Management.Automation/utils/PInvokeDllNames.cs b/src/System.Management.Automation/utils/PInvokeDllNames.cs index 9458ae964e1..a9c8cc022be 100644 --- a/src/System.Management.Automation/utils/PInvokeDllNames.cs +++ b/src/System.Management.Automation/utils/PInvokeDllNames.cs @@ -1,6 +1,5 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. namespace System.Management.Automation { diff --git a/src/System.Management.Automation/utils/PSTelemetryMethods.cs b/src/System.Management.Automation/utils/PSTelemetryMethods.cs index 9558e6e02c7..229f24803ac 100644 --- a/src/System.Management.Automation/utils/PSTelemetryMethods.cs +++ b/src/System.Management.Automation/utils/PSTelemetryMethods.cs @@ -1,7 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if LEGACYTELEMETRY -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System; using System.Collections.Generic; @@ -126,7 +125,6 @@ internal static void ReportGetCommandFailed(string[] name, long timeInMS) TelemetryWrapper.TraceMessage("PSGetCommandFailed", new { TimeInMS = timeInMS, CommandNames = name }); } - private static long[] s_tabCompletionTimes = new long[(int)CompletionResultType.DynamicKeyword + 1]; private static int[] s_tabCompletionCounts = new int[(int)CompletionResultType.DynamicKeyword + 1]; private static int[] s_tabCompletionResultCounts = new int[(int)CompletionResultType.DynamicKeyword + 1]; diff --git a/src/System.Management.Automation/utils/PSTelemetryWrapper.cs b/src/System.Management.Automation/utils/PSTelemetryWrapper.cs index 6be313afee5..995de89a167 100644 --- a/src/System.Management.Automation/utils/PSTelemetryWrapper.cs +++ b/src/System.Management.Automation/utils/PSTelemetryWrapper.cs @@ -1,7 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if LEGACYTELEMETRY -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ using System.Reflection; using System.Diagnostics.Tracing; diff --git a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs index b23db53835a..8023f72c8f7 100644 --- a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs +++ b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Internal; using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/utils/ParserException.cs b/src/System.Management.Automation/utils/ParserException.cs index 52a208466fd..88de64a8f1f 100644 --- a/src/System.Management.Automation/utils/ParserException.cs +++ b/src/System.Management.Automation/utils/ParserException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -41,7 +40,6 @@ protected ParseException(SerializationInfo info, _errors = (ParseError[])info.GetValue("Errors", typeof(ParseError[])); } - /// /// Add private data for serialization. /// @@ -170,7 +168,6 @@ public override string Message } } // ParseException - /// /// Defines the exception thrown when a incomplete parse error occurs while parsing msh script text. /// diff --git a/src/System.Management.Automation/utils/PathUtils.cs b/src/System.Management.Automation/utils/PathUtils.cs index 6b8b0de42da..2177f89dbb3 100644 --- a/src/System.Management.Automation/utils/PathUtils.cs +++ b/src/System.Management.Automation/utils/PathUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Generic; using System.Globalization; @@ -175,8 +174,6 @@ internal static void MasterStreamOpen( } } // void MasterStreamOpen - - internal static void ReportFileOpenFailure(Cmdlet cmdlet, string filePath, Exception e) { ErrorRecord errorRecord = new ErrorRecord( diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs index 028d768c0b6..a428af3cc18 100644 --- a/src/System.Management.Automation/utils/PlatformInvokes.cs +++ b/src/System.Management.Automation/utils/PlatformInvokes.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/PowerShellETWTracer.cs b/src/System.Management.Automation/utils/PowerShellETWTracer.cs index 39990d8a30d..487cef5e37a 100644 --- a/src/System.Management.Automation/utils/PowerShellETWTracer.cs +++ b/src/System.Management.Automation/utils/PowerShellETWTracer.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// + using System.Globalization; using System.Management.Automation.Runspaces; using System.Text; @@ -1127,7 +1127,6 @@ public bool WriteMessage(string message, Guid instanceId) PowerShellTraceTask.None, message, instanceId); } - /// /// /// diff --git a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs index 0278962d6b9..b3c4b95d7d0 100644 --- a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs +++ b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/PsUtils.cs b/src/System.Management.Automation/utils/PsUtils.cs index 70d5a7cde28..b6ede8c993f 100644 --- a/src/System.Management.Automation/utils/PsUtils.cs +++ b/src/System.Management.Automation/utils/PsUtils.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections; using System.Diagnostics; diff --git a/src/System.Management.Automation/utils/ResourceManagerCache.cs b/src/System.Management.Automation/utils/ResourceManagerCache.cs index 373947dca2b..6dfd4a6023a 100644 --- a/src/System.Management.Automation/utils/ResourceManagerCache.cs +++ b/src/System.Management.Automation/utils/ResourceManagerCache.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Reflection; using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/RuntimeException.cs b/src/System.Management.Automation/utils/RuntimeException.cs index 53011603272..9a0e04decc3 100644 --- a/src/System.Management.Automation/utils/RuntimeException.cs +++ b/src/System.Management.Automation/utils/RuntimeException.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Language; using System.Runtime.Serialization; @@ -133,7 +132,6 @@ internal RuntimeException(ErrorCategory errorCategory, _errorRecord.SetInvocationInfo(new InvocationInfo(invocationInfo.MyCommand, errorPosition)); } - #endregion ctor #region ErrorRecord diff --git a/src/System.Management.Automation/utils/SessionStateExceptions.cs b/src/System.Management.Automation/utils/SessionStateExceptions.cs index f19ff72be24..a6082744eec 100644 --- a/src/System.Management.Automation/utils/SessionStateExceptions.cs +++ b/src/System.Management.Automation/utils/SessionStateExceptions.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.ObjectModel; using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/StringUtil.cs b/src/System.Management.Automation/utils/StringUtil.cs index 685866297d6..7af181038f0 100644 --- a/src/System.Management.Automation/utils/StringUtil.cs +++ b/src/System.Management.Automation/utils/StringUtil.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Management.Automation.Host; using System.Threading; @@ -18,8 +17,6 @@ internal static return String.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o); } - - internal static string Format(string formatSpec, object o1, object o2) @@ -27,8 +24,6 @@ internal static return String.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o1, o2); } - - internal static string Format(string formatSpec, params object[] o) @@ -36,8 +31,6 @@ internal static return String.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o); } - - internal static string TruncateToBufferCellWidth(PSHostRawUserInterface rawUI, string toTruncate, int maxWidthInBufferCells) diff --git a/src/System.Management.Automation/utils/StructuredTraceSource.cs b/src/System.Management.Automation/utils/StructuredTraceSource.cs index 1eb71840bd0..cca0627e991 100644 --- a/src/System.Management.Automation/utils/StructuredTraceSource.cs +++ b/src/System.Management.Automation/utils/StructuredTraceSource.cs @@ -1,6 +1,6 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #define TRACE using System.Collections.Generic; @@ -442,7 +442,6 @@ internal void TracerObjectHeader( assemblyFileInfo.CreationTime); } - StringBuilder flagBuilder = new StringBuilder(); // Label diff --git a/src/System.Management.Automation/utils/Verbs.cs b/src/System.Management.Automation/utils/Verbs.cs index 8b1997f3a5b..3c609e58f10 100644 --- a/src/System.Management.Automation/utils/Verbs.cs +++ b/src/System.Management.Automation/utils/Verbs.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; using System.Collections.Generic; @@ -194,7 +193,6 @@ public static class VerbsCommon public const string Watch = "Watch"; }//VerbsCommon - /// /// Verbs that are commonly used in cmdlet names when the cmdlet manipulates data. /// @@ -497,7 +495,6 @@ public static class VerbsDiagnostic public const string Trace = "Trace"; }//VerbsDiagnostic - /// /// Verbs that are commonly used in cmdlet names when the cmdlet is used to communicate with something. /// diff --git a/src/System.Management.Automation/utils/assert.cs b/src/System.Management.Automation/utils/assert.cs index 5985b4e39c1..ce5312a7710 100644 --- a/src/System.Management.Automation/utils/assert.cs +++ b/src/System.Management.Automation/utils/assert.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // The define below is only valid for this file. It allows the methods // defined here to call Diagnostics.Assert when only ASSERTIONS_TRACE is defined diff --git a/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs b/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs index 868ee0aef6a..9c1e4d718ed 100644 --- a/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs +++ b/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; @@ -127,7 +126,6 @@ public abstract bool UpdateCounterByValue( long stepAmount, bool isNumerator); - /// /// If isNumerator is true, then updates the numerator component /// of target counter 'counterName' by a value given by 'stepAmount'. @@ -547,7 +545,6 @@ public override bool GetCounterValue(int counterId, bool isNumerator, out long c } } - /// /// This method retrieves the counter value associated with counter 'counterName' /// based on isNumerator parameter. diff --git a/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs b/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs index f6bf886cede..f5bc7ea2df1 100644 --- a/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs +++ b/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Diagnostics.PerformanceData; using System.Diagnostics.CodeAnalysis; @@ -89,7 +88,6 @@ public abstract class CounterSetRegistrarBase /// protected abstract CounterSetInstanceBase CreateCounterSetInstance(); - #endregion #region Constructors @@ -187,7 +185,6 @@ protected CounterSetRegistrarBase( [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public CounterInfo[] CounterInfoArray { get; } - /// /// Getter method that returns an instance of the CounterSetInstanceBase's /// derived type @@ -199,10 +196,8 @@ public CounterSetInstanceBase CounterSetInstance #endregion - #region Public Methods - /// /// Method that disposes the referenced instance of the CounterSetInstanceBase's derived type. /// This method is invoked by the PSPerfCountersMgr to dispose the appropriate @@ -251,7 +246,6 @@ public PSCounterSetRegistrar( } } - #endregion #region CounterSetRegistrarBase Overrides @@ -279,7 +273,6 @@ public override void DisposeCounterSetInstance() #endregion - #endregion } } diff --git a/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs b/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs index 17a7e50404c..52b19a14f76 100644 --- a/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs +++ b/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System.Collections.Concurrent; using System.Collections.Generic; @@ -437,7 +436,6 @@ public bool SetCounterValue( } } - #endregion #region Internal Methods diff --git a/src/System.Management.Automation/utils/tracing/EtwActivity.cs b/src/System.Management.Automation/utils/tracing/EtwActivity.cs index 75db5129b6c..cd8dcf2204d 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivity.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivity.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// + using System.Collections.Generic; using System.Diagnostics.Eventing; using System.Diagnostics; @@ -539,5 +539,4 @@ internal enum ActivityControlCode : uint } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs index 8ae9dd9248a..22badeaa20b 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs @@ -1,9 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- namespace System.Management.Automation.Tracing { @@ -60,5 +57,4 @@ public void Dispose() } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs index 682accc7d81..ac4440d7ded 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs @@ -1,9 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- namespace System.Management.Automation.Tracing { @@ -70,5 +67,4 @@ private object DoInvoke(Guid relatedActivityId, Delegate method, object[] method } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs index 7ffdf909532..d22830c5e6c 100644 --- a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs +++ b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs @@ -1,9 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- namespace System.Management.Automation.Tracing { @@ -116,5 +113,4 @@ public IEtwActivityReverter StartActivity() } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs index 1da52df3207..0b07aad161f 100644 --- a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs @@ -1,9 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- namespace System.Management.Automation.Tracing { @@ -16,5 +13,4 @@ internal interface IMethodInvoker } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs index 8ba057e94bf..787c275a925 100644 --- a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs @@ -1,6 +1,6 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + using System.Globalization; using System.Management.Automation.Internal; using System.Collections.Generic; @@ -271,7 +271,6 @@ internal static void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask t provider.WriteEvent(id, PSChannel.Operational, opcode, task, logContext, payLoad); } - internal static void SetActivityIdForCurrentThread(Guid newActivityId) { provider.SetActivityIdForCurrentThread(newActivityId); diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs index 574508a004c..3d043b35108 100755 --- a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// + using System.Diagnostics.Eventing; using System.Management.Automation.Internal; using System.Text; diff --git a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs index 7507c1c4402..c473fb93345 100755 --- a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if UNIX -// -// Copyright (C) Microsoft. All rights reserved. -// + using System.Diagnostics.Eventing; using System.Management.Automation.Configuration; using System.Management.Automation.Internal; @@ -57,8 +57,6 @@ private static StringBuilder PayloadBuilder } } - - /// /// Determines whether any session is requesting the specified event from the provider. /// diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index cd6d9d73927..ca1b5c8680d 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if UNIX using System; diff --git a/src/System.Management.Automation/utils/tracing/Tracing.cs b/src/System.Management.Automation/utils/tracing/Tracing.cs index b93061723c9..d3a1cbecf14 100644 --- a/src/System.Management.Automation/utils/tracing/Tracing.cs +++ b/src/System.Management.Automation/utils/tracing/Tracing.cs @@ -1,7 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// + using System.Text; namespace System.Management.Automation.Tracing diff --git a/src/System.Management.Automation/utils/tracing/TracingGen.cs b/src/System.Management.Automation/utils/tracing/TracingGen.cs index d277e047bd6..8eed00ccc0d 100644 --- a/src/System.Management.Automation/utils/tracing/TracingGen.cs +++ b/src/System.Management.Automation/utils/tracing/TracingGen.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #if !UNIX using System.Diagnostics.Eventing; using System.Diagnostics.CodeAnalysis; @@ -245,7 +247,6 @@ public void WriteTransferEvent(Guid currentActivityId, Guid parentActivityId) WriteEvent(WriteTransferEventEvent, currentActivityId, parentActivityId); } - /// /// DebugMessage (EventId: 0xc000/49152) /// @@ -255,7 +256,6 @@ public void DebugMessage(string message) WriteEvent(DebugMessageEvent, message); } - /// /// AbortingWorkflowExecution (EventId: 0xb038/45112) /// @@ -983,5 +983,4 @@ public void WorkflowValidationStarted(Guid workflowId) } // This code was generated on 02/01/2012 19:52:32 - #endif diff --git a/src/TypeCatalogGen/TypeCatalogGen.cs b/src/TypeCatalogGen/TypeCatalogGen.cs index 2078ab07ddd..710f50baafc 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.cs +++ b/src/TypeCatalogGen/TypeCatalogGen.cs @@ -1,4 +1,6 @@ -/* +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +/* * This is the source code for the tool 'TypeCatalogGen.exe', which has been checked in %SDXROOT%\tools\managed\v4.0\TypeCatalogGen. * The tool 'TypeCatalogGen.exe' is used when building 'Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll' for OneCore powershell * to generate the CoreCLR type catalog initialization code, which will then be compiled into the same DLL. @@ -467,4 +469,3 @@ internal TypeMetadata(string assemblyName, bool isTypeObsolete) } } - diff --git a/src/libpsl-native/src/createhardlink.cpp b/src/libpsl-native/src/createhardlink.cpp index d3bd84685e9..2d1f990458b 100644 --- a/src/libpsl-native/src/createhardlink.cpp +++ b/src/libpsl-native/src/createhardlink.cpp @@ -1,5 +1,6 @@ -//! @file createsymlink.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief create new hard link #include "createhardlink.h" diff --git a/src/libpsl-native/src/createhardlink.h b/src/libpsl-native/src/createhardlink.h index b8e62ddcc23..c286934622f 100644 --- a/src/libpsl-native/src/createhardlink.h +++ b/src/libpsl-native/src/createhardlink.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/createprocess.cpp b/src/libpsl-native/src/createprocess.cpp index b0cc2e81523..299cfd2811d 100644 --- a/src/libpsl-native/src/createprocess.cpp +++ b/src/libpsl-native/src/createprocess.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "createprocess.h" #include diff --git a/src/libpsl-native/src/createprocess.h b/src/libpsl-native/src/createprocess.h index 9755d8cc48f..af6afe40998 100644 --- a/src/libpsl-native/src/createprocess.h +++ b/src/libpsl-native/src/createprocess.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/createsymlink.cpp b/src/libpsl-native/src/createsymlink.cpp index 22ea389a30e..a652417e83b 100644 --- a/src/libpsl-native/src/createsymlink.cpp +++ b/src/libpsl-native/src/createsymlink.cpp @@ -1,5 +1,6 @@ -//! @file createsymlink.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief create new symbolic link #include "createsymlink.h" diff --git a/src/libpsl-native/src/createsymlink.h b/src/libpsl-native/src/createsymlink.h index d40821d8374..6f9252c85fa 100644 --- a/src/libpsl-native/src/createsymlink.h +++ b/src/libpsl-native/src/createsymlink.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/followsymlink.cpp b/src/libpsl-native/src/followsymlink.cpp index 033160fae67..215130b3fe3 100644 --- a/src/libpsl-native/src/followsymlink.cpp +++ b/src/libpsl-native/src/followsymlink.cpp @@ -1,5 +1,6 @@ -//! @file followSymLink.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns whether a path is a symbolic link #include "followsymlink.h" diff --git a/src/libpsl-native/src/followsymlink.h b/src/libpsl-native/src/followsymlink.h index fac7f5244f8..27f034477f6 100644 --- a/src/libpsl-native/src/followsymlink.h +++ b/src/libpsl-native/src/followsymlink.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getcomputername.cpp b/src/libpsl-native/src/getcomputername.cpp index b1fda7d9f07..89c54aa356b 100644 --- a/src/libpsl-native/src/getcomputername.cpp +++ b/src/libpsl-native/src/getcomputername.cpp @@ -1,5 +1,6 @@ -//! @file getcomputername.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements GetComputerName Win32 API #include "getcomputername.h" diff --git a/src/libpsl-native/src/getcomputername.h b/src/libpsl-native/src/getcomputername.h index 363210921be..17d456080f4 100644 --- a/src/libpsl-native/src/getcomputername.h +++ b/src/libpsl-native/src/getcomputername.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getcurrentprocessorid.cpp b/src/libpsl-native/src/getcurrentprocessorid.cpp index 6ef7ddb685b..0bc168e2e7b 100644 --- a/src/libpsl-native/src/getcurrentprocessorid.cpp +++ b/src/libpsl-native/src/getcurrentprocessorid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "getcurrentprocessorid.h" #include diff --git a/src/libpsl-native/src/getcurrentprocessorid.h b/src/libpsl-native/src/getcurrentprocessorid.h index ece2f5c358d..b0092d19b0a 100644 --- a/src/libpsl-native/src/getcurrentprocessorid.h +++ b/src/libpsl-native/src/getcurrentprocessorid.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getcurrentthreadid.cpp b/src/libpsl-native/src/getcurrentthreadid.cpp index 84d5b6f4aec..c1863949a03 100644 --- a/src/libpsl-native/src/getcurrentthreadid.cpp +++ b/src/libpsl-native/src/getcurrentthreadid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "getcurrentthreadid.h" #include diff --git a/src/libpsl-native/src/getcurrentthreadid.h b/src/libpsl-native/src/getcurrentthreadid.h index 9a6c94e9e3e..3ac30648369 100644 --- a/src/libpsl-native/src/getcurrentthreadid.h +++ b/src/libpsl-native/src/getcurrentthreadid.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/geterrorcategory.cpp b/src/libpsl-native/src/geterrorcategory.cpp index 52abf3e5dc9..f436899a701 100644 --- a/src/libpsl-native/src/geterrorcategory.cpp +++ b/src/libpsl-native/src/geterrorcategory.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "geterrorcategory.h" #include diff --git a/src/libpsl-native/src/geterrorcategory.h b/src/libpsl-native/src/geterrorcategory.h index fe7a9437f4e..4310bdc4433 100644 --- a/src/libpsl-native/src/geterrorcategory.h +++ b/src/libpsl-native/src/geterrorcategory.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getfileowner.cpp b/src/libpsl-native/src/getfileowner.cpp index 56de5d3f054..1443f3074cd 100644 --- a/src/libpsl-native/src/getfileowner.cpp +++ b/src/libpsl-native/src/getfileowner.cpp @@ -1,5 +1,6 @@ -//! @file getfileowner.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns the owner of a file #include "getstat.h" diff --git a/src/libpsl-native/src/getfileowner.h b/src/libpsl-native/src/getfileowner.h index 7da83dccca1..1d4578844dc 100644 --- a/src/libpsl-native/src/getfileowner.h +++ b/src/libpsl-native/src/getfileowner.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getfullyqualifiedname.cpp b/src/libpsl-native/src/getfullyqualifiedname.cpp index 12a3483ed7c..51df25a07ff 100644 --- a/src/libpsl-native/src/getfullyqualifiedname.cpp +++ b/src/libpsl-native/src/getfullyqualifiedname.cpp @@ -1,5 +1,6 @@ -//! @file getfullyqualifiedname.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements GetFullyQualifiedName on Linux #include "getcomputername.h" diff --git a/src/libpsl-native/src/getfullyqualifiedname.h b/src/libpsl-native/src/getfullyqualifiedname.h index b44ab68fd59..a9fb2632517 100644 --- a/src/libpsl-native/src/getfullyqualifiedname.h +++ b/src/libpsl-native/src/getfullyqualifiedname.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getinodedata.cpp b/src/libpsl-native/src/getinodedata.cpp index 56d76a79bb7..3534eac3b62 100644 --- a/src/libpsl-native/src/getinodedata.cpp +++ b/src/libpsl-native/src/getinodedata.cpp @@ -1,5 +1,6 @@ -//! @file getinodedata.cpp -//! @author Jeff Bienstadt +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Retrieve the device ID and inode number of a file #include "getinodedata.h" diff --git a/src/libpsl-native/src/getinodedata.h b/src/libpsl-native/src/getinodedata.h index f849e29c2d9..ed21b61bf6f 100644 --- a/src/libpsl-native/src/getinodedata.h +++ b/src/libpsl-native/src/getinodedata.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getlinkcount.cpp b/src/libpsl-native/src/getlinkcount.cpp index 8a04dec0097..6c4283b51aa 100644 --- a/src/libpsl-native/src/getlinkcount.cpp +++ b/src/libpsl-native/src/getlinkcount.cpp @@ -1,5 +1,6 @@ -//! @file getlinkcount.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Retrieve link count of a file #include "getlinkcount.h" diff --git a/src/libpsl-native/src/getlinkcount.h b/src/libpsl-native/src/getlinkcount.h index 6a3c8b8e417..1b3dfd90304 100644 --- a/src/libpsl-native/src/getlinkcount.h +++ b/src/libpsl-native/src/getlinkcount.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getppid.cpp b/src/libpsl-native/src/getppid.cpp index c562f4c7e24..824da6fce7b 100644 --- a/src/libpsl-native/src/getppid.cpp +++ b/src/libpsl-native/src/getppid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "getppid.h" #include diff --git a/src/libpsl-native/src/getppid.h b/src/libpsl-native/src/getppid.h index 46c9cfc9cd2..7b7244f4b0d 100644 --- a/src/libpsl-native/src/getppid.h +++ b/src/libpsl-native/src/getppid.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getpwuid.cpp b/src/libpsl-native/src/getpwuid.cpp index f147d7d8013..a3b4a21ecae 100644 --- a/src/libpsl-native/src/getpwuid.cpp +++ b/src/libpsl-native/src/getpwuid.cpp @@ -1,5 +1,6 @@ -//! @file getpwuid.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns the username for a uid #include "getpwuid.h" diff --git a/src/libpsl-native/src/getpwuid.h b/src/libpsl-native/src/getpwuid.h index d573a8292be..939345eb030 100644 --- a/src/libpsl-native/src/getpwuid.h +++ b/src/libpsl-native/src/getpwuid.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getstat.cpp b/src/libpsl-native/src/getstat.cpp index 56d3c6b1aa6..dba95262a7a 100644 --- a/src/libpsl-native/src/getstat.cpp +++ b/src/libpsl-native/src/getstat.cpp @@ -1,5 +1,6 @@ -//! @file getstat.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns the stat of a file #include "getstat.h" diff --git a/src/libpsl-native/src/getstat.h b/src/libpsl-native/src/getstat.h index 7f680470d98..12270e0e61b 100644 --- a/src/libpsl-native/src/getstat.h +++ b/src/libpsl-native/src/getstat.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getuserfrompid.cpp b/src/libpsl-native/src/getuserfrompid.cpp index 89b49ea5dbf..871f71f86fd 100644 --- a/src/libpsl-native/src/getuserfrompid.cpp +++ b/src/libpsl-native/src/getuserfrompid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include "pal.h" #include "getfileowner.h" #include "getpwuid.h" diff --git a/src/libpsl-native/src/getuserfrompid.h b/src/libpsl-native/src/getuserfrompid.h index 65ce612daaa..1c58dcb30e2 100644 --- a/src/libpsl-native/src/getuserfrompid.h +++ b/src/libpsl-native/src/getuserfrompid.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/getusername.cpp b/src/libpsl-native/src/getusername.cpp index e2bbe95bd4d..ed694f16a5b 100644 --- a/src/libpsl-native/src/getusername.cpp +++ b/src/libpsl-native/src/getusername.cpp @@ -1,5 +1,6 @@ -//! @file getusername.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements GetUserName for Linux #include "getpwuid.h" diff --git a/src/libpsl-native/src/getusername.h b/src/libpsl-native/src/getusername.h index 1326298f425..e9461c715ec 100644 --- a/src/libpsl-native/src/getusername.h +++ b/src/libpsl-native/src/getusername.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/isdirectory.cpp b/src/libpsl-native/src/isdirectory.cpp index 1cb75a72a43..1123dc5af68 100644 --- a/src/libpsl-native/src/isdirectory.cpp +++ b/src/libpsl-native/src/isdirectory.cpp @@ -1,5 +1,6 @@ -//! @file isdirectory.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns if the path is a directory #include "getstat.h" diff --git a/src/libpsl-native/src/isdirectory.h b/src/libpsl-native/src/isdirectory.h index fdf52b22b10..a89e9021836 100644 --- a/src/libpsl-native/src/isdirectory.h +++ b/src/libpsl-native/src/isdirectory.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/isexecutable.cpp b/src/libpsl-native/src/isexecutable.cpp index 81e00fba230..c4123797506 100644 --- a/src/libpsl-native/src/isexecutable.cpp +++ b/src/libpsl-native/src/isexecutable.cpp @@ -1,5 +1,6 @@ -//! @file isexecutable.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns whether a file is executable #include "isexecutable.h" diff --git a/src/libpsl-native/src/isexecutable.h b/src/libpsl-native/src/isexecutable.h index f5fcb5b7421..c04a4785251 100644 --- a/src/libpsl-native/src/isexecutable.h +++ b/src/libpsl-native/src/isexecutable.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/isfile.cpp b/src/libpsl-native/src/isfile.cpp index 0c3aecf46ab..531282d5856 100644 --- a/src/libpsl-native/src/isfile.cpp +++ b/src/libpsl-native/src/isfile.cpp @@ -1,5 +1,6 @@ -//! @file isfile.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns if the path exists #include "isfile.h" diff --git a/src/libpsl-native/src/isfile.h b/src/libpsl-native/src/isfile.h index 1aa6677c2f8..a7f5adf082c 100644 --- a/src/libpsl-native/src/isfile.h +++ b/src/libpsl-native/src/isfile.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/issamefilesystemitem.cpp b/src/libpsl-native/src/issamefilesystemitem.cpp index 9e63e6e0749..ce8143582be 100644 --- a/src/libpsl-native/src/issamefilesystemitem.cpp +++ b/src/libpsl-native/src/issamefilesystemitem.cpp @@ -1,5 +1,6 @@ -//! @file issamefilesystemitem.cpp -//! @author Jeff Bienstadt +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Determines whether two paths ultimately point to the same filesystem object #include "getstat.h" diff --git a/src/libpsl-native/src/issamefilesystemitem.h b/src/libpsl-native/src/issamefilesystemitem.h index 7c3e3ade860..c2c89718260 100644 --- a/src/libpsl-native/src/issamefilesystemitem.h +++ b/src/libpsl-native/src/issamefilesystemitem.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/issymlink.cpp b/src/libpsl-native/src/issymlink.cpp index cc6c126ea81..7fd518704f9 100644 --- a/src/libpsl-native/src/issymlink.cpp +++ b/src/libpsl-native/src/issymlink.cpp @@ -1,5 +1,6 @@ -//! @file isSymLink.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief returns whether a path is a symbolic link #include "issymlink.h" diff --git a/src/libpsl-native/src/issymlink.h b/src/libpsl-native/src/issymlink.h index 1106484580c..d0a1830ac0e 100644 --- a/src/libpsl-native/src/issymlink.h +++ b/src/libpsl-native/src/issymlink.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/nativesyslog.cpp b/src/libpsl-native/src/nativesyslog.cpp index 15df49d7429..130481d0e73 100755 --- a/src/libpsl-native/src/nativesyslog.cpp +++ b/src/libpsl-native/src/nativesyslog.cpp @@ -1,10 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @file nativesyslog.cpp //! @brief Provides wrappers around the syslog apis to support exporting //! for PInvoke calls by powershell. //! These functions are intended only for PowerShell internal use. //! To view log output in real time //! On Linux -//! tail -f /var/log/syslog | grep powershell +//! tail -f /var/log/syslog | grep powershell //! On OSX //! sudo log stream //! NOTE: replace powershell with the LogIdentity value when overriding in configuration @@ -45,7 +48,7 @@ extern "C" void Native_SysLog(int32_t priority, const char* message) case LOG_CRIT: os_log_fault(_log, MESSAGE_FORMAT, message); break; - + case LOG_ERR: os_log_error(_log, MESSAGE_FORMAT, message); break; @@ -53,10 +56,10 @@ extern "C" void Native_SysLog(int32_t priority, const char* message) case LOG_DEBUG: os_log_debug(_log, MESSAGE_FORMAT, message); break; - + default: os_log(_log, MESSAGE_FORMAT, message); - break; + break; } #else syslog(priority, "%s", message); @@ -84,7 +87,7 @@ extern "C" void Native_CloseLog() { #if defined(__APPLE__) && defined(__MACH__) // Nothing to do here now, for now. -#else +#else closelog(); #endif } diff --git a/src/libpsl-native/src/nativesyslog.h b/src/libpsl-native/src/nativesyslog.h index 71b222fa4de..d2613007cec 100644 --- a/src/libpsl-native/src/nativesyslog.h +++ b/src/libpsl-native/src/nativesyslog.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/src/pal.h b/src/libpsl-native/src/pal.h index 0770003569d..2323be806f0 100644 --- a/src/libpsl-native/src/pal.h +++ b/src/libpsl-native/src/pal.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include diff --git a/src/libpsl-native/src/setdate.cpp b/src/libpsl-native/src/setdate.cpp index 916795cb4da..97709ad558d 100644 --- a/src/libpsl-native/src/setdate.cpp +++ b/src/libpsl-native/src/setdate.cpp @@ -1,5 +1,6 @@ -//! @file setdate.cpp -//! @author George FLeming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief set local/system date and time #include "setdate.h" diff --git a/src/libpsl-native/src/setdate.h b/src/libpsl-native/src/setdate.h index ad0389a6a66..250cf515e59 100644 --- a/src/libpsl-native/src/setdate.h +++ b/src/libpsl-native/src/setdate.h @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #pragma once #include "pal.h" diff --git a/src/libpsl-native/test/main.cpp b/src/libpsl-native/test/main.cpp index 9bb465e024a..45569a6b583 100644 --- a/src/libpsl-native/test/main.cpp +++ b/src/libpsl-native/test/main.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include int main(int argc, char** argv) diff --git a/src/libpsl-native/test/test-createhardlink.cpp b/src/libpsl-native/test/test-createhardlink.cpp index bb9a3fbe520..37e488e76d4 100644 --- a/src/libpsl-native/test/test-createhardlink.cpp +++ b/src/libpsl-native/test/test-createhardlink.cpp @@ -1,5 +1,6 @@ -//! @file test-createhardlink.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements test for CreateHardLink() #include diff --git a/src/libpsl-native/test/test-createsymlink.cpp b/src/libpsl-native/test/test-createsymlink.cpp index 42f186b2951..3b570c8b2d9 100644 --- a/src/libpsl-native/test/test-createsymlink.cpp +++ b/src/libpsl-native/test/test-createsymlink.cpp @@ -1,5 +1,6 @@ -//! @file test-createsymlink.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements test for CreateSymLink() and FollowSymLink() #include diff --git a/src/libpsl-native/test/test-getcomputername.cpp b/src/libpsl-native/test/test-getcomputername.cpp index 9c1d676cbd7..235220cf355 100644 --- a/src/libpsl-native/test/test-getcomputername.cpp +++ b/src/libpsl-native/test/test-getcomputername.cpp @@ -1,5 +1,6 @@ -//! @file test-getcomputername.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Unit tests for GetComputerName #include diff --git a/src/libpsl-native/test/test-getcurrentprocessid.cpp b/src/libpsl-native/test/test-getcurrentprocessid.cpp index a1d10a0bee0..22ea7be7d0a 100644 --- a/src/libpsl-native/test/test-getcurrentprocessid.cpp +++ b/src/libpsl-native/test/test-getcurrentprocessid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include #include "getcurrentprocessorid.h" diff --git a/src/libpsl-native/test/test-getcurrentthreadid.cpp b/src/libpsl-native/test/test-getcurrentthreadid.cpp index 7488d192ddb..a044defdff8 100644 --- a/src/libpsl-native/test/test-getcurrentthreadid.cpp +++ b/src/libpsl-native/test/test-getcurrentthreadid.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include #include "getcurrentthreadid.h" #include diff --git a/src/libpsl-native/test/test-getfileowner.cpp b/src/libpsl-native/test/test-getfileowner.cpp index c13675467f1..ab1cf820ca8 100644 --- a/src/libpsl-native/test/test-getfileowner.cpp +++ b/src/libpsl-native/test/test-getfileowner.cpp @@ -1,5 +1,6 @@ -//! @file test-getfileowner.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Tests GetFileOwner #include diff --git a/src/libpsl-native/test/test-getfullyqualifiedname.cpp b/src/libpsl-native/test/test-getfullyqualifiedname.cpp index 443ad233023..8378f3a6853 100644 --- a/src/libpsl-native/test/test-getfullyqualifiedname.cpp +++ b/src/libpsl-native/test/test-getfullyqualifiedname.cpp @@ -1,5 +1,6 @@ -//! @file test-getfullyqualifiedname.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Unit tests for GetFullyQualifiedName #include diff --git a/src/libpsl-native/test/test-getlinkcount.cpp b/src/libpsl-native/test/test-getlinkcount.cpp index d005e31488f..741c0c55267 100644 --- a/src/libpsl-native/test/test-getlinkcount.cpp +++ b/src/libpsl-native/test/test-getlinkcount.cpp @@ -1,5 +1,6 @@ -//! @file test-getlinkcount.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements test for getLinkCount() #include diff --git a/src/libpsl-native/test/test-getuserfrompid.cpp b/src/libpsl-native/test/test-getuserfrompid.cpp index ca6d866c630..2b908cd9095 100644 --- a/src/libpsl-native/test/test-getuserfrompid.cpp +++ b/src/libpsl-native/test/test-getuserfrompid.cpp @@ -1,5 +1,6 @@ -//! @file test-getuserfrompid.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Unit tests for GetUserFromPid #include diff --git a/src/libpsl-native/test/test-getusername.cpp b/src/libpsl-native/test/test-getusername.cpp index 3f4751276f6..f3adf3ba161 100644 --- a/src/libpsl-native/test/test-getusername.cpp +++ b/src/libpsl-native/test/test-getusername.cpp @@ -1,5 +1,6 @@ -//! @file test-getusername.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Unit tests for GetUserName #include diff --git a/src/libpsl-native/test/test-isdirectory.cpp b/src/libpsl-native/test/test-isdirectory.cpp index 24ab6471135..a9f4a294ed7 100644 --- a/src/libpsl-native/test/test-isdirectory.cpp +++ b/src/libpsl-native/test/test-isdirectory.cpp @@ -1,5 +1,6 @@ -//! @file test-isdirectory.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Tests IsDirectory #include diff --git a/src/libpsl-native/test/test-isexecutable.cpp b/src/libpsl-native/test/test-isexecutable.cpp index 0ccfd403171..e86e7250f4c 100644 --- a/src/libpsl-native/test/test-isexecutable.cpp +++ b/src/libpsl-native/test/test-isexecutable.cpp @@ -1,5 +1,6 @@ -//! @file test-isexecutable.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements test for isexecutable() #include diff --git a/src/libpsl-native/test/test-isfile.cpp b/src/libpsl-native/test/test-isfile.cpp index 3c87c095070..756c20f7c04 100644 --- a/src/libpsl-native/test/test-isfile.cpp +++ b/src/libpsl-native/test/test-isfile.cpp @@ -1,5 +1,6 @@ -//! @file test-isfile.cpp -//! @author Andrew Schwartzmeyer +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Tests Isfile #include diff --git a/src/libpsl-native/test/test-issymlink.cpp b/src/libpsl-native/test/test-issymlink.cpp index 68055227a76..0bddaeab986 100644 --- a/src/libpsl-native/test/test-issymlink.cpp +++ b/src/libpsl-native/test/test-issymlink.cpp @@ -1,5 +1,6 @@ -//! @file test-issymlink.cpp -//! @author George Fleming +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Implements test for isSymLink() #include diff --git a/src/libpsl-native/test/test-locale.cpp b/src/libpsl-native/test/test-locale.cpp index 9a2ab4ae4cb..1abc92feb98 100644 --- a/src/libpsl-native/test/test-locale.cpp +++ b/src/libpsl-native/test/test-locale.cpp @@ -1,5 +1,6 @@ -//! @file test-locale.cpp -//! @author Alex Jordan +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + //! @brief Unit tests for linux locale #include diff --git a/src/powershell-native/Install-PowerShellRemoting.ps1 b/src/powershell-native/Install-PowerShellRemoting.ps1 index 5bfbf0e6b99..30bc2f1a100 100644 --- a/src/powershell-native/Install-PowerShellRemoting.ps1 +++ b/src/powershell-native/Install-PowerShellRemoting.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + ##################################################################################################### # # Registers the WinRM endpoint for this instance of PowerShell. diff --git a/src/powershell-native/nativemsh/pwrshcommon/ClrHostWrapper.h b/src/powershell-native/nativemsh/pwrshcommon/ClrHostWrapper.h index 6001cc3f8ba..e543db457a8 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/ClrHostWrapper.h +++ b/src/powershell-native/nativemsh/pwrshcommon/ClrHostWrapper.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: ClrHostWrapper.h // // Contents: Wrapper for the CLR runtime host diff --git a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp index 33b79046a43..f212917e55c 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp +++ b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.cpp @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + #include #include #include diff --git a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.h b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.h index e73a4c8d70b..e406b886501 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.h +++ b/src/powershell-native/nativemsh/pwrshcommon/ConfigFileReader.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // --------------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: A class that extracts the path to $PSHOME and the path to its // CoreCLR from a configuration file. // --------------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshcommon/IPwrshCommonOutput.h b/src/powershell-native/nativemsh/pwrshcommon/IPwrshCommonOutput.h index 421ce8275fc..2f66ed10fd7 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/IPwrshCommonOutput.h +++ b/src/powershell-native/nativemsh/pwrshcommon/IPwrshCommonOutput.h @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma once @@ -28,4 +27,4 @@ namespace NativeMsh int messageId, LPCWSTR insertionParam) = 0; }; -} \ No newline at end of file +} diff --git a/src/powershell-native/nativemsh/pwrshcommon/NativeMsh.h b/src/powershell-native/nativemsh/pwrshcommon/NativeMsh.h index d08620b732f..ff2e82bf4d7 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/NativeMsh.h +++ b/src/powershell-native/nativemsh/pwrshcommon/NativeMsh.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: NativeMsh.h // // Contents: common code required to start powershell (exe and plugin) diff --git a/src/powershell-native/nativemsh/pwrshcommon/NativeMshConstants.h b/src/powershell-native/nativemsh/pwrshcommon/NativeMshConstants.h index 55702b062c1..d8bb368abe1 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/NativeMshConstants.h +++ b/src/powershell-native/nativemsh/pwrshcommon/NativeMshConstants.h @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma once @@ -70,4 +69,4 @@ namespace NativeMsh const unsigned int EXIT_CODE_INCOMPATIBLE_MSH_VERSION = 0xFFFA0000; const DWORD INVALID_APPDOMAIN_ID = (DWORD)-1; // TODO: valid uninitialized value? -} // namespace NativeMsh \ No newline at end of file +} // namespace NativeMsh diff --git a/src/powershell-native/nativemsh/pwrshcommon/SystemCallFacade.h b/src/powershell-native/nativemsh/pwrshcommon/SystemCallFacade.h index 52021a19af8..63b4b583ed1 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/SystemCallFacade.h +++ b/src/powershell-native/nativemsh/pwrshcommon/SystemCallFacade.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: SystemCallFacade.h // // Contents: Facade for Windows API system calls diff --git a/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.cpp b/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.cpp index 5f65d70777f..36927735714 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.cpp +++ b/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.cpp @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: WinSystemCallFacade.h // // Contents: Wraps the actual API calls for production scenarios. diff --git a/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.h b/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.h index ec8b2bf9c00..0d60b8838cd 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.h +++ b/src/powershell-native/nativemsh/pwrshcommon/WinSystemCallFacade.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: WinSystemCallFacade.h // // Contents: Wraps the actual API calls for production scenarios. diff --git a/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp b/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp index 81d9d903a8a..94c6cf2cc1f 100644 --- a/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp +++ b/src/powershell-native/nativemsh/pwrshcommon/pwrshcommon.cpp @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // // Implementation of common code used by native PowerShell diff --git a/src/powershell-native/nativemsh/pwrshexe/CssMainEntry.cpp b/src/powershell-native/nativemsh/pwrshexe/CssMainEntry.cpp index 7ea1bb6d92e..6cba4b49345 100644 --- a/src/powershell-native/nativemsh/pwrshexe/CssMainEntry.cpp +++ b/src/powershell-native/nativemsh/pwrshexe/CssMainEntry.cpp @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: CoreCLRHost.cpp // // Contents: Unmanaged startup point for powershell.exe console app. diff --git a/src/powershell-native/nativemsh/pwrshexe/MainEntry.cpp b/src/powershell-native/nativemsh/pwrshexe/MainEntry.cpp index 102074108f6..a5d93508505 100644 --- a/src/powershell-native/nativemsh/pwrshexe/MainEntry.cpp +++ b/src/powershell-native/nativemsh/pwrshexe/MainEntry.cpp @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // File: MainEntry.cpp // // Contents: Unmanaged startup point for powershell.exe console app. diff --git a/src/powershell-native/nativemsh/pwrshexe/OutputWriter.h b/src/powershell-native/nativemsh/pwrshexe/OutputWriter.h index 84033f7f03a..7f6de26f54e 100644 --- a/src/powershell-native/nativemsh/pwrshexe/OutputWriter.h +++ b/src/powershell-native/nativemsh/pwrshexe/OutputWriter.h @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. #pragma once diff --git a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp index 74355bb6af4..a55de1645c1 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp +++ b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Entry points for PowerShell plugin used to host powershell // in a WSMan service. // ---------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.h b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.h index c6105729be9..8bb3430c07e 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.h +++ b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.h @@ -1,5 +1,6 @@ -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // // Contents: Headers used by pwrshplugin. // pwrshplugin is totally unmanaged. diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp index edae970c290..8289ae858fa 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.cpp @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Source code for abstraction of CLR and worker differences between PowerShell versions. // pwrshplugin is totally unmanaged. // ---------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.h b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.h index 169e9803ae2..6594c8a76e7 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.h +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshclrhost.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Headers used by pwrshplugin. // pwrshplugin is totally unmanaged. // ---------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshheaders.h b/src/powershell-native/nativemsh/pwrshplugin/pwrshheaders.h index bfc12fb27c9..7029157cb06 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshheaders.h +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshheaders.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Headers used by internal windows teams to access certain // Powershell functionality // ---------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h index faf7b2378ae..1c73e6b6027 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugin.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Headers used by pwrshplugin. // pwrshplugin is totally unmanaged. // ---------------------------------------------------------------------- diff --git a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugindefs.h b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugindefs.h index 7cfa8c5ce26..6306dddf95f 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/pwrshplugindefs.h +++ b/src/powershell-native/nativemsh/pwrshplugin/pwrshplugindefs.h @@ -1,8 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + // ---------------------------------------------------------------------- // -// Microsoft Windows NT -// Copyright (c) Microsoft Corporation. All rights reserved. -// // Contents: Headers used by pwrshplugin. // pwrshplugin is totally unmanaged. // ---------------------------------------------------------------------- diff --git a/src/powershell/Program.cs b/src/powershell/Program.cs index e208c9cd754..d7a9ae34a46 100644 --- a/src/powershell/Program.cs +++ b/src/powershell/Program.cs @@ -1,6 +1,5 @@ -/********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. ---********************************************************************/ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Reflection; diff --git a/test/PSReadLine/AssemblyInfo.cs b/test/PSReadLine/AssemblyInfo.cs index 4b8e4a20134..c5af7817c2a 100644 --- a/test/PSReadLine/AssemblyInfo.cs +++ b/test/PSReadLine/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/test/PSReadLine/Program.cs b/test/PSReadLine/Program.cs index 0604aeb1048..532186898de 100644 --- a/test/PSReadLine/Program.cs +++ b/test/PSReadLine/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; @@ -43,7 +43,6 @@ static void Main() PSConsoleReadLine.SetKeyHandler(new[] {"F2"}, PSConsoleReadLine.ValidateAndAcceptLine, "", ""); PSConsoleReadLine.SetKeyHandler(new[] {"Enter"}, PSConsoleReadLine.AcceptLine, "", ""); - EngineIntrinsics executionContext; using (var ps = PowerShell.Create(RunspaceMode.CurrentRunspace)) { diff --git a/test/common/markdown/markdown.tests.ps1 b/test/common/markdown/markdown.tests.ps1 index edd26487313..1096d51587b 100644 --- a/test/common/markdown/markdown.tests.ps1 +++ b/test/common/markdown/markdown.tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $moduleRootFilePath = Split-Path -Path $PSScriptRoot -Parent # Identify the repository root path of the resource module diff --git a/test/csharp/test_Binders.cs b/test/csharp/test_Binders.cs index a6baa1c179d..45d4ed51ac7 100644 --- a/test/csharp/test_Binders.cs +++ b/test/csharp/test_Binders.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation.Language; diff --git a/test/csharp/test_CorePsPlatform.cs b/test/csharp/test_CorePsPlatform.cs index f1682e60012..82144630e32 100644 --- a/test/csharp/test_CorePsPlatform.cs +++ b/test/csharp/test_CorePsPlatform.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.IO; @@ -177,7 +179,6 @@ public static void TestFileIsHardLink() Assert.Equal(0, process.ExitCode); } - // Since there are now two references to the file, both are considered // hardlinks by our API (though all files are hardlinks on Linux) FileSystemInfo fd = new FileInfo(path); diff --git a/test/csharp/test_ExtensionMethods.cs b/test/csharp/test_ExtensionMethods.cs index 04fd1259eb0..08c6beb78b5 100644 --- a/test/csharp/test_ExtensionMethods.cs +++ b/test/csharp/test_ExtensionMethods.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; diff --git a/test/csharp/test_FileSystemProvider.cs b/test/csharp/test_FileSystemProvider.cs index 340c648356b..b01095bd715 100644 --- a/test/csharp/test_FileSystemProvider.cs +++ b/test/csharp/test_FileSystemProvider.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Collections.Generic; diff --git a/test/csharp/test_MshSnapinInfo.cs b/test/csharp/test_MshSnapinInfo.cs index ffc5bf825de..8bf6788384b 100644 --- a/test/csharp/test_MshSnapinInfo.cs +++ b/test/csharp/test_MshSnapinInfo.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; diff --git a/test/csharp/test_PSConfiguration.cs b/test/csharp/test_PSConfiguration.cs index ed0255950fc..e474ff699a0 100644 --- a/test/csharp/test_PSConfiguration.cs +++ b/test/csharp/test_PSConfiguration.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.IO; diff --git a/test/csharp/test_PSVersionInfo.cs b/test/csharp/test_PSVersionInfo.cs index 80714e7d7e8..81d9980e530 100644 --- a/test/csharp/test_PSVersionInfo.cs +++ b/test/csharp/test_PSVersionInfo.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; diff --git a/test/csharp/test_Runspace.cs b/test/csharp/test_Runspace.cs index 0407cbae6cc..c9f06112407 100644 --- a/test/csharp/test_Runspace.cs +++ b/test/csharp/test_Runspace.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; @@ -61,7 +63,6 @@ public void TestRunspaceWithPowerShell() } } - [Fact] public void TestRunspaceWithPowerShellAndInitialSessionState() { diff --git a/test/csharp/test_SecuritySupport.cs b/test/csharp/test_SecuritySupport.cs index 040c90dcc4d..8d82799dd6f 100644 --- a/test/csharp/test_SecuritySupport.cs +++ b/test/csharp/test_SecuritySupport.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; diff --git a/test/csharp/test_SessionState.cs b/test/csharp/test_SessionState.cs index 452bfc188ca..52281a29b73 100644 --- a/test/csharp/test_SessionState.cs +++ b/test/csharp/test_SessionState.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Collections; diff --git a/test/csharp/test_Utils.cs b/test/csharp/test_Utils.cs index ea9fc915065..2bd76217f82 100644 --- a/test/csharp/test_Utils.cs +++ b/test/csharp/test_Utils.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using Xunit; using System; using System.Management.Automation; diff --git a/test/docker/networktest/DockerRemoting.Tests.ps1 b/test/docker/networktest/DockerRemoting.Tests.ps1 index 06e61b89350..f624e3e413d 100644 --- a/test/docker/networktest/DockerRemoting.Tests.ps1 +++ b/test/docker/networktest/DockerRemoting.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $imageName = "remotetestimage" Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ BeforeAll { diff --git a/test/docker/networktest/New-DockerTestBuild.ps1 b/test/docker/networktest/New-DockerTestBuild.ps1 index 5cb9927d305..e1a4a9baabd 100644 --- a/test/docker/networktest/New-DockerTestBuild.ps1 +++ b/test/docker/networktest/New-DockerTestBuild.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param ( [switch]$Force, [switch]$UseExistingMsi ) $script:Constants = @{ diff --git a/test/powershell/Host/Base-Directory.Tests.ps1 b/test/powershell/Host/Base-Directory.Tests.ps1 index 977da42dfeb..4a944c2c635 100644 --- a/test/powershell/Host/Base-Directory.Tests.ps1 +++ b/test/powershell/Host/Base-Directory.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Configuration file locations" -tags "CI","Slow" { BeforeAll { diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 44cc5069510..09d0889afde 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Diagnostics # Minishell (Singleshell) is a powershell concept. diff --git a/test/powershell/Host/HostUtilities.Tests.ps1 b/test/powershell/Host/HostUtilities.Tests.ps1 index bb8fe6d6a9d..5779f4e496e 100644 --- a/test/powershell/Host/HostUtilities.Tests.ps1 +++ b/test/powershell/Host/HostUtilities.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "InvokeOnRunspace method argument error handling" -tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "InvokeOnRunspace method argument error handling" -tags "Feature" { BeforeAll { $command = [System.Management.Automation.PSCommand]::new() diff --git a/test/powershell/Host/PSVersionTable.Tests.ps1 b/test/powershell/Host/PSVersionTable.Tests.ps1 index 587867b2fb3..1df44bd89d7 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "PSVersionTable" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Host/Read-Host.Tests.ps1 b/test/powershell/Host/Read-Host.Tests.ps1 index 739c4b85a02..aaa8202e8de 100644 --- a/test/powershell/Host/Read-Host.Tests.ps1 +++ b/test/powershell/Host/Read-Host.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Read-Host" -Tags "Slow","Feature" { Context "[Console]::ReadKey() implementation on non-Windows" { BeforeAll { diff --git a/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 b/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 index 291dc1165c7..171c3edefbd 100644 --- a/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Tab completion bug fix" -Tags "CI" { It "Issue#682 - '[system.manage' should work" { diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index b199918dd7b..d95717f81c3 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "TabCompletion" -Tags CI { BeforeAll { $separator = [System.IO.Path]::DirectorySeparatorChar @@ -45,7 +47,6 @@ Describe "TabCompletion" -Tags CI { $completionText -join ' ' | Should Be 'Alignment Expression FormatString Label Width' } - It 'Should complete format-* hashtable on GroupBy: ' -TestCases ( @{cmd = 'Format-Table'}, @{cmd = 'Format-List'}, diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index bf1eba54d04..ac8168a2f82 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Windows Installer" -Tags "Scenario" { BeforeAll { diff --git a/test/powershell/Language/Classes/MSFT_778492.psm1 b/test/powershell/Language/Classes/MSFT_778492.psm1 index f54aefda072..52a0efb47a5 100644 --- a/test/powershell/Language/Classes/MSFT_778492.psm1 +++ b/test/powershell/Language/Classes/MSFT_778492.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $foo = 'MSFT_778492 script scope' diff --git a/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 b/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 index d10e5a2ed44..c54964860ce 100644 --- a/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 +++ b/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Add-Type -WarningAction Ignore @' public class Base diff --git a/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 index 4a6cb7053fb..9813455286a 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Attributes Test' -Tags "CI" { BeforeAll { @@ -48,8 +50,6 @@ namespace Dummy Add-Type -TypeDefinition $dummyAttributesSource } - - Context 'Property.Instance.ValidateSet.String' { class C1 { [ValidateSet("Present", "Absent")][string]$Ensure } # This call should not throw exception @@ -268,7 +268,6 @@ Describe 'ValidateSet support a dynamically generated set' -Tag "CI" { } } - /// Implement of test IValidateSetValuesGenerator public class GenValuesForParamNull : IValidateSetValuesGenerator { @@ -477,7 +476,6 @@ Describe 'ValidateSet support a dynamically generated set' -Tag "CI" { } } - function Get-TestValidateSetPS4 { [CmdletBinding()] diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index b9655a8bccc..941998df8e2 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -1,6 +1,5 @@ -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. Describe 'Positive Parse Properties Tests' -Tags "CI" { It 'PositiveParsePropertiesTest' { @@ -578,7 +577,6 @@ Describe 'Hidden Members Test ' -Tags "CI" { It "Access hidden property should still work" { $instance.hiddenZ | should be 42 } - # Formatting should not include hidden members by default $tableOutput = $instance | Format-Table -HideTableHeaders -AutoSize | Out-String It "Table formatting should not have included hidden member hiddenZ - should contain 10" { $tableOutput.Contains(10) | should be $true} @@ -628,7 +626,6 @@ Describe 'Scoped Types Test' -Tags "CI" { It "[C1]::new() in nested scope" { (f1) | should be "f1 scope" } It "'new-object C1' in nested scope" { (f2) | should be "f2 scope" } - It "[C1]::new() in nested scope (in pipeline)" { (1 | f1 | f2 | f1) | should be "f1 scope" } It "'new-object C1' in nested scope (in pipeline)" { (1 | f2 | f1 | f2) | should be "f2 scope" } } diff --git a/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 index 3274bf80947..e4fc11e4f58 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Break statements with classes' -Tags "CI" { function Get-Errors([string]$sourceCode) { diff --git a/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 index 258354c5062..ccb6b5c17f6 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Exceptions flow for classes' -Tags "CI" { $canaryHashtable = @{} @@ -145,7 +147,6 @@ class C } } - function m2() { $canary = Get-Canary diff --git a/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 index 45162a1dcba..9cd054ea1b2 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Misc Test' -Tags "CI" { Context 'Where' { diff --git a/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 index c25cb49c5c6..d28c898aa59 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'PSModuleInfo.GetExportedTypeDefinitions()' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'PSModuleInfo.GetExportedTypeDefinitions()' -Tags "CI" { It "doesn't throw for any module" { $discard = Get-Module -ListAvailable | ForEach-Object { $_.GetExportedTypeDefinitions() } $true | Should Be $true # we only verify that we didn't throw. This line contains a dummy Should to make pester happy. diff --git a/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 index d37635616c4..7d88e5ccb76 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Script with a class definition run path" -Tags "CI" { $TestCases = @( diff --git a/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 index 4c014092ecd..69619df0964 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Additional static method tests" -Tags "CI" { Context "Basic static member methods" { diff --git a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 index f16a39db1c9..b62f45311c3 100644 --- a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'NestedModules' -Tags "CI" { function New-TestModule { @@ -37,7 +39,6 @@ Describe 'NestedModules' -Tags "CI" { try { - # Create modules in TestDrive:\ New-TestModule -Name NoRoot -NestedContents @( 'class A { [string] foo() { return "A1"} }', diff --git a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 index 13e71cc3bbf..e2dfc8d928e 100644 --- a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 @@ -1,6 +1,5 @@ -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. Describe 'Classes inheritance syntax' -Tags "CI" { @@ -362,7 +361,6 @@ Describe 'Classes methods with inheritance' -Tags "CI" { } } - Describe 'Classes inheritance ctors syntax errors' -Tags "CI" { #DotNet.Interface.NotImplemented diff --git a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 index b4120d072d4..57c99f91e87 100644 --- a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'using module' -Tags "CI" { BeforeAll { $originalPSModulePath = $env:PSModulePath @@ -433,7 +435,6 @@ function foo() } } - # here we are back to normal $env:PSModulePath, but all modules are there Context "Module by path" { BeforeAll { diff --git a/test/powershell/Language/Classes/scripting.enums.tests.ps1 b/test/powershell/Language/Classes/scripting.enums.tests.ps1 index daf8fbb432f..7e6c3d3af86 100644 --- a/test/powershell/Language/Classes/scripting.enums.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.enums.tests.ps1 @@ -1,6 +1,5 @@ -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. Describe 'enums' -Tags "CI" { Context 'basic enums' { diff --git a/test/powershell/Language/CompletionTestSupport.psm1 b/test/powershell/Language/CompletionTestSupport.psm1 index a15b57a4cec..71b4acc7b4b 100644 --- a/test/powershell/Language/CompletionTestSupport.psm1 +++ b/test/powershell/Language/CompletionTestSupport.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. class CompletionResult { diff --git a/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 b/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 index 9cc0b6fccd4..75a2f426a41 100644 --- a/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 +++ b/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "DotNetAPI" -Tags "CI" { $posh_E = 2.718281828459045 $posh_pi = 3.14159265358979 diff --git a/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 b/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 index b8a609008f6..fb1283287cf 100644 --- a/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 +++ b/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe ".NET class interoperability" -Tags "CI" { It "Should access types in System.Console" { [System.Console]::TreatControlCAsInput | Should Be $false diff --git a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 index c3357854ac8..06c78de8c00 100644 --- a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ComparisonOperator" -tag "CI" { It "Should be for " -TestCases @( diff --git a/test/powershell/Language/Operators/RangeOperator.Tests.ps1 b/test/powershell/Language/Operators/RangeOperator.Tests.ps1 index 055de78d572..e558a8b9caa 100644 --- a/test/powershell/Language/Operators/RangeOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/RangeOperator.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Range Operator" -Tags CI { Context "Range integer operations" { It "Range operator generates arrays of integers" { diff --git a/test/powershell/Language/Operators/SplitOperator.Tests.ps1 b/test/powershell/Language/Operators/SplitOperator.Tests.ps1 index e132043838d..907ebf18b74 100644 --- a/test/powershell/Language/Operators/SplitOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/SplitOperator.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Split Operator" -Tags CI { Context "Binary split operator" { It "Binary split operator can split array of value" { diff --git a/test/powershell/Language/Parser/Ast.Tests.ps1 b/test/powershell/Language/Parser/Ast.Tests.ps1 index 25ffd6d05a3..ca87e3b500e 100644 --- a/test/powershell/Language/Parser/Ast.Tests.ps1 +++ b/test/powershell/Language/Parser/Ast.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using Namespace System.Management.Automation.Language Describe "The SafeGetValue method on AST returns safe values" -Tags "CI" { It "A hashtable is returned from a HashtableAst" { diff --git a/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 b/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 index b3948430775..40e47520913 100644 --- a/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 +++ b/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Automatic variable $input' -Tags "CI" { # Skip on hold for discussion on https://github.com/PowerShell/PowerShell/issues/1563 diff --git a/test/powershell/Language/Parser/BNotOperator.Tests.ps1 b/test/powershell/Language/Parser/BNotOperator.Tests.ps1 index 3c8c0f12f75..3dc9be6c14b 100644 --- a/test/powershell/Language/Parser/BNotOperator.Tests.ps1 +++ b/test/powershell/Language/Parser/BNotOperator.Tests.ps1 @@ -1,4 +1,5 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $baseTypes = @{ [SByte] = 'sbyte'; [Byte] = 'byte' diff --git a/test/powershell/Language/Parser/Conversions.Tests.ps1 b/test/powershell/Language/Parser/Conversions.Tests.ps1 index b546f34c421..5cade9d22ea 100644 --- a/test/powershell/Language/Parser/Conversions.Tests.ps1 +++ b/test/powershell/Language/Parser/Conversions.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'conversion syntax' -Tags "CI" { # these test suite covers ([]).() syntax. # it mixes two purposes: casting and super-class method calls. @@ -218,7 +220,6 @@ Describe 'method conversion' -Tags 'CI' { static [timespan] Foo([timespan] $i, [timespan] $j, [timespan] $k, [timespan] $l, [timespan] $m, [timespan] $n, [timespan] $o, [timespan] $p) {return $i} } - It 'converts static method as Func does not throw' { {[Func[int, int]] [M]::Thrice} | Should Not Throw } @@ -227,7 +228,6 @@ Describe 'method conversion' -Tags 'CI' { ([Func[int, int]] [M]::Thrice) | Should Not BeNullOrEmpty } - It 'calls static method as Func' { $f = [Func[int, int]] [M]::Thrice [M]::Apply(1, $f) | Should be 3 diff --git a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 index 2cd7b0ce1e8..1284faaf161 100644 --- a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 +++ b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <# Much of this script belongs in a module, but we don't support importing classes yet. #> diff --git a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 index 288f3c45cc9..20f041a3ba9 100644 --- a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 +++ b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $powershellexe = (get-process -id $PID).mainmodule.filename Describe "Clone array" -Tags "CI" { @@ -72,7 +74,6 @@ Describe "ScriptBlockAst.GetScriptBlock throws on error" -Tags "CI" { { $ast.GetScriptBlock() } | Should Throw } - It "with semantic errors" { $ast = [System.Management.Automation.Language.Parser]::ParseInput('function foo{param()begin{}end{[ref][ref]1}dynamicparam{}}', [ref]$null, [ref]$e) diff --git a/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 b/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 index 7ec310f8772..c894460dcc0 100644 --- a/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 +++ b/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. if ( $IsCoreCLR ) { return } diff --git a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 index b259b5b07cd..7ae9e3564bb 100644 --- a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Argument transformation attribute on optional argument with explicit $null' -Tags "CI" { $tdefinition = @' @@ -67,7 +69,6 @@ Describe 'Argument transformation attribute on optional argument with explicit $ return $Address } - It "There was no error importing the in-memory module" { $ErrorImportingModule | Should Be $null } diff --git a/test/powershell/Language/Parser/Parser.Tests.ps1 b/test/powershell/Language/Parser/Parser.Tests.ps1 index 95b9eb2950c..0edc62fda66 100644 --- a/test/powershell/Language/Parser/Parser.Tests.ps1 +++ b/test/powershell/Language/Parser/Parser.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" { BeforeAll { $functionDefinitionFile = Join-Path -Path $TestDrive -ChildPath "functionDefinition.ps1" $functionDefinition = @' @@ -220,7 +222,6 @@ } } - It "Test that invoke has a higher precedence for a script than for an executable. (line 279)" { "1">$testfile $result = ExecuteCommand ". $testfile" @@ -374,7 +375,6 @@ foo``u{2195}abc } } - It "This test checks that array substitution occurs inside double quotes. (line 646)" { $result = ExecuteCommand '$MyArray = "a","b";"Hello $MyArray"' $result | should be "Hello a b" diff --git a/test/powershell/Language/Parser/Parsing.Tests.ps1 b/test/powershell/Language/Parser/Parsing.Tests.ps1 index 0cd3bbbb475..9737a090100 100644 --- a/test/powershell/Language/Parser/Parsing.Tests.ps1 +++ b/test/powershell/Language/Parser/Parsing.Tests.ps1 @@ -1,4 +1,6 @@ -set-strictmode -v 2 +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +set-strictmode -v 2 Describe 'for statement parsing' -Tags "CI" { ShouldBeParseError 'for' MissingOpenParenthesisAfterKeyword 4 -CheckColumnNumber @@ -22,7 +24,6 @@ Describe 'for statement parsing' -Tags "CI" { ShouldBeParseError ':lab for($a;$b;$c' MissingEndParenthesisAfterStatement 17 ShouldBeParseError ':lab for($a;$b;$c)' MissingLoopStatement 18 - Test-ErrorStmt 'for z' 'for' Test-ErrorStmt 'for {}' 'for' Test-ErrorStmt 'for ()' 'for ()' @@ -110,7 +111,6 @@ Describe 'do/while statement statement parsing' -Tags "CI" { Test-ErrorStmt ':lab do {1} while($false' ':lab do {1} while($false' '{1}' '1' '1' '1' '$false' '$false' '$false' } - Describe 'do/while statement statement parsing' -Tags "CI" { ShouldBeParseError 'do' MissingLoopStatement 3 -CheckColumnNumber ShouldBeParseError 'do {}' MissingWhileOrUntilInDoWhile 6 -CheckColumnNumber @@ -144,7 +144,6 @@ Describe 'trap statement parsing' -Tags "CI" { Test-ErrorStmt 'trap [int]' 'trap [int]' '[int]' } - Describe 'named blocks parsing' -Tags "CI" { ShouldBeParseError 'begin' MissingNamedStatementBlock 5 ShouldBeParseError 'process' MissingNamedStatementBlock 7 @@ -241,7 +240,6 @@ Describe 'switch statement parsing' -Tags "CI" { Test-ErrorStmt 'switch (1) {default {9} default{2}' 'switch (1) {default {9} default{2}' 'default' '{9}' '9' '9' '9' 'default' '{2}' '2' '2' '2' '1' '1' '1' } - Describe 'function statement parsing' -Tags "CI" { ShouldBeParseError 'function' MissingNameAfterKeyword 8 ShouldBeParseError 'function foo' MissingFunctionBody 12 @@ -260,12 +258,10 @@ Describe 'function statement parsing' -Tags "CI" { Test-ErrorStmt 'function foo($a = 1' 'function foo($a = 1' '$a = 1' '1' '$a' } - Describe 'assignment statement parsing' -Tags "CI" { ShouldBeParseError '$a,$b += 1,2' InvalidLeftHandSide 0 } - Describe 'splatting parsing' -Tags "CI" { ShouldBeParseError '@a' SplattingNotPermitted 0 ShouldBeParseError 'foreach (@a in $b) {}' SplattingNotPermitted 9 diff --git a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 index 0b7d9a7f9e0..d393a03ea88 100644 --- a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 +++ b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Redirection operator now supports encoding changes" -Tags "CI" { BeforeAll { $asciiString = "abc" @@ -9,7 +11,6 @@ Describe "Redirection operator now supports encoding changes" -Tags "CI" { $asciiCR = [string][char]10 } - # If Out-File -Encoding happens to have a default, be sure to # save it away $SavedValue = $null diff --git a/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 b/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 index 8f270d79f34..217b4402089 100644 --- a/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 +++ b/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Type accelerators" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 index da0b7be0682..3018088c162 100644 --- a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Using assembly" -Tags "CI" { @@ -91,7 +93,6 @@ public class ABC {} "@ $assemblies -contains "UsingAssemblyTest$guid" | Should Be $true - $assemblies = pwsh -noprofile -command @" using assembly System.Drawing [Appdomain]::CurrentDomain.GetAssemblies().GetName().Name diff --git a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 index e2f2a22c7ef..2167560661e 100644 --- a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # There is an automatic 'using namespace system' which is # tested by this test, so don't uncomment the following: diff --git a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 index 3edf8d8aae3..bdb1938e488 100644 --- a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 +++ b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { BeforeAll { $orgin = $GLOBAL:errorActionPreference } diff --git a/test/powershell/Language/Scripting/Array.Tests.ps1 b/test/powershell/Language/Scripting/Array.Tests.ps1 index 7006cec9303..d2d2013b78e 100644 --- a/test/powershell/Language/Scripting/Array.Tests.ps1 +++ b/test/powershell/Language/Scripting/Array.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ArrayExpression Tests" -Tags "CI" { It "@([object[]](1,2,3)) should return a 3-element array of object[]" { $result = @([object[]](1,2,3)) diff --git a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 index 04cc587302a..93fdf966c71 100644 --- a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 +++ b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Test restricted language check method on scriptblocks" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Test restricted language check method on scriptblocks" -Tags "CI" { BeforeAll { set-strictmode -v 2 function list { diff --git a/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 b/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 index f7e5b4dfc93..732d47a702a 100644 --- a/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 +++ b/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Cmdlet declaration statement" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Cmdlet declaration statement" -Tags "CI" { $testData = @( @{ Name = 'Verify non-cmdlet formatted names are allowed'; Script = ' @@ -106,7 +108,6 @@ $a }'}) - It '' -TestCases $testData { param($Name, $script) diff --git a/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 b/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 index 6abd4969193..51c88a9c0ca 100644 --- a/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 +++ b/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Common parameters support for script cmdlets" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Common parameters support for script cmdlets" -Tags "CI" { BeforeEach { $rs = [system.management.automation.runspaces.runspacefactory]::CreateRunspace() $rs.open() @@ -144,7 +146,6 @@ $_.FullyQualifiedErrorId | Should Be "ActionPreferenceStopException" } # Exception: "Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: error foo" - # BUG in runspace api. #$ps.error.count | Should Be 1 @@ -307,7 +308,6 @@ } } - Context 'confirmimpact support: High under the non-interactive host' { BeforeAll { $script = ' diff --git a/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 b/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 index 268fffc1389..163f94ad7a4 100644 --- a/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 +++ b/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Test constrained language mode" -Tags "CI" { It "dynamic invocation on non-PowerShell thread should work" { diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 index 53b0dfeca24..488de208b49 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 @@ -1,8 +1,5 @@ -## -## Copyright (c) Microsoft Corporation. All rights reserved. -## -## Script debugging tests -## +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Breakpoints set on custom FileSystem provider files should work" -Tags "CI" { # @@ -53,7 +50,6 @@ Describe "Breakpoints set on custom FileSystem provider files should work" -Tags } } - Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" { # # @@ -108,7 +104,6 @@ Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" { } } - Describe "Function calls clear debugger cache too early" -Tags "CI" { # # @@ -163,7 +158,6 @@ Describe "Function calls clear debugger cache too early" -Tags "CI" { } } - Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { # # @@ -211,7 +205,6 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { } } - Context "COM TESTS" { # DRT for 133807 SetBreakpointWithShortPath BeforeAll { @@ -248,7 +241,6 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { } } - Describe "Unit tests for various script breakpoints" -Tags "CI" { # # @@ -411,7 +403,6 @@ Describe "Unit tests for various script breakpoints" -Tags "CI" { } } - Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" { # # @@ -499,7 +490,6 @@ Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" { } } - Describe "Unit tests for line breakpoints on modules" -Tags "CI" { # # @@ -604,7 +594,6 @@ Describe "Unit tests for line breakpoints on modules" -Tags "CI" { } } - Describe "Sometimes line breakpoints are ignored" -Tags "CI" { ##################################################################################### # diff --git a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 index 5d883b85483..d0c278646c3 100644 --- a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $script1 = @' 'aaa'.ToString() > $null 'aa' > $null diff --git a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 index ff9398b0781..1450708dfe2 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 @@ -1,8 +1,5 @@ -## -## Copyright (c) Microsoft Corporation. All rights reserved. -## -## Debugging in Host tests -## +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Tests Debugger GetCallStack() on runspaces when attached to a WinRM host process" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/Delegates.Tests.ps1 b/test/powershell/Language/Scripting/Delegates.Tests.ps1 index d2075145bbe..fe40314b0ee 100644 --- a/test/powershell/Language/Scripting/Delegates.Tests.ps1 +++ b/test/powershell/Language/Scripting/Delegates.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Test for conversion b/w script block and delegate' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Test for conversion b/w script block and delegate' -Tags "CI" { BeforeAll { function lineno { diff --git a/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 b/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 index 595e7d660e0..393639b33ce 100644 --- a/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 +++ b/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "DeserializedMethods" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "DeserializedMethods" -Tags "CI" { It "Deserialized objects shouldn't ever have any methods (unless they are primitive known types)" { $a = [collections.arraylist]::new() $null = $a.Add(1) diff --git a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 index a1192217b00..47e08ee6e1c 100644 --- a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests conversion of deserialized types to original type using object properties." -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests conversion of deserialized types to original type using object properties." -Tags "CI" { BeforeAll { # Create new types and test functions. $type1,$type2,$type3,$type4 = Add-Type -PassThru -TypeDefinition @' diff --git a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 index 7f487ee718f..de3b28082e0 100644 --- a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 +++ b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Dynamic parameter support in script cmdlets." -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Dynamic parameter support in script cmdlets." -Tags "CI" { BeforeAll { Class MyTestParameter { [parameter(ParameterSetName = 'pset1', position=0, mandatory=1)] diff --git a/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 b/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 index 53b1fea953e..ec11d8732d0 100644 --- a/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 +++ b/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Parallel foreach syntax" -Tags "CI" { Context 'Should be able to retrieve AST of parallel foreach, error in regular case' { diff --git a/test/powershell/Language/Scripting/Generics.Tests.ps1 b/test/powershell/Language/Scripting/Generics.Tests.ps1 index c23fa88f60c..44099722df7 100644 --- a/test/powershell/Language/Scripting/Generics.Tests.ps1 +++ b/test/powershell/Language/Scripting/Generics.Tests.ps1 @@ -1,4 +1,6 @@ -using namespace system.collections.generic +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +using namespace system.collections.generic using namespace System.Management.Automation Describe "Generics support" -Tags "CI" { # list and stack are in different assemblies, and dictionary diff --git a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 index ba533cc39d4..9a85a035600 100644 --- a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { BeforeAll { class SampleClass5 { [int]$a @@ -113,7 +115,6 @@ } } - It 'Creating an object of an existing type from hashtable should succeed' { $result = [System.Management.Automation.Host.Coordinates]@{X=10;Y=33} $result.X | should be 10 diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 index c9ba850a167..3e4d1a46bb6 100644 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ b/test/powershell/Language/Scripting/I18n.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Testing of script internationalization' -Tags "CI" { BeforeAll { $dir=$PSScriptRoot @@ -12,7 +14,6 @@ Describe 'Testing of script internationalization' -Tags "CI" { $global:PSDefaultParameterValues = $defaultParamValues } - It 'convertFromString-Data should work with data statement.' { data mydata @@ -148,7 +149,6 @@ Describe 'Testing of script internationalization' -Tags "CI" { $exception | Should Match $Expected } - it 'Check alternate syntax that also supports complex variable names' { & { diff --git a/test/powershell/Language/Scripting/Indexer.Tests.ps1 b/test/powershell/Language/Scripting/Indexer.Tests.ps1 index b2dc681a6a5..9ba3e4a2727 100644 --- a/test/powershell/Language/Scripting/Indexer.Tests.ps1 +++ b/test/powershell/Language/Scripting/Indexer.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Tests for indexers' -Tags "CI" { It 'Indexer in dictionary' { diff --git a/test/powershell/Language/Scripting/LineEndings.Tests.ps1 b/test/powershell/Language/Scripting/LineEndings.Tests.ps1 index 2c7ec462b89..181b433bf14 100644 --- a/test/powershell/Language/Scripting/LineEndings.Tests.ps1 +++ b/test/powershell/Language/Scripting/LineEndings.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Line endings' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Line endings' -Tags "CI" { BeforeAll { $lf = "`n" $cr = "`r" diff --git a/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 b/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 index 984bd885212..a899630cb1d 100644 --- a/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 +++ b/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Testing of MyInvocation' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Testing of MyInvocation' -Tags "CI" { It 'MyInvocation works in Function' { function myfunc diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 index 8fd95be9e67..e9a629be154 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Native Command Arguments" -tags "CI" { # When passing arguments to native commands, quoted segments that contain # spaces need to be quoted with '"' characters when they are passed to the diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index f3823b93563..5f3000073fe 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Native pipeline should have proper encoding' -tags 'CI' { It '$OutputEncoding should be set to UTF8 without BOM' { $OutputEncoding.BodyName | Should Be "utf-8" diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 index a333adb4091..db49c9f2079 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "NativeLinuxCommands" -tags "CI" { BeforeAll { $originalDefaultParams = $PSDefaultParameterValues.Clone() diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 index f4aa0b5d994..93357815a43 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Native streams behavior with PowerShell" -Tags 'CI' { $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 index 1adeba86040..d301bc3a14d 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Native UNIX globbing tests' -tags "CI" { diff --git a/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 b/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 index c70951e6b9f..1c40c701081 100644 --- a/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 +++ b/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" { BeforeAll { If (-not $IsCoreCLR) { Get-WmiObject -Query "select * from win32_environment where name='TestWmiInstance'" | Remove-WmiObject @@ -16,7 +18,6 @@ $a.one | Should Be 1 } - Context 'Select-Xml cmdlet - Namespace parameter must take IDictionary' { $script:a = $null @@ -33,7 +34,6 @@ - '@ @@ -45,7 +45,6 @@ It '$a should not be $null' { $script:a | Should Not Be $null } } - It 'Set-WmiInstance cmdlet - Argument parameter must take IDictionary' -skip:$IsCoreCLR { $script:a = $null diff --git a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 index e6e4d01e9a8..68d0388df55 100644 --- a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 +++ b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests OutVariable only" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests OutVariable only" -Tags "CI" { BeforeAll { function get-foo1 @@ -371,7 +373,6 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { get-foo7 "foo-output" -ev script:foo_err3 -ov script:foo_out3 | get-foo7 -ev script:foo_err4 -ov script:foo_out4 } - get-bar5 -ev script:bar_err -ov script:bar_out 2>&1 > $null $script:foo_out1 | Should be "foo-output" diff --git a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 index 2fbf79f845f..589597013fc 100644 --- a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests for parameter binding" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests for parameter binding" -Tags "CI" { Context 'Test of Mandatory parameters' { BeforeAll { $f = "function get-foo { param([Parameter(mandatory=`$true)] `$a) `$a };" @@ -360,7 +362,6 @@ get-fooc } - It "No default value specified should not cause error when nothing is set on parameter" { function get-food { diff --git a/test/powershell/Language/Scripting/Requires.Tests.ps1 b/test/powershell/Language/Scripting/Requires.Tests.ps1 index 192b2b273f0..d4a25d04a70 100644 --- a/test/powershell/Language/Scripting/Requires.Tests.ps1 +++ b/test/powershell/Language/Scripting/Requires.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Requires tests" -Tags "CI" { Context "Parser error" { diff --git a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 index e8dfdcaba26..3e547165457 100644 --- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 +++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 @@ -1,4 +1,6 @@ -$ProgressPreference = "SilentlyContinue" +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +$ProgressPreference = "SilentlyContinue" Describe 'get-help HelpFunc1' -Tags "Feature" { BeforeAll { @@ -80,7 +82,6 @@ Describe 'get-help HelpFunc1' -Tags "Feature" { function helpFunc1 {} } - Context 'Get-Help helpFunc1' { $x = get-help helpFunc1 TestHelpFunc1 $x @@ -329,7 +330,6 @@ Describe 'get-help other tests' -Tags "CI" { .Synopsis - .Component component #> diff --git a/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 b/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 index 0b850626269..ff315f5e527 100644 --- a/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 +++ b/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Scripting.Followup.Tests" -Tags "CI" { It "'[void](New-Item) | ' should work and behave like passing AutomationNull to the pipe" { try { diff --git a/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 b/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 index 4030372105b..435ccea893f 100644 --- a/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 +++ b/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 @@ -1,4 +1,6 @@ -function Run-TestOnWinFull +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +function Run-TestOnWinFull { [CmdletBinding()] param( [string]$name ) diff --git a/test/powershell/Language/Scripting/Trap.Tests.ps1 b/test/powershell/Language/Scripting/Trap.Tests.ps1 index 6d72b896425..ed6537102e8 100644 --- a/test/powershell/Language/Scripting/Trap.Tests.ps1 +++ b/test/powershell/Language/Scripting/Trap.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Test trap" -Tags "CI" { Context "Trap with flow control" { diff --git a/test/powershell/Language/Scripting/TryCatch.Tests.ps1 b/test/powershell/Language/Scripting/TryCatch.Tests.ps1 index 5d27a66fa7a..fa82524fc6e 100644 --- a/test/powershell/Language/Scripting/TryCatch.Tests.ps1 +++ b/test/powershell/Language/Scripting/TryCatch.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. ############################################################# # diff --git a/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 b/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 index db5a5a32c26..8fc59e40a62 100644 --- a/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Try { if ( ! $IsWindows ) { $PSDefaultParameterValues['it:pending'] = $true diff --git a/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 b/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 index c60063f17a6..e1096648561 100644 --- a/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { if ( ! $IsWindows ) { $PSDefaultParameterValues['it:pending'] = $true diff --git a/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 b/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 index 0751cf9d868..b104ec8268d 100644 --- a/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { # Get-CimClass works only on windows right now if ( ! $IsWindows ) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 index 1b76c0d95bf..4d496bb95e2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "History cmdlet test cases" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "History cmdlet test cases" -Tags "CI" { Context "Simple History Tests" { BeforeEach { $setting = [system.management.automation.psinvocationsettings]::New() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 index d0027a1a30e..2fb84285d36 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Import-Module" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Import-Module" -Tags "CI" { $moduleName = "Microsoft.PowerShell.Security" BeforeAll { $originalPSModulePath = $env:PSModulePath diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 index 483342b7033..ba6b3be51bc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Job Cmdlet Tests" -Tag "CI" { Context "Simple Jobs" { BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 index a0ed821d9ff..51289834d9b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Out-Default Tests" -tag CI { BeforeAll { # due to https://github.com/PowerShell/PowerShell/issues/3405, `Out-Default -Transcript` emits output to pipeline diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 index 4ca7a747df3..2900806507c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Out-Host Tests" -tag CI { BeforeAll { $th = New-TestHost diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 index 29f57714065..d2e201d5b86 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { # Skip all tests on non-windows and non-PowerShellCore and non-elevated platforms. @@ -517,7 +519,6 @@ namespace PowershellTestConfigNamespace ValidateRemoteEndpoint -TestSessionConfigName $TestSessionConfigName -ScriptToExecute "return `$script:testvariable" -ExpectedOutput "testValue" -ExpectedError $null } - It "Validate Register-PSSessionConfiguration -AccessMode parameter" { $null = Register-PSSessionConfiguration -Name $TestSessionConfigName -path $LocalConfigFilePath -AccessMode Disabled -Force @@ -525,7 +526,6 @@ namespace PowershellTestConfigNamespace ValidateRemoteEndpoint -TestSessionConfigName $TestSessionConfigName -ScriptToExecute $null -ExpectedOutput $null -ExpectedError "RemoteConnectionDisallowed,PSSessionOpenFailed" } - It "Validate Register-PSSessionConfiguration -ModulesToImport parameter" -Pending { $null = Register-PSSessionConfiguration -Name $TestSessionConfigName -ModulesToImport $LocalTestModulePath -Force diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Pester.Commands.Cmdlets.GetCommand.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Pester.Commands.Cmdlets.GetCommand.Tests.ps1 index 856992eca76..1898dd3bd5e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Pester.Commands.Cmdlets.GetCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Pester.Commands.Cmdlets.GetCommand.Tests.ps1 @@ -1,6 +1,5 @@ -## -## Copyright (c) Microsoft Corporation. All rights reserved. -## +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { @@ -77,7 +76,6 @@ Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { $observed | Should BeExactly $result } - It "Get-Command -ShowCommandInfo ParameterSets property field test" { $properties = ($commandInfo.ParameterSets[0] | Get-Member -MemberType NoteProperty) $propertiesAsString = $properties.name | out-string diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 index 444064559e5..a7fc59fa049 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remote module tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 index b9b6d1e12a0..aed53b35860 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remote import-module tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 index ea6088ef11f..8344fb38cc8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "SSH Remoting Cmdlet Tests" -Tags "Feature" { It "Enter-PSSession HostName parameter set should throw error for invalid key path" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 index aad3d5c773f..0ff2204904a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Remove-Module" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Remove-Module" -Tags "CI" { $moduleName = "Microsoft.PowerShell.Security" BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 index 836042a3976..bf838df1e8c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-PSDebug" -Tags "CI" { Context "Tracing can be used" { AfterEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/TestGetCommand.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/TestGetCommand.Tests.ps1 index 11b0e6f7841..bea1baca67d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/TestGetCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/TestGetCommand.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-Command Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-Command Tests" -Tags "CI" { BeforeAll { function TestGetCommand-DynamicParametersDCR { @@ -39,7 +41,6 @@ $p1 = [System.Management.Automation.RuntimeDefinedParameter]::new("OneString",[string],$ac1) $dynamicParamDictionary.Add("OneString",$p1) - $attr2 = [System.Management.Automation.ParameterAttribute]::new() $attr2.Mandatory = $false $attr2.ParameterSetName = "__AllParameterSets" @@ -61,7 +62,6 @@ $p1 = [System.Management.Automation.RuntimeDefinedParameter]::new("OneString",[string],$ac1) $dynamicParamDictionary.Add("OneString",$p1) - $attr2 = [System.Management.Automation.ParameterAttribute]::new() $attr2.Mandatory = $false $attr2.ParameterSetName = "__AllParameterSets" @@ -221,7 +221,6 @@ $results.ToString() | Should Match "-Delimiter" } - It "Test Script Lookup Positive Script Info" { $tempFile = "mytempfile.ps1" $fullPath = Join-Path $TestDrive -ChildPath $tempFile diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 index e48f0473f89..d0765d7b847 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <############################################################################################ # File: CounterTestHelperFunctions.ps1 # Provides functions common to the performance counter Pester tests. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 index 9089a97d308..85178d0b347 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <############################################################################################ # File: Export-Counter.Tests.ps1 # Provides Pester tests for the Export-Counter cmdlet. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 index 7d1f24c93a2..40077617bfe 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <############################################################################################ # File: Get-Counter.Tests.ps1 # Provides Pester tests for the Get-Counter cmdlet. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 index 18dbc260e08..13ac15770ab 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Get-WinEvent' -Tags "CI" { BeforeAll { if ( ! $IsWindows ) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 index 0a07e9f940f..843f4ed3de8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <############################################################################################ # File: Import-Counter.Tests.ps1 # Provides Pester tests for the Import-Counter cmdlet. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 index a4479bd3fe7..e78f3d968fe 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'New-WinEvent' -Tags "CI" { Context "New-WinEvent tests" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 index 0de45d4cb1c..74eb6200e58 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 @@ -1,6 +1,5 @@ -# This is a Pester test suite to validate the cmdlets in LocalAccounts module -# # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # Module removed due to #4272 # disabling tests diff --git a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroupMember.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroupMember.Tests.ps1 index 1601287a65f..64864a4cd91 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroupMember.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalGroupMember.Tests.ps1 @@ -1,6 +1,5 @@ -# This is a Pester test suite to validate the cmdlets in LocalAccounts module -# # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # Module removed due to #4272 # disabling tests diff --git a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1 index 445921971e8..a0ea2f786b4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1 @@ -1,6 +1,5 @@ -# This is a Pester test suite to validate the cmdlets in LocalAccounts module -# # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # Module removed due to #4272 # disabling tests @@ -252,7 +251,6 @@ try { $result.AccountExpires | Should BeNullOrEmpty } - It "Errors on both AccountExpires and AccountNeverExpires being set" { $sb = { New-LocalUser TestUserNew1 -NoPassword -AccountExpires $dateInFuture -AccountNeverExpires @@ -260,7 +258,6 @@ try { VerifyFailingTest $sb "InvalidParameters,Microsoft.PowerShell.Commands.NewLocalUserCommand" } - It "Can set empty string for Description" { $result = New-LocalUser TestUserNew1 -NoPassword -Description "" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 index 302f17c8904..4452da3b5bb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Add-Content cmdlet tests" -Tags "CI" { $file1 = "file1.txt" Setup -File "$file1" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 index 62ec93be8b8..2c313a053bd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Basic Alias Provider Tests" -Tags "CI" { BeforeAll { $testAliasName = "TestAlias" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 index 996088c5171..3eb9fd66f26 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # get a random string of characters a-z and A-Z function Get-RandomString { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 index e050af1c52a..86d649a6816 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Clear-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 index 96316367ac8..78924f81814 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Clear-Item tests" -Tag "CI" { BeforeAll { ${myClearItemVariableTest} = "Value is here" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 index 219e36c3e79..8bd2ee56bd0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Control Service cmdlet tests" -Tags "Feature","RequireAdminOnWindows" { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 index 762ecc4048b..e376153aec7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Convert-Path tests" -Tag CI { It "Convert-Path should handle provider qualified paths" { Convert-Path "FileSystem::${TESTDRIVE}" | should be "${TESTDRIVE}" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 index b09c6eae3a3..608e580d333 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 @@ -1,8 +1,7 @@ -# This is a Pester test suite to validate Copy-Item remotely using a remote session. -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# +# Licensed under the MIT License. + +# This is a Pester test suite to validate Copy-Item remotely using a remote session. # If PS Remoting is not available, do not run the suite. function ShouldRun diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index f514e1e45ce..5aad92b50e3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Basic FileSystem Provider Tests" -Tags "CI" { BeforeAll { $testDir = "TestDir" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 index 1956a558f9f..1a52d2c7a1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-ChildItem" -Tags "CI" { Context 'FileSystem provider' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 index e77b9bff236..20b956efc97 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # # TEST SPECIFIC HELPER METHODS FOR TESTING Get-ComputerInfo cmdlet # @@ -396,7 +398,6 @@ public static extern int LCIDToLocaleName(uint localeID, System.Text.StringBuild $connectionStatus = 13 # default NetConnectionStatus.Other if ($adapter.NetConnectionStatus) { $connectionStatus = $adapter.NetConnectionStatus} - $config =$configHash.Item([string]$adapter.Index) $dHCPEnabled = $null @@ -444,7 +445,6 @@ public static extern int LCIDToLocaleName(uint localeID, System.Text.StringBuild 'Architecture'=$processor.Architecture; 'AddressWidth'=$processor.AddressWidth; - 'Availability'=$processor.Availability; 'CpuStatus'=$processor.CpuStatus; 'CurrentClockSpeed'=$processor.CurrentClockSpeed; @@ -1337,7 +1337,6 @@ try { ($observed.OsFreePhysicalMemory -gt 0) | Should Be $true } - It "(special case) Test for property = OsFreeSpaceInPagingFiles" -Skip:([System.Management.Automation.Platform]::IsIoT -or !$IsWindows) { ($observed.OsFreeSpaceInPagingFiles -gt 0) | Should Be $true } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 index af573035193..591f7837c1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Content" -Tags "CI" { $testString = "This is a test content for a file" $nl = [Environment]::NewLine diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 index 537b3beef37..9aa3503ffc9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 index 93ef537a1f3..e34271cc4b9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Item" -Tags "CI" { BeforeAll { if ( $IsWindows ) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 index 0c940302a89..bcf6c2f1c1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-ItemProperty" -Tags "CI" { $currentDirectory = Split-Path $PSScriptRoot -Leaf $parentDirectory = Split-Path (Join-Path -Path $PSScriptRoot -ChildPath "..") -Leaf diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 index 6c21fffc488..b1c46df8281 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Location" -Tags "CI" { $currentDirectory=[System.IO.Directory]::GetCurrentDirectory() BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 index ceec9a084b9..095d6466c9a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-PSDrive" -Tags "CI" { It "Should not throw" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 index 6e0ec064c5b..be7548a1028 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-PSProvider" -Tags "CI" { It "Should be able to call with no parameters without error" { { Get-PSProvider } | Should Not Throw diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 index 1b4cd9221ab..afd99b6f00e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Process for admin" -Tags @('CI', 'RequireAdminOnWindows') { It "Should support -IncludeUserName" { (Get-Process -Id $pid -IncludeUserName).UserName | Should Match $env:USERNAME diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 index 99163036b04..c5c2beb16f6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-Service cmdlet tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-Service cmdlet tests" -Tags "CI" { # Service cmdlet is currently working on windows only # So skip the tests on non-Windows BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 index 6dab82f5325..bf4ae5981f6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Hierarchical paths" -Tags "CI" { BeforeAll { $data = "Hello World" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 index d35d25639e6..1c20a8852c5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Simple ItemProperty Tests" -Tag "CI" { It "Can retrieve the PropertyValue with Get-ItemPropertyValue" { Get-ItemPropertyValue -path $TESTDRIVE -Name Attributes | should be "Directory" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 index eea6f06525e..b8a709d0511 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Join-Path cmdlet tests" -Tags "CI" { $SepChar=[io.path]::DirectorySeparatorChar BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 index d2981962d4b..71cc6a5dc38 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Move-Item tests" -Tag "CI" { BeforeAll { $content = "This is content" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 index 95db7dbf0c4..824d25924f2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 index 1c648511919..65acb0c4c2d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Clean-State { if (Test-Path $FullyQualifiedLink) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 index af4180fb52a..9b0b6863e8a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Basic Alias Provider Tests" -Tags "CI" { Context "Validate basic PSDrive Cmdlets" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Pester.Commands.Cmdlets.NoNewlineParameter.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Pester.Commands.Cmdlets.NoNewlineParameter.Tests.ps1 index fab6e4ce6af..a88c8b1a649 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Pester.Commands.Cmdlets.NoNewlineParameter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Pester.Commands.Cmdlets.NoNewlineParameter.Tests.ps1 @@ -1,4 +1,7 @@ -# Tests related to TFS item 1370133 [PSUpgrade] Need -NoNewline parameter on Out-File, Add-Content and Set-Content +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# Tests related to TFS item 1370133 [PSUpgrade] Need -NoNewline parameter on Out-File, Add-Content and Set-Content # Connect request https://connect.microsoft.com/PowerShell/feedback/details/524739/need-nonewline-parameter-on-out-file-add-content-and-set-content Describe "Tests for -NoNewline parameter of Out-File, Add-Content and Set-Content" -tags "Feature" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 index 95e4fd181c7..6d48b39bda7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Pop-Location" -Tags "CI" { $startDirectory = $(Get-Location).Path diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 index c49d4a24d4a..214bd3b42f7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Test-Push-Location" -Tags "CI" { New-Variable -Name startDirectory -Value $(Get-Location).Path -Scope Global -Force diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 index b4d3539b942..6ab94fe4785 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { #skip all tests on non-windows platform $defaultParamValues = $PSdefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 index a3310c7ba73..646ccd10abf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { BeforeAll { $defaultParamValues = $PSdefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 index 1717da27e19..ba9dd490e13 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remove-Item" -Tags "CI" { $testpath = $TestDrive $testfile = "testfile.txt" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 index 86c96add0b5..d8cda5d81e6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $RenameTesthook = "TestRenameComputer" $RenameResultName = "TestRenameComputerResults" $DefaultResultValue = 0 @@ -50,7 +52,6 @@ try $WarnVar | should BeNullOrEmpty } - Context "Rename-Computer Error Conditions" { $testcases = @{ OldName = "." ; NewName = "localhost" ; ExpectedError = "FailToRenameComputer,Microsoft.PowerShell.Commands.RenameComputerCommand" }, diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 index b764afdbf92..212f18c4093 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Rename-Item tests" -Tag "CI" { BeforeAll { $content = "This is content" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 index e80671b7e3e..25e655ba6ea 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Resolve-Path returns proper path" -Tag "CI" { It "Resolve-Path returns resolved paths" { Resolve-Path $TESTDRIVE | Should be "$TESTDRIVE" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 index 44006051777..56081d9e848 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 @@ -1,9 +1,12 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # the testhook for restart-computer is the same as for stop-computer $restartTesthookName = "TestStopComputer" $restartTesthookResultName = "TestStopComputerResults" $DefaultResultValue = 0 -try +try { # set up for testing $PSDefaultParameterValues["it:skip"] = ! $IsWindows @@ -39,23 +42,23 @@ try } } - # this requires setting a test hook, so we wrap the execution with try/finally of the - # set operation. Internally, we want to suppress the progress, so + # this requires setting a test hook, so we wrap the execution with try/finally of the + # set operation. Internally, we want to suppress the progress, so # that is also wrapped in try/finally It "Should wait for a remote system" { try { Enable-Testhook -testhookname TestWaitStopComputer $timeout = 3 - try + try { $pPref = $ProgressPreference $ProgressPreference="SilentlyContinue" - $duration = Measure-Command { - Restart-Computer -computer localhost -Wait -Timeout $timeout -ErrorAction stop | Should BeNullOrEmpty + $duration = Measure-Command { + Restart-Computer -computer localhost -Wait -Timeout $timeout -ErrorAction stop | Should BeNullOrEmpty } } - finally + finally { $ProgressPreference=$pPref } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 index a63295fde4f..846ad828a7b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Content cmdlet tests" -Tags "CI" { BeforeAll { $file1 = "file1.txt" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 index 6598ea0c387..68496bf064e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Item" -Tag "CI" { $testCases = @{ Path = "variable:SetItemTestCase"; Value = "TestData"; Validate = { $SetItemTestCase | Should be "TestData" }; Reset = {remove-item variable:SetItemTestCase} }, @{ Path = "alias:SetItemTestCase"; Value = "Get-Alias"; Validate = { (Get-Alias SetItemTestCase).Definition | should be "Get-Alias"}; Reset = { remove-item alias:SetItemTestCase } }, diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 index be9e0965c0b..dfc26ada210 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Location" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 index e3f189a65d3..a43caaa7790 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnWindows" { BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 index 432441be971..9d28dc46fe9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Split-Path" -Tags "CI" { It "Should return a string object when invoked" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 index ba5f3583923..1b3641e9fe0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Start-Process" -Tags @("Feature") { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 index 5b9136337c1..b129fc5c3c2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 @@ -1,10 +1,13 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # note these will manipulate private data in the PowerShell engine which will # enable us to not actually stop the system, but return right before we do $stopTesthook = "TestStopComputer" $stopTesthookResultName = "TestStopComputerResults" $DefaultResultValue = 0 -try +try { # set up for testing $PSDefaultParameterValues["it:skip"] = ! $IsWindows @@ -32,7 +35,7 @@ try $computerNames = "localhost","${env:COMPUTERNAME}" Stop-Computer -Computer $computerNames -ErrorAction Stop| Should BeNullOrEmpty } - + It "Should support WsmanAuthentication types" { $authChoices = "Default","Basic","Negotiate","CredSSP","Digest","Kerberos" foreach ( $auth in $authChoices ) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 index 12fdd4676f5..c0a38194c37 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Test-Path" -Tags "CI" { BeforeAll { $testdirectory = $TestDrive diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 index 9f2aeb93955..547b7e68f08 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 @@ -1,6 +1,5 @@ -# This is a Pester test suite to validate the cmdlets in the TimeZone module -# # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <# -------------------------------------- diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 index 9f4c7f58415..510c91fde9a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" { $Commands = @( diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 index 38bb26c3ee7..deb66de4b0c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Validate basic Variable provider cmdlets" -Tags "CI" { BeforeAll { $testVarName = "MyTestVarThatWontConflict" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 index eb7c5430558..fe76526a8a0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Acl cmdlets are available and operate properly" -Tag CI { It "Get-Acl returns an ACL object" -pending:(!$IsWindows) { $ACL = get-acl $TESTDRIVE diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 index 2a1341b11de..1fd5e449e30 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # The import and table creation work on non-windows, but are currently not needed if($IsWindows) { @@ -8,7 +11,7 @@ if($IsWindows) @{path = 'Cert:\CurrentUser\my'} @{path = 'cert:\currentuser\my'} @{path = 'Microsoft.PowerShell.Security\Certificate::CurrentUser\My'} - @{path = 'Microsoft.PowerShell.Security\certificate::currentuser\my'} + @{path = 'Microsoft.PowerShell.Security\certificate::currentuser\my'} ) $testLocations = @( @@ -30,7 +33,7 @@ Describe "Certificate Provider tests" -Tags "CI" { # Skip for non-Windows platforms $defaultParamValues = $global:PSDefaultParameterValues.Clone() $global:PSDefaultParameterValues = @{ "it:skip" = $true } - } + } } AfterAll { @@ -50,7 +53,7 @@ Describe "Certificate Provider tests" -Tags "CI" { $resolvedPath = Resolve-Path $_.PSPath $resolvedPath.Provider | should be $expectedResolvedPath.Provider $resolvedPath.ProviderPath.TrimStart('\') | should be $expectedResolvedPath.ProviderPath.TrimStart('\') - } + } } it "Should return two items at the root of the provider" { (Get-Item -Path cert:\*).Count | should be 2 @@ -87,9 +90,9 @@ Describe "Certificate Provider tests" -Tags "Feature" { # Skip for non-Windows platforms $defaultParamValues = $global:PSDefaultParameterValues.Clone() $PSDefaultParameterValues = @{ "it:skip" = $true } - } + } } - + AfterAll { if($IsWindows) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 index 5b2a99e05c6..c7cff635636 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Import-Module (Join-Path -Path $PSScriptRoot 'certificateCommon.psm1') -Force Describe "CmsMessage cmdlets and Get-PfxCertificate basic tests" -Tags "CI" { @@ -58,7 +60,6 @@ Describe "CmsMessage cmdlets and Get-PfxCertificate basic tests" -Tags "CI" { } } - Describe "CmsMessage cmdlets thorough tests" -Tags "Feature" { BeforeAll{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 index 60701788def..af6bb488cc9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 @@ -1,4 +1,6 @@ -## +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +## ## Tests for PowerShell system lock down and constrained language mode restrictions ## These are Windows platform only tests ## diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 index debe15d28aa..ff73e42ceec 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Import-Module HelpersCommon # # These are general tests that verify non-Windows behavior diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index 712310c8e52..f85e46e948c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -1,7 +1,7 @@ -# This is a Pester test suite to validate the New-FileCatalog & Test-FileCatalog cmdlets on PowerShell Core. -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. + +# This is a Pester test suite to validate the New-FileCatalog & Test-FileCatalog cmdlets on PowerShell Core. try { #skip all tests on non-windows platform @@ -204,7 +204,6 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { "CatalogTestFile2.xml" = "00B7DA28CD285F796660D36B77B2EC6054F21A44D5B329EB6BC4EC7687D70B13"; "TestImage.gif" = "2D938D255D0D6D547747BD21447CF7295318D34D9B4105D04C1C27487D2FF402" } - $catalogPath = "$env:TEMP\NewFileCatalogVersion2WithMultipleFoldersAndFiles.cat" $catalogDataPath = @("$testDataPath\UserConfigProv\","$testDataPath\CatalogTestFile1.mof","$testDataPath\CatalogTestFile2.xml", "$testDataPath\TestImage.gif") diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 index 1014ee7b76b..5d47512684c 100755 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Credential Test" -tag "CI" { BeforeAll { $th = New-TestHost diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 index fbd7ff7982e..b378d50eedd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "SecureString conversion tests" -Tags "CI" { BeforeAll { $string = "ABCD" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion1/UserConfigProviderModVersion1.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion1/UserConfigProviderModVersion1.psm1 index 87de82a6a00..6d9231d4445 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion1/UserConfigProviderModVersion1.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion1/UserConfigProviderModVersion1.psm1 @@ -1,4 +1,5 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # The Get-TargetResource cmdlet is used to fetch the desired state of the DSC managed node through a powershell script. # This cmdlet executes the user supplied script (i.e., the script is responsible for validating the desired state of the @@ -21,7 +22,6 @@ function Get-TargetResource $result; } - # The Set-TargetResource cmdlet is used to Set the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). If the DSC managed node requires a restart either during or after the execution of the SetScript, @@ -41,7 +41,6 @@ function Set-TargetResource Add-Content -Path $path -Value $text } - # The Test-TargetResource cmdlet is used to validate the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). The result of the script execution should be true if the DSC managed machine is in the desired state diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion2/UserConfigProviderModVersion2.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion2/UserConfigProviderModVersion2.psm1 index aecbaf3e29d..c4ba990084c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion2/UserConfigProviderModVersion2.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion2/UserConfigProviderModVersion2.psm1 @@ -1,4 +1,5 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # The Get-TargetResource cmdlet is used to fetch the desired state of the DSC managed node through a powershell script. # This cmdlet executes the user supplied script (i.e., the script is responsible for validating the desired state of the @@ -21,7 +22,6 @@ function Get-TargetResource $result; } - # The Set-TargetResource cmdlet is used to Set the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). If the DSC managed node requires a restart either during or after the execution of the SetScript, @@ -42,7 +42,6 @@ function Set-TargetResource Add-Content -Path $path -Value $text } - # The Test-TargetResource cmdlet is used to validate the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). The result of the script execution should be true if the DSC managed machine is in the desired state diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion3/UserConfigProviderModVersion3.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion3/UserConfigProviderModVersion3.psm1 index 953d5fd3d44..efa75bd89bf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion3/UserConfigProviderModVersion3.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion3/UserConfigProviderModVersion3.psm1 @@ -1,4 +1,5 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # The Get-TargetResource cmdlet is used to fetch the desired state of the DSC managed node through a powershell script. # This cmdlet executes the user supplied script (i.e., the script is responsible for validating the desired state of the @@ -21,7 +22,6 @@ function Get-TargetResource $result; } - # The Set-TargetResource cmdlet is used to Set the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). If the DSC managed node requires a restart either during or after the execution of the SetScript, @@ -42,7 +42,6 @@ function Set-TargetResource Add-Content -Path $path -Value $text } - # The Test-TargetResource cmdlet is used to validate the desired state of the DSC managed node through a powershell script. # The method executes the user supplied script (i.e., the script is responsible for validating the desired state of the # DSC managed node). The result of the script execution should be true if the DSC managed machine is in the desired state diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.psd1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.psd1 index f2abc78aae1..ae1da14c827 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.psd1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.psd1 @@ -18,13 +18,13 @@ ModuleVersion = '1.0' GUID = 'a5506849-3cc7-44ec-8d8a-79e0f43c4f8b' # Author of this module -Author = 'brucepay' +Author = 'PowerShell' # Company or vendor of this module -CompanyName = 'Unknown' +CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = '(c) 2013 brucepay. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module # Description = '' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.schema.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.schema.psm1 index 4dadbac2342..c58e5cf4ebf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.schema.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/scriptdsc/scriptdsc.schema.psm1 @@ -1,4 +1,5 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. configuration scriptdsc { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/UserConfigProv.psd1 b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/UserConfigProv.psd1 index fe48cbc407f..9fe5fc0d02c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/UserConfigProv.psd1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/UserConfigProv.psd1 @@ -1,6 +1,6 @@ @{ ModuleVersion = '3.0.0.1' - Author = 'fayzas' + Author = 'PowerShell' CompanyName = 'Microsoft Corporation' Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' Description = 'Hello World!' @@ -9,4 +9,4 @@ RequiredModules = @() # NestedModules = @("UserConfigProviderModVersion.psm1") # FunctionsToExport = @("Get-TargetResource", "Set-TargetResource", "Test-TargetResource") - } \ No newline at end of file + } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 index 53de520ee1b..141e1f837f7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Function New-GoodCertificate { <# diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 index 54634705e0b..18e075415ea 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Add-Member DRT Unit Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Add-Member DRT Unit Tests" -Tags "CI" { It "Mandatory parameters should not be null nor empty" { # when Name is null diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 index e5f7d933def..5d9aac7222e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Add-Type" -Tags "CI" { BeforeAll { $guid = [Guid]::NewGuid().ToString().Replace("-","") diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 index 04be98def08..5eae4c376ee 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Clear-Variable DRT Unit Tests" -Tags "CI" { It "Clear-Variable normal variable Name should works"{ Set-Variable foo bar diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 index 64e01dc5d6e..27836bb2e5c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Compare-Object" -Tags "CI" { BeforeAll { $nl = [Environment]::NewLine diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 index 9f3e2154d02..fbe8be135e5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $here = Split-Path -Parent $MyInvocation.MyCommand.Path Describe "ConvertFrom-Csv" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 index a13c3067883..403e8bb55f9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'ConvertFrom-Json' -tags "CI" { BeforeAll { @@ -7,7 +9,6 @@ Describe 'ConvertFrom-Json' -tags "CI" { ) } - It 'Can convert a single-line object with AsHashtable switch set to ' -TestCase $testCasesWithAndWithoutAsHashtableSwitch { Param($AsHashtable) ('{"a" : "1"}' | ConvertFrom-Json -AsHashtable:$AsHashtable).a | Should Be 1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 index 3bbed5132fa..456e189eea8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" { It "Should able to throw error when convert invalid line" { $str =@" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 index 11de104cbd3..234108aa926 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" { $inputObject = [pscustomobject]@{ First = 1; Second = 2 } @@ -39,7 +41,6 @@ Describe "ConvertTo-Csv" -Tags "CI" { $Name = "Hello"; $Data = "World"; $testObject = New-Object psobject -Property @{ FirstColumn = $Name; SecondColumn = $Data } - It "Should Be able to be called without error" { { $testObject | ConvertTo-Csv } | Should Not Throw } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 index 9d41fa95a3c..dd1aaa77aa4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "ConvertTo-Html Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "ConvertTo-Html Tests" -Tags "CI" { BeforeAll { $customObject = [pscustomobject]@{"Name" = "John Doe"; "Age" = 42; "Friends" = ("Jack", "Jill")} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 index eaa55227a9c..092a40baa22 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'ConvertTo-Json' -tags "CI" { It 'Newtonsoft.Json.Linq.Jproperty should be converted to Json properly' { $EgJObject = New-Object -TypeName Newtonsoft.Json.Linq.JObject diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 index eabc644476f..7cec247c7e6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ConvertTo--SecureString" -Tags "CI" { Context "Checking return types of ConvertTo--SecureString" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Xml.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Xml.Tests.ps1 index 6d11e51e734..4f069c22056 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Xml.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Xml.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" { BeforeAll { class fruit { [string] $name; diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 index b07c1cc9ec1..df5cb2c1422 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Debug-Runspace" -tag "CI" { BeforeAll { $rs1 = [runspacefactory]::CreateRunspace() @@ -56,4 +58,3 @@ Describe "Debug-Runspace" -tag "CI" { } - diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 index cb8e6937377..0294366cd69 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/EnableDisablePSBreakpoint.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Enable and Disable PSBreakpoints" -Tag "CI" { BeforeAll { $path = Setup -F testbp.ps1 -content "get-command`nget-date`nget-location" -pass diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 index 2cf79380c30..8ea69c78143 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Environment-Variables" -Tags "CI" { It "Should have environment variables" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 index d2fcbd26a56..e0c4d8383d5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Event Subscriber Tests" -tags "CI" { BeforeEach { Get-EventSubscriber | Unregister-Event diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 index a09f66eaea5..4cd16da9f3c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Export-Alias DRT Unit Tests" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 index 0748bb61b59..11ad3091c43 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Export-Csv" -Tags "CI" { BeforeAll { $testObject = @("test","object","array") diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 index 7761cf4ac24..457074cde68 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Export-FormatData DRT Unit Tests" -Tags "CI" { It "Test basic functionality" { $fd = Get-FormatData diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 index 51bc86de143..0e7380cb697 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Format-Custom" -Tags "CI" { Context "Check Format-Custom aliases" { @@ -24,7 +26,6 @@ Describe "Format-Custom" -Tags "CI" { } } - Describe "Format-Custom DRT basic functionality" -Tags "CI" { Add-Type -TypeDefinition @" public abstract class NamedItem diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 index c38a9b66437..33695000260 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Format-List" -Tags "CI" { $nl = [Environment]::NewLine BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 index f11d7f9b88f..6a6ab2d61ae 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Format-Table" -Tags "CI" { It "Should call format table on piped input without error" { { Get-Date | Format-Table } | Should Not Throw @@ -27,7 +29,6 @@ Describe "Format-Table" -Tags "CI" { } } - Describe "Format-Table DRT Unit Tests" -Tags "CI" { It "Format-Table with not existing table with force should throw PipelineStoppedException"{ $obj = New-Object -typename PSObject diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 index 40afe24a3f2..fe7b1dca727 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Format-Wide" -Tags "CI" { It "Should have the same output between the alias and the unaliased function" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/FormatHex.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/FormatHex.Tests.ps1 index 2b401fc7c6b..eeb26f0f88a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/FormatHex.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/FormatHex.Tests.ps1 @@ -1,7 +1,7 @@ -# This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module. -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. + +# This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module. <# Purpose: diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 index 0076ce50e94..118326da91f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Alias DRT Unit Tests" -Tags "CI" { It "Get-Alias Bogus Scope Name should throw PSArgumentException"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 index 5106eeb41c9..6c87a75cc4f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Culture DRT Unit Tests" -Tags "CI" { It "Should works proper with get-culture" { $results = get-Culture @@ -20,5 +22,4 @@ Describe "Get-Culture" -Tags "CI" { } - } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 index 9c18379671a..c111d721bf2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Date DRT Unit Tests" -Tags "CI" { It "Get-Date with all parameters returns proper results" { $date = [datetime]::Now + ([timespan]::new(0,0,30)) @@ -84,10 +86,8 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { Remove-Item -Path $pathString -Force -Recurse } - } - Describe "Get-Date" -Tags "CI" { It "-Format FileDate works" { Get-date -Date 0030-01-01T01:02:03.0004 -Format FileDate | Should Be "00300101" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 index 509562adcab..a5c0d82d106 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Event" -Tags "CI" { BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 index af39ab06d39..66176a476c3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-EventSubscriber" -Tags "CI" { AfterEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 index 11874b21896..b05d6ac3a2d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-FileHash" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 index 821ea5a57ed..c19b8976e88 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-FormatData" -Tags "CI" { Context "Check return type of Get-FormatData" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 index a4b12df4504..214c57f390a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Host DRT Unit Tests" -Tags "CI" { It "Should works proper with get-host" { $results = Get-Host diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 index d03e9bb36bc..5e08a78f169 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Member" -Tags "CI" { It "Should be able to be called on string objects, ints, arrays, etc" { $a = 1 #test numbers @@ -63,7 +65,6 @@ Describe "Get-Member DRT Unit Tests" -Tags "CI" { } } - public string LastName { get @@ -76,7 +77,6 @@ Describe "Get-Member DRT Unit Tests" -Tags "CI" { } } - public int YearsInMS { get diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 index c43b7d41dd7..5757e3baefe 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-PSBreakpoint" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-PSBreakpoint" -Tags "CI" { $scriptName = "Get-PSBreakpoint.Tests.ps1" $fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSCallStack.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSCallStack.Tests.ps1 index 964b95ebbee..00c43985aed 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSCallStack.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSCallStack.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" { BeforeAll { $scriptFileName = "GetTryCatchCallStack.ps1" $scriptFilePath = Join-Path $TestDrive -ChildPath $scriptFileName @@ -57,7 +59,7 @@ $results[2].Command | Should be $scriptFileName $results[2].ScriptName | Should be $scriptFilePath $results[2].ScriptLineNumber | Should be 32 - $results[2].InvocationInfo.ScriptLineNumber | Should be 44 + $results[2].InvocationInfo.ScriptLineNumber | Should be 46 } It "Verify that the script block of a trap statement shows up on the call stack" { @@ -77,11 +79,11 @@ $results[0].Command | Should be $scriptFileName $results[0].ScriptName | Should be $scriptFilePath $results[0].ScriptLineNumber | Should be 3 - $results[0].InvocationInfo.ScriptLineNumber | Should be 75 + $results[0].InvocationInfo.ScriptLineNumber | Should be 77 $results[1].Command | Should be $scriptFileName $results[1].ScriptName | Should be $scriptFilePath $results[1].ScriptLineNumber | Should be 7 - $results[1].InvocationInfo.ScriptLineNumber | Should be 75 + $results[1].InvocationInfo.ScriptLineNumber | Should be 77 } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 index 4714eb95378..06628db01df 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Random DRT Unit Tests" -Tags "CI" { $testData = @( @{ Name = 'no params'; Maximum = $null; Minimum = $null; GreaterThan = -1; LessThan = ([int32]::MaxValue); Type = 'System.Int32' } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 index d5d6df3a215..5dc58c47a75 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-RunspaceDebug" -Tags "CI" { Context "Check return types of RunspaceDebug" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 index 9bcb4e9688c..550d8911af1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-TraceSource" -Tags "Feature" { It "Should output data sorted by name" { $expected = (Get-TraceSource | Sort-Object Name) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 index 723360c1050..703d2b4a0e5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-UICulture" -Tags "CI" { It "Should have $ PsUICulture variable be equivalent to Get-UICulture object" { $result = Get-UICulture diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 index 26db1fe49ac..4f4f5a4957d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Unique DRT Unit Tests" -Tags "CI" { It "Command get-unique works with AsString switch" { $inputArray = "aa","aa","Aa","ba","BA","BA" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 index 55dbb02ef92..586a1dae9b5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Uptime" -Tags "CI" { BeforeAll { $IsHighResolution = [system.diagnostics.stopwatch]::IsHighResolution diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 index c9618be51ee..064e71015c3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Variable DRT Unit Tests" -Tags "CI" { It "Get-Variable of not existing variable Name should throw ItemNotFoundException"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 index 38d68130e72..f1443f34444 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Get-Verb" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Get-Verb" -Tags "CI" { It "Should get a list of Verbs" { Get-Verb | Should not be $null diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 index 7a812348f97..efc1f8d9ab8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Group-Object DRT Unit Tests" -Tags "CI" { It "Test for CaseSensitive switch" { $testObject = 'aA', 'aA', 'AA', 'AA' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 index 4166feeb92b..4146a919fff 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 @@ -1,4 +1,6 @@ -# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# # Skip all tests on non-windows and non-PowerShellCore and non-elevated platforms. # $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() @@ -198,7 +200,6 @@ try if ($null -ne $session) { Remove-PSSession $session -ErrorAction SilentlyContinue } } - It "Verifies that broken alias results in one error" { try { Invoke-Command $session { Set-Alias BrokenAlias NonExistantCommand } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 index 94a2f20d3cf..2b72bb83cf8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Import-Alias DRT Unit Tests" -Tags "CI" { $testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory $testAliases = "TestAliases" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 index c8190f3b6f1..35cd18884dd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Import-Csv DRT Unit Tests" -Tags "CI" { BeforeAll { $fileToGenerate = Join-Path $TestDrive -ChildPath "importCSVTest.csv" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 index c62bd6a15fa..db38f33b9e9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets Describe "Import-LocalizedData" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 index 49fd4d45c93..cf0bc73f09a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tags "Feature" { BeforeAll { # note, we will not use "," as that's the default for CSV $delimiters = "/", " ", "@", "#", "$", "\", "&", "(", ")", diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 index 8283479c7b1..909363b7bea 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Invoke-Expression" -Tags "CI" { Context "Should execute the invoked command validly" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 index b55f2b8030e..e63f7d63355 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Diagnostics Describe "Invoke-Item basic tests" -Tags "Feature" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 index b9e83d924ec..030534357ef 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Unit tests for JsonObject' -tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Unit tests for JsonObject' -tags "CI" { BeforeAll { $jsonWithEmptyKey = '{"": "Value"}' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 index ba7fde492e0..c0ee88abe46 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Measure-Command" -Tags "CI" { Context "Validate return types for Measure-Command" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 index d18919f9145..6791d790a1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Measure-Object" -Tags "CI" { BeforeAll { $testObject = 1,3,4 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 index 71e06773eba..42895219e5e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "GetDateFormatUpdates" -Tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "GetDateFormatUpdates" -Tags "Feature" { It "Verifies that FileDate format works" { $date = Get-Date diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 index 31391ba6f55..ec2f34ae3a8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-Alias DRT Unit Tests" -Tags "CI" { It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{ try { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 index d24ff173c74..facd177f412 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-Event" -Tags "CI" { Context "Check return type of New-Event" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 index f68203c2dee..ee6411ed866 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-Object" -Tags "CI" { It "Support 'ComObject' parameter on platforms" { if ($IsLinux -or $IsMacOs ) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 index a85575054a9..9cab87f089b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-TimeSpan DRT Unit Tests" -Tags "CI" { It "Should works proper with new-timespan"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 index 64b34681072..c5bf5edd2ce 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-Variable DRT Unit Tests" -Tags "CI" { It "New-Variable variable with description should works"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/NewGuid.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/NewGuid.Tests.ps1 index 95b0fdfef6d..d4925947de9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/NewGuid.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/NewGuid.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "New-Guid" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "New-Guid" -Tags "CI" { It "returns a new guid" { $guid = New-Guid diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/NewTemporaryFile.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/NewTemporaryFile.Tests.ps1 index b9bd916036a..82a57e53126 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/NewTemporaryFile.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/NewTemporaryFile.Tests.ps1 @@ -1,7 +1,7 @@ -# This is a Pester test suite to validate the New-TemporaryFile cmdlet in the Microsoft.PowerShell.Utility module. -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. + +# This is a Pester test suite to validate the New-TemporaryFile cmdlet in the Microsoft.PowerShell.Utility module. <# Purpose: diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 index 46f32b84ac2..38704ad782e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Out-File DRT Unit Tests" -Tags "CI" { It "Should be able to write the contents into a file with -pspath" { $tempFile = Join-Path -Path $TestDrive -ChildPath "ExposeBug928965" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 index 825627852b2..e29723bd520 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Out-String DRT Unit Tests" -Tags "CI" { It "check display of properties with names containing wildcard characters" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Pester.Commands.Cmdlets.Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Pester.Commands.Cmdlets.Json.Tests.ps1 index e257fe89cea..a2d1fe12844 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Pester.Commands.Cmdlets.Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Pester.Commands.Cmdlets.Json.Tests.ps1 @@ -1,6 +1,6 @@ -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. + # This is a Pester test suite which validate the Json cmdlets. # @@ -335,7 +335,6 @@ Describe "Json Tests" -Tags "Feature" { $result.SampleValue | Should Be 12345 } - It "ConvertFrom-Json sample values" { $json = '{"SampleInt":98765, "SampleString":"stringVal","SampleArray":[2,"two"], "SampleTrue":true, "SampleFalse":false,"SampleNull":null, "SampleFloat":9.8765E43}' @@ -344,7 +343,6 @@ Describe "Json Tests" -Tags "Feature" { # Validate the result object ValidateSampleObject -result $result - $json = '{"SampleInt":98765, "SampleString":"stringVal","SampleArray":[2,"two"], "SampleTrue":true, ' + '"SampleFalse":false,"SampleNull":null, "SampleFloat":9.8765E43, "SampleObject":'+ '{"SampleInt":98765, "SampleString":"stringVal","SampleArray":[2,"two"], '+ @@ -1270,7 +1268,6 @@ Describe "Validate Json serialization" -Tags "CI" { } } - Context "Validate Json Serialization for 'Get-CimClass' and 'Get-Command'" { function ValidateProperties @@ -1369,7 +1366,6 @@ Describe "Validate Json serialization" -Tags "CI" { } } - Context "Validate Json output is either Pretty or Compressed" { It "Should print a pretty Array" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 index d4a41357064..53e2c66b2d5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests for the Import-PowerShellDataFile cmdlet" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests for the Import-PowerShellDataFile cmdlet" -Tags "CI" { It "Validates error on a missing path" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 index 3defda9031c..587a9ca2518 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Read-Host Test" -tag "CI" { BeforeAll { $th = New-TestHost diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 index 3487db2d615..4ec75cfd81f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Register-EngineEvent" -Tags "CI" { Context "Check return type of Register-ObjectEvent" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 index 2044dc01a19..ee10db39724 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Register-ObjectEvent" -Tags "CI" { BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 index 913cf57c7aa..5b91a18aceb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remove-Alias" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 index 4cf4ecaa746..9a113970d1f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remove-Event" -Tags "CI" { BeforeEach { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 index 642295d147e..cd43e2c54a2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Remove-PSBreakpoint" -Tags "CI" { # Set up test script $testScript = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath psbreakpointtestscript.ps1 @@ -57,7 +59,6 @@ Get-Date $(Get-PSBreakpoint).Id.Length | Should Be 0 } - #Clean up after ourselves Remove-Item $testScript diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-TypeData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-TypeData.Tests.ps1 index 130ac8b64dc..17b85f019fa 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-TypeData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-TypeData.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Remove-TypeData DRT Unit Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Remove-TypeData DRT Unit Tests" -Tags "CI" { BeforeAll { $XMLFile1 = Join-Path $TestDrive -ChildPath "testFile1.ps1xml" $XMLFile2 = Join-Path $TestDrive -ChildPath "testFile2.ps1xml" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 index 626ee055e64..304f68221e2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # ensure the machine is in a clean state from the outset. Remove-Variable -Name var1 -ErrorAction SilentlyContinue -Force @@ -182,7 +185,6 @@ Describe "Remove-Variable" -Tags "CI" { } } - Describe "Remove-Variable basic functionality" -Tags "CI" { It "Remove-Variable variable should works"{ New-Variable foo bar diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 index 5aca83dcb60..07f301a63d1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Get-Runspace cmdlet tests" -Tag "CI" { BeforeAll { $CurrentRunspace = $ExecutionContext.Host.Runspace diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 index 7c7709eee04..825b168c65c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . (Join-Path -Path $PSScriptRoot -ChildPath Test-Mocks.ps1) Describe "Select-Object" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 index 9513a0846d8..46454251ebb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Select-String" -Tags "CI" { $nl = [Environment]::NewLine $currentDirectory = $pwd.Path diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-XML.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-XML.Tests.ps1 index 72c04a00a52..aaa6f60baba 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-XML.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-XML.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Select-XML DRT Unit Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 index d6ce401f2a8..4564490c865 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Basic Send-MailMessage tests" -Tags CI { BeforeAll { function test-smtpserver diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 index cb4c782d1dd..21ecb6cbb33 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Alias DRT Unit Tests" -Tags "CI" { It "Set-Alias Invalid Scope Name should throw PSArgumentException"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 index c5950aa7160..e3de326fea1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Date for admin" -Tag @('CI', 'RequireAdminOnWindows') { # Currently, CI tests on Linux/macOS are always run as normal user. So we need to skip these tests on non-Windows platform. # CI tests in root privilege on Linux/macOS is not supported. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 index d25630ff4c8..a5bb84d2f19 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $ps = Join-Path -Path $PsHome -ChildPath "pwsh" Describe "Set-PSBreakpoint DRT Unit Tests" -Tags "CI" { @@ -36,7 +38,6 @@ set-psbreakpoint -command foo $contents > $scriptFileName $contentsBug > $scriptFileNameBug - It "Should be able to set psbreakpoints for -Line" { $brk = Set-PSBreakpoint -Line 13 -Script $scriptFileName $brk.Line | Should Be 13 @@ -72,7 +73,6 @@ set-psbreakpoint -command foo Remove-PSBreakPoint -Id $brk.Id } - It "-script and -line are positional" { $brk = sbp $scriptFileName 13 $brk.Line | Should Be 13 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 index e3fa2e97e56..dab857ca09f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Set-Variable DRT Unit Tests" -Tags "CI" { It "Set-Variable normal variable Name should works"{ diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 index 8fc0b98d749..875454e7fb2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Sort-Object" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Sort-Object" -Tags "CI" { It "should be able to sort object in ascending with using Property switch" { { Get-ChildItem -Path $PSScriptRoot -Include *.ps1 -Recurse | Sort-Object -Property Length } | Should Not Throw diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 index 8ead15e5e77..e535f973cd3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Start-Sleep DRT Unit Tests" -Tags "CI" { # WaitHandle.WaitOne(milliseconds, exitContext) is not accurate. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 index 64410db8ef1..c408bc14f06 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Tee-Object" -Tags "CI" { Context "Validate Tee-Object is correctly forking output" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 index 63d255ac235..7032e0acba2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Function GetFileMock () { $objs = @( [pscustomobject]@{ Size=4533816; Mode="-a---l"; LastWriteTime="9/1/2015 11:15 PM"; Name="explorer.exe" }, [pscustomobject]@{ Size=994816; Mode="-a---l"; LastWriteTime="9/1/2015 11:13 PM"; Name="HelpPane.exe" }, diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 index df88082b08a..b9109204b34 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # This came from monad/tests/ci/PowerShell/tests/Commands/Cmdlets/pester.utility.command.tests.ps1 Describe "Trace-Command" -tags "CI" { @@ -108,7 +111,7 @@ Describe "Trace-Command" -tags "CI" { It "Trace-Command fails for non-filesystem paths" { { Trace-Command -Name ParameterBinding -Expression {$null} -FilePath "Env:\Test" -ErrorAction Stop } | ShouldBeErrorID 'FileListenerPathResolutionFailed,Microsoft.PowerShell.Commands.TraceCommandCommand' } - + It "Trace-Command to readonly file" { $null = New-Item $filePath -Force Set-ItemProperty $filePath -name IsReadOnly -value $true diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 index 11bf4e4cecd..670773072ce 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Test-UnblockFile { try { Get-Content -Path $testfilepath -Stream Zone.Identifier -ErrorAction Stop | Out-Null diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 index f53f4177c05..e2af8a3d85b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Unimplemented Utility Cmdlet Tests" -Tags "CI" { $Commands = @( diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 index 28b726f7b6e..8ceba23cfd4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Update-FormatData" -Tags "CI" { BeforeAll { @@ -72,7 +74,6 @@ Describe "Update-FormatData basic functionality" -Tags "CI" { } } - Describe "Update-FormatData with resources in CustomControls" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 index 433684e21d5..3e8f843c7d7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Update-TypeData basic functionality" -Tags "CI" { BeforeAll { @@ -153,7 +155,6 @@ Describe "Update-TypeData basic functionality" -Tags "CI" { $ps.Streams.Error[0].FullyQualifiedErrorId | Should be "ValueShouldBeSpecified,Microsoft.PowerShell.Commands.UpdateTypeDataCommand" } - It "Update-TypeData with Invalid DynamicType with No MemberName should throw Exception"{ $null = $ps.AddScript('Update-TypeData -MemberType NoteProperty -Value "Error" -TypeName System.String') $ps.Invoke() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 index 3ce80a0dbdd..a0bddee2daf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Wait-Event" -Tags "CI" { Context "Validate Wait-Event is waiting for events" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index b8441a87128..6bdde9c2a63 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -1,6 +1,6 @@ -# # Copyright (c) Microsoft Corporation. All rights reserved. -# +# Licensed under the MIT License. + # This is a Pester test suite which validate the Web cmdlets. # # Note: These tests use data from WebListener @@ -761,7 +761,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature" { $response.Content.Headers."Authorization" | Should BeExactly "test" } - It "Validates Invoke-WebRequest preserves the authorization header on multiple redirects: " -TestCases $redirectTests { param($redirectType) $uri = Get-WebListenerUrl -Test 'Redirect' -TestValue 3 -Query @{type = $redirectType} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 index f1a6f920bfa..7675ef8d2b5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Write-Debug tests" -Tags "CI" { It "Should not have added line breaks" { $text = "0123456789" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 index 96b8913188a..21a1466d5c2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Write-Error Tests" -Tags "CI" { It "Should be works with command: write-error myerrortext" { $e = Write-Error myerrortext 2>&1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 index a66501ff97b..97b56290a39 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Host.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Write-Host with default Console Host" -Tags "Slow","Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Write-Host with default Console Host" -Tags "Slow","Feature" { BeforeAll { $powershell = Join-Path -Path $PsHome -ChildPath "pwsh" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 index 3d00127011b..cfe3e63910c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Write-Output DRT Unit Tests" -Tags "CI" { It "Simple Write Object Test" { $objectWritten = 1, 2.2, @("John", "Smith", 10), "abc" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 index 4fac1469d2e..4a5fa6a281a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Write-Progress DRT Unit Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Write-Progress DRT Unit Tests" -Tags "CI" { It "Should be able to throw exception when missing mandatory parameters" { try { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 index d8507e9573d..dab0d03c22b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Stream writer tests" -Tags "CI" { $targetfile = Join-Path -Path $TestDrive -ChildPath "writeoutput.txt" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 index dbb14c27793..b32452cf39c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Write-Verbose" -Tags "CI" { It "Should be able to call cmdlet without error" { { Write-Verbose -Message "test" -ErrorAction SilentlyContinue } | Should Not Throw diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 index 83d0ad3c977..5d14185cd33 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 index 562a0c50156..ff4b864857a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 @@ -1,4 +1,6 @@ -Describe "Alias tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Alias tests" -Tags "CI" { BeforeAll { $testPath = Join-Path testdrive:\ ("testAlias\[.test") diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 index 5f1bf4e5f36..beb014b3dd8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 @@ -14,13 +14,11 @@ ConvertFrom-StringData @' '@ } - Import-LocalizedData -BindingVariable Day # Build an array of weekdays. $a = $Day.d0, $Day.d1, $Day.d2, $Day.d3, $Day.d4, $Day.d5, $Day.d6 - # Get the day of the week as a number (Monday = 1). # Index into $a to get the name of the day. # Use string formatting to build a sentence. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 index 1ddc40d5c2f..9eef6350390 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 @@ -1,4 +1,6 @@ -Describe "CliXml test" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "CliXml test" -Tags "CI" { BeforeAll { $testFilePath = Join-Path "testdrive:\" "testCliXml" @@ -97,7 +99,6 @@ It "can be created with literal path using pipeline" { - $filePath = Join-Path $subFilePath 'gps.xml' ($gpsList | Select-Object -First 1) | Export-Clixml -Depth 1 -LiteralPath $filePath diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 index 912a8a552b6..76e091fe8ac 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 @@ -1,4 +1,6 @@ -Describe "Trace-Command" -tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Trace-Command" -tags "Feature" { Context "Listener options" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/formatdata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/formatdata.tests.ps1 index ee14efb97a3..b4f8d958485 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/formatdata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/formatdata.tests.ps1 @@ -1,4 +1,6 @@ -Describe "FormatData" -tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "FormatData" -tags "Feature" { Context "Export" { It "can export all types" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 index e3493397a04..14381b2f41b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 @@ -1,4 +1,6 @@ -Describe "Object cmdlets" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Object cmdlets" -Tags "CI" { Context "Group-Object" { It "AsHashtable returns a hashtable" { $result = Get-Process | Group-Object -Property ProcessName -AsHashTable diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 index 0303da96daf..3a4713bb425 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 @@ -1,4 +1,6 @@ -Describe "String cmdlets" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "String cmdlets" -Tags "CI" { Context "Select-String" { BeforeAll { $sep = [io.path]::DirectorySeparatorChar diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 index 4f5840346cb..eaa83972694 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 @@ -1,4 +1,6 @@ -Describe "TestData cmdlets" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "TestData cmdlets" -Tags "CI" { Context "Get-TypeData" { It "System.DateTime" { (Get-TypeData System.DateTime).TypeName | Should Be System.DateTime diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/xml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/xml.tests.ps1 index f37280a8020..a4c4eaecb22 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/xml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/xml.tests.ps1 @@ -1,4 +1,6 @@ -Describe "XML cmdlets" -Tags "Feature" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "XML cmdlets" -Tags "Feature" { Context "Select-XML" { BeforeAll { $fileName = New-Item -Path 'TestDrive:\testSelectXml.xml' diff --git a/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 b/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 index f31ee6855c4..b004e647649 100644 --- a/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { BeforeAll { @@ -49,7 +51,6 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { Remove-Item $transcriptFilePath -Force -ErrorAction SilentlyContinue } - AfterEach { Remove-Item $transcriptFilePath -ErrorAction SilentlyContinue } diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 index bd227477714..c2d332b3bfa 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows { BeforeAll { #skip all tests on non-windows platform diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 index e17dabc8016..027373f6305 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "CredSSP cmdlet tests" -Tags 'Feature','RequireAdminOnWindows' { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 index a3f1fd8c5e4..2aabc48ad65 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "TestWSMan tests" -Tags 'Feature' { BeforeAll { diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 index 25492465adb..32215a217af 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "DSC MOF Compilation" -tags "CI" { AfterAll { @@ -81,7 +83,6 @@ Describe "DSC MOF Compilation" -tags "CI" { Ensure = "Present" } - #Ensure directory for Wordpress site nxFile wpHttpDir{ DestinationPath = "/var/www/wordpress" @@ -133,7 +134,6 @@ Describe "DSC MOF Compilation" -tags "CI" { #Set wp-config - #Fixup SE Linux context #nxScript SELinuxContext{ #TestScript= "#!/bin/bash" @@ -148,15 +148,12 @@ Describe "DSC MOF Compilation" -tags "CI" { ContainsLine = "SELINUX=disabled" } - nxScript SELinuxHTTPNet{ GetScript = "#!/bin/bash`ngetsebool httpd_can_network_connect" setScript = "#!/bin/bash`nsetsebool -P httpd_can_network_connect=1" TestScript = "#!/bin/bash`n exit 1" } - - } } diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index e9449563a70..d64b4935fad 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "PSReadLine" -tags "CI" { BeforeAll { if (Get-Module PSReadLine) { diff --git a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 index d6338dcd45b..50e4e04f4fc 100644 --- a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 +++ b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 @@ -1,4 +1,4 @@ -# +# # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ $InternalGallery = "https://dtlgalleryint.cloudapp.net/api/v2/" $InternalSource = 'OneGetTestSource' - Describe "PackageManagement Acceptance Test" -Tags "Feature" { BeforeAll{ @@ -37,7 +36,6 @@ Describe "PackageManagement Acceptance Test" -Tags "Feature" { $gpp | Where-Object { $_.name -eq "PowerShellGet" } | should not BeNullOrEmpty } - It "find-packageprovider PowerShellGet" { $fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name $fpp -contains "PowerShellGet" | should be $true @@ -48,7 +46,6 @@ Describe "PackageManagement Acceptance Test" -Tags "Feature" { $ipp -contains "gistprovider" | should be $true } - it "Find-package" { $f = Find-Package -ProviderName NuGet -Name jquery -source Nugettest $f.Name -contains "jquery" | should be $true diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 25da1e0d1d6..9619ebf5c0c 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -1,4 +1,7 @@ -# no progress output during these tests +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# no progress output during these tests $ProgressPreference = "SilentlyContinue" $RepositoryName = 'INTGallery' @@ -8,7 +11,6 @@ $ContosoServer = 'ContosoServer' $FabrikamServerScript = 'Fabrikam-ServerScript' $Initialized = $false - #region Utility functions function IsInbox { $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) } diff --git a/test/powershell/Provider/AutomountSubstDrive.ps1 b/test/powershell/Provider/AutomountSubstDrive.ps1 index 082cecb1c2d..0cbc8c5756e 100644 --- a/test/powershell/Provider/AutomountSubstDrive.ps1 +++ b/test/powershell/Provider/AutomountSubstDrive.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # Precondition: start from fresh PS session, do not have the media mounted param([switch]$useModule, [string]$FullPath) diff --git a/test/powershell/Provider/AutomountSubstDriveCore.ps1 b/test/powershell/Provider/AutomountSubstDriveCore.ps1 index fd7f7393f0e..09ae998846d 100644 --- a/test/powershell/Provider/AutomountSubstDriveCore.ps1 +++ b/test/powershell/Provider/AutomountSubstDriveCore.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param ([String]$Path) try diff --git a/test/powershell/Provider/AutomountVHDDrive.ps1 b/test/powershell/Provider/AutomountVHDDrive.ps1 index b8202054a97..84c8a8e6240 100644 --- a/test/powershell/Provider/AutomountVHDDrive.ps1 +++ b/test/powershell/Provider/AutomountVHDDrive.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # Precondition: start from fresh PS session, do not have the media mounted param([switch]$useModule, [string]$VHDPath) @@ -47,7 +50,7 @@ try $drive = CreateVHD -VHDPath $VHDPath -Size 5mb $pathToCheck = "${drive}:" - + if ($useModule) { Test-DrivePresenceFromModule -Path $pathToCheck diff --git a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 index af71d73d6b1..b6f1abad79c 100644 --- a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 +++ b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 @@ -1,4 +1,6 @@ -<############################################################################################ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +<############################################################################################ # File: Pester.AutomountedDrives.Tests.ps1 # Pester.AutomountedDrives.Tests suite contains Tests that are # used for validating automounted PowerShell drives. diff --git a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 index 2b33e8f9ef4..a39cba58d34 100644 --- a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 +++ b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ProviderIntrinsics Tests" -tags "CI" { BeforeAll { setup -d TestDir diff --git a/test/powershell/SDK/Json.Tests.ps1 b/test/powershell/SDK/Json.Tests.ps1 index 9040cafde6f..300ebdec92e 100644 --- a/test/powershell/SDK/Json.Tests.ps1 +++ b/test/powershell/SDK/Json.Tests.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # http://www.newtonsoft.com/json/help/html/ParsingLINQtoJSON.htm Describe "Json.NET LINQ Parsing" -tags "CI" { diff --git a/test/powershell/SDK/PSDebugging.Tests.ps1 b/test/powershell/SDK/PSDebugging.Tests.ps1 index 2f14eba077d..9555e99ff07 100644 --- a/test/powershell/SDK/PSDebugging.Tests.ps1 +++ b/test/powershell/SDK/PSDebugging.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Diagnostics using namespace System.Management.Automation.Internal @@ -25,7 +27,6 @@ Describe "PowerShell Command Debugging" -tags "CI" { return $process } - function EnsureChildHasExited([Process]$process, [int]$WaitTimeInMS = 15000) { $process.WaitForExit($WaitTimeInMS) @@ -95,7 +96,6 @@ Describe "PowerShell Command Debugging" -tags "CI" { $line | Should Be "For instructions about how to customize your debugger prompt, type `"help about_prompt`"." } - It "Should be able to step over debugging" { $debugfn = NewProcessStartInfo "-noprofile -c ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn @@ -112,7 +112,6 @@ Describe "PowerShell Command Debugging" -tags "CI" { $process.ExitCode | Should Be 0 } - It "Should be able to step out of debugging" { $debugfn = NewProcessStartInfo "-noprofile -c ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn @@ -163,7 +162,6 @@ Describe "PowerShell Command Debugging" -tags "CI" { } - It -Pending "Should be able to get the call stack in debugging" { $debugfn = NewProcessStartInfo "-noprofile -c ""`$function:foo = { 'bar' }""" -RedirectStdIn $process = RunPowerShell $debugfn @@ -182,7 +180,6 @@ Describe "PowerShell Command Debugging" -tags "CI" { } - } # Scripting\Debugging\RunspaceDebuggingTests.cs @@ -277,5 +274,3 @@ Describe "Runspace Debugging API tests" -tag CI { } } - - diff --git a/test/powershell/engine/Api/BasicEngine.Tests.ps1 b/test/powershell/engine/Api/BasicEngine.Tests.ps1 index 00c86e807bf..10931fc9e32 100644 --- a/test/powershell/engine/Api/BasicEngine.Tests.ps1 +++ b/test/powershell/engine/Api/BasicEngine.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Basic engine APIs' -Tags "CI" { Context 'powershell::Create' { It 'can create default instance' { diff --git a/test/powershell/engine/Api/GetNewClosure.Tests.ps1 b/test/powershell/engine/Api/GetNewClosure.Tests.ps1 index 78080390cf7..7868a25f8e4 100644 --- a/test/powershell/engine/Api/GetNewClosure.Tests.ps1 +++ b/test/powershell/engine/Api/GetNewClosure.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "ScriptBlock.GetNewClosure()" -tags "CI" { BeforeAll { diff --git a/test/powershell/engine/Api/InitialSessionState.Tests.ps1 b/test/powershell/engine/Api/InitialSessionState.Tests.ps1 index bf952ac2cae..5db70192ecd 100644 --- a/test/powershell/engine/Api/InitialSessionState.Tests.ps1 +++ b/test/powershell/engine/Api/InitialSessionState.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "InitialSessionState capacity" -Tags CI { BeforeAll { $iss = [initialsessionstate]::CreateDefault() diff --git a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 index 04ebb0b9829..003d9ba262b 100644 --- a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 +++ b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Language Primitive Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Language Primitive Tests" -Tags "CI" { It "Equality comparison with string and non-numeric type should not be culture sensitive" { $date = [datetime]'2005,3,10' $val = [System.Management.Automation.LanguagePrimitives]::Equals($date, "3/10/2005") diff --git a/test/powershell/engine/Api/ProxyCommand.Tests.ps1 b/test/powershell/engine/Api/ProxyCommand.Tests.ps1 index 9abb8717f47..61046788c92 100644 --- a/test/powershell/engine/Api/ProxyCommand.Tests.ps1 +++ b/test/powershell/engine/Api/ProxyCommand.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Management.Automation using namespace System.Collections.ObjectModel diff --git a/test/powershell/engine/Api/Serialization.Tests.ps1 b/test/powershell/engine/Api/Serialization.Tests.ps1 index cc83b7c37b5..d7bf4709ff5 100644 --- a/test/powershell/engine/Api/Serialization.Tests.ps1 +++ b/test/powershell/engine/Api/Serialization.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Serialization Tests" -tags "CI" { BeforeAll { $testfileName="SerializationTest.txt" diff --git a/test/powershell/engine/Api/TypeInference.Tests.ps1 b/test/powershell/engine/Api/TypeInference.Tests.ps1 index af91d1f4bce..44e5694d379 100644 --- a/test/powershell/engine/Api/TypeInference.Tests.ps1 +++ b/test/powershell/engine/Api/TypeInference.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Management.Automation using namespace System.Collections.Generic @@ -40,7 +42,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should be 'System.Int32' } - It "Infers type from string literal" { $res = [AstTypeInference]::InferTypeOf( { "Text" }.Ast) $res.Count | Should Be 1 @@ -138,7 +139,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Count | Should Be 0 } - It "Infers type from using statement" { $res = [AstTypeInference]::InferTypeOf( { $pid = 1; $using:pid }.Ast.EndBlock.Statements[1].PipelineElements[0].Expression) $res.Count | Should Be 1 @@ -192,7 +192,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should be 'System.String' } - It "Infers type from named block" { $res = [AstTypeInference]::InferTypeOf( { begin {1}}.Ast.BeginBlock) $res.Count | Should Be 1 @@ -579,7 +578,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Count | Should be 0 } - It 'Infers type of alias property' { class X { [int] $Length @@ -593,7 +591,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should be System.Int32 } - It 'Infers type of code property' { class X { static [int] CodeProp([psobject] $o) { return 1 } @@ -642,7 +639,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should be System.Int32 } - It 'Infers type of note property' { $res = [AstTypeInference]::InferTypeOf( { @@ -844,7 +840,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should Be System.DateTime } - It 'Infers type of note property with safe eval' -Skip { $res = [AstTypeInference]::InferTypeOf( { [pscustomobject] @{ @@ -865,8 +860,6 @@ Describe "Type inference Tests" -tags "CI" { $res.Name | Should be System.Int32 } - - It 'Infers type of script property with safe eval' -Skip { class Y {} Update-TypeData -TypeName Y -MemberName SafeEvalScriptProp -MemberType ScriptProperty -Value {1} -Force diff --git a/test/powershell/engine/Basic/Assembly.LoadFrom.ps1 b/test/powershell/engine/Basic/Assembly.LoadFrom.ps1 index 9704df5f8ed..de542d01ca7 100644 --- a/test/powershell/engine/Basic/Assembly.LoadFrom.ps1 +++ b/test/powershell/engine/Basic/Assembly.LoadFrom.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Assembly.LoadFrom Validation Test" -Tags "CI" { BeforeAll { $ConsumerCode = @' diff --git a/test/powershell/engine/Basic/Attributes.Tests.ps1 b/test/powershell/engine/Basic/Attributes.Tests.ps1 index 78434566ed4..5e4e233498b 100644 --- a/test/powershell/engine/Basic/Attributes.Tests.ps1 +++ b/test/powershell/engine/Basic/Attributes.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Attribute tests" -Tags "CI" { BeforeEach { Remove-Item $testdrive/test.ps1 -Force -ErrorAction SilentlyContinue diff --git a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 index 3659e183015..0840bd451a8 100644 --- a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 +++ b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Command Discovery tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Command Discovery tests" -Tags "CI" { BeforeAll { setup -f testscript.ps1 -content "'This script should not run. Running from testscript.ps1'" diff --git a/test/powershell/engine/Basic/Credential.Tests.ps1 b/test/powershell/engine/Basic/Credential.Tests.ps1 index 3612efb4c6a..cfbc37ab62d 100644 --- a/test/powershell/engine/Basic/Credential.Tests.ps1 +++ b/test/powershell/engine/Basic/Credential.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Credential tests" -Tags "CI" { It "Explicit cast for an empty credential returns null" { # We should explicitly check that the expression returns $null diff --git a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 index d111d3a9129..56db6f98cb2 100644 --- a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 +++ b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Verify approved aliases list" -Tags "CI" { BeforeAll { $FullCLR = !$isCoreCLR diff --git a/test/powershell/engine/Basic/Encoding.Tests.ps1 b/test/powershell/engine/Basic/Encoding.Tests.ps1 index 309f2c26af1..8ab4836441a 100644 --- a/test/powershell/engine/Basic/Encoding.Tests.ps1 +++ b/test/powershell/engine/Basic/Encoding.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "File encoding tests" -Tag CI { Context "ParameterType for parameter 'Encoding' should be 'Encoding'" { diff --git a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 index 7a718852f50..cbd4d10f92c 100644 --- a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 +++ b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # # Functional tests to verify basic conditions for IO to the powershell.config.json files # The properties files are supported on non-Windows OSes, but the tests are specific to diff --git a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 index 981b4ffceb2..172ce829537 100644 --- a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 +++ b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Management.Automation using namespace System.Management.Automation.Language diff --git a/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 b/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 index 217197d7281..87755ed0a00 100644 --- a/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 +++ b/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Validate Attributes Tests' -Tags 'CI' { Context "ValidateCount" { diff --git a/test/powershell/engine/COM/COM.Basic.Tests.ps1 b/test/powershell/engine/COM/COM.Basic.Tests.ps1 index e0d277a2900..d6477f998c5 100644 --- a/test/powershell/engine/COM/COM.Basic.Tests.ps1 +++ b/test/powershell/engine/COM/COM.Basic.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { $defaultParamValues = $PSdefaultParameterValues.Clone() diff --git a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 index 8e2e0d59554..349139efd14 100644 --- a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 +++ b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $script:CimClassName = "PSCore_CimTest1" $script:CimNamespace = "root/default" $script:moduleDir = Join-Path -Path $PSScriptRoot -ChildPath assets -AdditionalChildPath CimTest diff --git a/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 b/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 index 3998c527e4f..83f2af544c5 100644 --- a/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 +++ b/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 @@ -1,6 +1,6 @@ @{ GUID = '41486F7D-842F-40F1-ACE4-8405F9C2ED9B' - Author="Microsoft Corporation" + Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion = '2.0.0.0' diff --git a/test/powershell/engine/ETS/Adapter.Tests.ps1 b/test/powershell/engine/ETS/Adapter.Tests.ps1 index 72efe1388dd..5dc7794ef54 100644 --- a/test/powershell/engine/ETS/Adapter.Tests.ps1 +++ b/test/powershell/engine/ETS/Adapter.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Adapter Tests" -tags "CI" { Context "Property Adapter Tests" { BeforeAll { diff --git a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 index c267ca51a4f..fb784a4390d 100644 --- a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 +++ b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function getIndex { param([string[]]$strings,[string]$pattern) diff --git a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 index 439df6c2300..ffa094722f2 100644 --- a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 @@ -1,4 +1,6 @@ -Describe 'Online help tests for PowerShell Core Cmdlets' -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe 'Online help tests for PowerShell Core Cmdlets' -Tags "CI" { # The csv files (V2Cmdlets.csv and V3Cmdlets.csv) contain a list of cmdlets and expected HelpURIs. # The HelpURI is part of the cmdlet metadata, and when the user runs 'get-help -online' diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index a48268f8622..b72a98616bb 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -1,4 +1,6 @@ -# +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +# # Validates Get-Help for cmdlets in Microsoft.PowerShell.Core. function UpdateHelpFromLocalContentPath @@ -164,7 +166,6 @@ Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', ' $noun = $helptest.noun $pending = $helptest.pending - It -Pending:$pending "Shows contextual help when Get-Help is invoked for provider-specific path (Get-Help -Name $verb-$noun -Path $path)" { # Path should exist or else Get-Help will fallback to default help text diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index 0f38be9a5e6..3f193728fcd 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -1,4 +1,6 @@ - +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # Test Settings: # This is the list of PowerShell Core modules for which we test update-help $powershellCoreModules = @( diff --git a/test/powershell/engine/Job/Jobs.Tests.ps1 b/test/powershell/engine/Job/Jobs.Tests.ps1 index eb0ac846548..72eb53a0f44 100644 --- a/test/powershell/engine/Job/Jobs.Tests.ps1 +++ b/test/powershell/engine/Job/Jobs.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe 'Basic Job Tests' -Tags 'CI' { BeforeAll { # Make sure we do not have any jobs running @@ -233,7 +235,6 @@ Describe 'Basic Job Tests' -Tags 'CI' { } } - Context 'Remove-Job tests' { # The test pattern used here is different from other tests since there is a scoping issue in Pester. # If BeforeEach is used then $removeJobTestCases does not bind when the It is called. diff --git a/test/powershell/engine/Module/ModulePath.Tests.ps1 b/test/powershell/engine/Module/ModulePath.Tests.ps1 index ade31fa71f8..6dd7142d678 100644 --- a/test/powershell/engine/Module/ModulePath.Tests.ps1 +++ b/test/powershell/engine/Module/ModulePath.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "SxS Module Path Basic Tests" -tags "CI" { BeforeAll { @@ -39,7 +41,6 @@ Describe "SxS Module Path Basic Tests" -tags "CI" { $env:PSModulePath = $originalModulePath } - It "validate sxs module path" { $env:PSModulePath = "" @@ -53,7 +54,6 @@ Describe "SxS Module Path Basic Tests" -tags "CI" { $paths[2].TrimEnd([System.IO.Path]::DirectorySeparatorChar) | Should Be $expectedSystemPath } - It "ignore pshome module path derived from a different powershell core instance" -Skip:(!$IsCoreCLR) { ## Create 'powershell' and 'pwsh.deps.json' in the fake PSHome folder, diff --git a/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 b/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 index ce69ee44ed0..6cbde262bd8 100644 --- a/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-ModuleManifest tests" -tags "CI" { BeforeEach { $null = New-Item -ItemType Directory -Path testdrive:/module diff --git a/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 b/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 index 1276906a406..1d823f35ab7 100644 --- a/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 +++ b/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Tests for paths of submodules in module manifest" -tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Tests for paths of submodules in module manifest" -tags "CI" { $moduleName = 'ModuleA' $moduleFileName = "$moduleName.psd1" diff --git a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 index 744e0d1a3f4..53df7081dab 100644 --- a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Test-ModuleManifest tests" -tags "CI" { AfterEach { @@ -124,7 +126,6 @@ Describe "Test-ModuleManifest tests" -tags "CI" { } } - Describe "Tests for circular references in required modules" -tags "CI" { function CreateTestModules([string]$RootPath, [string[]]$ModuleNames, [bool]$AddVersion, [bool]$AddGuid, [bool]$AddCircularReference) diff --git a/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psd1 b/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psd1 index 8c274b0e722..149a2f7a297 100644 --- a/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psd1 +++ b/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psd1 @@ -8,13 +8,13 @@ ModuleVersion = '2.5' GUID = '369f0ee4-4cda-4ac3-a5c5-08e7bbc06e1a' # Author of this module -Author = 'manikb' +Author = 'PowerShell' # Company or vendor of this module -CompanyName = 'Unknown' +CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = '(c) 2015 manikb. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' # Description of the functionality provided by this module Description = 'NestedRequiredModule1 module' diff --git a/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psm1 b/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psm1 index 52544a3cade..863908fa935 100644 --- a/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psm1 +++ b/test/powershell/engine/Module/assets/testmodulerunspace/NestedRequiredModule1/2.5/NestedRequiredModule1.psm1 @@ -1 +1,3 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Get-NestedRequiredModule1 { Get-Date } diff --git a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 index 2c76e1f0dc8..eebbde90243 100644 --- a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "BooleanParameterDCR Tests" -tags "CI" { BeforeAll { Function ParserTestSwitchCmdlet diff --git a/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 b/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 index 17e35879fb4..3a165a47b69 100644 --- a/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Nullable Boolean DCR Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Nullable Boolean DCR Tests" -Tags "CI" { BeforeAll { function ParserTestFunction { diff --git a/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 b/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 index 47a572cd943..9795b2aa046 100644 --- a/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 @@ -1,4 +1,6 @@ -Describe "Parameter Binding Tests" -Tags "CI" { +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +Describe "Parameter Binding Tests" -Tags "CI" { It "Should throw a parameter binding exception when two parameters have the same position" { function test-PositionalBinding1 { [CmdletBinding()] diff --git a/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 b/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 index 2aaf432e068..14a6e875873 100644 --- a/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. using namespace System.Management.Automation.Language Describe "StaticParameterBinder tests" -Tags "CI" { diff --git a/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 b/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 index 18697e7f21a..b2f02cff4f0 100644 --- a/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 +++ b/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 @@ -1,4 +1,6 @@ -## +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +## ## PowerShell Invoke-Command -RemoteDebug Tests ## diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index ff78ef011ae..88cf35be5e2 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "New-PSSession basic test" -Tag @("CI") { It "New-PSSession should not crash powershell" { try { diff --git a/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 b/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 index d516803d6c9..dd2a16f7878 100644 --- a/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 +++ b/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. ## ## PowerShell Remoting Endpoint Role Capability Files Tests ## diff --git a/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 b/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 index 1b041d3e8c8..2eaa9be66bf 100644 --- a/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 +++ b/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "SSH Remoting API Tests" -Tags "Feature" { Context "SSHConnectionInfo Class Tests" { diff --git a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 index df2d2d6639d..d538fd58ba0 100644 --- a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 +++ b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. ## ## SSH Remoting cmdlet tests ## diff --git a/test/powershell/engine/Remoting/SessionOption.Tests.ps1 b/test/powershell/engine/Remoting/SessionOption.Tests.ps1 index f0431b5649e..4689904e67b 100644 --- a/test/powershell/engine/Remoting/SessionOption.Tests.ps1 +++ b/test/powershell/engine/Remoting/SessionOption.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. try { if ( ! $IsWindows ) { $PSDefaultParameterValues['it:skip'] = $true diff --git a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 index 2ba5ee9b3bf..e7e849b06c6 100644 --- a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.Management.Infrastructure.CimCmdlets" diff --git a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 index 29737b26270..0f6c3367f86 100644 --- a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.ConsoleHost" diff --git a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 index e3f757f3b4e..9bd8992c3de 100644 --- a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.CoreCLR.Eventing" diff --git a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 index d125ba0a82c..ae242d37127 100644 --- a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.Commands.Management" diff --git a/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 index 44845b3548a..d03788a4d50 100644 --- a/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $AssemblyName = "System.Management.Automation" diff --git a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 index d386be36f04..d58bf385fc3 100644 --- a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.PowerShell.Security" diff --git a/test/powershell/engine/ResourceValidation/TestRunner.ps1 b/test/powershell/engine/ResourceValidation/TestRunner.ps1 index 7c016207218..99c4d798e21 100644 --- a/test/powershell/engine/ResourceValidation/TestRunner.ps1 +++ b/test/powershell/engine/ResourceValidation/TestRunner.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Test-ResourceStrings { param ( $AssemblyName, $ExcludeList ) diff --git a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 index 67e4e49ceeb..a50245439d2 100644 --- a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $AssemblyName = "Microsoft.PowerShell.Commands.Utility" diff --git a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 index 3c8a2cdee3b..c2154dc46d6 100644 --- a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. . "$psscriptroot/TestRunner.ps1" $assemblyName = "Microsoft.WSMan.Management" diff --git a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 index bd3fd21eae4..cbab044244d 100644 --- a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 +++ b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 @@ -1,4 +1,6 @@ -param( +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. +param( [Parameter(Mandatory = $true, Position = 0)] $coverallsToken, [Parameter(Mandatory = $true, Position = 1)] $codecovToken, [Parameter(Position = 2)] $azureLogDrive = "L:\", diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index 17ac9e6a211..0b970f245ca 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Wait-UntilTrue { [CmdletBinding()] diff --git a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 index a275fec8452..45e4db5b844 100755 --- a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 +++ b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $definition = @' using System; using System.Collections.Generic; diff --git a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 index 6343395e22f..2296feccc59 100644 --- a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 +++ b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # # Run the new parser, return either errors or the ast # @@ -51,7 +53,6 @@ function position_message } } - # # Pester friendly version of Test-Error # @@ -106,7 +107,6 @@ function ShouldBeParseError } } - function Flatten-Ast { [CmdletBinding()] diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 index d80cbb4017a..9ac45770446 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. # # This module include help functions for writing remoting tests # diff --git a/test/tools/Modules/HttpListener/HttpListener.psd1 b/test/tools/Modules/HttpListener/HttpListener.psd1 index 0199dab6007..711bf72f164 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psd1 +++ b/test/tools/Modules/HttpListener/HttpListener.psd1 @@ -1,7 +1,7 @@ @{ ModuleVersion = '1.0.0' GUID = 'e148b26c-0594-4963-99e5-419d4ff302e2' -Author = 'Steve Lee' +Author = 'PowerShell' CompanyName = 'Microsoft' Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' Description = 'Creates a new HTTP Listener for testing purposes' diff --git a/test/tools/Modules/HttpListener/HttpListener.psm1 b/test/tools/Modules/HttpListener/HttpListener.psm1 index b682235617a..11d12682503 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psm1 +++ b/test/tools/Modules/HttpListener/HttpListener.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Function Stop-HTTPListener { <# .Synopsis diff --git a/test/tools/Modules/WebListener/WebListener.psm1 b/test/tools/Modules/WebListener/WebListener.psm1 index 54aed0c6654..95856f0e208 100644 --- a/test/tools/Modules/WebListener/WebListener.psm1 +++ b/test/tools/Modules/WebListener/WebListener.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Class WebListener { [int]$HttpPort diff --git a/test/tools/OpenCover/OpenCover.psd1 b/test/tools/OpenCover/OpenCover.psd1 index 0b92431fd9d..89fd1db07db 100644 --- a/test/tools/OpenCover/OpenCover.psd1 +++ b/test/tools/OpenCover/OpenCover.psd1 @@ -2,7 +2,7 @@ RootModule = 'OpenCover.psm1' ModuleVersion = '1.1.0.0' GUID = '4eedcffd-26e8-4172-8aad-9b882c13d370' -Author = 'Microsoft Corporation' +Author = 'PowerShell' CompanyName = 'Microsoft Corporation' Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' Description = 'Module to install OpenCover and run Powershell tests to collect code coverage' diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 7822bd23001..8899fb72166 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -1,4 +1,7 @@ -#region privateFunctions +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +#region privateFunctions $script:psRepoPath = [string]::Empty if ($null -ne (Get-Command -Name 'git' -ErrorAction Ignore)) { @@ -426,7 +429,6 @@ function Get-CodeCoverage (Get-CoverageData -xmlPath $xmlPath) } - <# .Synopsis Compare results between two coverage runs. diff --git a/test/tools/TestExe/TestExe.cs b/test/tools/TestExe/TestExe.cs index bd2ae5219f5..40167a86d66 100644 --- a/test/tools/TestExe/TestExe.cs +++ b/test/tools/TestExe/TestExe.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Threading; using System.Diagnostics; diff --git a/test/tools/WebListener/Constants.cs b/test/tools/WebListener/Constants.cs index bb6c3d3c86b..ea4276318da 100644 --- a/test/tools/WebListener/Constants.cs +++ b/test/tools/WebListener/Constants.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; namespace mvc.Controllers @@ -11,7 +13,6 @@ internal static class Constants public const string NoRelLinkHeader = "; foo=\"bar\""; public const string NoUrlLinkHeader = "<>; rel=\"next\""; - } internal static class StatusCodes diff --git a/test/tools/WebListener/Controllers/AuthController.cs b/test/tools/WebListener/Controllers/AuthController.cs index c75eff0b7e7..a7172d1aaca 100644 --- a/test/tools/WebListener/Controllers/AuthController.cs +++ b/test/tools/WebListener/Controllers/AuthController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/CertController.cs b/test/tools/WebListener/Controllers/CertController.cs index 1acbf566020..d272eecd8a4 100644 --- a/test/tools/WebListener/Controllers/CertController.cs +++ b/test/tools/WebListener/Controllers/CertController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/CompressionController.cs b/test/tools/WebListener/Controllers/CompressionController.cs index b715f5db6c4..22cab21c796 100644 --- a/test/tools/WebListener/Controllers/CompressionController.cs +++ b/test/tools/WebListener/Controllers/CompressionController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/test/tools/WebListener/Controllers/DelayController.cs b/test/tools/WebListener/Controllers/DelayController.cs index 310276bd15b..2298c892540 100644 --- a/test/tools/WebListener/Controllers/DelayController.cs +++ b/test/tools/WebListener/Controllers/DelayController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/EncodingController.cs b/test/tools/WebListener/Controllers/EncodingController.cs index b139a1a719c..e093d396f29 100644 --- a/test/tools/WebListener/Controllers/EncodingController.cs +++ b/test/tools/WebListener/Controllers/EncodingController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/GetController.cs b/test/tools/WebListener/Controllers/GetController.cs index 59df91e0f68..24a3edb3bfe 100644 --- a/test/tools/WebListener/Controllers/GetController.cs +++ b/test/tools/WebListener/Controllers/GetController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/HomeController.cs b/test/tools/WebListener/Controllers/HomeController.cs index 2a8a7a3e29a..88c12d7ebd4 100644 --- a/test/tools/WebListener/Controllers/HomeController.cs +++ b/test/tools/WebListener/Controllers/HomeController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/test/tools/WebListener/Controllers/LinkController.cs b/test/tools/WebListener/Controllers/LinkController.cs index 3242e35326e..a24b1895a1d 100644 --- a/test/tools/WebListener/Controllers/LinkController.cs +++ b/test/tools/WebListener/Controllers/LinkController.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.Collections; using System.Collections.Generic; diff --git a/test/tools/WebListener/Controllers/MultipartController.cs b/test/tools/WebListener/Controllers/MultipartController.cs index c56c6e68c97..f94e539893e 100644 --- a/test/tools/WebListener/Controllers/MultipartController.cs +++ b/test/tools/WebListener/Controllers/MultipartController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -11,7 +13,6 @@ using Microsoft.Net.Http.Headers; using mvc.Models; - namespace mvc.Controllers { public class MultipartController : Controller diff --git a/test/tools/WebListener/Controllers/RedirectController.cs b/test/tools/WebListener/Controllers/RedirectController.cs index faa7747a7a0..ac5e14f26a6 100644 --- a/test/tools/WebListener/Controllers/RedirectController.cs +++ b/test/tools/WebListener/Controllers/RedirectController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; @@ -11,7 +13,6 @@ using Microsoft.Extensions.Primitives; using mvc.Models; - namespace mvc.Controllers { public class RedirectController : Controller diff --git a/test/tools/WebListener/Controllers/ResponseController.cs b/test/tools/WebListener/Controllers/ResponseController.cs index cfef8d1aaf2..40bf06a2cc6 100644 --- a/test/tools/WebListener/Controllers/ResponseController.cs +++ b/test/tools/WebListener/Controllers/ResponseController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/ResponseHeadersController.cs b/test/tools/WebListener/Controllers/ResponseHeadersController.cs index 04de81a727b..e53f10f6271 100644 --- a/test/tools/WebListener/Controllers/ResponseHeadersController.cs +++ b/test/tools/WebListener/Controllers/ResponseHeadersController.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; diff --git a/test/tools/WebListener/DeflateFilter.cs b/test/tools/WebListener/DeflateFilter.cs index beab309b007..89e9e353fb2 100644 --- a/test/tools/WebListener/DeflateFilter.cs +++ b/test/tools/WebListener/DeflateFilter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; using System.IO.Compression; diff --git a/test/tools/WebListener/GzipFilter.cs b/test/tools/WebListener/GzipFilter.cs index c15976beb7f..4fd39034e3a 100644 --- a/test/tools/WebListener/GzipFilter.cs +++ b/test/tools/WebListener/GzipFilter.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; using System.IO; using System.IO.Compression; diff --git a/test/tools/WebListener/Models/ErrorViewModel.cs b/test/tools/WebListener/Models/ErrorViewModel.cs index 3c4066e0ecb..3a501f23674 100644 --- a/test/tools/WebListener/Models/ErrorViewModel.cs +++ b/test/tools/WebListener/Models/ErrorViewModel.cs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. using System; namespace mvc.Models diff --git a/test/tools/WebListener/Program.cs b/test/tools/WebListener/Program.cs index e0706c9a374..74135b2f2ce 100644 --- a/test/tools/WebListener/Program.cs +++ b/test/tools/WebListener/Program.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -12,8 +14,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; - - namespace mvc { public class Program diff --git a/test/tools/WebListener/Startup.cs b/test/tools/WebListener/Startup.cs index 1c2417a45cd..9cf4844d578 100644 --- a/test/tools/WebListener/Startup.cs +++ b/test/tools/WebListener/Startup.cs @@ -1,4 +1,6 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/tools/ResxGen/ResxGen.ps1 b/tools/ResxGen/ResxGen.ps1 index e56c00ab7c6..ab67f16e7fa 100755 --- a/tools/ResxGen/ResxGen.ps1 +++ b/tools/ResxGen/ResxGen.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <# .SYNOPSIS Generates a resx file and code file from an ETW manifest diff --git a/tools/ResxGen/ResxGen.psm1 b/tools/ResxGen/ResxGen.psm1 index 12f6188e9aa..6b3054846cf 100644 --- a/tools/ResxGen/ResxGen.psm1 +++ b/tools/ResxGen/ResxGen.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <# Enumerate all events in the manifest and create a hash table of event id to message id. > $manifest.assembly.instrumentation.events.provider.events.event @@ -298,7 +300,6 @@ class EventMessage } } - enum LogLevel { Always = 0 diff --git a/tools/Sign-Package.ps1 b/tools/Sign-Package.ps1 index 6a9409b45cb..a72db5a358f 100644 --- a/tools/Sign-Package.ps1 +++ b/tools/Sign-Package.ps1 @@ -1,4 +1,7 @@ -# Utility to generate a self-signed certificate and sign a given package such as PowerShell.zip/appx/msi +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# Utility to generate a self-signed certificate and sign a given package such as PowerShell.zip/appx/msi [CmdletBinding()] param ( @@ -113,7 +116,6 @@ function Sign-Package return $PackageFilePath } - $certificate = New-SelfSignedCertificate -Verbose ConvertTo-Pfx -Verbose $signedPackage = Sign-Package -PackageFilePath $PackageFilePath -Verbose diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index ecb6a30a6e3..b423a2a5618 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $ErrorActionPreference = 'Stop' $repoRoot = Join-Path $PSScriptRoot '..' $script:administratorsGroupSID = "S-1-5-32-544" @@ -83,7 +85,6 @@ function Add-UserToGroup $groupAD.Add($userAD.AdsPath); } - # tests if we should run a daily build # returns true if the build is scheduled # or is a pushed tag diff --git a/tools/failingTests/fail.tests.ps1 b/tools/failingTests/fail.tests.ps1 index ed4d5ac37ef..c8ed87b0041 100644 --- a/tools/failingTests/fail.tests.ps1 +++ b/tools/failingTests/fail.tests.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Describe "Failing test used to test CI Scripts" -Tags 'CI' { It "Should fail" { 1 | should be 2 diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 444832f09be..9090016aa75 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. <# .Synopsis Install PowerShell Core on Windows, Linux or macOS. diff --git a/tools/packaging/packaging.psd1 b/tools/packaging/packaging.psd1 index 49c929f7ec3..fccf1a40f48 100644 --- a/tools/packaging/packaging.psd1 +++ b/tools/packaging/packaging.psd1 @@ -1,6 +1,6 @@ @{ GUID="41857994-4283-4757-a932-0b0edb104913" -Author="Microsoft Corporation" +Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0" diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 46dfff836ff..dc96def14f2 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. $Environment = Get-EnvironmentInformation $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.psd1" @@ -1227,7 +1229,6 @@ function New-ZipPackage } } - function New-NugetPackage { [CmdletBinding(SupportsShouldProcess=$true)] @@ -1255,7 +1256,6 @@ function New-NugetPackage [ValidateNotNullOrEmpty()] [string] $PackageConfiguration, - # Source Path to the Product Files - required to package the contents into an Zip [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index 74b3762e79c..5c5ff761316 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # PowerShell Script to build and package PowerShell from specified form and branch # Script is intented to use in Docker containers # Ensure PowerShell is available in the provided image diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 5db03c7eb4a..1ff7ba872cc 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. [cmdletbinding(DefaultParameterSetName='default')] # PowerShell Script to clone, build and package PowerShell from specified fork and branch param ( diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 index 3f54e2d6105..25079028edf 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. function Install-ChocolateyPackage { param( diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 index 11da58df024..db55a2d99a5 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. Import-Module "$PSScriptRoot\dockerInstall.psm1" # Install using Wix Zip because the MSI requires an older version of dotnet diff --git a/tools/releaseBuild/createComplianceFolder.ps1 b/tools/releaseBuild/createComplianceFolder.ps1 index 8e7dd922b0d..28716f0390c 100644 --- a/tools/releaseBuild/createComplianceFolder.ps1 +++ b/tools/releaseBuild/createComplianceFolder.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param( [Parameter(HelpMessage="Artifact folder to find compliance files in.")] [string[]] diff --git a/tools/releaseBuild/generatePackgeSigning.ps1 b/tools/releaseBuild/generatePackgeSigning.ps1 index bb02231f2e8..b5b2032772b 100644 --- a/tools/releaseBuild/generatePackgeSigning.ps1 +++ b/tools/releaseBuild/generatePackgeSigning.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param( [Parameter(Mandatory)] [string] $Path, diff --git a/tools/releaseBuild/macOS/PowerShellPackage.ps1 b/tools/releaseBuild/macOS/PowerShellPackage.ps1 index 2fdc90fed11..ba4eef86657 100644 --- a/tools/releaseBuild/macOS/PowerShellPackage.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackage.ps1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # PowerShell Script to build and package PowerShell from specified form and branch # Script is intented to use in Docker containers # Ensure PowerShell is available in the provided image diff --git a/tools/releaseBuild/updateSigning.ps1 b/tools/releaseBuild/updateSigning.ps1 index 6cf637cb5b2..32419153f6f 100644 --- a/tools/releaseBuild/updateSigning.ps1 +++ b/tools/releaseBuild/updateSigning.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param( [string] $SigningXmlPath = (Join-Path -Path $PSScriptRoot -ChildPath 'signing.xml') ) diff --git a/tools/releaseBuild/vstsbuild.ps1 b/tools/releaseBuild/vstsbuild.ps1 index e4a1e47f3f9..ddbe1475e5e 100644 --- a/tools/releaseBuild/vstsbuild.ps1 +++ b/tools/releaseBuild/vstsbuild.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. [cmdletbinding(DefaultParameterSetName='Build')] param( [Parameter(ParameterSetName='packageSigned')] @@ -70,7 +72,6 @@ End { $additionalFiles += $BuildPackagePath } - $psReleaseBranch = 'master' $psReleaseFork = 'PowerShell' $location = Join-Path -Path $PSScriptRoot -ChildPath 'PSRelease' diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index 1f05c44f395..1869ac90f6f 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. class CommitNode { [string] $Hash [string[]] $Parents @@ -245,5 +247,4 @@ function Get-NewOfficalPackage } } - Export-ModuleMember -Function Get-ChangeLog, Get-NewOfficalPackage diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 9e4795d9709..9005dbdc4db 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -1,3 +1,5 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. param( [ValidateSet('Bootstrap','Build','Failure','Success')] [String]$Stage = 'Build' @@ -6,7 +8,6 @@ param( Import-Module $PSScriptRoot/../build.psm1 -Force Import-Module $PSScriptRoot/packaging -Force - function Send-DailyWebHook { param ( @@ -148,7 +149,6 @@ function Set-DailyBuildBadge } } - # https://docs.travis-ci.com/user/environment-variables/ # TRAVIS_EVENT_TYPE: Indicates how the build was triggered. # One of push, pull_request, api, cron. @@ -166,7 +166,6 @@ else $commitMessage = $env:TRAVIS_COMMIT_MESSAGE } - # Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` $hasFeatureTag = $commitMessage -match '\[feature\]' $hasPackageTag = $commitMessage -match '\[package\]'