diff --git a/build.psm1 b/build.psm1 index 96e88e3804..2acbd36713 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 a572561f10..489502a6d3 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 30ada4e97e..1f5d60587d 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 d3688e7ea1..444ec34973 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 95b694c638..f393916408 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 3517e80588..4639f7ee1d 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 38ea8fd414..b127a2e516 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 7e4fc37831..c979a97467 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 02374b1d79..df7d814942 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 ee90c69f78..15fedb5207 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 f0ef43376a..72cc084d41 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 27e09f29e4..8f93dd507c 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 6703215241..0dc33f85c4 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 16b426a91d..291677fd94 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 0544efe15e..586e14a208 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 c9026304c9..fdad32a860 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 59bea0ce0d..db9867e8d2 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 2f4fb5e648..48165baf53 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 68ae2f3491..524f0c651d 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 f9aa64abfd..e126fd28a3 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 9391a58982..27e082c365 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 f9aa64abfd..e126fd28a3 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 9391a58982..27e082c365 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 92f0375196..ec88a87b6e 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 7a2005fee6..eeb950a639 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 bbf97b2fb5..8e575e235a 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 773f81ad6d..fad68f72b4 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 b9f9962710..b496a963d9 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 2f5dd0ac2a..b3fb43ba92 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 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// 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 47a0df2979..524f1c928a 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 e660b8ad4a..61a1fbcdd0 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 ad23b933c3..41b6434ad0 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 34a6319f08..c32c1f3a7b 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 79f91a1d86..33e7e1e9fc 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 84b0883feb..7543e21a18 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 785e0f2000..d8a49bd985 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 91005d8ecf..909f994a44 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 e5fed39d40..c9454f8e6c 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 f8758d98a6..8939e6d64e 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 d1cf303cb5..bdc22c965d 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 2dd000d96d..ea84a9d718 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 eadc0bc8e6..c8ab7fa01b 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.Collections.Generic; 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 9b2396c7d2..72ad250564 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 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets } } - /// /// /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs index f0259d744b..0c3d07d4d0 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 23b34f60a0..67f3250c28 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 1a87b451af..48310add1a 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 f5d84647cd..ab87b0676a 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 87f5466f12..9f05857fe6 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 @@ using System.Collections.Generic; #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 58a8538e07..21425d7b63 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 a59208be6a..f9a3b21db4 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 @@ using System.Diagnostics.CodeAnalysis; #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 57e610ddcc..628ea34811 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.Diagnostics.CodeAnalysis; 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 f67ee6cb5b..0b619f87a7 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.Diagnostics.CodeAnalysis; 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 c843acdb04..14f9c5f13c 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.Diagnostics.CodeAnalysis; 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 8e601f60e9..a9cfe00ee4 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 @@ using Microsoft.Management.Infrastructure.Options; #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 c03352af01..9bdc9c6c60 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 System.Management.Automation; 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 39ce6cfcd6..ec3005062b 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 System.Management.Automation; 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 6544f9d442..eb81541119 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 @@ using System.Management.Automation; #endregion - namespace Microsoft.Management.Infrastructure.CimCmdlets { /// @@ -64,7 +61,6 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets } 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 97194b9524..fbefb22302 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 3ff061400c..e1a85f30b2 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 66828f9b61..95d9efdc27 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 8ee3e95903..13b3eece1c 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 @@ namespace Microsoft.PowerShell.Commands.Diagnostics.Common [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 88b3a6f134..5ea3041de9 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 858f5f0b6f..f41e26a3a8 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 4ba65b3c8e..7732b20360 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 Microsoft.Powershell.Commands.GetCounter.PdhNative; using System.Globalization; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.PowerShell.Commands.GetCounter { public class PerformanceCounterSample @@ -56,7 +53,6 @@ namespace Microsoft.PowerShell.Commands.GetCounter } private string _path = ""; - public string InstanceName { get { return _instanceName; } @@ -64,7 +60,6 @@ namespace Microsoft.PowerShell.Commands.GetCounter } private string _instanceName = ""; - public double CookedValue { get { return _cookedValue; } @@ -107,7 +102,6 @@ namespace Microsoft.PowerShell.Commands.GetCounter } 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 fb7edd1ac9..d981700a11 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 @@ namespace Microsoft.PowerShell.Commands.GetCounter } 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 9a7e138b52..2769277e59 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.PdhNative; using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -54,7 +51,6 @@ namespace Microsoft.PowerShell.Commands private string _path; private string _resolvedPath; - // // Format parameter. // Valid strings are "blg", "csv", "tsv" (case-insensitive). @@ -73,8 +69,6 @@ namespace Microsoft.PowerShell.Commands } private string _format = "blg"; - - // // MaxSize parameter // Maximum output file size, in megabytes. @@ -88,7 +82,6 @@ namespace Microsoft.PowerShell.Commands } private UInt32 _maxSize = 0; - // // InputObject parameter // @@ -109,7 +102,6 @@ namespace Microsoft.PowerShell.Commands } private PerformanceCounterSampleSet[] _counterSampleSets = new PerformanceCounterSampleSet[0]; - // // Force switch // @@ -134,8 +126,6 @@ namespace Microsoft.PowerShell.Commands } private SwitchParameter _circular; - - private ResourceManager _resourceMgr = null; private PdhHelper _pdhHelper = null; @@ -213,7 +203,6 @@ namespace Microsoft.PowerShell.Commands _pdhHelper.Dispose(); } - /// /// Handle Control-C /// @@ -279,7 +268,6 @@ namespace Microsoft.PowerShell.Commands _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 29da31a48b..50d099b25f 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.PdhNative; using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -59,7 +56,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _listSet = { "*" }; - // // Counter parameter // @@ -93,7 +89,6 @@ namespace Microsoft.PowerShell.Commands private List _accumulatedCounters = new List(); - // // SampleInterval parameter. // Defaults to 1 second. @@ -111,7 +106,6 @@ namespace Microsoft.PowerShell.Commands } private int _sampleInterval = 1; - // // MaxSamples parameter // @@ -134,7 +128,6 @@ namespace Microsoft.PowerShell.Commands private Int64 _maxSamples = 1; private bool _maxSamplesSpecified = false; - // // Continuous switch // @@ -146,7 +139,6 @@ namespace Microsoft.PowerShell.Commands } private bool _continuous = false; - // // ComputerName parameter // @@ -228,7 +220,6 @@ namespace Microsoft.PowerShell.Commands return; } - if (Continuous.IsPresent && _maxSamplesSpecified) { Exception exc = new Exception(string.Format(CultureInfo.CurrentCulture, _resourceMgr.GetString("CounterContinuousOrMaxSamples"))); @@ -249,7 +240,6 @@ namespace Microsoft.PowerShell.Commands _pdhHelper.Dispose(); } - // // Handle Control-C // @@ -449,7 +439,6 @@ namespace Microsoft.PowerShell.Commands _cultureAndSpecialCharacterMap.TryGetValue(culture.Name, out characterReplacementList); } - StringCollection allExpandedPaths = new StringCollection(); foreach (string path in paths) { @@ -597,7 +586,6 @@ namespace Microsoft.PowerShell.Commands } } - // // 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 f23a6da9ad..78b64e74b6 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 @@ namespace Microsoft.PowerShell.Commands } private string[] _logName = { "*" }; - /// /// ListProvider parameter /// @@ -99,7 +97,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _listProvider = { "*" }; - /// /// ProviderName parameter /// @@ -123,7 +120,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _providerName; - /// /// Path parameter /// @@ -147,7 +143,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _path; - /// /// MaxEvents parameter /// @@ -244,7 +239,6 @@ namespace Microsoft.PowerShell.Commands } private PSCredential _credential = PSCredential.Empty; - /// /// FilterXPath parameter /// @@ -294,7 +288,6 @@ namespace Microsoft.PowerShell.Commands } private XmlDocument _xmlQuery = null; - /// /// FilterHashtable parameter /// @@ -349,7 +342,6 @@ namespace Microsoft.PowerShell.Commands } private bool _oldest = false; - // // Query builder constant strings // @@ -404,7 +396,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); } - /// /// EndProcessing() is invoked once per pipeline /// @@ -438,7 +428,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// ProcessRecord() override. /// This is the main entry point for the cmdlet. @@ -481,7 +470,6 @@ namespace Microsoft.PowerShell.Commands } } - // // 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 @@ namespace Microsoft.PowerShell.Commands } } - // // Process GetProviderSet parameter set // @@ -558,7 +545,6 @@ namespace Microsoft.PowerShell.Commands return; } - EventLogQuery logQuery = null; if (_providersByLogMap.Count > 1) { @@ -584,7 +570,6 @@ namespace Microsoft.PowerShell.Commands } } - // // Process ListLog parameter set // @@ -746,7 +731,6 @@ namespace Microsoft.PowerShell.Commands } } - // // Process FileSet parameter set // @@ -857,7 +841,6 @@ namespace Microsoft.PowerShell.Commands return eventLogSession; } - // // ReadEvents helper. // @@ -901,7 +884,6 @@ namespace Microsoft.PowerShell.Commands } outputObj.Properties.Add(new PSNoteProperty("Message", evtMessage)); - // // Enumerate the object one level to get to event payload // @@ -918,8 +900,6 @@ namespace Microsoft.PowerShell.Commands } } - - // // BuildStructuredQuery() builds a structured query from cmdlet arguments. // @@ -1311,7 +1291,6 @@ namespace Microsoft.PowerShell.Commands } } //end foreach hashtable - result.Append(queryListClose); return result.ToString(); @@ -1444,7 +1423,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands return ret.ToString(); } - // // HandleEndTimeHashValue helper for hashtable structured query builder. // Constructs and returns TimeCreated XPath portion as a string. @@ -1563,7 +1540,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands return true; } - // // KeywordStringToInt64 helper converts a string to Int64. // Returns true and keyLong ref if successful. @@ -1876,7 +1850,6 @@ namespace Microsoft.PowerShell.Commands return ret; } - // // BuildProvidersPredicate() builds a predicate expression like: // "System/Provider[@Name='a' or @Name='b']" @@ -1903,7 +1876,6 @@ namespace Microsoft.PowerShell.Commands return predicate.ToString(); } - // // BuildAllProvidersPredicate() builds a predicate expression like: // "System/Provider[@Name='a' or @Name='b']" @@ -1948,7 +1920,6 @@ namespace Microsoft.PowerShell.Commands return predicate.ToString(); } - // // AddLogsForProviderToInternalMap helper. // Retrieves log names to which _providerName writes. @@ -2130,4 +2101,3 @@ namespace Microsoft.PowerShell.Commands } } - diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs index 6aa23f2eca..a4483c7497 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 d8635b38b5..b9275784fc 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.PdhNative; using Microsoft.PowerShell.Commands.GetCounter; using Microsoft.PowerShell.Commands.Diagnostics.Common; - namespace Microsoft.PowerShell.Commands { /// @@ -62,7 +59,6 @@ namespace Microsoft.PowerShell.Commands private List _accumulatedFileNames = new List(); - // // ListSet parameter // @@ -84,7 +80,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _listSet = new string[0]; - // // StartTime parameter // @@ -100,7 +95,6 @@ namespace Microsoft.PowerShell.Commands } private DateTime _startTime = DateTime.MinValue; - // // EndTime parameter // @@ -116,7 +110,6 @@ namespace Microsoft.PowerShell.Commands } private DateTime _endTime = DateTime.MaxValue; - // // Counter parameter // @@ -165,14 +158,12 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands _accumulatedFileNames.AddRange(_path); } - // // BeginProcessing() is invoked once per pipeline // @@ -241,7 +231,6 @@ namespace Microsoft.PowerShell.Commands _pdhHelper.Dispose(); } - // // Handle Control-C // @@ -251,7 +240,6 @@ namespace Microsoft.PowerShell.Commands _pdhHelper.Dispose(); } - // // ProcessRecord() override. // This is the main entry point for the cmdlet. @@ -331,7 +319,6 @@ namespace Microsoft.PowerShell.Commands continue; } - StringCollection counterSetCounters = new StringCollection(); StringCollection counterSetInstances = new StringCollection(); @@ -508,7 +495,6 @@ namespace Microsoft.PowerShell.Commands } } - // // ValidateFilePaths() helper. // Validates the _resolvedPaths: present for all parametersets. @@ -563,7 +549,6 @@ namespace Microsoft.PowerShell.Commands } } - // // ResolveFilePath helper. // Returns a string collection of resolved file paths. @@ -674,4 +659,3 @@ namespace Microsoft.PowerShell.Commands } } - diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index ec064f0d8b..e242d3455a 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 @@ namespace Microsoft.PowerShell.Commands private const string DataTag = "data"; private ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); - /// /// ProviderName /// @@ -73,7 +71,6 @@ namespace Microsoft.PowerShell.Commands private int _id; private bool _idSpecified = false; - /// /// Version (event version) /// @@ -95,7 +92,6 @@ namespace Microsoft.PowerShell.Commands private byte _version; private bool _versionSpecified = false; - /// /// Event Payload /// @@ -353,4 +349,4 @@ namespace Microsoft.PowerShell.Commands : 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 ce1eea08e9..d42d6a2f60 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative _isPreVista = isPreVista; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private struct PDH_COUNTER_PATH_ELEMENTS { @@ -274,7 +270,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative public UInt32 SampleCount; } - /* // // This is the structure returned by PdhGetCounterInfo(). @@ -304,7 +299,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative [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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative [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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative ref IntPtr pdwBufferSize, uint dwFlags); - [DllImport("pdh.dll", CharSet = CharSet.Unicode)] private static extern uint PdhExpandWildCardPathH(PdhSafeDataSourceHandle hDataSource, string szWildCardPath, @@ -427,11 +419,9 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative [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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative // private Dictionary _consumerPathToHandleAndInstanceMap = new Dictionary(); - // // m_ReloggerPathToHandleAndInstanceMap map is used for writing relog counters. // @@ -504,8 +493,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - public uint ConnectToDataSource(StringCollection blgFileNames) { if (blgFileNames.Count == 1) @@ -635,7 +621,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - public uint SetQueryTimeRange(DateTime startTime, DateTime endTime) { Debug.Assert(_hQuery != null); @@ -799,7 +784,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative { 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } } - private uint MakePath(PDH_COUNTER_PATH_ELEMENTS pathElts, out string outPath, bool bWildcardInstances) { outPath = ""; @@ -947,7 +930,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } pathElts.ObjectName = objNameLocalized; - string ctrNameLocalized; res = LookupPerfNameByIndex(pathElts.MachineName, (uint)counterIndex, out ctrNameLocalized); if (res != 0) @@ -1085,11 +1064,9 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative res = MakePath(pathElts, out localizedPath, false); - return res; } - public uint LookupPerfNameByIndex(string machineName, uint index, out string locName) { // @@ -1124,8 +1101,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - - public uint GetValidPaths(string machineName, string objectName, ref StringCollection counters, @@ -1168,7 +1143,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - public uint AddCounters(ref StringCollection validPaths, bool bFlushOldCounters) { Debug.Assert(_hQuery != null && !_hQuery.IsInvalid); @@ -1210,7 +1184,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return bAtLeastOneAdded ? 0 : res; } - // // AddRelogCounters combines instances and adds counters to m_hQuery. // The counter handles and full paths @@ -1325,8 +1298,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - public uint ReadNextSet(out PerformanceCounterSampleSet nextSet, bool bSkipReading) { Debug.Assert(_hQuery != null && !_hQuery.IsInvalid); @@ -1658,7 +1628,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative fmtValueDouble.CStatus); } - nextSet = new PerformanceCounterSampleSet(batchStamp, samplesArr, _firstReading); _firstReading = false; @@ -1677,7 +1646,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative return res; } - public uint GetFilesSummary(out CounterFileInfo summary) { IntPtr pNumEntries = new IntPtr(0); @@ -1770,7 +1738,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative 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 b2adb01126..c77e9f10f5 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 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { @@ -29,9 +27,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } } - - - internal sealed class PdhSafeQueryHandle : SafeHandle { private PdhSafeQueryHandle() : base(IntPtr.Zero, true) { } @@ -44,7 +39,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } } - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] protected override bool ReleaseHandle() { @@ -64,7 +58,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative } } - [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 793bb0e6ba..b878633b75 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 0854414a44..af44bb8fee 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 93bb4f7932..1ed6dadfa9 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 58b981c0ce..7091121746 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 2ed6c186d0..c28363eae5 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 366f31a76a..1b7fbf99da 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 86adf0750e..088b56b796 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 db81ea3793..f93c54cd7c 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 49a227dadc..a1cb7ad62a 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 c51085292a..c1f0206420 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 734f87e7e1..bdddd60ac5 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 662d890b69..edeb98b784 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 f19fadc667..a2a400eb7b 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 67035a15e2..dc4a9c8d48 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 cf2a78ca39..9800745128 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 @@ namespace Microsoft.PowerShell.Cmdletization.Cim 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 @@ namespace Microsoft.PowerShell.Cmdletization.Cim 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 50b4d48697..9d5606fd5b 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 75866b49e3..96fd9c1e37 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 9c6679697c..c51de701a7 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 @@ namespace Microsoft.PowerShell.Cim "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 2cee2f22a8..89f0cad906 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 528dac6cda..bbd6bad2fc 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 4878cf51bf..3add2eb53f 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 8a7bfa882a..81fc991dd4 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 683384b5a8..f07114a537 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 f9784f9f5e..04b2c6df35 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 @@ namespace Microsoft.PowerShell.Commands 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 ad56f989ae..28f4e97f43 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 f0e57fc3e4..acda6e95ae 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 b752936ac1..60ded819c9 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 @@ namespace Microsoft.PowerShell.Commands } // 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 183c3712fb..9e2ec6eb74 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 @@ namespace Microsoft.PowerShell.Commands [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 a1fd4a9ee4..be7cda5a31 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 @@ namespace Microsoft.PowerShell.Commands } // 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 a23aa040ed..8d583a7fec 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 744849d3d9..208c75d061 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 @@ $result } }// 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 @@ $result [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 @@ $result 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 @@ $result /// internal const string localhostStr = "localhost"; - /// /// Get the local admin user name from a local NetworkCredential /// @@ -1967,7 +1964,6 @@ $result return renamecomputerchangeinfo; } - internal static void WriteNonTerminatingError(int errorcode, PSCmdlet cmdlet, string computername) { Win32Exception ex = new Win32Exception(errorcode); @@ -2107,7 +2103,7 @@ $result 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 87a3256316..f82be5f916 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 @@ namespace Microsoft.PowerShell.Commands } // AttachNotes } // ContentPathsCache - /// /// A struct to hold the path information and the content readers/writers /// for an item. @@ -410,7 +408,6 @@ namespace Microsoft.PowerShell.Commands holder.PathInfo.Path, e); - // Log a provider health event MshLog.LogProviderHealthEvent( @@ -448,7 +445,6 @@ namespace Microsoft.PowerShell.Commands 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 5950e80b0f..8c8dcbe2e2 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 ef093e9107..06ea2fc792 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 @@ namespace Microsoft.PowerShell.Commands } // 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 a5392a7caf..15b3327b3c 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 @@ namespace Microsoft.PowerShell.Commands } // 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 86194f41fe..eececdd3d3 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 @@ namespace Microsoft.PowerShell.Commands } private long[] _instanceIds = null; - /// /// match eventlog entries by the Index /// gets or sets an array of indexes @@ -152,7 +150,6 @@ namespace Microsoft.PowerShell.Commands } private int[] _indexes = null; - /// /// match eventlog entries by the EntryType /// gets or sets an array of EntryTypes @@ -224,7 +221,6 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = "List")] public SwitchParameter List { get; set; } - /// /// Return the log names rather than the EventLog objects /// @@ -442,8 +438,6 @@ namespace Microsoft.PowerShell.Commands } } - - private bool FiltersMatch(EventLogEntry entry) { if (_indexes != null) @@ -614,7 +608,6 @@ namespace Microsoft.PowerShell.Commands [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] LogName { get; set; } - /// /// Clear eventlog entries from these Computers. /// @@ -706,7 +699,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string LogName { get; set; } - /// /// The source by which the application is registered on the specified computer. /// @@ -748,7 +740,6 @@ namespace Microsoft.PowerShell.Commands [ValidateLength(0, 32766)] public string Message { get; set; } - /// /// Write eventlog entries of this log /// @@ -1318,7 +1309,6 @@ namespace Microsoft.PowerShell.Commands [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 695648a182..f71f0ee751 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 @@ namespace Microsoft.PowerShell.Commands #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 176ee34721..f88f79aefb 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 a4a0e4ff12..f94c119074 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 @@ namespace Microsoft.PowerShell.Commands //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 @@ namespace Microsoft.PowerShell.Commands 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 dee0e3835f..5248ac19e5 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 7cf2b94cd7..8c746508e9 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 f7182e46d7..05216d7e1b 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 e6b85ded55..3488b10e0e 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 @@ namespace Microsoft.PowerShell.Commands { #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 8f10d92d37..e96fa603d0 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.Principal; using System.Security.AccessControl; using Dbg = System.Management.Automation; - namespace Microsoft.PowerShell.Commands { #region Get-HotFix @@ -79,7 +77,6 @@ namespace Microsoft.PowerShell.Commands #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 fa275c3303..8a911bfb69 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 d51f40b7ca..ffdf1b95ca 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 @@ namespace Microsoft.PowerShell.Commands } // 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 7378d2bf50..a4f7e8750e 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 @@ namespace Microsoft.PowerShell.Commands /// public virtual string Filter { get; set; } - /// /// Gets or sets the include property /// @@ -225,7 +223,6 @@ namespace Microsoft.PowerShell.Commands // Include - /// /// Gets or sets the exclude property /// @@ -244,7 +241,6 @@ namespace Microsoft.PowerShell.Commands // Exclude - /// /// Gets or sets the force property /// @@ -276,7 +272,6 @@ namespace Microsoft.PowerShell.Commands } // Force private bool _force; - /// /// Retrieves the dynamic parameters for the command from /// the provider. @@ -419,7 +414,6 @@ namespace Microsoft.PowerShell.Commands #region Location parameter set parameters - /// /// Gets or sets the provider from which to get the current location. /// @@ -486,7 +480,6 @@ namespace Microsoft.PowerShell.Commands #region command data - #region Location parameter set data /// @@ -505,10 +498,8 @@ namespace Microsoft.PowerShell.Commands #endregion Stack parameter set data - #endregion command data - #region command code /// @@ -717,7 +708,6 @@ namespace Microsoft.PowerShell.Commands } // class GetLocationCommand #endregion GetLocationCommand - #region SetLocationCommand /// @@ -962,7 +952,6 @@ namespace Microsoft.PowerShell.Commands } // set } // LiteralPath - /// /// Gets or sets the parameter -passThru which states output from /// the command should be placed in the pipeline. @@ -1156,10 +1145,8 @@ namespace Microsoft.PowerShell.Commands #endregion Command data - #region Command code - /// /// Gets the top container from the location stack and sets the /// location to it. @@ -1586,7 +1573,6 @@ namespace Microsoft.PowerShell.Commands } } - WildcardPattern providerMatcher = null; PSSnapinQualifiedName pssnapinQualifiedProviderName = null; @@ -1606,7 +1592,6 @@ namespace Microsoft.PowerShell.Commands WildcardOptions.IgnoreCase); } - WildcardPattern nameMatcher = null; if (!driveNameEmpty) @@ -3387,7 +3372,6 @@ namespace Microsoft.PowerShell.Commands continue; } - // See if the item to be moved is in use. bool isCurrentLocationOrAncestor = false; try @@ -3561,7 +3545,6 @@ namespace Microsoft.PowerShell.Commands 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 9d36ec244e..fbf3312c14 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 @@ namespace Microsoft.PowerShell.Commands } // 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 1b096166a7..a87643e36b 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 @@ namespace Microsoft.PowerShell.Commands /// private const string extensionSet = "ExtensionSet"; - /// /// The parameter set name to get the qualifier set. /// @@ -187,7 +185,6 @@ namespace Microsoft.PowerShell.Commands #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 cb70655f8b..7f4e3e65c0 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 5028632301..734433ffc9 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 66bbe573a1..37f39e54e2 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 @@ namespace Microsoft.PowerShell.Commands } // 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 30ef0e096a..251e0cfd61 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 @@ namespace Microsoft.PowerShell.Commands return processAsPsobj; } - /// /// Retrieve the UserName through PInvoke /// @@ -901,7 +899,6 @@ namespace Microsoft.PowerShell.Commands private int _timeout = 0; private bool _timeOutSpecified; - #endregion Parameters private bool _disposed = false; @@ -948,7 +945,6 @@ namespace Microsoft.PowerShell.Commands private ManualResetEvent _waitHandle; private int _numberOfProcessesToWaitFor; - /// /// gets the list of process /// @@ -1135,7 +1131,6 @@ namespace Microsoft.PowerShell.Commands set { _passThru = value; } } - //Addition by v-ramch Mar 18 2008 //Added force parameter /// @@ -1270,7 +1265,6 @@ namespace Microsoft.PowerShell.Commands } } // ProcessRecord - /// /// Kill the current process here. /// @@ -1616,7 +1610,6 @@ namespace Microsoft.PowerShell.Commands [Alias("PSPath")] public string FilePath { get; set; } - /// /// Arguments for the process /// @@ -1626,7 +1619,6 @@ namespace Microsoft.PowerShell.Commands [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public string[] ArgumentList { get; set; } - /// /// Credentials for the process /// @@ -1652,7 +1644,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string WorkingDirectory { get; set; } - /// /// load user profile from registry /// @@ -1691,7 +1682,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public SwitchParameter PassThru { get; set; } - /// /// Redirect error /// @@ -1709,7 +1699,6 @@ namespace Microsoft.PowerShell.Commands } private string _redirectstandarderror; - /// /// Redirect input /// @@ -1727,7 +1716,6 @@ namespace Microsoft.PowerShell.Commands } private string _redirectstandardinput; - /// /// Redirect output /// @@ -1865,7 +1853,6 @@ namespace Microsoft.PowerShell.Commands startInfo.Arguments = sb.ToString(); ; } - //WorkingDirectory if (WorkingDirectory != null) { @@ -2263,7 +2250,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands System.IntPtr hTemplateFile ); - [Flags] internal enum LogonFlags { @@ -2745,7 +2728,6 @@ namespace Microsoft.PowerShell.Commands } } - [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 f64d33e18f..9f65a40b9d 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 091e1903a4..0e288454b0 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 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string ComputerName { get; set; } = "localhost"; - /// /// The WMI class to use /// @@ -97,7 +95,6 @@ namespace Microsoft.PowerShell.Commands } #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 b6c1b4b3e7..76df0806b8 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 @@ namespace Microsoft.PowerShell.Commands } // 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 711cd7ea07..31c78f79e8 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 5e3000ceb5..8f2fc873ce 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 @@ namespace Microsoft.PowerShell.Commands } // 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 d1222aa659..140c4c3e1a 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 @@ namespace Microsoft.PowerShell.Commands } // Relative private SwitchParameter _relative; - #endregion Parameters #region parameter data @@ -158,7 +156,6 @@ namespace Microsoft.PowerShell.Commands } // 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 4f48e18b8e..1c586b100c 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 0e4229762a..f228143983 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 @@ namespace Microsoft.PowerShell.Commands [Alias("DS")] public SwitchParameter DependentServices { get; set; } - /// /// This returns the ServicesDependedOn of the specified service. /// @@ -1472,8 +1471,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands // 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 a59d4a6967..525c4a975c 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 bd2584a3f7..5eeaec0a1d 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 f64bfaf321..74a1d38415 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 @@ namespace Microsoft.PowerShell.Commands } // 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 acdbea27d0..94744c03cf 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 4d91c4d546..a2eb946989 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 75b4168298..42c54f74ca 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 @@ namespace Microsoft.PowerShell.Commands [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 a36f997a14..43b722d08f 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 8cf7df9d61..91abff494e 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 @@ namespace Microsoft.PowerShell.Commands } #endregion Helper Classes - /// /// A class to set WMI connection options /// @@ -1708,8 +1706,6 @@ namespace Microsoft.PowerShell.Commands } } - - private ThrottleManager _throttleManager = new ThrottleManager(); private object _syncObject = new object(); // sync object @@ -1783,7 +1779,6 @@ namespace Microsoft.PowerShell.Commands private bool _bJobFailed; private bool _bAtLeastOneObject; - private ArrayList _wmiSinkArray; /// /// Event raised by this job to indicate to its parent that @@ -1884,7 +1879,6 @@ namespace Microsoft.PowerShell.Commands /// 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 7ddb52ec82..84d966e909 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 System.Resources; using Microsoft.Win32; using System.Text.RegularExpressions; - namespace Microsoft.PowerShell.Commands { #region New-WebServiceProxy @@ -105,7 +103,6 @@ namespace Microsoft.PowerShell.Commands } 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 ec5d50ab3b..eb2731450c 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 742ccf2f2a..06661bb6b2 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 9c19d68183..8739520624 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 @@ namespace Microsoft.PowerShell.Commands get { return _passThru; } } - #region Simplifying NoteProperty Declaration private const string NotePropertySingleMemberSet = "NotePropertySingleMemberSet"; @@ -180,7 +178,6 @@ namespace Microsoft.PowerShell.Commands #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 4bba1753e3..9234ba9708 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 Microsoft.CodeAnalysis.Emit; using PathType = System.IO.Path; - namespace Microsoft.PowerShell.Commands { /// @@ -476,7 +474,6 @@ namespace Microsoft.PowerShell.Commands 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 5ee144d030..ba8bb6be34 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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands #endregion Command Line Parameters - - /// /// Write the string to a file or pipeline /// @@ -171,8 +167,6 @@ namespace Microsoft.PowerShell.Commands } private bool _isLiteralPath = false; - - /// /// Property that sets force parameter. /// @@ -266,7 +260,6 @@ namespace Microsoft.PowerShell.Commands _helper = new ExportCsvHelper(this, base.Delimiter); } - /// /// Convert the current input object to Csv and write to file/WriteObject /// @@ -516,7 +509,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNull] public char Delimiter { get; set; } - /// /// mandatory file name to read from /// @@ -576,7 +568,6 @@ namespace Microsoft.PowerShell.Commands } private bool _useculture; - /// /// Header property to customize the names /// @@ -703,8 +694,6 @@ namespace Microsoft.PowerShell.Commands _helper = new ExportCsvHelper(this, base.Delimiter); } - - /// /// Convert the current input object to Csv and write to stream/WriteObject /// @@ -897,7 +886,6 @@ namespace Microsoft.PowerShell.Commands //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 @@ namespace Microsoft.PowerShell.Commands //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 ffbc04e3cb..6fe3c3f5c0 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 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// /// 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 3d9a63b632..9ad5a1c0c9 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 48d42ea9b0..bce8acb126 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 c2ea772584..09aacba0d2 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 @@ namespace System.Management.Automation return; } - if (HandlePrimitiveKnownTypePSObject(source, property, depth)) { return; @@ -428,7 +426,6 @@ namespace System.Management.Automation 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 109880780c..9c22f590aa 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 @@ namespace System.Management.Automation { #region element tags - /// /// Element tag for root node /// @@ -27,7 +25,6 @@ namespace System.Management.Automation /// 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 0c3ef0080c..003fcef583 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 770eae7490..9f7f3a3efb 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 37736ca2f3..d4ba85d090 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 acfd146caa..81acbef07a 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 c83b2272c2..bebc287c44 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 @@ namespace Microsoft.PowerShell.Commands } } // ProcessRecord - /// /// Writes the aliases to the file /// @@ -327,7 +325,6 @@ namespace Microsoft.PowerShell.Commands 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 ad398a7e76..1c18571c9b 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 d0a4221fd8..e56e2b4d2e 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 0def6c0b64..a6b8606167 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 7329ed8117..395eaee204 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 e3f013dd78..1461f22601 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 f6e929c5a4..adcf5f0c12 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 @@ namespace Microsoft.PowerShell.Commands private const string IndexPropertyName = "IndexValue"; private int _index; - /// Columns definition of the underlying Management List private HeaderInfo _headerInfo; @@ -261,8 +259,6 @@ namespace Microsoft.PowerShell.Commands 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 62195903f2..e8204464c9 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 062d557190..f828d1324d 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 e8c9142b91..7f047e376a 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 @@ namespace Microsoft.PowerShell.Commands } } - 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 609253074f..c78b54090e 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 bc90a9536b..89ab8c1ca2 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 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands { 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 3cd9ed9d60..6db9582103 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 266a5d65b6..a4efe11799 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 @@ namespace Microsoft.PowerShell.Commands 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 06dce66506..fcf92d00f6 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 @@ namespace Microsoft.PowerShell.Commands } } - 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 6a68001373..9075782e26 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 @@ namespace Microsoft.PowerShell.Commands this.implementation = new InnerFormatShapeCommand(FormatShape.Wide); } - #region Command Line Switches /// @@ -60,7 +58,6 @@ namespace Microsoft.PowerShell.Commands } private Nullable _autosize = null; - /// /// optional, non positional parameter /// @@ -110,7 +107,6 @@ namespace Microsoft.PowerShell.Commands // 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 3b01c1b57f..01b8ff081f 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 @@ namespace Microsoft.PowerShell.Commands 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 910e8906dc..7b79ddaaaf 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format ev.HasMorePages = _lines.Count > 0; } - /// /// flag for one time initialization of the interface (columns, etc.) /// @@ -290,7 +288,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// 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 b1c0944133..d70f044340 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 @@ namespace Microsoft.PowerShell.Commands } } - - - 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 55f3db8f07..fb63659b4c 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 3701640e24..cd449e2e48 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 54a12b175b..3b07991f42 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 a9e35503ee..568bbdfbb2 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 @@ namespace Microsoft.PowerShell.Commands 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 a370026e51..1667ca7c6b 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 @@ namespace Microsoft.PowerShell.Commands } // 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 9f9da1ed28..9668376a90 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 @@ namespace Microsoft.PowerShell.Commands private DateTime _date; private bool _dateSpecified; - /// /// Allows the user to override the year /// @@ -63,7 +61,6 @@ namespace Microsoft.PowerShell.Commands private int _year; private bool _yearSpecified; - /// /// Allows the user to override the month /// @@ -84,7 +81,6 @@ namespace Microsoft.PowerShell.Commands private int _month; private bool _monthSpecified; - /// /// Allows the user to override the day /// @@ -105,7 +101,6 @@ namespace Microsoft.PowerShell.Commands private int _day; private bool _daySpecified; - /// /// Allows the user to override the hour /// @@ -126,7 +121,6 @@ namespace Microsoft.PowerShell.Commands private int _hour; private bool _hourSpecified; - /// /// Allows the user to override the minute /// @@ -147,7 +141,6 @@ namespace Microsoft.PowerShell.Commands private int _minute; private bool _minuteSpecified; - /// /// Allows the user to override the second /// @@ -194,7 +187,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public DisplayHintType DisplayHint { get; set; } = DisplayHintType.DateTime; - /// /// Unix format string /// @@ -202,7 +194,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string UFormat { get; set; } - /// /// Unix format string /// @@ -323,7 +314,6 @@ namespace Microsoft.PowerShell.Commands } } // EndProcessing - /// /// This is more an implementation of the UNIX strftime /// @@ -539,4 +529,3 @@ namespace Microsoft.PowerShell.Commands #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 cac484db50..7de6d9879e 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 @@ namespace Microsoft.PowerShell.Commands } 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 3e00f79679..7ef87569f3 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 @@ namespace Microsoft.PowerShell.Commands [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 336c4829d4..732619dc52 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 c490604827..90d36efe40 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 bee70b23fa..6806d930be 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 @@ namespace Microsoft.PowerShell.Commands [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } - /// /// The member names to be retrieved /// @@ -76,7 +74,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string[] Name { set; get; } = new string[] { "*" }; - /// /// The member types to be retrieved /// @@ -84,7 +81,6 @@ namespace Microsoft.PowerShell.Commands [Alias("Type")] public PSMemberTypes MemberType { set; get; } = PSMemberTypes.All; - /// /// View from which the members are retrieved. /// @@ -190,7 +186,6 @@ namespace Microsoft.PowerShell.Commands // 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 35bba80c9d..87e81a4537 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 65fc5cb7be..009c1c2a43 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 6f8693e4b3..9a958d1e1b 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 @@ namespace Microsoft.PowerShell.Commands } // 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 4b9e68af77..d3cedd9a83 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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } 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 609df1d655..1d8b178cfc 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 384c103008..878f753dfa 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 e2217f688e..f9394ffceb 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 @@ if ($script:__psImplicitRemoting_versionOfScriptGenerator.Major -ne {2}) 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 ea6fb4dc21..5e31191303 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 332742d08d..4a98475ab5 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 d0418892bd..ee253baf22 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 @@ namespace Microsoft.PowerShell.Commands /// /// 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 @@ namespace Microsoft.PowerShell.Commands } 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 e415dc7de2..7c751922b4 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 17adfd80f8..ef70aacf40 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 @@ namespace Microsoft.PowerShell.Commands } private string _filename; - /// /// The full path of the file containing the matching line. /// @@ -435,7 +433,6 @@ namespace Microsoft.PowerShell.Commands 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 06b77334d7..0a16b3a315 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 @@ namespace Microsoft.PowerShell.Commands public object Minimum { get; set; } } - /// /// Class output by Measure-Object /// @@ -413,7 +411,6 @@ namespace Microsoft.PowerShell.Commands #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 64f3d2934f..bc6276eada 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 @@ namespace Microsoft.PowerShell.Commands 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 b4a80fd63f..b8ecc9381f 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 2ea9133903..36b7d3f145 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 71504e063b..c346dfb669 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands } // 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 77df4fa926..2de4840951 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 @@ namespace Microsoft.PowerShell.Commands this.cultureInfo = cultureInfo; } - internal object PropertyValue { get; } internal bool IsExistingProperty { get; } @@ -154,7 +152,6 @@ namespace Microsoft.PowerShell.Commands return (val == null); } - internal int Compare(ObjectCommandPropertyValue first, ObjectCommandPropertyValue second) { if (first.IsExistingProperty && second.IsExistingProperty) @@ -196,7 +193,6 @@ namespace Microsoft.PowerShell.Commands // 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 6b726c1dea..afed3c1e6f 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 f37c274aad..a6d8962b95 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 @@ namespace Microsoft.PowerShell.Commands } #endregion Parameters - #region Cmdlet Overrides /// @@ -171,8 +169,6 @@ namespace Microsoft.PowerShell.Commands #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 01bc5af442..15dd6f5019 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 48a3fe8a09..8346b7aace 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 286c79437a..395e30829b 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 92f0c1fbf2..dfc98d2c2b 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 @@ namespace Microsoft.PowerShell.Commands /// /// 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 @@ namespace Microsoft.PowerShell.Commands /// /// 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 e50431aaf6..d59db2282e 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 df2014d9fc..0b6651920a 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.Net.Mail; using System.Diagnostics.CodeAnalysis; using System.Management.Automation; - namespace Microsoft.PowerShell.Commands { #region SendMailMessage @@ -208,7 +206,6 @@ namespace Microsoft.PowerShell.Commands } private String _subject; - /// /// Specifies the To address for this e-mail message. /// @@ -272,10 +269,8 @@ namespace Microsoft.PowerShell.Commands #endregion - #region private variables and methods - // Instantiate a new instance of MailMessage private MailMessage _mMailMessage = new MailMessage(); @@ -361,8 +356,6 @@ namespace Microsoft.PowerShell.Commands AddAddressesToMailMessage(_cc, "cc"); } - - //set the delivery notification _mMailMessage.DeliveryNotificationOptions = _deliverynotification; @@ -382,7 +375,6 @@ namespace Microsoft.PowerShell.Commands // 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 1371eec048..67e48bbf90 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 @@ namespace Microsoft.PowerShell.Commands } 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 ce54fa27ce..dd5d8ea057 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 1f7e91e823..fb7f0fc9fd 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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } // 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 e048249152..f2a1476fec 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 c6e6ae0457..fc02201d3f 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 384c4c8bc6..9f9d663ef9 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 95ce809a7e..c9eed0a7d1 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 0a1933e442..3b572bfd94 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 9760a70468..a8769d2c9c 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 fcda24ca44..20ab1c538d 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 @@ namespace Microsoft.PowerShell.Commands } } - internal string CommandNeedingHelp { get @@ -149,7 +145,6 @@ namespace Microsoft.PowerShell.Commands _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 fa12ccaa59..2abf326f54 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 @@ namespace Microsoft.PowerShell.Commands #endregion - - #region parameters /// @@ -48,7 +45,6 @@ namespace Microsoft.PowerShell.Commands [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 7cbab7653b..26857e97e4 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 @@ namespace Microsoft.PowerShell.Commands [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } = AutomationNull.Value; - /// /// The script block to apply /// @@ -45,7 +43,6 @@ namespace Microsoft.PowerShell.Commands #region methods - /// /// Output the timer /// @@ -54,7 +51,6 @@ namespace Microsoft.PowerShell.Commands 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 5578654c42..932d2ee44c 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 8ab72b1cd4..267aa5d52f 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 36a90b93c8..1cf0cf8e94 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 b81a6501de..50a9a2973c 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.Diagnostics.CodeAnalysis; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell.Commands { /// @@ -129,7 +127,6 @@ namespace Microsoft.PowerShell.Commands get { return _serializationMethod; } } - /// /// TargetTypeForDeserialization /// @@ -141,7 +138,6 @@ namespace Microsoft.PowerShell.Commands get { return _targetTypeForDeserialization; } } - /// /// SerializationDepth /// @@ -154,7 +150,6 @@ namespace Microsoft.PowerShell.Commands get { return _serializationDepth; } } - /// /// DefaultDisplayProperty /// @@ -166,7 +161,6 @@ namespace Microsoft.PowerShell.Commands get { return _defaultDisplayProperty; } } - /// /// InheritPropertySerializationSet /// @@ -178,7 +172,6 @@ namespace Microsoft.PowerShell.Commands get { return _inheritPropertySerializationSet; } } - /// /// StringSerializationSource /// @@ -190,7 +183,6 @@ namespace Microsoft.PowerShell.Commands get { return _stringSerializationSource; } } - /// /// DefaultDisplayPropertySet /// @@ -215,7 +207,6 @@ namespace Microsoft.PowerShell.Commands 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 c5988b3a45..af39227d23 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.Text; 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 e596e0cb64..f0d39620af 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 @@ namespace Microsoft.PowerShell.Commands } private string[] _exclude = new string[0]; - #region helpers /// @@ -244,7 +242,6 @@ namespace Microsoft.PowerShell.Commands } - /// /// Implements get-variable command. /// @@ -277,8 +274,6 @@ namespace Microsoft.PowerShell.Commands } private string[] _name = new string[] { "*" }; - - /// /// Output only the value(s) of the requested variable(s). /// @@ -296,7 +291,6 @@ namespace Microsoft.PowerShell.Commands } private bool _valueOnly; - /// /// The Include parameter for all the variable commands /// @@ -409,7 +403,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } // ProcessRecord } // NewVariableCommand - /// /// This class implements set-variable command /// @@ -638,7 +630,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } private SessionStateEntryVisibility? _visibility; - /// /// The variable object should be passed down the pipeline. /// @@ -976,7 +966,6 @@ namespace Microsoft.PowerShell.Commands matchingVariable.Value = varValue; } - if (Description != null) { matchingVariable.Description = Description; @@ -1114,7 +1103,6 @@ namespace Microsoft.PowerShell.Commands 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 a66bda09d8..041e1b5345 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 @@ namespace Microsoft.PowerShell.Commands } } - // 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 c2899459a4..dfa6c16108 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 82f3033b7c..751ff60d87 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 7c6a149cc7..0ca37557ea 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 748732d7c6..a7b5bcfa23 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 @@ namespace Microsoft.PowerShell.Commands WebSession.UseDefaultCredentials = true; } - if (null != CertificateThumbprint) { X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); @@ -947,7 +945,6 @@ namespace Microsoft.PowerShell.Commands 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 ee29d80e6f..e819f246f2 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 3718b0937c..dca51d7fc4 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 b5ccb14424..a51779dc18 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 944df03eb4..1de3a7c14e 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 f7d0c83184..e2cc32bc7f 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 256db1888f..a3fbb5b704 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 0949b34317..47b0367f22 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 2623da9ea3..0e7689788e 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 fcb17ce175..a4ca4ab667 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 23e9129caf..601c12e2c7 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 f06514ab4a..1096ff1c7e 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 7fd144c3e3..0c1f9e63ca 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 7664652cb6..cd02e22533 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 @@ namespace Microsoft.PowerShell.Commands } } 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 83044fabc9..4325e29054 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 11afdf24b1..40ae4d45a6 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 b55639acd7..43809cd39c 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 2ac76d2c63..a525ee6e3b 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 9e195d3e30..478e0cbf3a 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 @@ namespace Microsoft.PowerShell.Commands [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 c53dc13623..f7f8c24bc4 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 @@ namespace Microsoft.PowerShell.Commands // Parameters // - - /// /// /// Object to be output. @@ -33,7 +30,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// /// The separator to print between objects @@ -65,7 +59,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public object Separator { get; set; } = " "; - // // Cmdlet Overrides // @@ -118,8 +111,6 @@ namespace Microsoft.PowerShell.Commands 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 d9936e1422..7bbd3bd337 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 @@ namespace Microsoft.PowerShell.Commands HelpMessageResourceId = "ActivityParameterHelpMessage")] public string Activity { get; set; } - /// /// /// Describes the current state of the activity. @@ -50,7 +45,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string Status { get; set; } = WriteProgressResourceStrings.Processing; - /// /// /// Uniquely identifies this activity for purposes of chaining subordinate activities. @@ -62,7 +56,6 @@ namespace Microsoft.PowerShell.Commands [ValidateRange(0, Int32.MaxValue)] public int Id { get; set; } = 0; - /// /// /// Percentage completion of the activity, or -1 if n/a @@ -74,7 +67,6 @@ namespace Microsoft.PowerShell.Commands [ValidateRange(-1, 100)] public int PercentComplete { get; set; } = -1; - /// /// /// Seconds remaining to complete the operation, or -1 if n/a @@ -85,7 +77,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public int SecondsRemaining { get; set; } = -1; - /// /// /// Description of current operation in activity, empty if n/a @@ -96,7 +87,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public string CurrentOperation { get; set; } - /// /// /// Identifies the parent Id of this activity, or -1 if none. @@ -108,7 +98,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// /// Identifies the source of the record. @@ -142,7 +129,6 @@ namespace Microsoft.PowerShell.Commands [Parameter] public int SourceId { get; set; } - /// /// /// Writes a ProgressRecord created from the parameters. @@ -163,10 +149,8 @@ namespace Microsoft.PowerShell.Commands 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 33845a3f23..ae9140f3cb 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 @@ namespace Microsoft.PowerShell.Commands CreateFileStream(); } - /// /// /// @@ -314,7 +312,6 @@ namespace Microsoft.PowerShell.Commands } private bool _isLiteralPath = false; - #endregion Command Line Parameters #region IDisposable Members @@ -367,7 +364,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// implementation for the convertto-xml command /// @@ -378,7 +374,6 @@ namespace Microsoft.PowerShell.Commands { #region Command Line Parameters - /// /// Depth of serialization /// @@ -386,7 +381,6 @@ namespace Microsoft.PowerShell.Commands [ValidateRange(1, int.MaxValue)] public int Depth { get; set; } = 0; - /// /// Input Object which is written to XML format /// @@ -394,7 +388,6 @@ namespace Microsoft.PowerShell.Commands [AllowNull] public PSObject InputObject { get; set; } - /// /// Property that sets NoTypeInformation parameter. /// @@ -422,7 +415,6 @@ namespace Microsoft.PowerShell.Commands #endregion Command Line Parameters - #region Overrides /// @@ -441,7 +433,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// override ProcessRecord /// @@ -454,7 +445,6 @@ namespace Microsoft.PowerShell.Commands if (null != _serializer) _serializer.SerializeAsStream(InputObject); - if (null != _serializer) { _serializer.DoneAsStream(); @@ -630,7 +620,6 @@ namespace Microsoft.PowerShell.Commands #endregion IDisposable Members } - /// /// Helper class to import single XML file /// @@ -742,7 +731,6 @@ namespace Microsoft.PowerShell.Commands _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 0dd2e5b2c9..68b5cd89ab 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 89e61edbf9..3cbcf8e7f9 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 @@ namespace Microsoft.PowerShell.Commands return ""; } - /// /// /// @@ -419,7 +417,6 @@ namespace Microsoft.PowerShell.Commands 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 60d316aecb..f967cd3a07 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 @@ namespace Microsoft.PowerShell.Commands Count++; } - - private static string BuildName(List propValues) { StringBuilder sb = new StringBuilder(); @@ -141,7 +138,6 @@ namespace Microsoft.PowerShell.Commands 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 89f7bccf97..82f78f0684 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 @@ namespace Microsoft.PowerShell.Commands 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 29ac9dfa98..14812d759f 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 @@ namespace Microsoft.PowerShell.Commands #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 b5c4f0a358..c11fd593cf 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 @@ namespace Microsoft.PowerShell.Commands [Parameter(ValueFromPipeline = true)] public PSObject InputObject { set; get; } = AutomationNull.Value; - /// /// /// @@ -147,7 +145,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands /// private List _expandMshParameterList; - - private MshExpressionFilter _exclusionFilter; private class UniquePSObjectHelper @@ -351,7 +346,6 @@ namespace Microsoft.PowerShell.Commands return; } - //If property parameter is mentioned List matchedProperties = new List(); foreach (MshParameter p in _propertyMshParameterList) @@ -396,8 +390,6 @@ namespace Microsoft.PowerShell.Commands } } - - private void ProcessParameter(MshParameter p, PSObject inputObject, List result) { string name = p.GetEntry(NameEntryDefinition.NameEntryKey) as string; @@ -473,7 +465,6 @@ namespace Microsoft.PowerShell.Commands 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 b3288396a3..e322af31fe 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 b5520bbad7..1b1937df9b 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 8b9103f292..26bcdaaa7f 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 ae0af27e05..0d8b2dd784 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 49c4c51ffa..90a335f32a 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 @@ namespace Microsoft.PowerShell.Commands } } // 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 292a69db89..55faf98812 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 bffa86fcc9..df22e683c6 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 @@ namespace Microsoft.PowerShell.Commands set { base.PSHostListener = value; } } // PSHost - #endregion Parameters #region Cmdlet code @@ -153,7 +151,6 @@ namespace Microsoft.PowerShell.Commands Collection preconfiguredSources = null; _matchingSources = ConfigureTraceSource(base.NameInternal, false, out preconfiguredSources); - TurnOnTracing(_matchingSources, false); TurnOnTracing(preconfiguredSources, true); @@ -215,14 +212,12 @@ namespace Microsoft.PowerShell.Commands 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 34ddcc2e00..ab3955a0d9 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 @@ namespace Microsoft.PowerShell.Commands /// internal string[] NameInternal { get; set; } = new string[0]; - /// /// The flags to be set on the TraceSource /// @@ -441,7 +439,6 @@ namespace Microsoft.PowerShell.Commands } } // 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 afff8f3b8d..22f0e65e0a 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 f1b1bcd51a..6d5ccb134c 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 @@ namespace Microsoft.PowerShell.Commands [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-Debug command /// @@ -76,7 +74,6 @@ namespace Microsoft.PowerShell.Commands [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-verbose command /// @@ -126,7 +123,6 @@ namespace Microsoft.PowerShell.Commands [Alias("Msg")] public string Message { get; set; } = null; - /// /// This method implements the ProcessRecord method for Write-Warning command /// @@ -214,7 +210,6 @@ namespace Microsoft.PowerShell.Commands #endregion WriteInformationCommand - #region WriteOrThrowErrorCommand /// @@ -311,7 +306,6 @@ namespace Microsoft.PowerShell.Commands [Alias("TargetType")] public string CategoryTargetType { get; set; } = ""; - /// /// Write an error to the output pipe, or throw a terminating error. /// @@ -493,5 +487,3 @@ namespace Microsoft.PowerShell.Commands #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 b26ef9a062..7248db150a 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 5ccccbcb8e..617b095eee 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 840e8fb4d6..0854b7a2ca 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 84ae968d20..13687f7d35 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 @@ Copyright (c) Microsoft Corporation. All rights reserved. // 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 @@ namespace Microsoft.PowerShell } } - #endregion #region Input - - /// /// /// Reads input from the console device according to the mode in effect (see GetMode, SetMode) @@ -1344,7 +1339,6 @@ namespace Microsoft.PowerShell } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Called in CHK builds")] private static void CheckWriteConsoleOutputContents(BufferCell[,] contents, Rectangle contentsRegion) { @@ -2051,7 +2045,6 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell } #endregion ReadConsoleOutput CJK - private static void ReadConsoleOutputPlain ( ConsoleHandle consoleHandle, @@ -2277,7 +2269,6 @@ namespace Microsoft.PowerShell } } - /// /// Wraps Win32 FillConsoleOutputCharacter /// @@ -2543,8 +2534,6 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell #region Cursor - /// /// Wraps Win32 SetConsoleCursorPosition /// @@ -2848,8 +2836,6 @@ namespace Microsoft.PowerShell } } - - /// /// Wraps Win32 GetConsoleCursorInfo /// @@ -3125,7 +3111,6 @@ namespace Microsoft.PowerShell [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 060fa942b5..d52122c10f 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 @@ namespace Microsoft.PowerShell } private static CommandLineParameterParser s_cpp; - - #if UNIX /// /// @@ -856,8 +853,6 @@ namespace Microsoft.PowerShell } private PSObject _consoleColorProxy; - - /// /// /// See base class @@ -877,8 +872,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -1249,7 +1242,6 @@ namespace Microsoft.PowerShell internal WrappedSerializer.DataFormat OutputFormat { get; private set; } - internal WrappedSerializer.DataFormat InputFormat { get; private set; } internal WrappedDeserializer.DataFormat ErrorFormat @@ -1919,7 +1911,6 @@ namespace Microsoft.PowerShell } } - /// /// /// Escapes backtick and tick characters with a backtick, returns the result @@ -2071,7 +2062,6 @@ namespace Microsoft.PowerShell /// internal event EventHandler RunspacePushed; - #endregion non-overrides #region debugger @@ -2885,11 +2875,8 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index af6f660c62..8d90d6af03 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.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 System; using System.Management.Automation; @@ -19,8 +17,6 @@ using ConsoleHandle = Microsoft.Win32.SafeHandles.SafeFileHandle; using WORD = System.UInt16; using DWORD = System.UInt32; - - namespace Microsoft.PowerShell { /// @@ -131,8 +127,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -189,8 +183,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -234,8 +226,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -303,8 +293,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -375,8 +363,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -436,8 +422,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -570,8 +554,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -598,8 +580,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -788,8 +768,6 @@ namespace Microsoft.PowerShell return keyInfo; } - - private static void KEY_EVENT_RECORDToKeyInfo(ConsoleControl.KEY_EVENT_RECORD keyEventRecord, out KeyInfo keyInfo) @@ -801,8 +779,6 @@ namespace Microsoft.PowerShell keyEventRecord.KeyDown); } - - /// /// /// See base class @@ -826,8 +802,6 @@ namespace Microsoft.PowerShell cachedKeyEvent.RepeatCount = 0; } - - /// /// /// See base class @@ -884,7 +858,6 @@ namespace Microsoft.PowerShell } } - /// /// /// See base class @@ -1004,8 +977,6 @@ namespace Microsoft.PowerShell ConsoleControl.WriteConsoleOutput(handle, origin, contents); } - - /// /// /// If is completely outside of the screen buffer, it's a no-op. @@ -1185,8 +1156,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class. @@ -1271,8 +1240,6 @@ namespace Microsoft.PowerShell return contents; } - - /// /// /// See base class @@ -1386,7 +1353,6 @@ namespace Microsoft.PowerShell return ConsoleControl.LengthInBufferCells(s, offset, parent.SupportsVirtualTerminal); } - /// /// /// See base class @@ -1423,7 +1389,6 @@ namespace Microsoft.PowerShell #region helpers - // pass-by-ref for speed. /// /// @@ -1455,7 +1420,6 @@ namespace Microsoft.PowerShell } } - /// /// Get output buffer info /// @@ -1475,8 +1439,6 @@ namespace Microsoft.PowerShell 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 b9143e878e..61f56ee131 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 @@ namespace Microsoft.PowerShell } private bool _isTranscribing; - /* internal void StartTranscribing(string transcriptFilename, bool shouldAppend) { @@ -74,8 +67,6 @@ namespace Microsoft.PowerShell */ private string _transcriptFileName = String.Empty; - - internal string StopTranscribing() @@ -113,8 +104,6 @@ namespace Microsoft.PowerShell } } - - internal void WriteToTranscript(string text) @@ -128,11 +117,8 @@ namespace Microsoft.PowerShell } } - - 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 6d17884987..7c57d9532b 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 @@ namespace Microsoft.PowerShell // } //} - /// /// /// true if command completion is currently running @@ -190,7 +188,6 @@ namespace Microsoft.PowerShell return ReadLine(false, "", out unused, true, true); } - /// /// /// See base class @@ -452,7 +449,6 @@ namespace Microsoft.PowerShell } } - /// /// /// Handle writing print token with proper cursor adjustment for ReadLineSafe @@ -500,8 +496,6 @@ namespace Microsoft.PowerShell WriteToConsole(printToken, false); } - - /// /// /// Handle backspace with proper cursor adjustment for ReadLineSafe @@ -548,8 +542,6 @@ namespace Microsoft.PowerShell // do nothing if cursorPosition.X is left of screen } - - /// /// Blank out at and move rawui.CursorPosition to /// @@ -561,7 +553,6 @@ namespace Microsoft.PowerShell _rawui.CursorPosition = cursorPosition; } - #if !UNIX /// /// @@ -643,8 +634,6 @@ namespace Microsoft.PowerShell } } - - private void WriteToConsole(ConsoleColor foregroundColor, ConsoleColor backgroundColor, string text) { ConsoleColor fg = RawUI.ForegroundColor; @@ -670,8 +659,6 @@ namespace Microsoft.PowerShell WriteToConsole(Crlf, true); } - - private void WriteLineToConsole() { WriteToConsole(Crlf, true); @@ -679,8 +666,6 @@ namespace Microsoft.PowerShell #endregion WriteToConsole - - /// /// /// See base class. @@ -725,8 +710,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -775,8 +758,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// See base class @@ -808,8 +789,6 @@ namespace Microsoft.PowerShell #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 @@ namespace Microsoft.PowerShell return result; } - - /// /// /// Struct used by WrapText /// /// - [Flags] internal enum WordFlags { @@ -951,8 +927,6 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell } } - /// /// /// See base class @@ -1356,8 +1327,6 @@ namespace Microsoft.PowerShell } } - - public override void WriteErrorLine(string value) { if (string.IsNullOrEmpty(value)) @@ -1408,11 +1377,8 @@ namespace Microsoft.PowerShell #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 @@ namespace Microsoft.PowerShell } #endif - /// /// Strip nulls from a string... /// @@ -1905,7 +1870,6 @@ namespace Microsoft.PowerShell 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 6c9350802c..d8b19a6881 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 @@ namespace Microsoft.PowerShell } } - - /// /// /// Invoked by ConsoleHostUserInterface.WriteProgress to update the set of outstanding activities for which @@ -106,8 +100,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// TimerCallback for '_progPaneUpdateTimer' to update 'progPaneUpdateFlag' @@ -131,8 +123,6 @@ namespace Microsoft.PowerShell } } - - private void PostWrite() @@ -143,8 +133,6 @@ namespace Microsoft.PowerShell } } - - private void PostWrite(string value) @@ -164,8 +152,6 @@ namespace Microsoft.PowerShell } } - - private void PreRead() @@ -176,8 +162,6 @@ namespace Microsoft.PowerShell } } - - private void PostRead() @@ -188,8 +172,6 @@ namespace Microsoft.PowerShell } } - - private void PostRead(string value) @@ -210,8 +192,6 @@ namespace Microsoft.PowerShell } } - - private ProgressPane _progPane = null; private PendingProgress _pendingProgress = null; // The timer set up 'progPaneUpdateFlag' every 'UpdateTimerThreshold' milliseconds to update 'ProgressPane' @@ -221,5 +201,3 @@ namespace Microsoft.PowerShell } } // namespace - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index 660cd74143..97ae10731d 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 System.Security; using Dbg = System.Management.Automation.Diagnostics; using InternalHostUserInterface = System.Management.Automation.Internal.Host.InternalHostUserInterface; - - namespace Microsoft.PowerShell { internal partial @@ -44,8 +39,6 @@ namespace Microsoft.PowerShell Overflow } - - private static bool AtLeastOneHelpMessageIsPresent(Collection descriptions) @@ -64,8 +57,6 @@ namespace Microsoft.PowerShell 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 369a938544..719d489904 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 b945d24dc2..8501bffec3 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 89703712e5..ec3b1044b6 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 7e14ca9d8c..cc4cebebc3 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 HRESULT = System.UInt32; using DWORD = System.UInt32; using NakedWin32Handle = System.IntPtr; - - namespace Microsoft.PowerShell { internal @@ -30,8 +25,6 @@ namespace Microsoft.PowerShell _ui = ui; } - - public override Encoding Encoding @@ -42,8 +35,6 @@ namespace Microsoft.PowerShell } } - - public override void Write(string value) @@ -51,8 +42,6 @@ namespace Microsoft.PowerShell _ui.WriteToConsole(value, true); } - - public override void WriteLine(string value) @@ -60,8 +49,6 @@ namespace Microsoft.PowerShell this.Write(value + ConsoleHostUserInterface.Crlf); } - - public override void Write(Boolean b) @@ -69,8 +56,6 @@ namespace Microsoft.PowerShell this.Write(b.ToString()); } - - public override void Write(Char c) @@ -78,8 +63,6 @@ namespace Microsoft.PowerShell this.Write(new String(c, 1)); } - - public override void Write(Char[] a) @@ -87,10 +70,7 @@ namespace Microsoft.PowerShell 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 b3ba10f1ec..c8cdc9068f 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 @@ namespace Microsoft.PowerShell } } - - // called on the pipeline thread private void ErrorObjectStreamHandler(object sender, EventArgs e) @@ -114,7 +111,6 @@ namespace Microsoft.PowerShell } } - /// /// This method handles the failure in executing pipeline asynchronously /// @@ -425,7 +421,6 @@ namespace Microsoft.PowerShell 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 b82b277b7b..71693b3573 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 c2be475e02..d4a6ae51ca 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 System.Management.Automation.Internal; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell { /// @@ -157,8 +153,6 @@ namespace Microsoft.PowerShell AgeNodesAndResetStyle(); } - - private void EvictNode() @@ -183,7 +177,6 @@ namespace Microsoft.PowerShell } } - /// /// /// Removes a node from the tree. @@ -221,7 +214,6 @@ namespace Microsoft.PowerShell #endif } - private void RemoveNodeAndPromoteChildren(ArrayList nodes, int indexToRemove) @@ -267,8 +259,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// Adds a node to the tree, first removing the oldest node if the tree is too large. @@ -298,8 +288,6 @@ namespace Microsoft.PowerShell #endif } - - private class FindOldestNodeVisitor : NodeVisitor { @@ -318,30 +306,21 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell return v.FoundNode; } - private ProgressNode FindOldestLeafmostNode(out ArrayList listWhereFound, out int indexWhereFound) @@ -394,8 +372,6 @@ namespace Microsoft.PowerShell return result; } - - /// /// /// Convenience overload. @@ -412,8 +388,6 @@ namespace Microsoft.PowerShell FindNodeById(sourceId, activityId, out listWhereFound, out indexWhereFound); } - - private class FindByIdNodeVisitor : NodeVisitor { @@ -424,8 +398,6 @@ namespace Microsoft.PowerShell _idToFind = activityIdToFind; } - - internal override bool Visit(ProgressNode node, ArrayList listWhereFound, int indexWhereFound) @@ -440,32 +412,22 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell return found; } - - private class AgeAndResetStyleVisitor : NodeVisitor { @@ -608,8 +566,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// Increments the age of each of the nodes in the given list, and all their children. Also sets the rendering @@ -627,14 +583,10 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell return (string[])result.ToArray(typeof(string)); } - - /// /// /// Helper function for Render(). Recursively renders nodes. @@ -777,8 +727,6 @@ namespace Microsoft.PowerShell } } - - private class HeightTallyer : NodeVisitor { @@ -845,7 +793,6 @@ namespace Microsoft.PowerShell return ht.Tally; } - #if DEBUG || ASSERTIONS_TRACE /// @@ -887,8 +834,6 @@ namespace Microsoft.PowerShell return true; } - - /// /// /// Debugging code. NodeVisitor that counts up the number of nodes in the tree. @@ -912,8 +857,6 @@ namespace Microsoft.PowerShell Count; } - - /// /// /// Debugging code. Counts the number of nodes in the tree of nodes. @@ -936,7 +879,6 @@ namespace Microsoft.PowerShell #endif - /// /// /// Helper function to CompressToFit. Considers compressing nodes from one level to another. @@ -1030,8 +972,6 @@ namespace Microsoft.PowerShell return false; } - - /// /// /// "Compresses" the nodes representing the outstanding progress activities until their rendering will fit within a @@ -1130,15 +1070,10 @@ namespace Microsoft.PowerShell return 0; } - - - #endregion // Rendering Code #region Utility Code - - private abstract class NodeVisitor { @@ -1199,16 +1134,11 @@ namespace Microsoft.PowerShell } } - #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 159a1d5c78..2529c31927 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 System.Management.Automation.Internal; 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 @@ namespace Microsoft.PowerShell } } - - /// /// /// Renders a node in the "Minimal" style. @@ -402,8 +392,6 @@ namespace Microsoft.PowerShell maxWidth)); } - - /// /// /// The nodes that have this node as their parent. @@ -414,8 +402,6 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell int Age; - - /// /// /// The style in which this node should be rendered. @@ -445,8 +429,6 @@ namespace Microsoft.PowerShell RenderStyle Style = RenderStyle.FullPlus; - - /// /// /// Identifies the source of the progress record. @@ -457,7 +439,6 @@ namespace Microsoft.PowerShell Int64 SourceId; - /// /// /// The number of vertical BufferCells that are required to render the node in its current style. @@ -494,7 +475,6 @@ namespace Microsoft.PowerShell return 0; } - /// /// /// The number of vertical BufferCells that are required to render the node in the Full style. @@ -553,7 +533,6 @@ namespace Microsoft.PowerShell return lines; } - /// /// /// The number of vertical BufferCells that are required to render the node in the Compact style. @@ -586,4 +565,3 @@ namespace Microsoft.PowerShell } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs index b1d20c8314..922aad8f17 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 @@ namespace Microsoft.PowerShell _rawui = ui.RawUI; } - - /// /// /// Indicates whether the pane is visible on the screen buffer or not. @@ -64,8 +58,6 @@ namespace Microsoft.PowerShell } } - - /// /// /// 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 @@ namespace Microsoft.PowerShell } } - - /// /// /// 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 @@ namespace Microsoft.PowerShell } } - - /// /// /// Updates the pane with the rendering of the supplied PendingProgress, and shows it. @@ -257,8 +245,6 @@ namespace Microsoft.PowerShell } } - - private Coordinates _location = new Coordinates(0, 0); private Coordinates _savedCursor; private Size _bufSize; @@ -269,6 +255,3 @@ namespace Microsoft.PowerShell } } // namespace - - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs index 9eefb0e3b9..760570099c 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 @@ namespace Microsoft.PowerShell None = 2 } - - protected Serialization(DataFormat dataFormat, string streamName) { @@ -67,16 +61,12 @@ namespace Microsoft.PowerShell this.streamName = streamName; } - - protected static string XmlCliTag = "#< CLIXML"; protected string streamName; protected DataFormat format; } - - internal class WrappedSerializer : Serialization { @@ -106,8 +96,6 @@ namespace Microsoft.PowerShell } } - - internal void Serialize(object o) @@ -138,7 +126,6 @@ namespace Microsoft.PowerShell } } - internal void End() @@ -162,15 +149,12 @@ namespace Microsoft.PowerShell } } - internal TextWriter textWriter; private XmlWriter _xmlWriter; private Serializer _xmlSerializer; private bool _firstCall = true; } - - internal class WrappedDeserializer : Serialization { @@ -208,8 +192,6 @@ namespace Microsoft.PowerShell } } - - internal object Deserialize() @@ -250,8 +232,6 @@ namespace Microsoft.PowerShell return o; } - - internal bool AtEnd @@ -279,8 +259,6 @@ namespace Microsoft.PowerShell } } - - internal void End() @@ -297,7 +275,6 @@ namespace Microsoft.PowerShell } } - internal TextReader textReader; private XmlReader _xmlReader; private Deserializer _xmlDeserializer; @@ -306,4 +283,3 @@ namespace Microsoft.PowerShell } } // namespace - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs index 6739e77073..06009b22d2 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.IO; using System.Management.Automation; using System.Management.Automation.Internal; - namespace Microsoft.PowerShell.Commands { /// @@ -147,7 +143,6 @@ namespace Microsoft.PowerShell.Commands get; set; } - /// /// /// Starts the transcription @@ -344,5 +339,3 @@ namespace Microsoft.PowerShell.Commands } } - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs index 8c058a5e78..fa60872b01 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 @@ namespace Microsoft.PowerShell.Commands } } } - - - diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Telemetry.cs index ac035ba730..1200842584 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 d768faabd9..82755a3149 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 62d6c4c25b..63f2a97455 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 a504b27b28..e9ec9e8826 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 36244513e7..2b8cbcfc39 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 b628b885f1..baa14c16e8 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 @@ namespace System.Diagnostics.Eventing } } - [System.Security.SecurityCritical] private static unsafe string EncodeObject(ref object data, EventData* dataDescriptor, byte* dataBuffer) /*++ @@ -427,7 +423,6 @@ namespace System.Diagnostics.Eventing 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 @@ namespace System.Diagnostics.Eventing return WriteMessageEvent(eventMessage, 0, 0); } - /// /// WriteEvent method to write parameters with event schema properties /// @@ -597,7 +591,6 @@ namespace System.Diagnostics.Eventing return true; } - /// /// WriteTransferEvent, method to write a parameters with event schema properties /// @@ -767,7 +760,6 @@ namespace System.Diagnostics.Eventing 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 f692701cbc..c2a9c026e5 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 120738c142..71be5f4ca3 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 @@ namespace System.Diagnostics.Eventing.Reader 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 eecfcb274e..6e7694949a 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 @@ namespace System.Diagnostics.Eventing.Reader 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 8b700059f0..bc937391a2 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 435556b014..3d7c298d82 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 909f18f5ad..bac4f8db58 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 88a9942df0..c8580091f0 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 @@ namespace System.Diagnostics.Eventing.Reader 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 14010a4bdb..486c45e572 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 fbb5dd8b66..06222aa808 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 6311574009..daebcc3787 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 @@ namespace System.Diagnostics.Eventing.Reader 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 c40819565f..5941775028 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 @@ namespace System.Diagnostics.Eventing.Reader } } - 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 c9bed16f3b..f1ba68016d 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 570a8811a4..65eaee0e6d 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 668e02a1a8..7190cb04a0 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 d71761c08a..ae1ea29482 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 @@ namespace System.Diagnostics.Eventing.Reader } } - internal void PrepareSystemData() { if (_systemProperties.filled) @@ -285,7 +286,6 @@ namespace System.Diagnostics.Eventing.Reader } } - public override EventBookmark Bookmark { [System.Security.SecuritySafeCritical] @@ -340,7 +340,6 @@ namespace System.Diagnostics.Eventing.Reader } } - public override string OpcodeDisplayName { get @@ -392,7 +391,6 @@ namespace System.Diagnostics.Eventing.Reader } } - 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 8ed3512531..9bf610ca61 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 @@ namespace System.Diagnostics.Eventing.Reader // 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 0b12cedf3e..489c47e6e7 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 c6ae17d208..6a016d5066 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 @@ namespace System.Diagnostics.Eventing.Reader } } - 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 f6bc7ad2ea..64c35238bf 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 4cde07513a..dd9cdecfb4 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 035d053edd..99c6219955 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 671b831289..53f3e9132e 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 620d713552..1d9e173257 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 @@ namespace System.Diagnostics.Eventing.Reader 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 73a8d428ce..0e048b0fc3 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 @@ namespace System.Diagnostics.Eventing.Reader return handle; } - [System.Security.SecurityCritical] public static void EvtSeek( EventLogHandle resultSet, @@ -213,7 +214,6 @@ namespace System.Diagnostics.Eventing.Reader EventLogException.Throw(win32Error); } - [System.Security.SecurityCritical] public static EventLogHandle EvtOpenLog(EventLogHandle session, string path, PathType flags) { @@ -429,7 +429,6 @@ namespace System.Diagnostics.Eventing.Reader } } - [System.Security.SecurityCritical] internal static EventLogHandle EvtGetPublisherMetadataPropertyHandle(EventLogHandle pmHandle, UnsafeNativeMethods.EvtPublisherMetadataPropertyId thePropertyId) { @@ -466,7 +465,6 @@ namespace System.Diagnostics.Eventing.Reader } } - // implies UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId flag. [System.Security.SecurityCritical] public static string EvtFormatMessage(EventLogHandle handle, uint msgId) @@ -987,7 +985,6 @@ namespace System.Diagnostics.Eventing.Reader 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 @@ namespace System.Diagnostics.Eventing.Reader } } - //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 @@ namespace System.Diagnostics.Eventing.Reader if (val.Type != (int)desiredType) throw new EventLogInvalidDataException(); - return ConvertToObject(val); } @@ -1287,7 +1282,6 @@ namespace System.Diagnostics.Eventing.Reader return Marshal.PtrToStringAnsi(val.AnsiString); } - [System.Security.SecurityCritical] public static EventLogHandle ConvertToSafeHandle(UnsafeNativeMethods.EvtVariant val) { @@ -1297,7 +1291,6 @@ namespace System.Diagnostics.Eventing.Reader 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 @@ namespace System.Diagnostics.Eventing.Reader } } - [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 0843386d61..5ff0706e3c 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 @@ namespace System.Diagnostics.Eventing.Reader 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 @@ namespace System.Diagnostics.Eventing.Reader generalDisplayName = NativeWrapper.EvtFormatMessage(providerHandle, unchecked((uint)generalMessageId)); } - switch (objectTypeName) { case ObjectTypeName.Level: @@ -445,7 +445,6 @@ namespace System.Diagnostics.Eventing.Reader } } - public IList Levels { get @@ -498,7 +497,6 @@ namespace System.Diagnostics.Eventing.Reader } } - public IList Tasks { get @@ -516,7 +514,6 @@ namespace System.Diagnostics.Eventing.Reader } } - 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 6fedf2f149..feb1823cc3 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 @@ namespace System.Diagnostics.Eventing.Reader 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 47746d7686..0534158c2a 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 c2a43ba09e..3089ce8b17 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 @@ namespace System.Diagnostics.Eventing 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 @@ namespace System.Diagnostics.Eventing [SecurityCritical] internal static extern int EventUnregister([In] long registrationHandle); - // // Control (Is Enabled) APIs // @@ -524,7 +523,6 @@ namespace System.Diagnostics.Eventing public int Flags; } - //SEEK [Flags] internal enum EvtSeekFlags @@ -682,7 +680,6 @@ namespace System.Diagnostics.Eventing out int eventMetadataPropertyBufferUsed ); - //Channel Configuration Native Api [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] @@ -703,7 +700,6 @@ namespace System.Diagnostics.Eventing out int channelPathBufferUsed ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] internal static extern EventLogHandle EvtOpenPublisherEnum( @@ -737,7 +733,6 @@ namespace System.Diagnostics.Eventing int flags ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -748,7 +743,6 @@ namespace System.Diagnostics.Eventing ref EvtVariant propertyValue ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -771,7 +765,6 @@ namespace System.Diagnostics.Eventing [MarshalAs(UnmanagedType.I4)]PathType flags ); - [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -839,7 +832,6 @@ namespace System.Diagnostics.Eventing out int propCount ); - [DllImport(WEVTAPI, EntryPoint = "EvtRender", CallingConvention = CallingConvention.Winapi, SetLastError = true)] [SecurityCritical] [return: MarshalAs(UnmanagedType.Bool)] @@ -853,7 +845,6 @@ namespace System.Diagnostics.Eventing 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 65540314dc..70b2e9f18c 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -94,7 +96,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +105,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -125,7 +125,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// @@ -209,7 +208,6 @@ namespace Microsoft.PowerShell.Commands 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 9d7d4c5ca3..eb47f20ec8 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -91,7 +93,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -101,7 +102,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -119,7 +119,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs index cf0562f23f..f872439c55 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -91,9 +93,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -103,7 +102,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -121,7 +119,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs index bd93d56fa6..69c1416a78 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.Management.Automation.SecurityAccountsManager.Extensions; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -61,9 +63,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -73,7 +72,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -91,7 +89,6 @@ namespace Microsoft.PowerShell.Commands ProcessSids(); } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs index 0acb4d03de..a9f28b792c 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; using System.Management.Automation.SecurityAccountsManager.Extensions; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -92,7 +94,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -102,7 +103,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -128,7 +128,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs index e37acc7061..d5a33ac357 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; using System.Management.Automation.SecurityAccountsManager.Extensions; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -64,8 +66,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -75,7 +75,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -93,7 +92,6 @@ namespace Microsoft.PowerShell.Commands ProcessSids(); } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs index 35a6272de9..d7283d5430 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -57,8 +59,6 @@ namespace Microsoft.PowerShell.Commands private string name; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -68,7 +68,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -93,7 +92,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs index 70690eb858..566a3039c0 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -179,8 +181,6 @@ namespace Microsoft.PowerShell.Commands private System.Management.Automation.SwitchParameter usermaynotchangepassword; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -195,7 +195,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -250,7 +249,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs index cb93071ca5..cccc31e791 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -84,7 +86,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -94,7 +95,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -112,7 +112,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs index b8c87bef98..26c5914faf 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -94,7 +96,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +105,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -125,7 +125,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs index cbcef6ef48..a5e36fcc81 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 Microsoft.PowerShell.LocalAccounts; using System.Diagnostics.CodeAnalysis; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -85,8 +87,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier[] sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -96,7 +96,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -114,7 +113,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs index 25254cf05f..a1e458e6d1 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -95,7 +97,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -105,7 +106,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -123,7 +123,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs index 4a48b659e6..c731820caa 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -95,8 +97,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -106,7 +106,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -124,7 +123,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs index eeaf701bff..b22806aad9 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -93,8 +95,6 @@ namespace Microsoft.PowerShell.Commands private System.Security.Principal.SecurityIdentifier sid; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -104,7 +104,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -148,7 +147,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs index 4ae4e422d3..0b3e4b2fbe 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 System.Management.Automation.SecurityAccountsManager.Extensions; using Microsoft.PowerShell.LocalAccounts; #endregion - namespace Microsoft.PowerShell.Commands { /// @@ -185,8 +187,6 @@ namespace Microsoft.PowerShell.Commands private System.Boolean usermaychangepassword; #endregion Parameter Properties - - #region Cmdlet Overrides /// /// BeginProcessing method. @@ -201,7 +201,6 @@ namespace Microsoft.PowerShell.Commands sam = new Sam(); } - /// /// ProcessRecord method. /// @@ -278,7 +277,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// EndProcessing method. /// diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs index a9f7193efe..679c89d009 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 86ef63e3ef..0a956c1086 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 170493522f..eb54498633 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 @@ namespace Microsoft.PowerShell.Commands } #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 94e5972d26..eef3d02b30 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 fb27679fea..12e8832bf0 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 @@ namespace Microsoft.PowerShell.Commands /// public bool UserMayChangePassword { get; set; } - /// /// Indicates whether the user must have a password (true) or not (false). /// @@ -69,7 +71,6 @@ namespace Microsoft.PowerShell.Commands 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 4a085d7867..e7a7d0ec7f 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native } } - // 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 59e00f0b25..231909c917 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native public const UInt32 STATUS_MORE_ENTRIES = 0x00000105; - - - - - ///////////////////////////////////////////////////////////////////////// // // Standard Information values @@ -453,7 +449,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native return Severity(ntstatus) == STATUS_SEVERITY_ERROR; } - /// /// Determine if an NTSTATUS value indicates a Warning /// @@ -480,7 +475,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native return Severity(ntstatus) == STATUS_SEVERITY_INFORMATIONAL; } - /// /// Return the Severity part of an NTSTATUS value /// @@ -493,7 +487,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native return ntstatus >> 30; } - /// /// Return the Facility part of an NSTATUS value /// @@ -508,7 +501,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native 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 6a4688584f..026a47ca6f 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 b74184e168..6afc175ae8 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 @@ namespace System.Management.Automation.SecurityAccountsManager #endregion Additional members } - /// /// Provides methods for manipulating local Users and Groups. /// @@ -176,7 +178,6 @@ namespace System.Management.Automation.SecurityAccountsManager Max = Win32.MAXIMUM_ALLOWED } - /// /// The operation under way. Used in the class. /// @@ -855,7 +856,6 @@ namespace System.Management.Automation.SecurityAccountsManager 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 e0c686ea7c..a459894730 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native.NtSam public LOGON_HOURS LogonHours; } - [StructLayout(LayoutKind.Sequential)] internal struct POLICY_PRIMARY_DOMAIN_INFO { @@ -273,7 +275,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native.NtSam 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native.NtSam internal const UInt32 USER_ALL_UNDEFINED_MASK = 0xC0000000; - // // Bit masks for the UserAccountControl member of the USER_ALL_INFORMATION structure // @@ -351,7 +351,6 @@ namespace System.Management.Automation.SecurityAccountsManager.Native.NtSam 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 @@ namespace System.Management.Automation.SecurityAccountsManager.Native.NtSam 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 afc20f1261..24943c563c 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 cfde8a0c81..a1f618c315 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 8be3229350..08853e30b8 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 bf61ff7149..5754ed682c 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 @@ namespace Microsoft.PowerShell.ScheduledJob throw new PSNotSupportedException(); } - /// /// StopJob /// @@ -375,7 +374,6 @@ namespace Microsoft.PowerShell.ScheduledJob 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 826b4cfdc7..a0485ed55c 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 25ad74822b..858288f3c4 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 37d3eab4b2..5e14b5f12c 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 b73dbc7432..a145b5b5c1 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 1ac15ed476..9daebe3281 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 e89df8051f..36713a7a88 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 0bfb6d8ae5..4837a66486 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 a84de3eace..bd1ed864a1 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 73553266f6..a6f7f037ed 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 e8d73e93f7..ebc4db8774 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 fc1e2ef553..f51ceced32 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 3344785d84..6758469069 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 54b8790aa1..494fd08081 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 a59869d902..fb1539f6ba 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 469176d0f4..dc188dc067 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 be12fb0e3e..07058f03a7 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 cabb4e3b66..f7a83d88c9 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 224c11a8b5..55fb9a4c0b 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 b451a9fc16..9a48be140b 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 @@ namespace Microsoft.PowerShell.ScheduledJob 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 757e52f39b..2456b46de6 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 25509d8cc5..6021aa6ea9 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 135bcc9cb3..89571e90e5 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 ca3f42809b..cf7631b47a 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 @@ namespace Microsoft.PowerShell.ScheduledJob 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 bfe72b9e07..7a365ea12d 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 ef329895bd..3ebe841629 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 8eea6a6b00..bde525a294 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 e4a8d0421d..40cf6aa33d 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 @@ namespace Microsoft.PowerShell.Commands } } // CmdletProviderContext - #region brokered properties /// diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index 722a8b0707..08051337a5 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 94d032e48a..024bbbb62a 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 @@ namespace Microsoft.PowerShell.Commands // private ArrayList _filesNotFound = new ArrayList(); - /// /// Initializes a new instance of the GetPfxCertificateCommand /// class @@ -123,7 +120,6 @@ namespace Microsoft.PowerShell.Commands 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 533cb60767..01e2db04f1 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 @@ namespace Microsoft.PowerShell.Commands } } // constructor - /// /// Removes an item at the specified path /// @@ -1321,7 +1320,6 @@ namespace Microsoft.PowerShell.Commands return; } - CommandInfo commandInfo = new CmdletInfo( "Import-Module", @@ -1369,7 +1367,6 @@ namespace Microsoft.PowerShell.Commands int separatorIndex = path.LastIndexOf(StringLiterals.DefaultPathSeparator); - // Since there was no path separator return the entire path if (separatorIndex == -1) { @@ -2218,7 +2215,6 @@ namespace Microsoft.PowerShell.Commands GetChildItemsOrNames(path, false, returnContainers, true, GetFilter()); } // GetChildNames - /// /// Determines if the item at the specified path is a store /// or location. @@ -2877,7 +2873,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands { private List _ekuList = new List(); - /// /// get property of EKUList /// @@ -3371,7 +3365,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// downlevel helper function to determine if the OS is WIN8 and above /// @@ -3525,7 +3518,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands 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 b93a55f5e0..944d14ae46 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 @@ namespace Microsoft.PowerShell.Commands } private string _resolvedPath = null; - /// /// Validate / convert arguments /// @@ -438,7 +436,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 1bc1d186d6..cdf7a3ce4c 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 6720d3d9c8..f0c318021a 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 c426e0d8ce..83b40529c9 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// Defines the implementation of the 'ConvertTo-SecureString' cmdlet. /// This cmdlet imports a new SecureString from encrypted data -- @@ -278,7 +276,6 @@ namespace Microsoft.PowerShell.Commands } 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 94f8a8a691..b7a3e1cb85 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 1e2c758f1d..2f865bbb73 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 @@ namespace Microsoft.PowerShell return er; } - /// /// Create an error record for 'operation not supported' condition /// @@ -183,7 +181,6 @@ namespace Microsoft.PowerShell 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 222cdc3347..0a1f7372f2 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 7f884b13f9..43a3eb7141 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 f2a21a1e34..c4d01b9e3b 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 @@ namespace Microsoft.WSMan.Management #endregion - #region DriveCmdletProvider /// /// @@ -221,7 +220,6 @@ namespace Microsoft.WSMan.Management return drive; } - #endregion #region ItemCmdletProvider @@ -390,8 +388,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management return; } - if (path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { //Get the ChildName @@ -866,7 +861,6 @@ namespace Microsoft.WSMan.Management return; } - if (path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { //Get the ChildName @@ -1353,7 +1347,6 @@ namespace Microsoft.WSMan.Management return null; } - #endregion #region ContainerCmdletProvider @@ -1426,8 +1419,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management string host = GetHostName(path); string uri = NormalizePath(path, host); - //Chk for Winrm Service if (IsPathLocalMachine(host)) { @@ -1644,7 +1633,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management return; } - if (path.Length == 0 || !path.Contains(WSManStringLiterals.DefaultPathSeparator.ToString())) { NewItemCreateComputerConnection(path); @@ -1797,7 +1784,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management } } - /// /// Used By ItemExists, HasChildItem,IsValidPath, IsItemContainer /// @@ -3763,7 +3746,6 @@ namespace Microsoft.WSMan.Management ChildName = path; } - //Get the wsman host name to find the session object string host = GetHostName(path); @@ -4065,7 +4047,6 @@ namespace Microsoft.WSMan.Management throw new InvalidOperationException("InvalidPath"); } - //Checks the WinRM Service if (IsPathLocalMachine(host)) { @@ -4230,8 +4211,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management keys = keysColumns.Split('|'); } - private void ProcessCertMappingObjects(XmlDocument xmlCerts, out Hashtable Certcache, out Hashtable Keyscache) { Hashtable lCache = new Hashtable(); @@ -4790,7 +4768,6 @@ namespace Microsoft.WSMan.Management objResource.Properties.Add(new PSNoteProperty("SupportsOptions", false)); } - //Processing capabilities XmlDocument xmlCapabilities = new XmlDocument(); @@ -5365,7 +5342,6 @@ namespace Microsoft.WSMan.Management } 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 @@ namespace Microsoft.WSMan.Management } - #endregion #region Listener Dynamic Parameters @@ -5975,7 +5950,6 @@ namespace Microsoft.WSMan.Management private SwitchParameter _concatenate = false; } - #endregion SetItemDynamicParameters #endregion @@ -6124,7 +6098,6 @@ namespace Microsoft.WSMan.Management /// internal const string containerCertMapping = "Service/certmapping"; - /// /// Possible Values in Plugin Top Level XML /// @@ -6358,11 +6331,7 @@ $_ | Start-WSManServiceD15A7957836142a18627D7E1D342DD82 -force $args[0] -caption private string[] _keys; } - - #endregion "WsMan Output Objects" - } - diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index cfe47a63a5..5112eee602 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 @@ namespace Microsoft.WSMan.Management /// 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 @@ namespace Microsoft.WSMan.Management #endregion IDisposable Members - - - - } - - - #endregion } diff --git a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs index 02b2038fdb..aeb78f97bb 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 5d8a6802db..4d526f0150 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 @@ namespace Microsoft.WSMan.Management #endregion WsManEnumFlags - - - #region WsManSessionFlags /// WSManSessionFlags enumeration. /// @@ -388,7 +383,6 @@ namespace Microsoft.WSMan.Management int ProxyAuthenticationUseDigest(); }; - #endregion IWSManConnectionOptions #region IWSManEnumerator @@ -498,7 +492,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management #endif object CreateConnectionOptions(); - /// /// /// @@ -540,12 +532,10 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management /// 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 @@ namespace Microsoft.WSMan.Management [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")] - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sel")] [Guid("A7A1BA28-DE41-466A-AD0A-C4059EAD7428")] @@ -729,7 +717,6 @@ namespace Microsoft.WSMan.Management [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] #endif - public interface IWSManResourceLocator { #if CORECLR @@ -775,7 +762,6 @@ namespace Microsoft.WSMan.Management // 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 @@ namespace Microsoft.WSMan.Management // Clear all selectors // IDL: HRESULT ClearSelectors (void); - - [DispId(3)] void ClearSelectors(); @@ -810,7 +794,6 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management [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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management [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 @@ namespace Microsoft.WSMan.Management get; } - - } #endregion IWsManResourceLocator @@ -922,7 +899,6 @@ namespace Microsoft.WSMan.Management /// 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 @@ namespace Microsoft.WSMan.Management [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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management #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 6d9aba7296..936f97dd63 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; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - - namespace Microsoft.WSMan.Management { /// @@ -206,7 +204,6 @@ namespace Microsoft.WSMan.Management } private Hashtable valueset; - /// /// The following is the definition of the input parameter "ResourceURI". /// URI of the resource class/instance representation @@ -223,13 +220,11 @@ namespace Microsoft.WSMan.Management } 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 @@ namespace Microsoft.WSMan.Management //create the connection string connectionStr = helper.CreateConnectionString(connectionuri, port, computername, applicationname); - } /// @@ -251,7 +245,6 @@ namespace Microsoft.WSMan.Management protected override void ProcessRecord() { - try { //create the resourcelocator object @@ -321,9 +314,5 @@ namespace Microsoft.WSMan.Management } - - - - }//End Class } diff --git a/src/Microsoft.WSMan.Management/NewWSManSession.cs b/src/Microsoft.WSMan.Management/NewWSManSession.cs index ab730bcdd2..c927bbc88a 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.Collections.Generic; 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 @@ namespace Microsoft.WSMan.Management } 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 @@ namespace Microsoft.WSMan.Management } private bool useutf16; - - - - /// /// BeginProcessing method. /// @@ -241,8 +233,6 @@ namespace Microsoft.WSMan.Management 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 21e9bd9569..66dd6800b2 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; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.WSMan.Management { @@ -124,7 +123,6 @@ namespace Microsoft.WSMan.Management } 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 6edb2b0d0e..c7378949be 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; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.WSMan.Management { #region Set-WsManQuickConfig @@ -91,11 +90,8 @@ namespace Microsoft.WSMan.Management QuickConfigRemoting(false); }//End BeginProcessing() - - #region private - private void QuickConfigRemoting(bool serviceonly) { IWSManSession m_SessionObj = null; @@ -112,7 +108,6 @@ namespace Microsoft.WSMan.Management string xpathStatus = string.Empty; string xpathResult = string.Empty; - if (!usessl) { transport = "http"; @@ -134,7 +129,6 @@ namespace Microsoft.WSMan.Management action = "Analyze"; } - string analysisOutputXml = m_SessionObj.Invoke(action, "winrm/config/service", analysisInputXml, 0); XmlDocument resultopxml = new XmlDocument(); resultopxml.LoadXml(analysisOutputXml); @@ -152,8 +146,6 @@ namespace Microsoft.WSMan.Management 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 dd8b14e20c..b63d3d5d2e 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.Management.Automation.Runspaces; 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 @@ namespace Microsoft.WSMan.Management } private SwitchParameter usessl; - - #endregion /// @@ -356,8 +353,6 @@ namespace Microsoft.WSMan.Management } }//End BeginProcessing() - - }//End Class #endregion Disconnect-WSMAN } diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index 96dfa8e843..8b968e6b9d 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 System.Diagnostics.CodeAnalysis; using Dbg = System.Management.Automation; using System.Globalization; - namespace Microsoft.WSMan.Management { #region Get-WSManInstance @@ -579,7 +578,6 @@ namespace Microsoft.WSMan.Management #endregion IDisposable Members - /// /// BeginProcessing method. /// @@ -589,7 +587,6 @@ namespace Microsoft.WSMan.Management helper.CleanUp(); } - } #endregion @@ -685,7 +682,6 @@ namespace Microsoft.WSMan.Management } 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 @@ namespace Microsoft.WSMan.Management } private Hashtable valueset; - - #endregion private WSManHelper helper ; @@ -831,7 +825,6 @@ namespace Microsoft.WSMan.Management helper.WSManOp = "set"; IWSManSession m_session = null; - if (dialect != null) { if (dialect.ToString().Equals(helper.ALIAS_WQL, StringComparison.CurrentCultureIgnoreCase)) @@ -941,11 +934,8 @@ namespace Microsoft.WSMan.Management } - - #endregion - #region Remove-WsManInstance /// @@ -1111,12 +1101,8 @@ namespace Microsoft.WSMan.Management } private SwitchParameter usessl; - - - #endregion - /// /// ProcessRecord method. /// @@ -1200,10 +1186,8 @@ namespace Microsoft.WSMan.Management #endregion IDisposable Members - } - #endregion #region New-WsManInstance @@ -1418,7 +1402,6 @@ namespace Microsoft.WSMan.Management }//End BeginProcessing() - /// /// ProcessRecord method. /// diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index f0843fad94..45e906510d 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 @@ namespace Microsoft.WSMan.Management 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 @@ namespace Microsoft.WSMan.Management // // - internal static void ReleaseSessions() { lock (Sessions.SessionObjCache) @@ -200,7 +198,6 @@ namespace Microsoft.WSMan.Management return result; } - /// /// add a session to dictionary /// @@ -568,7 +565,6 @@ namespace Microsoft.WSMan.Management { m_resource = (IWSManResourceLocator)wsmanObj.CreateResourceLocator(resource); - if (optionset != null) { foreach (DictionaryEntry entry in optionset) @@ -765,7 +761,6 @@ namespace Microsoft.WSMan.Management connObject.SetProxy((int)sessionoption.ProxyAccessType, (int)sessionoption.ProxyAuthentication, null, null); } - } if (sessionoption.SkipCACheck) { @@ -830,7 +825,6 @@ namespace Microsoft.WSMan.Management internal void CleanUp() { - if (_sr != null) { _sr.Dispose(); @@ -1097,7 +1091,6 @@ namespace Microsoft.WSMan.Management throw (e); } - } /// @@ -1126,6 +1119,5 @@ namespace Microsoft.WSMan.Management /// private static Dictionary ResourceValueCache = new Dictionary(); - } } diff --git a/src/Microsoft.WSMan.Management/WsManSnapin.cs b/src/Microsoft.WSMan.Management/WsManSnapin.cs index b47e57f424..8f7ed60177 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 0a5a9c2268..0477dcc7ae 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.Runtime.InteropServices; 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 88a0034539..56bb928718 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 cd915abe7a..c55839fd44 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 c270ed5384..1eef40c487 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 20df5b5ea2..5afb77fe13 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 65f4c80fc5..b6ae454242 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 049f89c7d1..f43e7df4ab 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 34343b0063..5ce8045b8b 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 52c5e2ab83..5049c15af5 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 a84bd87f3c..fe88525544 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 524f2ccb73..d0b184bf44 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 af936717b6..1eaafbce6a 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 4c48be5e2a..04d4e36064 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 6aa5b03d76..35a987c1c8 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 5d95cfb3a7..6db471f524 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 8f682e5367..dd87994738 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 1f68c7822b..e7a43cf4ae 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 0c0921821d..967268f8bb 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 4f1b1e4701..b4ad19bd6f 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 9d5e525472..2909c7f731 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 473d39909e..d332635db6 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 9ecd112b2e..b19636df0f 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 4a48f4ec1e..b8bd33f155 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 a8ed0ab830..d2831607ee 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 4c5246ff53..44a39ed088 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 8bc235b14a..1dd69f1538 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 b652d90d53..265370dbe3 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 bbc4f565c2..2d73ba752f 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 4a21405f65..7d5dee725e 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 @@ namespace System.Management.Automation 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 3170b54588..d8ca4a0a3a 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 @@ namespace System.Management.Automation.Security } } - #if UNIX // Porting note: Tracing is absolutely not available on Linux @@ -978,7 +976,6 @@ namespace System.Management.Automation.Tracing return false; } - /// /// /// diff --git a/src/System.Management.Automation/CoreCLR/EventResource.cs b/src/System.Management.Automation/CoreCLR/EventResource.cs index 9ff6f38d40..2adf60428e 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 8aac81ca45..b66740b483 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 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal } } - bool supported = false; bool missingDefaultConstructor = false; if (type.GetTypeInfo().IsValueType) @@ -3731,7 +3733,6 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal } } - if($null -ne $value['ExclusiveResources']) { # make sure the references are well-formed @@ -3899,7 +3900,6 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal } } - # 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 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration.Internal } } - 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 ebbb08a5e8..07277a8cd4 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 6a733afd4d..712977f765 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 6e7d3d7eeb..7e083ef66d 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 317cd60517..b68e036edc 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 f2db072630..0eede35767 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 b92f990b9c..b29fb2c5da 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 3e1fb82f9d..e9f8842ee9 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 e19d0dc9a5..682acddb14 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 03dd42b3eb..ef0a79e12a 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 05f07cb6c5..cfb6d5aa4b 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 cec51adf5d..d11b1538ed 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 736f533999..80658c30c3 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format false)); } - /// /// send an object to the pipeline /// @@ -232,7 +229,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// internal ImplementationCommandBase implementation = null; - #region IDisposable Implementation /// @@ -377,7 +373,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// 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 14ca8b34fd..136a91cb59 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - internal override void EndProcessing() { // need to pop all the contexts, in case the transmission sequence @@ -447,7 +445,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format this.WriteObject(startFormat); } - /// /// write a payplad object by properly wrapping it into /// a FormatEntry object @@ -503,7 +500,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return scriptBlock; } - private MshExpressionFactory _expressionFactory; #endregion @@ -531,7 +527,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format [Parameter] public object GroupBy { get; set; } = null; - /// /// optional, non positional parameter /// @@ -556,7 +551,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } internal Nullable showErrorsAsMessages = null; - /// /// optional, non positional parameter /// @@ -636,7 +630,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return null; } - #endregion /// @@ -803,7 +796,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } private Nullable _multiLine = null; - #endregion internal override FormattingCommandLineParameters GetCommandLineParameters() { @@ -840,4 +832,3 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs index 74ad087336..34d71e3199 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// definitions for hash table keys /// @@ -427,7 +425,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 bb64bde1db..5ef046b61a 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - private bool ProcessObject(PSObject so) { object o = _formatObjectDeserializer.Deserialize(so); @@ -214,7 +212,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// enum describing the state for the output finite state machine /// @@ -241,14 +238,12 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format //Console.WriteLine("ProcessGroupStart"); GroupOutputContext goc = (GroupOutputContext)c; - if (goc.Data.groupingEntry != null) { _lo.WriteLine(""); @@ -613,7 +607,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// retrieve the active FormatOutputContext on the stack /// by walking up to the top of the stack @@ -634,7 +627,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// context manager instance to guide the message traversal /// @@ -792,7 +784,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format private FormatObjectDeserializer _formatObjectDeserializer; - /// /// context for the outer scope of the format sequence /// @@ -862,7 +853,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// internal GroupStartData Data { get; } = null; - protected OutCommandInner InnerCommand { get; } } @@ -1082,7 +1072,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return retVal; } - /// /// write the headers /// @@ -1228,7 +1217,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format _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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 56687b2ae7..38fc778f58 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 210754dbe2..ba922a7c31 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format firstLineIndentation = 0; } - // compute the first line indentation or hanging int firstLineWidth = _textColumns - rightIndentation - leftIndentation; int followingLinesWidth = firstLineWidth; @@ -224,7 +222,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format private const int maxRecursionDepth = 50; } - internal sealed class IndentationManager { private sealed class IndentationStackFrame : IDisposable @@ -288,7 +285,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - 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 2cca282bf3..de48f5e09f 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 @@ namespace System.Management.Automation.Runspaces SetDefaultErrorRecord(); } - - /// /// This constructor takes a localized message and an inner exception. /// @@ -270,7 +267,6 @@ namespace System.Management.Automation.Runspaces 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 a48c9bac7f..a27319cd65 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal int errorCount; } - /// /// entry logged by the loader and made available to external consumers /// @@ -74,7 +72,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - protected void SetDatabaseLoadingInfo(XmlFileLoadInfo info) { _loadingInfo.fileDirectory = info.fileDirectory; @@ -711,7 +706,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 bb3e60a368..865af22db5 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 db4b84f55d..b22c84d093 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal ViewDefinitionsSection viewDefinitionsSection = new ViewDefinitionsSection(); internal FormatControlDefinitionHolder formatControlDefinitionHolder = new FormatControlDefinitionHolder(); - /// /// cache for resource strings in format.ps1xml /// @@ -59,7 +57,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } #endregion - #region Default Settings #if _LATER @@ -121,7 +118,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } private bool? _multilineTables; - internal FormatErrorPolicy formatErrorPolicy = new FormatErrorPolicy(); internal ShapeSelectionDirectives shapeSelectionDirectives = new ShapeSelectionDirectives(); internal List enumerableExpansionDirectiveList = new List(); @@ -185,7 +181,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal string formatErrorStringInFormattedOutput = "#FMTERR"; } - internal sealed class ShapeSelectionDirectives { internal int PropertyCountForTable @@ -229,7 +224,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #endregion - #region Type Groups Definitions internal sealed class TypeGroupsSection @@ -261,10 +255,8 @@ namespace Microsoft.PowerShell.Commands.Internal.Format { } - #endregion - #region Elementary Tokens internal abstract class FormatToken @@ -365,7 +357,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #endregion Elementary Tokens - #region Control Definitions: common data /// @@ -453,7 +444,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #endregion - #region View Definitions: common data internal sealed class ViewDefinitionsSection { @@ -477,7 +467,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } - 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 fc6e3f7172..d4ed74e97c 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 642b1d5b89..5c049e7167 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 acad22df75..146da136c3 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 7bebf09eda..7dd3eac2c0 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 6a74c5b9b3..c0dcee3001 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// 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 c5560edf1f..3e4ed05b2b 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 c4f4e237fd..2fba81a4f8 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 838ed276f1..1bc4f8bbb0 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 3467716071..f5127d028f 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// helper object holding a generic object and the related /// "applies to" object. @@ -210,7 +208,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return BestMatchIndexUndefined; } - private bool MatchCondition(PSObject currentObject, MshExpression ex) { if (ex == null) @@ -225,7 +222,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return retVal; } - private MshExpressionFactory _expressionFactory; private TypeInfoDataBase _db; private Collection _typeNameHierarchy; @@ -334,7 +330,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return FormatShape.List; } - internal static ViewDefinition GetViewByShapeAndType(MshExpressionFactory expressionFactory, TypeInfoDataBase db, FormatShape shape, Collection typeNames, string viewName) { @@ -561,7 +556,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return result; } - private static bool IsOutOfBandView(ViewDefinition vd) { return (vd.mainControl is ComplexControlBody || vd.mainControl is ListControlBody) && vd.outOfBand; @@ -619,7 +613,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 1e2b3edb76..2a7a2bccbf 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal string psSnapinName; } - /// /// class to load the XML document into data structures. /// It encapsulates the file format specific code @@ -167,7 +165,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format // processing pre-validated type / formatting information. private bool _suppressValidation = false; - /// /// entry point for the loader algorithm /// @@ -1102,7 +1099,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return cpt; } - var frame = (CustomItemFrame)item; var frameToken = new FrameToken { @@ -1301,7 +1297,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #endregion - #region Type Groups Loading private void LoadTypeGroups(TypeInfoDataBase db, XmlNode typeGroupsNode) @@ -1393,7 +1388,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #endregion - #region AppliesTo Loading private AppliesTo LoadAppliesToSection(XmlNode appliesToNode, bool allowSelectionCondition) @@ -1557,7 +1551,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - if (typeFound && typeGroupFound) { //Error at XPath {0} in file {1}: Cannot have SelectionSetName and TypeName at the same time. @@ -1690,7 +1683,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - private TextToken LoadLabel(XmlNode textNode) { using (this.StackFrame(textNode)) @@ -1806,7 +1797,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format // success in loading resource.loadingInfo = this.LoadingInfo; - // optional pre-load and binding verification if (this.VerifyStringResources) { @@ -2187,4 +2177,3 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - 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 cb1fe4b71b..70986f79b7 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } // 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 6c2bdf898c..c303ba16d6 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 de895ffd89..a582dfbfba 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 4e1052281c..8313adabdd 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - - 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 38e1706b3a..9151bfb65e 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 2308170705..6ba01682f1 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 24f9badc41..51b3e7ed92 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// 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 18841851b4..b6e0e0936f 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - FormatEntry fe = new FormatEntry(); startGroup.groupingEntry.formatValueList.Add(fe); @@ -272,7 +269,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return _groupingManager.UpdateGroupingKeyValue(so); } - internal GroupEndData GenerateGroupEndData() { return new GroupEndData(); @@ -308,7 +304,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return result; } - private GroupingInfoManager _groupingManager = null; protected bool AutoSize @@ -397,7 +392,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return retVal; } - internal FormatErrorManager ErrorManager { get { return _errorManager; } @@ -405,7 +399,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 e657ea8609..2b0e7a9617 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - // 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - formatValueList.Add(fpf); formatValueList.Add(new FormatNewLine()); } @@ -562,7 +559,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - // 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 f90d04d1dc..04f3a0fe06 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 23450e5373..bc502f3a43 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 b7b2d7df74..5f3af4cb9b 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 adca8c0bc4..750f4a3b0a 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - private static ViewGenerator SelectViewGeneratorFromViewDefinition( TerminatingErrorContext errorContext, MshExpressionFactory expressionFactory, @@ -447,8 +444,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return viewGenerator; } - - /// /// the view generator that produced data for a selected shape /// @@ -588,7 +583,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// Helper class to manage the logging of errors resulting from /// evaluations of MshExpression instances @@ -715,7 +709,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 b679bb9ddf..f027c7fa9e 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 7660eb45f4..81bb639734 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 @@ Copyright (c) Microsoft Corporation. All rights reserved. using System.Collections.Generic; - namespace Microsoft.PowerShell.Commands.Internal.Format { #region Root of Class Hierarchy @@ -50,7 +49,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format public abstract string ClassId2e4f51ef21dd47e99d3c952918aff9cd { get; } } - #endregion #region Top Level Messages @@ -243,7 +241,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format public string propertyName = null; } - internal sealed class ListViewHeaderInfo : ShapeInfo { internal const string CLSID = "830bdcb24c1642258724e441512233a4"; @@ -258,7 +255,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 869f1e919c..1aed8ae637 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.Collections.Generic; using System.Management.Automation; using System.Management.Automation.Internal; - namespace Microsoft.PowerShell.Commands.Internal.Format { /// @@ -49,7 +47,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return fid; } - // returns null on failure private static FormatInfoData CreateInstance(string clsid, FormatObjectDeserializer deserializer) { @@ -480,8 +476,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - #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 0919fa17a2..b4fd10892d 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format /// 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 83fa285d32..52ad545bde 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 cd4adf2c33..9a75268bdb 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal static PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutputManagerInner", "OutputManagerInner"); #endregion tracer - #region LineOutput internal LineOutput LineOutput { @@ -123,7 +121,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// 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 46c15e02e5..a501e518be 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format _groupingDuration = groupingDuration; } - /// /// add an object to the cache /// @@ -326,7 +324,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 27cfa6d5a8..abd9f0a60b 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - /// /// Initialize the table specifying the width of each column /// @@ -214,7 +212,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - if (multiLine) { string[] lines = GenerateTableRow(values, currentAlignment, lo.DisplayCells); @@ -246,7 +243,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format if (validColumnCount == 0) return null; - StringCollection[] scArray = new StringCollection[validColumnCount]; for (int k = 0; k < scArray.Length; k++) { @@ -334,7 +330,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return sc; } - private string GenerateRow(string[] values, int[] alignment, DisplayCells dc) { StringBuilder sb = new StringBuilder(); @@ -367,7 +362,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 37b42baf77..fdc09b8175 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 956892e459..1c27af3c1d 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.Collections.Generic; using System.Text; using System.Diagnostics.CodeAnalysis; - namespace Microsoft.PowerShell.Commands.Internal.Format { /// @@ -195,7 +193,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format return false; } - #region Error Processing private static void ProcessAmbiguousKey(TerminatingErrorContext invocationContext, @@ -221,7 +218,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format invocationContext.ThrowTerminatingError(errorRecord); } - internal ParameterProcessor(CommandParameterDefinition p) { _paramDef = p; @@ -337,7 +332,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format // 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format #region Error Processing - private static void ProcessUnknownParameterType(TerminatingErrorContext invocationContext, object actualObject, Type[] allowedTypes) { string allowedTypesList = CatenateTypeArray(allowedTypes); @@ -493,7 +486,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 e571c5a00a..09a0cbcbd9 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format 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 6def0a76b3..41976170a4 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format internal Exception Exception { get; } = null; } - internal class MshExpression { /// @@ -268,7 +266,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format } } - // 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 5d4c05dd51..29ae8ae8ac 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 @@ namespace Microsoft.PowerShell.Commands } } - diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs index 4808107426..c6ed4bd371 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 @@ namespace Microsoft.PowerShell.Commands.Internal.Format private PSHostRawUserInterface _rawUserInterface; } - - - /// /// Implementation of the LineOutput interface on top of Console and RawConsole /// @@ -259,7 +255,6 @@ namespace Microsoft.PowerShell.Commands.Internal.Format _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 823c5b5ea6..5b97235db3 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 a72e34844a..1731a205df 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 @@ namespace Microsoft.PowerShell.Commands private object _lineOutput = null; - /// /// set inner command /// @@ -92,6 +90,3 @@ namespace Microsoft.PowerShell.Commands } } - - - diff --git a/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs index 9247b13fff..d6a39a7058 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 110d3a53ce..226ee1edd1 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 b559951632..46c384eff2 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 fa7d0ce519..a3eb67c12d 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 2dc843d567..dbf58e240d 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 5f79633253..2bc67139a3 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 a244064ebc..10a7fa9517 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 @@ function __cmdletization_BindCommonParameters } } - private const string StaticCommonParameterSetTemplate = "{1}"; //"{0}::{1}"; private const string StaticMethodParameterSetTemplate = "{0}"; //"{1}::{0}"; @@ -2196,7 +2194,6 @@ Microsoft.PowerShell.Core\Export-ModuleMember -Function '{1}' -Alias '*' _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 c5a9695e25..b438ec82c0 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 c9f404c87e..aa4290a08c 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 a0143cac91..ab4f378aa8 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 @@ namespace Microsoft.PowerShell.Cmdletization.Xml // 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 @@ namespace Microsoft.PowerShell.Cmdletization.Xml #endregion "Constructor" - #region "Field Definition" XmlReader _r; @@ -145,7 +144,6 @@ namespace Microsoft.PowerShell.Cmdletization.Xml #endregion "Field Definition" - #region "Property Definition" internal XmlReader Reader @@ -197,7 +195,6 @@ namespace Microsoft.PowerShell.Cmdletization.Xml #endregion "Property Definition" - #region "Method Definition" internal void InitPrimitiveIDs() @@ -534,7 +531,6 @@ namespace Microsoft.PowerShell.Cmdletization.Xml #endregion "Method Definition" - #endregion Copy_From_XmlSerializationReader public object Read50_PowerShellMetadata() @@ -6334,6 +6330,3 @@ namespace Microsoft.PowerShell.Cmdletization.Xml } } #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 b1236bc59a..d6f90a3c61 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 eb89c9f371..59efd97faf 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 9623adb1af..465d83a93e 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 2095b70724..87aeeb51c6 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 @@ namespace System.Management.Automation /// 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 c5f0a0e8fe..1cfe74881a 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 95dd97d768..a761e2fd00 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 d96a428451..29edbb2e5f 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 @@ namespace System.Management.Automation Type = new[] { new PSTypeName(typeName) }; } - /// /// Construct the attribute from an array of System.Type /// @@ -810,7 +808,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } } - /// /// Initializes a new instance of the ValidateLengthAttribute class /// @@ -1420,7 +1416,6 @@ namespace System.Management.Automation 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 0b8d677019..279bab545a 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 @@ namespace System.Management.Automation /// 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 95e1571927..0d3c432ef2 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 afe2e2c585..2683fb7f01 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.Text; using System.ComponentModel; using Microsoft.PowerShell; - namespace System.Management.Automation { /// @@ -50,7 +48,6 @@ namespace System.Management.Automation } } - /// /// Returns null if memberName is not a member in the adapter or /// the corresponding PSMemberInfo @@ -161,7 +158,6 @@ namespace System.Management.Automation return prop.GetValue(property.baseObject); } - /// /// Sets the value of a property coming from a previous call to DoGetProperty /// @@ -174,10 +170,6 @@ namespace System.Management.Automation prop.SetValue(property.baseObject, setValue); } - - - - /// /// Returns true if the property is settable /// @@ -189,7 +181,6 @@ namespace System.Management.Automation return prop.IsSettable; } - /// /// Returns true if the property is gettable /// @@ -201,7 +192,6 @@ namespace System.Management.Automation return prop.IsGettable; } - /// /// Returns the name of the type corresponding to the property /// @@ -214,7 +204,6 @@ namespace System.Management.Automation return forDisplay ? ToStringCodeMethods.Type(prop.Type) : prop.Type.FullName; } - /// /// get the property signature. /// @@ -226,10 +215,8 @@ namespace System.Management.Automation 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 9432d52e75..92d2d7d2d9 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 9aaafb00f3..d29fc8df7d 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 bc8919fe78..194328bfe4 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 @@ namespace System.Management.Automation _methods.Add(index); } - /// /// Returns the different method overloads signatures. /// @@ -65,7 +63,6 @@ namespace System.Management.Automation { 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 033afc0819..70d2b556bf 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 @@ namespace System.Management.Automation private int _getterIndex; private COM.ITypeInfo _typeInfo; - /// /// Initializes a new instance of ComProperty. /// @@ -112,7 +110,6 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation /// internal bool IsGettable { get; private set; } = false; - /// /// Get value of this property /// @@ -216,8 +212,6 @@ namespace System.Management.Automation return null; } - - /// /// Sets value of this property. /// @@ -298,7 +292,6 @@ namespace System.Management.Automation } } - /// /// 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 58462333a9..6f356e74f3 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 @@ namespace System.Management.Automation private COM.ITypeInfo _typeinfo = null; private Guid _guid = Guid.Empty; - /// /// Constructor /// @@ -52,7 +50,6 @@ namespace System.Management.Automation } } - /// /// Collection of properties in the COM object. /// @@ -139,7 +136,6 @@ namespace System.Management.Automation } } - /// /// Get the typeinfo interface for the given comobject. /// @@ -175,7 +171,6 @@ namespace System.Management.Automation return result; } - private void AddProperty(string strName, COM.FUNCDESC funcdesc, int index) { ComProperty prop; @@ -206,7 +201,6 @@ namespace System.Management.Automation } } - /// /// Get TypeAttr for the given type information. /// @@ -238,7 +232,6 @@ namespace System.Management.Automation return funcdesc; } - /// /// /// @@ -268,7 +261,6 @@ namespace System.Management.Automation 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 c493adccbd..070c92e73b 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 @@ namespace System.Management.Automation 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 fc7a007256..8cb4feb440 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 @@ namespace System.Management.Automation "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 @@ namespace System.Management.Automation return _sessionState.GetChildItemsDynamicParameters(path, recurse, context); } // GetChildItemsDynamicParameters - #endregion GetChildItems #region GetChildNames @@ -900,7 +897,6 @@ namespace System.Management.Automation 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 a72f220d9d..49aefe667a 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 @@ namespace System.Management.Automation "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 e0585b020d..832a4614ab 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 6fd6062c96..184e8fcd00 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 @@ namespace System.Management.Automation #endregion ctor - #region helper_methods /// @@ -276,24 +274,20 @@ namespace System.Management.Automation // second parameter changed from true to false ValidateParameterSets(true, false); - // Always get the dynamic parameters as there may be mandatory parameters there // Now try binding the dynamic parameters HandleCommandLineDynamicParameters(out currentBindingException); - // Try binding the default parameters again. After dynamic binding, new parameter metadata are // included, so it's possible a previously unsuccessful binding will succeed. ApplyDefaultParameterBinding("DYNAMIC BIND", true); - // If this generated an exception (but we didn't have one from the non-dynamic // parameters, report on this one. if (reportedBindingException == null) reportedBindingException = currentBindingException; - // If the cmdlet implements a ValueFromRemainingArguments parameter (VarArgs) // bind the unbound arguments to that parameter. HandleRemainingArguments(); @@ -301,7 +295,6 @@ namespace System.Management.Automation VerifyArgumentsProcessed(reportedBindingException); } - /// /// Process all valid parameter sets, and filter out those that don't take any pipeline input /// @@ -404,7 +397,6 @@ namespace System.Management.Automation return; } - /// /// Bind the default parameter value pairs /// @@ -519,7 +511,6 @@ namespace System.Management.Automation return result; } - /// /// Get all qualified default parameter value pairs based on the /// given currentParameterSetFlag. @@ -869,7 +860,6 @@ namespace System.Management.Automation } } - /// /// Verify if all arguments from the command line are bound. /// @@ -1446,7 +1436,6 @@ namespace System.Management.Automation return result; } - /// /// Binds the specified argument to the specified parameter using the appropriate /// parameter binder. @@ -1590,7 +1579,6 @@ namespace System.Management.Automation return result; } - /// /// Binds the remaining arguments to an unbound ValueFromRemainingArguments parameter (Varargs) /// @@ -1715,7 +1703,6 @@ namespace System.Management.Automation } } // 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 @@ namespace System.Management.Automation } } - if (!latchOnToDefault) { // If only the all set takes pipeline input then latch on to the @@ -2849,7 +2835,6 @@ namespace System.Management.Automation ParameterBinderStrings.AmbiguousParameterSet, "AmbiguousParameterSet"); - // Trace the parameter sets still active uint currentParameterSet = 1; @@ -3016,10 +3001,8 @@ namespace System.Management.Automation // Create a collection to store the prompt descriptions of unbound mandatory parameters - Collection fieldDescriptionList = CreatePromptDataStructures(missingMandatoryParameters); - Dictionary parameters = PromptForMissingMandatoryParameters( fieldDescriptionList, @@ -3272,7 +3255,6 @@ namespace System.Management.Automation return label.ToString(); } - /// /// Gets the parameter set name for the current parameter set. /// @@ -3830,7 +3812,6 @@ namespace System.Management.Automation // 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation return result; } - #endregion helper_methods - #region private_members /// @@ -4818,4 +4796,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/CodeMethods.cs b/src/System.Management.Automation/engine/CodeMethods.cs index 41207e6560..3585a6af23 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 1dc962894f..092f19791a 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 63862c32dd..eebd876905 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 8f02f894d5..35cfacd076 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 fe585885a7..cc2fc8bff0 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 f29a0ed591..1ed522a9ad 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 dcd0bddc55..4a5cbf7105 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 d3a05741b5..b437fdf7ea 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 5bc812c236..5a2368bf32 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 2c89c19df1..2ee835aff9 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 0c07aa382b..f55323c55e 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 3420159224..d5c4ea01ba 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 f406ac042f..e7cd946d59 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 bb4275a9b4..1968d04263 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 32ef9ffae1..632d2d0651 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 3f4b5f9b66..a0ae37725c 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 d46b69393e..3be7fdbd52 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 2d2e2ba6f0..c3aaf40bbb 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 @@ namespace System.Management.Automation.ComInterop } } - // // Call Invoke // diff --git a/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs index a4a5923711..8adc529cbb 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 e2c068c157..b29924a43f 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 56dee24f82..6e35772878 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 6a77be6c0e..9409574204 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 1a25ca4b10..4b405b85af 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 @@ namespace System.Management.Automation.ComInterop // 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 @@ namespace System.Management.Automation.ComInterop return type.CreateType().GetMethod("ConvertByrefToPtr"); } - #region Generated Convert ByRef Delegates // *** BEGIN GENERATED CODE *** @@ -821,7 +818,6 @@ namespace System.Management.Automation.ComInterop #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 dcb78c0244..7adb8026da 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 c9a9f256f8..75fc9ed3e9 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 36de3e94ef..78a57c4942 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 @@ namespace System.Management.Automation.ComInterop 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 1b8e08a933..12634f0199 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 c6c958aa03..e5e400fc62 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 6b55866bba..e2ae7ab65e 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 c211328d80..5e8ce696cb 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 13f2240719..ebb79e4b82 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 2d685a3dfe..08f6be519a 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 c58b3ddb0e..29cf290256 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 a37ea0effc..cfcd60d480 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 1613f8640d..39e18316b3 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 fcbce35eca..a12f6bd3bb 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 54fdc53a8e..43d6ea67bc 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 08b95e3da3..ebfdb4868a 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 b25996031c..784401399f 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 3b1024fc5d..abe1775e6e 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 048eb869a4..95a2285bf8 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 ba3af47c0e..353a89fe74 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 65812089b6..8f7b4c8507 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 74f5e38344..1069fccb60 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 @@ namespace System.Management.Automation.ComInterop 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 f41af694c0..6ad943edcc 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 f4a7e2aac0..fda43e814b 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 3f1539ed63..1050f0695f 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 26aa920051..a5b772373a 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 e47a08cb0e..89291cd5cf 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 @@ namespace System.Management.Automation.ComInterop { 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 91998b0508..e43956280d 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 412aa96c2c..cd9d2501c5 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 1312e875a5..72032d65b6 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 a8ccd09ee6..1a4a949b80 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 @@ namespace System.Management.Automation.ComInterop 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 b2ee61a17a..2b10d67725 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 @@ namespace System.Management.Automation.ComInterop ); } - 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 f95cace3ba..6bbe838fb4 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 @@ namespace System.Management.Automation.ComInterop typeNames += typeName; } - throw Error.AmbiguousConversion(argumentType.Name, typeNames); } @@ -488,7 +486,6 @@ namespace System.Management.Automation.ComInterop 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 b0ddecb82f..829b67f0d3 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 @@ namespace System.Management.Automation.ComInterop _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 caf9a0c5c6..980f239f23 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 @@ namespace System.Management.Automation.ComInterop ); } - 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 b2af22aa9b..a1c8bf0e04 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 f8177844c3..958c673954 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 @@ namespace System.Management.Automation.ComInterop 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 6732409b6e..d582278ed6 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 @@ namespace System.Management.Automation.Internal #endregion Override - /// /// throws if the pipeline is stopping /// @@ -258,7 +256,6 @@ namespace System.Management.Automation.Internal } } - 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 814f671f26..1c77c5b495 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 7dbee431f2..091523b8ae 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 @@ namespace System.Management.Automation return cursor.Offset < extent.StartOffset || cursor.Offset > extent.EndOffset; } - internal CompletionContext CreateCompletionContext(PowerShell powerShell) { var typeInferenceContext = new TypeInferenceContext(powerShell); @@ -167,7 +164,6 @@ namespace System.Management.Automation 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 39a9860df9..4a1363c91c 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 @@ namespace System.Management.Automation return null; } - private static bool InvokeScriptArgumentCompleter( ScriptBlock scriptBlock, string commandName, @@ -3194,7 +3191,6 @@ namespace System.Management.Automation var providerName = context.WordToComplete ?? string.Empty; var quote = HandleDoubleAndSingleQuote(ref providerName); - if (!providerName.EndsWith("*", StringComparison.Ordinal)) { providerName += "*"; @@ -3806,7 +3802,6 @@ namespace System.Management.Automation #endregion Native Command Argument Completion - /// /// Find the positional argument at the specific position from the parsed argument list /// @@ -5312,7 +5307,6 @@ namespace System.Management.Automation 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 2109c6b2d0..e282c8dca3 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 @@ namespace System.Management.Automation _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 337a2dde20..a50d3e3215 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.Diagnostics.CodeAnalysis; 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 5954739f62..7e44b051db 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 395078354a..0012e6c1c5 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 @@ namespace System.Management.Automation } } - #region comment out RequiresNetFrameworkVersion feature 8/10/2010 /* * The "#requires -NetFrameworkVersion" feature is CUT OFF. @@ -538,7 +536,6 @@ namespace System.Management.Automation */ #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 @@ namespace System.Management.Automation return matchingModules; } - private static CommandInfo InvokeCommandNotFoundHandler(string commandName, ExecutionContext context, string originalCommandName, CommandOrigin commandOrigin) { CommandInfo result = null; @@ -1341,7 +1337,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation private static string[] s_cachedPathExtCollection; private static string[] s_cachedPathExtCollectionWithPs1; - /// /// Gets the cmdlet information for the specified name. /// @@ -1865,4 +1859,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/CommandInfo.cs b/src/System.Management.Automation/engine/CommandInfo.cs index 5f3f60db55..d62bb016a8 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.Reflection; using System.Runtime.ExceptionServices; using Microsoft.PowerShell.Commands; - namespace System.Management.Automation { /// @@ -77,7 +75,6 @@ namespace System.Management.Automation /// Workflow = 0x0080, - /// /// A Configuration /// @@ -294,7 +291,6 @@ namespace System.Management.Automation /// public abstract string Definition { get; } - /// /// This is required for renaming aliases, functions, and filters /// @@ -658,7 +654,6 @@ namespace System.Management.Automation /// 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 d9ddfb3cf2..e9db54d318 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 @@ end 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 ecd23002ed..6b2fb317bf 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 b53a665fdb..a61560ded6 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 @@ namespace System.Management.Automation _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 9fec56133d..7302b72c52 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 System.Management.Automation.Internal; using Microsoft.PowerShell.Commands; using Dbg = System.Management.Automation.Diagnostics; - namespace System.Management.Automation { /// @@ -409,7 +407,6 @@ namespace System.Management.Automation /// private bool _bailInNextCall; - /// /// Populates the parameters specified from the pipeline. /// @@ -856,4 +853,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index f691b6d73e..a2219ace10 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 5c0dc3418d..d585dd004d 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 @@ namespace System.Management.Automation return currentMatch; } - /// /// Gets the CommandInfo representing the current command match. /// @@ -422,7 +420,6 @@ namespace System.Management.Automation } } // Current - object IEnumerator.Current { get @@ -630,7 +627,6 @@ namespace System.Management.Automation break; } - if ((_commandTypes & CommandTypes.Application) != 0) { // Anything else is treated like an application @@ -1356,7 +1352,6 @@ namespace System.Management.Automation 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 b1af362822..5de830fa3b 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 4a90b0849c..3f879d6d1a 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 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/ConfigurationInfo.cs b/src/System.Management.Automation/engine/ConfigurationInfo.cs index 4b02416c20..e8b98ec46f 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 e115e69ced..05b0c0fc5d 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 @@ namespace System.Management.Automation "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 bec80b891a..4fbb5f662d 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 @@ namespace System.Management.Automation } #endregion method - #region parameterized property internal string BaseParameterizedPropertyType(PSParameterizedProperty property) { @@ -692,9 +690,6 @@ namespace System.Management.Automation } } - - - internal string BaseParameterizedPropertyToString(PSParameterizedProperty property) { try @@ -878,7 +873,6 @@ namespace System.Management.Automation return 1; } - // Apply tie breaking rules, related to specificity of parameters betterCount = CompareTypeSpecificity(candidate1, candidate2); } @@ -2652,7 +2646,6 @@ namespace System.Management.Automation Expression.Convert(value, property.PropertyType)), parameter, value).Compile(); } - internal MemberInfo member; internal GetterDelegate getterDelegate @@ -4355,7 +4348,6 @@ namespace System.Management.Automation throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns true if the property is settable /// @@ -4367,7 +4359,6 @@ namespace System.Management.Automation throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns true if the property is gettable /// @@ -4379,7 +4370,6 @@ namespace System.Management.Automation throw PSTraceSource.NewNotSupportedException(); } - /// /// Returns the name of the type corresponding to the property's value /// @@ -4579,7 +4569,6 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } #endregion virtual - /// /// Auxiliary in GetProperty to perform case sensitive and case insensitive searches /// in the child nodes @@ -5090,7 +5077,6 @@ namespace System.Management.Automation 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 0e01281c72..be9d5fc5e1 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 @@ namespace System.Management.Automation private NetworkCredential _netCred; - /// /// Returns an equivalent NetworkCredential object for this /// PSCredential. @@ -272,7 +270,6 @@ namespace System.Management.Automation 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 ee64ec9211..ff042f7e89 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 5d05b87477..e672d56577 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 @@ namespace System.Management.Automation } } // 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 127e7798b6..c3e849cb48 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 @@ namespace System.Management.Automation /// private SessionState _sessionState; - /// /// Gets the name of the provider. /// @@ -338,7 +336,6 @@ namespace System.Management.Automation { } - /// /// Constructor for the ProviderInfo class. /// @@ -681,4 +678,3 @@ namespace System.Management.Automation } // 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 4e63b0f96b..bcbca6e2d9 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 ed40ef004a..d1963c6535 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 @@ namespace System.Management.Automation "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 4c0ec5e6ea..d271f8945c 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 79ca58f1db..2284766714 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 @@ namespace System.Management.Automation // 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 87e5106e3a..2d52c492e9 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 @@ namespace System.Management.Automation _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 1b4d2738cb..d8d97c59f2 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 0a5e5e9f28..d88f59e276 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 3f9d88fc87..d890c3ce49 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 44c275e688..b108a459c1 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 @@ namespace System.Management.Automation } // class ErrorDetails - /// /// Represents an error. /// @@ -1058,8 +1056,6 @@ namespace System.Management.Automation } #endregion Serialization - - #region Remoting /// diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index 590da2eb90..b279481ef4 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 @@ namespace System.Management.Automation [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 @@ namespace System.Management.Automation return SubscribeEvent(source, eventName, sourceIdentifier, data, handlerDelegate, supportEvent, forwardEvent, maxTriggerCount); } - /// /// Unsubscribes from an event on an object. /// @@ -537,7 +535,6 @@ namespace System.Management.Automation return SubscribeEvent(source, eventName, sourceIdentifier, data, handlerDelegate, supportEvent, forwardEvent, 0); } - /// /// Subscribes to an event on an object. /// @@ -578,7 +575,6 @@ namespace System.Management.Automation return subscriber; } - #region OnIdleProcessing private Timer _timer = null; @@ -843,7 +839,6 @@ namespace System.Management.Automation } } - /// /// Unsubscribes from an event on an object. /// @@ -856,7 +851,6 @@ namespace System.Management.Automation UnsubscribeEvent(subscriber, false); } - /// /// Unsubscribes from an event on an object. /// @@ -1338,7 +1332,6 @@ namespace System.Management.Automation } } - internal bool IsExecutingEventAction { get { return (_processingAction != null); } @@ -1982,7 +1975,6 @@ namespace System.Management.Automation internal static readonly HashSet EngineEvents = new HashSet(StringComparer.OrdinalIgnoreCase) { Exiting, OnIdle, OnScriptBlockInvoke }; } - /// /// Represents a subscriber to an event /// @@ -2107,7 +2099,6 @@ namespace System.Management.Automation /// public PSEventReceivedEventHandler HandlerDelegate { get; } = null; - /// /// Get the flag that marks this event as a supporting event /// @@ -2189,7 +2180,6 @@ namespace System.Management.Automation } } - /// /// 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 @@ namespace System.Management.Automation /// public delegate void PSEventReceivedEventHandler(Object sender, PSEventArgs e); - /// /// The event arguments associated with unsubscribing from an event /// @@ -2458,7 +2447,6 @@ namespace System.Management.Automation /// public delegate void PSEventUnsubscribedEventHandler(Object sender, PSEventUnsubscribedEventArgs e); - /// /// This class contains the collection of events received by the /// execution context. @@ -2651,7 +2639,6 @@ namespace System.Management.Automation } 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 e67e8fcb39..889044b9b4 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 @@ namespace System.Management.Automation #region Engine State - - /// /// The state for current engine that is running. /// @@ -572,7 +569,6 @@ namespace System.Management.Automation /// Reference to command discovery internal CommandProcessorBase CurrentCommandProcessor { get; set; } - /// /// Redirect to the CommandDiscovery in the engine. /// @@ -585,7 +581,6 @@ namespace System.Management.Automation } } - /// /// Interface that should be used for interaction with host /// @@ -605,7 +600,6 @@ namespace System.Management.Automation 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 e9271edffb..c5c226a79d 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 @@ namespace System.Management.Automation SetErrorId(errorId); } - #region Serialization /// /// Initializes a new instance of ExtendedTypeSystemException with serialization parameters @@ -71,7 +69,6 @@ namespace System.Management.Automation } // ExtendedTypeSystemException - /// /// Defines the exception thrown for Method related errors /// @@ -123,7 +120,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of MethodException with serialization parameters @@ -189,7 +185,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of MethodInvocationException with serialization parameters @@ -253,7 +248,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of GetValueException with serialization parameters @@ -270,7 +264,6 @@ namespace System.Management.Automation } // GetValueException - /// /// Defines the exception thrown for errors getting the value of properties /// @@ -319,7 +312,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of GetValueException with serialization parameters @@ -383,7 +375,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of GetValueInvocationException with serialization parameters @@ -445,7 +436,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of SetValueException with serialization parameters @@ -507,7 +497,6 @@ namespace System.Management.Automation { } - #region Serialization /// /// Initializes a new instance of SetValueInvocationException with serialization parameters @@ -618,4 +607,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/ExternalScriptInfo.cs b/src/System.Management.Automation/engine/ExternalScriptInfo.cs index 399ec441a4..6b21e8a758 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 6df54ba872..a53f73545f 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 7492b320ff..918cf9ac49 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 7786655552..2414c20090 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 369fc9deed..34a065c2ff 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 @@ namespace Microsoft.PowerShell.Commands } } - // Only for this case, the loop should exit // Get-Command Foo if (isPattern || All || TotalCount != -1 || _isCommandTypeSpecified || _isModuleSpecified || _isFullyQualifiedModuleSpecified) @@ -912,7 +910,6 @@ namespace Microsoft.PowerShell.Commands } } 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 783dfd098c..184ab8933e 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 ef6bdc2cff..cd792a2da5 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 @@ namespace System.Management.Automation 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 e6bee00af5..a5fd7b5984 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 @@ namespace System.Management.Automation /// 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 9cdd6656c2..51f25e23e6 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 @@ namespace System.Management.Automation.Runspaces 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 @@ namespace System.Management.Automation.Runspaces CommandType = CommandTypes.Cmdlet; } - /// /// /// @@ -514,7 +511,6 @@ namespace System.Management.Automation.Runspaces HelpFileName = helpFileName; } - /// /// Shallow-clone this object... /// @@ -975,7 +971,6 @@ namespace System.Management.Automation.Runspaces private Collection _attributes; } - /// /// /// @@ -1158,7 +1153,6 @@ namespace System.Management.Automation.Runspaces } } - /// /// 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 @@ namespace System.Management.Automation.Runspaces 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 @@ namespace System.Management.Automation.Runspaces 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 @@ if($paths) { { "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 @@ if($paths) { "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 40a1804f4a..63e4c063f7 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 @@ namespace Microsoft.PowerShell.Commands #endregion ScriptBlockSet - #region PropertyAndMethodSet /// @@ -154,7 +152,6 @@ namespace Microsoft.PowerShell.Commands #endregion PropertyAndMethodSet - /// /// Execute the begin scriptblock at the start of processing /// @@ -719,7 +716,6 @@ namespace Microsoft.PowerShell.Commands return errorRecord; } - /// /// Execute the end scriptblock when the pipeline is complete /// @@ -783,7 +779,6 @@ namespace Microsoft.PowerShell.Commands } } - private string _property; /// /// The property to retrieve value @@ -825,7 +820,6 @@ namespace Microsoft.PowerShell.Commands get { return _property; } } - private object _convertedValue; private object _value = true; private bool _valueNotSpecified = true; @@ -1640,8 +1634,6 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// Implements a cmdlet that sets the script debugging options. /// @@ -1836,6 +1828,5 @@ namespace Microsoft.PowerShell.Commands } #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 2852eb5886..d104584d65 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 3c14e8ee58..74fdd57cb5 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 @@ namespace System.Management.Automation "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 @@ namespace System.Management.Automation _sessionState.InvokeDefaultAction(new string[] { path }, false); } // InvokeDefaultAction - /// /// Invokes the default action of the item(s) at the specified path(s). /// @@ -827,7 +824,6 @@ namespace System.Management.Automation _sessionState.InvokeDefaultAction(path, literalPath); } // InvokeDefaultAction - /// /// Invokes the default action for the item at the specified path. /// @@ -1225,7 +1221,6 @@ namespace System.Management.Automation return _sessionState.NewItem(new string[] { path }, name, itemTypeName, content, false); } // NewItem - /// /// Creates a new item at the given path. /// @@ -1296,7 +1291,6 @@ namespace System.Management.Automation return _sessionState.NewItem(path, name, itemTypeName, content, force); } // NewItem - /// /// Creates a new item at the given path. /// @@ -1999,7 +1993,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 2be6567140..27aa00c00f 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation return LanguagePrimitives.ReturnNullEnumerable; } - private static readonly CallSite> s_getEnumeratorSite = CallSite>.Create(PSEnumerableBinder.Get()); @@ -809,7 +806,6 @@ namespace System.Management.Automation } } - string firstString = first as string; if (firstString != null) @@ -1231,7 +1227,6 @@ namespace System.Management.Automation return false; } - /// /// Verifies if type is one of the boolean types /// @@ -3212,7 +3207,6 @@ namespace System.Management.Automation valueToConvert.ToString(), resultType.ToString(), exception.Message); } - private static Delegate ConvertPSMethodInfoToDelegate(object valueToConvert, Type resultType, bool recurse, @@ -3884,7 +3878,6 @@ namespace System.Management.Automation } } - private class ConvertCheckingForCustomConverter { internal PSConverter tryfirstConverter; @@ -4190,7 +4183,6 @@ namespace System.Management.Automation 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 c7fa0334a7..15518567e3 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 @@ namespace System.Management.Automation return returnValue; } - /// /// Called after a non null return from GetMember to try to call /// the method with the arguments @@ -704,7 +702,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation protected abstract object InvokeManagementMethod(ManagementObject wmiObject, string methodName, ManagementBaseObject inParams); - /// /// Get a method object given method name /// @@ -903,7 +899,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation protected abstract PSProperty DoGetProperty(ManagementBaseObject wmiObject, string propertyName); - #endregion #region Private Data @@ -1110,7 +1104,6 @@ namespace System.Management.Automation // ignore the exception. } - return null; } diff --git a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs index abd35ea65e..be186a12a3 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation return result; } // GetParameterSetName - /// /// Helper function to retrieve the name of the parameter /// which defined an alias. @@ -479,7 +476,6 @@ namespace System.Management.Automation name = name.Substring(1); } - // First try to match the bindable parameters foreach (string parameterName in _bindableParameters.Keys) @@ -697,7 +693,6 @@ namespace System.Management.Automation } } - /// /// 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 318596290c..270b4678ac 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 06ae7ca0a9..9dda14d5f4 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 ab54f34d08..c6e2a6216d 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 5b3a7f8219..a1bce6c9a2 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 @@ namespace Microsoft.PowerShell.Commands #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 90d8308e2c..d9a418314b 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 6d703e9362..db474b4e1a 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 @@ namespace Microsoft.PowerShell.Commands //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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands } } - if (actualRootModuleIsXaml) { manifestInfo.SetModuleType(ModuleType.Workflow); @@ -3349,7 +3344,6 @@ namespace Microsoft.PowerShell.Commands } } - if (newManifestInfo.DeclaredVariableExports == null || newManifestInfo.DeclaredVariableExports.Count == 0) { @@ -4210,7 +4204,6 @@ namespace Microsoft.PowerShell.Commands powerShell.AddParameter("Version", requiredModule.Version); } - powerShell.Invoke(); if (powerShell.Streams.Error != null && powerShell.Streams.Error.Count > 0) { @@ -4963,7 +4956,6 @@ namespace Microsoft.PowerShell.Commands Collection filePaths; - if (context != null && context.EngineSessionState != null && context.EngineSessionState.IsProviderLoaded(context.ProviderNames.FileSystem)) { try @@ -5001,7 +4993,6 @@ namespace Microsoft.PowerShell.Commands Collection filePaths; - if (context != null && context.EngineSessionState != null && context.EngineSessionState.IsProviderLoaded(context.ProviderNames.FileSystem)) { try @@ -5157,7 +5148,6 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands } } - private static void AnalyzeSnapinDomainHelper() { String path = (string)AppDomain.CurrentDomain.GetData("PathToProcess"); @@ -7567,7 +7556,6 @@ namespace Microsoft.PowerShell.Commands } } - 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 1a71b3b619..8b75437174 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 0b7fb6f99f..7e854fa9df 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 @@ namespace Microsoft.PowerShell.Commands 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 c295f3af36..c320388851 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 68aff2813b..a01342d985 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 981c9b19af..3f73906a0d 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 77780ca7ef..8f1c3316ef 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 @@ namespace System.Management.Automation } } - private bool IsScriptModuleFile(string path) { var ext = System.IO.Path.GetExtension(path); @@ -821,7 +819,6 @@ namespace System.Management.Automation private readonly List _compiledExports = new List(); - /// /// Add AliasInfo to the fixed exports list... /// @@ -840,7 +837,6 @@ namespace System.Management.Automation /// internal List CompiledAliasExports { get; } = new List(); - /// /// FileList /// @@ -1504,7 +1500,6 @@ namespace System.Management.Automation s_appdomainModulePathCache.Clear(); } - #if DEBUG /// /// A method available in debug mode providing access to the module path cache. @@ -1614,7 +1609,6 @@ namespace System.Management.Automation 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 3086277556..e5f3fc842a 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 7f735e44ad..3dd8d3ac92 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 00eaba100d..0178f4220a 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 a884a447ea..39cf4b94e6 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 6a9085eb75..171198b829 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 43672e3116..efbdd4d7a7 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 @@ namespace System.Management.Automation return DoShouldContinue(query, caption, false, true, ref yesToAll, ref noToAll); } - private bool DoShouldContinue( string query, string caption, @@ -2320,7 +2317,6 @@ namespace System.Management.Automation private Thread _wasPermittedToWriteThread = null; } // AllowWrite - /// /// Stores the exception to be returned from /// PipelineProcessor.SynchronousExecute, @@ -2488,7 +2484,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation this.OutputPipe.Add(sendToPipeline); } - // NOTICE-2004/06/08-JonN 959638 // Use this variant to skip the ThrowIfWriteNotPermitted check /// @@ -2872,7 +2866,6 @@ namespace System.Management.Automation #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 @@ namespace System.Management.Automation } } - - private bool _isDebugPreferenceSet = false; private ActionPreference _debugPreference = InitialSessionState.defaultDebugPreference; private bool _isDebugPreferenceCached = false; @@ -2951,7 +2942,6 @@ namespace System.Management.Automation return ActionPreference.SilentlyContinue; } - if (!_isDebugPreferenceCached) { bool defaultUsed = false; @@ -3047,7 +3037,6 @@ namespace System.Management.Automation return ActionPreference.Continue; // Debug:$false and Verbose:$false ignored - if (!_isWarningPreferenceCached) { bool defaultUsed = false; @@ -3137,7 +3126,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation private bool _isInformationPreferenceCached = false; - internal PagingParameters PagingParameters { get; set; } #endregion Preference @@ -3715,4 +3702,4 @@ namespace System.Management.Automation } } } -} \ 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 126de7325a..223208a921 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 @@ namespace System.Management.Automation thisAsProperty.SetAdaptedValue(setValue, false); } - /// /// Initializes a new instance of an PSMemberInfo derived class /// @@ -620,7 +618,6 @@ namespace System.Management.Automation return returnValue.ToString(); } - /// /// Called from TypeTableUpdate before SetSetterFromTypeTable is called /// @@ -861,7 +858,6 @@ namespace System.Management.Automation } } - /// /// Gets and Sets the value of this member /// @@ -1241,7 +1237,6 @@ namespace System.Management.Automation return returnValue.ToString(); } - internal object noteValue; /// @@ -1408,7 +1403,6 @@ namespace System.Management.Automation return returnValue.ToString(); } - internal PSVariable _variable; /// @@ -2164,7 +2158,6 @@ namespace System.Management.Automation } } - /// /// Used from TypeTable /// @@ -2231,7 +2224,6 @@ namespace System.Management.Automation } } - /// /// Invokes CodeReference method and returns its results. /// @@ -2346,7 +2338,6 @@ namespace System.Management.Automation } } - /// /// Initializes a new instance of PSScriptMethod /// @@ -3042,7 +3033,6 @@ namespace System.Management.Automation } } - /// /// Used to access parameterized properties from the BaseObject /// @@ -3062,7 +3052,6 @@ namespace System.Management.Automation return this.adapter.BaseParameterizedPropertyToString(this); } - internal Adapter adapter; internal object adapterData; internal object baseObject; @@ -3150,7 +3139,6 @@ namespace System.Management.Automation this.adapter.BaseParameterizedPropertySet(this, valueToSet, arguments); } - /// /// Returns a collection of the definitions for this property /// @@ -3366,7 +3354,6 @@ namespace System.Management.Automation } } - /// /// Gets the internal member collection /// @@ -3898,7 +3885,6 @@ namespace System.Management.Automation return null; } - /// /// Returns all members in memberList matching name and memberTypes /// @@ -4040,7 +4026,6 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation #region IEnumerable - /// /// Gets the general enumerator for this collection /// @@ -4453,7 +4437,6 @@ namespace System.Management.Automation #region CollectionEntry - internal class CollectionEntry where T : PSMemberInfo { internal delegate PSMemberInfoInternalCollection GetMembersDelegate(PSObject obj); @@ -4585,7 +4568,6 @@ namespace System.Management.Automation internal Collection> Collections { get; } - private PSObject _mshOwner; private PSMemberSet _memberSetOwner; @@ -4668,7 +4650,6 @@ namespace System.Management.Automation ExtendedTypeSystem.CannotAddPropertyOrMethod); } - if (_memberSetOwner != null && _memberSetOwner.IsReservedMember) { throw new ExtendedTypeSystemException("CannotAddToReservedNameMemberset", @@ -4812,7 +4793,6 @@ namespace System.Management.Automation _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 @@ namespace System.Management.Automation } } - /// /// Returns the name corresponding to name or null if it is not present /// @@ -4934,7 +4913,6 @@ namespace System.Management.Automation } } - private PSMemberInfoInternalCollection GetIntegratedMembers(MshMemberMatchOptions matchOptions) { using (PSObject.memberResolution.TraceScope("Generating the total list of members")) @@ -5014,7 +4992,6 @@ namespace System.Management.Automation } } - /// /// Returns all members in the collection matching name /// @@ -5185,7 +5162,6 @@ namespace System.Management.Automation _current = null; } - /// /// Not supported /// diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index c4651c8a1e..1e3589a0b2 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 @@ namespace System.Management.Automation /// private object _immediateBaseObject; - private WeakReference _typeTable; /// @@ -735,7 +733,6 @@ namespace System.Management.Automation #endregion instance fields - #endregion fields #region properties @@ -809,7 +806,6 @@ namespace System.Management.Automation } private PSMemberInfoIntegratingCollection _methods; - /// /// Gets the object we are directly wrapping. /// @@ -1584,7 +1580,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation /// public const string BaseObjectMemberSetName = "psbase"; - /// /// The PSObject's properties /// @@ -1852,8 +1846,6 @@ namespace System.Management.Automation 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 6a7af45f14..7274d87655 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation { } - /// /// Retrieves a to provide information about the properties for an object of the type . /// @@ -751,4 +747,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/MshReference.cs b/src/System.Management.Automation/engine/MshReference.cs index c22377905a..00532b6222 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 6b48bfdc32..3a33abe583 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 336c2f5932..19f1f7cdb2 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 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/NativeCommand.cs b/src/System.Management.Automation/engine/NativeCommand.cs index 63bea73314..883bc6e1f9 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 a3df920e77..4b0b2d9afa 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 f8beed2b91..fca59bdfc4 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 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index c51e730495..8968fa74c0 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 @@ namespace System.Management.Automation } } - /// /// An output object from the child process. /// If it's from the error stream isError will be true @@ -767,7 +766,6 @@ namespace System.Management.Automation } } - #region Process cleanup with Child Process cleanup /// @@ -1223,7 +1221,6 @@ namespace System.Management.Automation } } - // 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 @@ namespace System.Management.Automation [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 @@ namespace System.Management.Automation _serializedRemoteInvocationInfo = serializedRemoteInvocationInfo; } - #region ISerializable Members /// diff --git a/src/System.Management.Automation/engine/NullString.cs b/src/System.Management.Automation/engine/NullString.cs index ef7ccc84b5..b6acafa581 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 dd6450f396..b6803819d1 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 @@ namespace Microsoft.PowerShell.Commands } 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 fbfd436bce..03bab13b3c 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 @@ namespace System.Management.Automation public string HelpFile { get; internal set; } = String.Empty; } - /// /// Contains a class field information /// @@ -88,4 +84,4 @@ namespace System.Management.Automation /// 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 90f28ee722..970dc68ccb 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 8861e676c4..73028fb128 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 55e30b350e..335cd678c0 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 @@ namespace System.Management.Automation } } - 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 94b15552f6..983683e0b6 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 @@ namespace System.Management.Automation _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 @@ namespace System.Management.Automation boType = argumentType; } - if (boType == typeof(bool)) { if (LanguagePrimitives.IsBooleanType(toType)) @@ -1199,7 +1196,6 @@ namespace System.Management.Automation 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 d4f78e0eb7..72f9fd0169 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 @@ namespace System.Management.Automation ParameterBinderStrings.ParameterAlreadyBound, "ParameterAlreadyBound"); - throw bindingException; } @@ -635,7 +633,6 @@ namespace System.Management.Automation throw bindingException; } - if (positionalParameterDictionary.Count > 0) { int unboundArgumentsIndex = 0; @@ -902,7 +899,6 @@ namespace System.Management.Automation return result; } - /// /// Generate elaborated binding exception so that the user will know the default binding might cause the failure /// @@ -941,7 +937,6 @@ namespace System.Management.Automation 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 e650537002..602f52d485 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 @@ namespace System.Management.Automation 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 f34c269f90..bcbbc31f6b 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 1df11b5e59..9c698082f3 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 @@ namespace System.Management.Automation 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 2dde7499cd..c699ced387 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 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation 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 c116ac3ea5..771e758aa8 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 340adb41ba..27ee2b4641 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 @@ namespace System.Management.Automation.Internal } } - /// /// 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 0d8261e24d..8ef2fb8cb7 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 3349a1fcdf..8f9c76794f 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 630407434b..de0d30e2c3 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 @@ namespace System.Management.Automation } } - - /// /// /// Gets and sets the Id of the activity for which this record is a subordinate. @@ -145,8 +142,6 @@ namespace System.Management.Automation } } - - /// /// /// Gets and sets the description of the activity for which progress is being reported. @@ -177,8 +172,6 @@ namespace System.Management.Automation } } - - /// /// /// 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 @@ namespace System.Management.Automation } } - - /// /// /// 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 @@ namespace System.Management.Automation } } - - /// /// /// 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 @@ namespace System.Management.Automation } } - - /// /// /// 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 @@ namespace System.Management.Automation } } - - /// /// /// Gets and sets the type of record represented by this instance. @@ -320,8 +305,6 @@ namespace System.Management.Automation } } - - /// /// /// Overrides @@ -497,7 +480,6 @@ namespace System.Management.Automation #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 @@ namespace System.Management.Automation #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 5efb304610..4bc16ed00c 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 @@ namespace System.Management.Automation "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 @@ namespace System.Management.Automation return _sessionState.SetProperty(new string[] { path }, propertyValue, false, false); } // SetProperty - /// /// Sets the specified properties on the specified item(s) /// @@ -436,7 +433,6 @@ namespace System.Management.Automation return _sessionState.SetProperty(path, propertyValue, force, literalPath); } // SetProperty - /// /// Sets the specified properties on the specified item(s) /// @@ -1615,7 +1611,6 @@ namespace System.Management.Automation false, false); } // CopyProperty - /// /// Copies a property on the specified item(s) /// @@ -1700,7 +1695,6 @@ namespace System.Management.Automation literalPath); } // CopyProperty - /// /// Copies a property on the specified item(s) /// @@ -1928,7 +1922,6 @@ namespace System.Management.Automation false); } // MoveProperty - /// /// Moves a property on the specified item(s) /// @@ -2017,7 +2010,6 @@ namespace System.Management.Automation 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 46e288cbb3..7be21c3b88 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 @@ namespace System.Management.Automation #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 59199cd9a6..2443827378 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 362dc23b00..8d36b4f9d6 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 344818f0ff..e089b74543 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 b7a40740e4..50b8ff4ef2 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 ab9f25b0f6..aef42ddae6 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 9b0991deaa..6d47c93b86 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 c90388e0e2..774944fd10 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 @@ namespace System.Management.Automation.Runspaces PSSnapIn = psSnapin; } - /// /// Gets name of configuration entry /// @@ -528,5 +526,4 @@ namespace System.Management.Automation.Runspaces } } - #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 b7e951450c..51b80461da 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 @@ namespace System.Management.Automation return this; } - /// /// Moves the enumerator to the next matching scoped item. /// @@ -132,7 +130,6 @@ namespace System.Management.Automation } } - public object Current { get @@ -141,14 +138,11 @@ namespace System.Management.Automation } } - - public void Reset() { InitializeScopeEnumerator(); } - public void Dispose() { _current = default(T); @@ -261,7 +255,6 @@ namespace System.Management.Automation #endregion private members } // class ScopedItemSearcher - /// /// The scope searcher for variables /// @@ -398,7 +391,6 @@ namespace System.Management.Automation private readonly CommandOrigin _origin; - /// /// Derived classes override this method to return their /// particular type of scoped item. @@ -434,7 +426,6 @@ namespace System.Management.Automation 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 6c4e3f4d1a..e74842906e 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 9f1151f419..e14f0616f7 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 95e756826f..9d5cac12ab 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 6a8fb2fe82..86f81b0d8a 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 @@ namespace System.Management.Automation "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 @@ namespace System.Management.Automation 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 4cea5e1692..d1760df8e8 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 @@ namespace System.Management.Automation 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 9cc1ecd970..ae0d0db7a3 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 51a631afe3..97dc1b51be 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 @@ namespace System.Management.Automation // that uses variables qualified by script: it works. GlobalScope.ScriptScope = GlobalScope; - if (parent != null) { GlobalScope.Parent = parent.GlobalScope; @@ -123,7 +121,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation GlobalScope.SetVariable(psDefaultParameterValuesVariable.Name, psDefaultParameterValuesVariable, false, false, this, fastPath: true); } - #endregion Constructor #region Private data @@ -235,7 +231,6 @@ namespace System.Management.Automation /// public List Applications { get; } = new List(new string[] { "*" }); - /// /// List of functions/filters to export from this session state object... /// @@ -535,7 +530,6 @@ namespace System.Management.Automation 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 57e79c33bf..b8dc2ef34f 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 @@ namespace System.Management.Automation /// internal List ExportedAliases { get; } = new List(); - /// /// Gets the value of the specified alias from the alias table. /// @@ -142,7 +139,6 @@ namespace System.Management.Automation return null; } - // Use the scope enumerator to find the alias using the // appropriate scoping rules @@ -620,7 +616,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } // SessionStateInternal class } - diff --git a/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs b/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs index 320a23a20e..41e16ee2b1 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } // SessionStateInternal class } - diff --git a/src/System.Management.Automation/engine/SessionStateContainer.cs b/src/System.Management.Automation/engine/SessionStateContainer.cs index 687f1be639..d84af11f99 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 @@ namespace System.Management.Automation out provider, out providerInstance); - foreach (string providerPath in providerPaths) { result = ItemExists(providerInstance, providerPath, context); @@ -207,7 +205,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -369,7 +366,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -562,7 +558,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -709,7 +704,6 @@ namespace System.Management.Automation out provider, out providerInstance); - foreach (string providerPath in providerPaths) { result = IsItemContainer(providerInstance, providerPath, context); @@ -1096,7 +1090,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1308,7 +1301,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1585,7 +1577,6 @@ namespace System.Management.Automation 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. @@ -1742,7 +1733,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -1965,7 +1955,6 @@ namespace System.Management.Automation context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -1994,7 +1983,6 @@ namespace System.Management.Automation 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. @@ -2345,7 +2333,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -2573,7 +2560,6 @@ namespace System.Management.Automation context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -2621,7 +2607,6 @@ namespace System.Management.Automation return; } - if ((!pathContainsGlobCharacters || recurse) && IsItemContainer(providerInstance, providerPath, context)) { // Since the path contained glob characters or we are recursing and the @@ -3000,7 +2985,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3188,7 +3172,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3429,7 +3412,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3597,7 +3579,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3893,7 +3874,6 @@ namespace System.Management.Automation } } // NewItem - /// /// Creates a new item at the specified path. /// @@ -3946,7 +3926,6 @@ namespace System.Management.Automation path != null, "Caller should validate path before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -3977,7 +3956,6 @@ namespace System.Management.Automation } } // NewItem - /// /// Gets the dynamic parameters for the new-item cmdlet. /// @@ -4124,7 +4102,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -4427,7 +4404,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -4937,7 +4913,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ContainerCmdletProvider containerCmdletProvider = GetContainerProviderInstance(providerInstance); @@ -5414,7 +5389,6 @@ namespace System.Management.Automation #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 fc62fce44f..ad808ea75b 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 @@ namespace System.Management.Automation #pragma warning restore 56500 - diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 1350d57700..6506db4e6b 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 @@ namespace System.Management.Automation /// private PSDriveInfo _currentDrive; - #region NewDrive /// @@ -223,7 +221,6 @@ namespace System.Management.Automation throw; } - if (ProvidersCurrentWorkingDrive[drive.Provider] == null) { // Set the new drive as the current @@ -413,7 +410,6 @@ namespace System.Management.Automation return null; } - DriveCmdletProvider provider = GetDriveProviderInstance(providerId); object result = null; @@ -772,7 +768,6 @@ namespace System.Management.Automation // 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 @@ namespace System.Management.Automation { } - scope.RemoveDrive(drive); } } @@ -963,7 +957,6 @@ namespace System.Management.Automation { 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation e); } - if (result != null) { // Make sure the provider didn't try to pull a fast one on us @@ -1440,7 +1431,6 @@ namespace System.Management.Automation driveNames.Add(drive.Name.Substring(0, 1)); } - foreach (SessionStateScope lookupScope in scopeEnumerator) { foreach (PSDriveInfo drive in lookupScope.Drives) @@ -1466,8 +1456,6 @@ namespace System.Management.Automation 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 4c15dfc2fe..a45aa8d2c4 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 @@ namespace System.Management.Automation return null; } // NewPropertyDynamicParameters - /// /// Gets the dynamic parameters for the new-itemproperty cmdlet. /// @@ -800,7 +798,6 @@ namespace System.Management.Automation return null; } // RemovePropertyDynamicParameters - /// /// Gets the dynamic parameters for the remove-itemproperty cmdlet. /// @@ -857,7 +854,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - object result = null; try { @@ -1669,7 +1665,6 @@ namespace System.Management.Automation } } // MoveProperty - /// /// Moves the property from one item to another /// @@ -1936,7 +1931,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - object result = null; try @@ -2153,7 +2147,6 @@ namespace System.Management.Automation } } // 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 1387543d28..b7c92b7587 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.Language; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace System.Management.Automation { /// @@ -546,7 +544,6 @@ namespace System.Management.Automation options |= ScopedItemOptions.Private; } - FunctionScopeItemSearcher searcher = new FunctionScopeItemSearcher( this, @@ -636,7 +633,6 @@ namespace System.Management.Automation 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 2869d702c4..a2f72764ed 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 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -363,7 +361,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -598,7 +595,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -762,7 +758,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -989,7 +984,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1144,7 +1138,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1358,7 +1351,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - ItemCmdletProvider itemCmdletProvider = GetItemProviderInstance(providerInstance); @@ -1513,7 +1505,6 @@ namespace System.Management.Automation 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 9c512b40b9..e304d2d219 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.Collections.ObjectModel; using System.Management.Automation.Provider; using Dbg = System.Management.Automation; - namespace System.Management.Automation { /// @@ -1068,5 +1066,3 @@ namespace System.Management.Automation } // SessionStateInternal class } - - diff --git a/src/System.Management.Automation/engine/SessionStateNavigation.cs b/src/System.Management.Automation/engine/SessionStateNavigation.cs index 42a934ffd5..bf27edbe16 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - NavigationCmdletProvider navigationCmdletProvider = GetNavigationProviderInstance(providerInstance, false); @@ -678,17 +675,14 @@ namespace System.Management.Automation // 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 @@ namespace System.Management.Automation } } // NormalizeRelativePath - /// /// Tests the specified character for equality with one of the powershell path separators and /// returns true if it matches. @@ -774,7 +767,6 @@ namespace System.Management.Automation // Get an instance of the provider - Provider.CmdletProvider providerInstance = GetProviderInstance(provider); NavigationCmdletProvider navigationCmdletProvider = providerInstance as NavigationCmdletProvider; @@ -1025,7 +1017,6 @@ namespace System.Management.Automation // Get an instance of the provider - Provider.CmdletProvider providerInstance = provider.CreateInstance(); return MakePath(providerInstance, parent, child, context); @@ -1345,7 +1336,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - CmdletProvider providerInstance = provider.CreateInstance(); return GetChildName(providerInstance, path, context, true); @@ -1738,7 +1728,6 @@ namespace System.Management.Automation context != null, "Caller should validate context before calling this method"); - NavigationCmdletProvider navigationCmdletProvider = GetNavigationProviderInstance(providerInstance, false); @@ -1905,7 +1894,6 @@ namespace System.Management.Automation 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 385385018b..a43153553b 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 @@ namespace System.Management.Automation 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 62012a4db0..4608c005ae 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 @@ namespace System.Management.Automation return provider; } - /// /// Determines the appropriate provider for the drive and then calls the NewDrive /// method of that provider. @@ -1232,7 +1230,6 @@ namespace System.Management.Automation 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 ad8d3d83d9..707f588b5e 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 @@ namespace System.Management.Automation _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 7e24039a16..e542da6480 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 @@ namespace System.Management.Automation } } - _variables[name] = variable; variable.SessionState = sessionState; return variable; @@ -935,7 +933,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation return result; } // SetAliasValue - /// /// Sets an alias to the given value. /// @@ -1021,7 +1017,6 @@ namespace System.Management.Automation 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 b6be9c5517..2c7850f179 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 b81e26ae48..dd04b54a23 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 2df21f9b15..eb9929fff3 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 @@ namespace System.Management.Automation #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 7310881666..1f4d6010e4 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 5f555c5ebe..a11c25421a 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 333e2dd132..ab419c2ac0 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 974bdb49d3..d2362689d6 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 @@ namespace System.Management.Automation _description = description; } - /// /// Constructs a variable with the given name, value, options, and attributes /// @@ -248,7 +246,6 @@ namespace System.Management.Automation } private string _description = String.Empty; - internal void DebuggerCheckVariableRead() { var context = SessionState != null @@ -420,7 +417,6 @@ namespace System.Management.Automation } private PSVariableAttributeCollection _attributes; - /// /// Checks if the given value meets the validation attribute constraints on the PSVariable. /// @@ -734,7 +730,6 @@ namespace System.Management.Automation 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 fb9fbd9a52..f1a2c32315 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 7332608793..c3b64c3c66 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 73f6701821..c337ccf8d1 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 3abeb718c5..798d3a7696 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 @@ namespace System.Management.Automation.Internal } } - diff --git a/src/System.Management.Automation/engine/TypeMetadata.cs b/src/System.Management.Automation/engine/TypeMetadata.cs index ad6df66cad..352ea45aac 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 @@ namespace System.Management.Automation } } // 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 3b9f958bf9..4025850d6b 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 @@ namespace System.Management.Automation.Runspaces SetDefaultErrorRecord(); } - - /// /// This constructor takes a localized message and an inner exception. /// @@ -1988,7 +1985,6 @@ namespace System.Management.Automation.Runspaces } } - // They are of NoteProperty private string _serializationMethod; private Type _targetTypeForDeserialization; @@ -2531,7 +2527,6 @@ namespace System.Management.Automation.Runspaces #endregion TypeData - /// /// A class that keeps the information from types.ps1xml files in a cache table /// @@ -2748,7 +2743,6 @@ namespace System.Management.Automation.Runspaces 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 @@ namespace System.Management.Automation.Runspaces } } - private void ProcessTypeDataToAdd(ConcurrentBag errors, TypeData typeData) { string typeName = typeData.TypeName; @@ -3559,7 +3552,6 @@ namespace System.Management.Automation.Runspaces 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 36aecab308..e12ad850a5 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 0103c2df6e..2599cf5958 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 657d0b4fed..240f908de9 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 3659d0c4cd..5b108a9797 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 @@ namespace System.Management.Automation return false; } - #region Versioning related methods /// @@ -1041,7 +1039,6 @@ namespace System.Management.Automation } } - internal static bool IsReservedDeviceName(string destinationPath) { #if !UNIX @@ -1198,7 +1195,6 @@ namespace System.Management.Automation return assemblyName; } - /// /// If a mutex is abandoned, in our case, it is ok to proceed /// @@ -1302,7 +1298,6 @@ namespace System.Management.Automation 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 86dfa5396d..e8bbeb56ac 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 a3fbe14cd3..2c5e11fa3a 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 d5675a8de3..151339f2fd 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 c218472b6a..8177dcb2ff 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 3966c2c06f..2912272148 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 ba66798d5e..df54de53df 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.Resources; using System.Management.Automation.Internal; using Dbg = System.Management.Automation.Diagnostics; - - namespace System.Management.Automation { /// @@ -58,7 +55,6 @@ namespace System.Management.Automation } ); - /// /// Lists the common parameters that are added by the PowerShell engine when a cmdlet defines /// additional capabilities (SupportsShouldProcess, SupportsTransactions) @@ -78,7 +74,6 @@ namespace System.Management.Automation } ); - /// /// Is this command stopping? /// @@ -1172,7 +1167,6 @@ namespace System.Management.Automation } } - #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 5c3da3d7d6..734e005717 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 @@ namespace System.Management.Automation 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 9d787e214e..034612b939 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 3b33c4458d..d3804aab09 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 @@ namespace System.Management.Automation.Runspaces } } - /// /// 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 72b9e86086..f0499133c3 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 @@ namespace System.Management.Automation.Host } } - - /// /// /// Gets and sets the help message for this field. @@ -174,5 +168,3 @@ namespace System.Management.Automation.Host } } - - diff --git a/src/System.Management.Automation/engine/hostifaces/Command.cs b/src/System.Management.Automation/engine/hostifaces/Command.cs index c08209fbb3..e4b3566b2d 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 @@ namespace System.Management.Automation.Runspaces #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 @@ namespace System.Management.Automation.Runspaces commandAsPSObject.Properties.Add(new PSNoteProperty(RemoteDataNameStrings.MergeUnclaimedPreviousCommandResults, this.MergeUnclaimedPreviousCommandResults)); - if (psRPVersion != null && psRPVersion >= RemotingConstants.ProtocolVersionWin10RTM) { @@ -713,7 +710,6 @@ namespace System.Management.Automation.Runspaces 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 c948a2f205..a622c84fa9 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 @@ namespace System.Management.Automation.Runspaces _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 094d0189d0..3081041fd9 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 @@ namespace System.Management.Automation.Runspaces #endif } - /// /// Derived class's open implementation /// protected abstract void OpenHelper(bool syncCall); - #endregion open #region close @@ -417,7 +414,6 @@ namespace System.Management.Automation.Runspaces CloseHelper(syncCall); } - /// /// Derived class's close implementation /// @@ -741,7 +737,6 @@ namespace System.Management.Automation.Runspaces this.SetRunspaceState(state, null); } - /// /// Raises events for changes in runspace state. /// @@ -953,7 +948,6 @@ namespace System.Management.Automation.Runspaces } } - /// /// Stops all the running pipelines /// @@ -1510,7 +1504,6 @@ namespace System.Management.Automation.Runspaces } } - /// /// 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 6a95c8865a..fcf3aac5fb 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 @@ namespace System.Management.Automation.Runspaces 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 3c8634e1d0..96b9898bca 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 @@ namespace Microsoft.PowerShell #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 8d02deab24..a5cf51f29e 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 Dbg = System.Management.Automation.Diagnostics; //using System.Management.Automation; //using System.Reflection; - - namespace System.Management.Automation.Host { /// @@ -71,7 +67,6 @@ namespace System.Management.Automation.Host } } - /// /// /// Sets the ParameterTypeName, ParameterTypeFullName, and ParameterAssemblyFullName as a single operation. @@ -102,8 +97,6 @@ namespace System.Management.Automation.Host SetParameterAssemblyFullName(parameterType.AssemblyQualifiedName); } - - /// /// /// Gets the short name of the parameter's type. @@ -140,8 +133,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// Gets the full string name of the parameter's type. @@ -173,7 +164,6 @@ namespace System.Management.Automation.Host } } - /// /// /// Gets the full name of the assembly containing the type identified by ParameterTypeFullName or ParameterTypeName @@ -206,8 +196,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// A short, human-presentable message to describe and identify the field. If supplied, a typical implementation of @@ -256,8 +244,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// Gets and sets the help message for this field. @@ -296,7 +282,6 @@ namespace System.Management.Automation.Host } } - /// /// /// Gets and sets whether a value must be supplied for this field @@ -387,8 +372,6 @@ namespace System.Management.Automation.Host parameterTypeName = nameOfType; } - - /// /// /// For use by remoting serialization. @@ -413,8 +396,6 @@ namespace System.Management.Automation.Host parameterTypeFullName = fullNameOfType; } - - /// /// /// For use by remoting serialization. @@ -501,5 +482,3 @@ namespace System.Management.Automation.Host } } - - diff --git a/src/System.Management.Automation/engine/hostifaces/History.cs b/src/System.Management.Automation/engine/hostifaces/History.cs index 7fa640a1f0..785c34a89e 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.Internal; using System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; - namespace Microsoft.PowerShell.Commands { /// @@ -137,13 +135,10 @@ namespace Microsoft.PowerShell.Commands } } - #endregion public #region internal - - /// /// Cleared status of an entry /// @@ -160,8 +155,6 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// Sets Id /// @@ -232,8 +225,6 @@ namespace Microsoft.PowerShell.Commands /// private DateTime _endTime; - - /// /// Flag indicating an entry is present/cleared /// @@ -256,7 +247,6 @@ namespace Microsoft.PowerShell.Commands #endregion } - /// /// This class implements history and provides APIs for adding and fetching /// entries from history @@ -377,8 +367,6 @@ namespace Microsoft.PowerShell.Commands } } - - /// /// Get count HistoryEntries /// @@ -400,7 +388,6 @@ namespace Microsoft.PowerShell.Commands throw PSTraceSource.NewArgumentNullException("newest"); } - if (count == -1 || count > _countEntriesAdded || count > _countEntriesInBuffer) count = _countEntriesInBuffer; @@ -558,7 +545,6 @@ namespace Microsoft.PowerShell.Commands }// 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 @@ namespace Microsoft.PowerShell.Commands } } - - - /// /// Clears the history entry from buffer for a given id. /// @@ -683,7 +666,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// gets the total number of entries added /// @@ -694,7 +676,6 @@ namespace Microsoft.PowerShell.Commands return _capacity; } - #endregion internal #region private @@ -856,7 +837,6 @@ namespace Microsoft.PowerShell.Commands _countEntriesInBuffer++; } - /// /// Get the current history size /// @@ -906,7 +886,6 @@ namespace Microsoft.PowerShell.Commands /// private long _countEntriesAdded; - /// /// Private object for synchronization /// @@ -923,7 +902,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// This class Implements the get-history command /// @@ -982,7 +960,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// Implements the Processing() method for show/History command /// @@ -1112,7 +1089,6 @@ namespace Microsoft.PowerShell.Commands #endregion - /// /// Implements the BeginProcessing() method for eval/History command /// @@ -1195,7 +1171,6 @@ namespace Microsoft.PowerShell.Commands //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 @@ namespace Microsoft.PowerShell.Commands return entry; } - /// /// Id of history entry to execute. /// @@ -1412,7 +1386,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// This class Implements the add-history command /// @@ -1460,7 +1433,6 @@ namespace Microsoft.PowerShell.Commands lpl.AddHistoryEntryFromAddHistoryCmdlet(); } - /// /// override for ProcessRecord /// @@ -1667,7 +1639,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// This Class implements the Clear History cmdlet /// @@ -1728,7 +1699,6 @@ namespace Microsoft.PowerShell.Commands private string[] _commandline = null; - /// /// Clears the specified number of history entries /// @@ -1924,7 +1894,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// Clears the session history based on the Commandline parameter /// takes no parameters @@ -1989,7 +1958,6 @@ namespace Microsoft.PowerShell.Commands } } - /// /// Clears the session history based on the input parameter /// id of the entry to be cleared @@ -2057,7 +2025,6 @@ namespace Microsoft.PowerShell.Commands return; }//end function - /// /// history obj /// @@ -2072,4 +2039,3 @@ namespace Microsoft.PowerShell.Commands } } - diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index e5f8688bae..5fe16acd36 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 @@ namespace System.Management.Automation return returnValue; } - /// /// Gets an array of commands that can be run sequentially to set $profile and run the profile commands. /// @@ -459,7 +461,6 @@ namespace System.Management.Automation } } - return returnSuggestions; } @@ -641,7 +642,6 @@ namespace System.Management.Automation 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 9ed6e675e5..f779dce3dd 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 26253e07d3..8bcbfc2f3c 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 @@ namespace System.Management.Automation.Internal.Host 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 652693cbb7..b7db534362 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 @@ namespace System.Management.Automation.Internal.Host _parentHost = parentHost; } - - internal void ThrowNotInteractive() @@ -41,8 +35,6 @@ namespace System.Management.Automation.Internal.Host throw e; } - - /// /// /// See base class @@ -79,8 +71,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -118,8 +108,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -157,8 +145,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -196,8 +182,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -235,8 +219,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -274,8 +256,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -313,8 +293,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -343,8 +321,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -373,8 +349,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -416,8 +390,6 @@ namespace System.Management.Automation.Internal.Host return result; } - - /// /// /// See base class @@ -440,8 +412,6 @@ namespace System.Management.Automation.Internal.Host _externalRawUI.FlushInputBuffer(); } - - /// /// /// See base class @@ -470,8 +440,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -509,8 +477,6 @@ namespace System.Management.Automation.Internal.Host } } - - /// /// /// See base class @@ -534,8 +500,6 @@ namespace System.Management.Automation.Internal.Host _externalRawUI.SetBufferContents(origin, contents); } - - /// /// /// See base class @@ -564,8 +528,6 @@ namespace System.Management.Automation.Internal.Host _externalRawUI.SetBufferContents(r, fill); } - - /// /// /// See base class @@ -590,8 +552,6 @@ namespace System.Management.Automation.Internal.Host return _externalRawUI.GetBufferContents(r); } - - /// /// /// See base class @@ -668,7 +628,6 @@ namespace System.Management.Automation.Internal.Host 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 9be358ee6c..cf69c0077a 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 @@ namespace System.Management.Automation.Internal.Host return result; } - - /// /// /// See base class @@ -171,8 +166,6 @@ namespace System.Management.Automation.Internal.Host return result; } - - /// /// /// See base class @@ -204,8 +197,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.Write(value); } - - /// /// /// See base class @@ -241,8 +232,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.Write(foregroundColor, backgroundColor, value); } - - /// /// /// See base class @@ -269,8 +258,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.WriteLine(); } - - /// /// /// See base class @@ -302,8 +289,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.WriteLine(value); } - - public override void WriteErrorLine(string value) @@ -321,8 +306,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.WriteErrorLine(value); } - - /// /// /// See base class @@ -358,8 +341,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.WriteLine(foregroundColor, backgroundColor, value); } - - /// /// /// See base class @@ -406,7 +387,6 @@ namespace System.Management.Automation.Internal.Host } } - /// /// Helper function for WriteDebugLine /// @@ -514,8 +494,6 @@ namespace System.Management.Automation.Internal.Host WriteDebugRecord(new DebugRecord(message)); } - - /// /// /// Ask the user whether to continue/stop or break to a nested prompt. @@ -596,8 +574,6 @@ namespace System.Management.Automation.Internal.Host return shouldContinue; } - - /// /// /// See base class @@ -633,8 +609,6 @@ namespace System.Management.Automation.Internal.Host _externalUI.WriteProgress(sourceId, record); } - - /// /// /// See base class @@ -857,9 +831,6 @@ namespace System.Management.Automation.Internal.Host 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 237fa4ec0c..399334e1b2 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 e9c66ea910..5473785165 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 @@ namespace System.Management.Automation.Runspaces } private TranscriptionData _transcriptionData = null; - private JobRepository _jobRepository; /// /// List of jobs in this runspace @@ -1190,7 +1188,6 @@ namespace System.Management.Automation.Runspaces } } - #endregion SessionStateProxy #region IDisposable Members @@ -1569,7 +1566,6 @@ namespace System.Management.Automation.Runspaces { } - /// /// Populates a with the /// data needed to serialize the RunspaceOpenModuleLoadException object. @@ -1592,6 +1588,3 @@ namespace System.Management.Automation.Runspaces #endregion Helper Class } - - - diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index 2cac96bb84..5ed6faaff3 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 @@ namespace System.Management.Automation.Runspaces InitStreams(); } - /// /// Copy constructor to support cloning /// @@ -1063,7 +1061,6 @@ namespace System.Management.Automation.Runspaces } } - private long _historyIdForThisPipeline = -1; /// /// This method is called Add-History cmdlet to add history entry. @@ -1117,9 +1114,6 @@ namespace System.Management.Automation.Runspaces #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 1ad99b0313..486e0822a2 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 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets the version of the hosting application. This value should remain invariant for a particular build of the @@ -109,8 +106,6 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets the hosting application's implementation of the @@ -150,8 +143,6 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets the host's culture: the culture that the runspace should use to set the CurrentCulture on new threads @@ -174,8 +165,6 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets the host's UI culture: the culture that the runspace and cmdlets should use to do resource loading. @@ -194,8 +183,6 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host } } - - /// /// /// 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 @@ namespace System.Management.Automation.Host 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 843cfb7ae5..09d1491d2f 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 @@ namespace System.Management.Automation.Host set { y = value; } } - /// /// /// Initializes a new instance of the Coordinates class and defines the X and Y values. @@ -77,8 +72,6 @@ namespace System.Management.Automation.Host this.y = y; } - - /// /// /// Overrides @@ -97,8 +90,6 @@ namespace System.Management.Automation.Host return String.Format(CultureInfo.InvariantCulture, "{0},{1}", X, Y); } - - /// /// /// Overrides @@ -130,8 +121,6 @@ namespace System.Management.Automation.Host return result; } - - /// /// /// Overrides @@ -196,8 +185,6 @@ namespace System.Management.Automation.Host return result; } - - /// /// /// Compares two instances for equality @@ -228,8 +215,6 @@ namespace System.Management.Automation.Host return result; } - - /// /// /// Compares two instances for inequality @@ -259,8 +244,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// Represents a width and height pair @@ -299,7 +282,6 @@ namespace System.Management.Automation.Host set { height = value; } } - /// /// /// Initialize a new instance of the Size class and defines the Width and Height values. @@ -322,8 +304,6 @@ namespace System.Management.Automation.Host this.height = height; } - - /// /// /// Overloads @@ -499,8 +479,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// Governs the behavior of @@ -546,8 +524,6 @@ namespace System.Management.Automation.Host IncludeKeyUp = 0x0008 } - - /// /// /// Defines the states of Control Key @@ -613,8 +589,6 @@ namespace System.Management.Automation.Host EnhancedKey = 0x0100 } - - /// /// /// Represents information of a keystroke @@ -864,9 +838,6 @@ namespace System.Management.Automation.Host } } - - - /// /// /// Represents a rectangular region of the screen. @@ -988,7 +959,6 @@ namespace System.Management.Automation.Host this.bottom = bottom; } - /// /// /// Initializes a new instance of the Rectangle class and defines the Left, Top, Right, and Bottom values @@ -1017,8 +987,6 @@ namespace System.Management.Automation.Host { } - - /// /// /// Overloads @@ -1199,8 +1167,6 @@ namespace System.Management.Automation.Host } } - - /// /// /// Represents a character, a foregroundColor color, and background color @@ -1306,7 +1272,6 @@ namespace System.Management.Automation.Host this.bufferCellType = bufferCellType; } - /// /// /// Overloads @@ -1325,7 +1290,6 @@ namespace System.Management.Automation.Host return string.Format(CultureInfo.InvariantCulture, "'{0}' {1} {2} {3}", Character, ForegroundColor, BackgroundColor, BufferCellType); } - /// /// /// Overrides @@ -1488,9 +1452,6 @@ namespace System.Management.Automation.Host #endregion Ancillary types - - - /// /// /// Defines the lowest-level user interface functions that an interactive application hosting an MSH @@ -1524,8 +1485,6 @@ namespace System.Management.Automation.Host // 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host set; } - - /// /// /// Gets or sets the cursor size as a percentage 0..100. @@ -1633,8 +1584,6 @@ namespace System.Management.Automation.Host set; } - - /// /// /// Gets or sets the current size of the screen buffer, measured in character cells. @@ -1654,8 +1603,6 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host set; } - - /// /// /// Gets the size of the largest window possible for the current buffer, current font, and current display hardware. @@ -1708,8 +1653,6 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets the largest window possible for the current font and display hardware, ignoring the current buffer dimensions. In @@ -1736,8 +1679,6 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Reads a key stroke from the keyboard device, blocking until a keystroke is typed. @@ -1766,8 +1707,6 @@ namespace System.Management.Automation.Host return ReadKey(ReadKeyOptions.IncludeKeyDown); } - - /// /// /// Reads a key stroke from the keyboard device, blocking until a keystroke is typed. @@ -1806,8 +1745,6 @@ namespace System.Management.Automation.Host KeyInfo ReadKey(ReadKeyOptions options); - - /// /// /// Resets the keyboard input buffer. @@ -1821,8 +1758,6 @@ namespace System.Management.Automation.Host void FlushInputBuffer(); - - /// /// /// A non-blocking call to examine if a keystroke is waiting in the input buffer. @@ -1844,8 +1779,6 @@ namespace System.Management.Automation.Host get; } - - /// /// /// Gets or sets the titlebar text of the current view window. @@ -1860,8 +1793,6 @@ namespace System.Management.Automation.Host set; } - - /// /// /// Copies the array into the screen buffer at the @@ -1892,8 +1823,6 @@ namespace System.Management.Automation.Host 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 @@ namespace System.Management.Automation.Host void SetBufferContents(Rectangle rectangle, BufferCell fill); - - /// /// /// Extracts a rectangular region of the screen buffer. @@ -1996,8 +1923,6 @@ namespace System.Management.Automation.Host 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 bac5cdd012..9a23b9896e 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 @@ namespace System.Management.Automation.Host internal string PromptText { get; set; } } - // Holds options for PowerShell transcription internal class TranscriptionOption : IDisposable { @@ -1293,4 +1291,3 @@ namespace System.Management.Automation.Host } } // namespace System.Management.Automation.Host - diff --git a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs index fc5650b339..fff7ab43d6 100644 --- a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs +++ b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs @@ -1,5 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. /********************************************************************++ -Copyright (c) Microsoft Corporation. All rights reserved. Description: @@ -70,7 +71,6 @@ namespace Microsoft.PowerShell return ImmediateParent; } - // Check whether we have any fallback specified // MUI_MERGE_SYSTEM_FALLBACK | MUI_MERGE_USER_FALLBACK // returns fallback cultures (specified by the user) @@ -363,7 +363,6 @@ namespace Microsoft.PowerShell int bufferSize = 0; string returnval = ""; - if (filterOutNonConsoleCultures) { // Filter out languages that do not support console. @@ -487,4 +486,4 @@ namespace Microsoft.PowerShell #endregion } -} \ No newline at end of file +} diff --git a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs index 3b0266586c..b259dc23c5 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs @@ -1,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 Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs index f2b4fe0ca4..4fa7952163 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs @@ -1,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/Parameter.cs b/src/System.Management.Automation/engine/hostifaces/Parameter.cs index b87e14f8bc..d71b0f8394 100644 --- a/src/System.Management.Automation/engine/hostifaces/Parameter.cs +++ b/src/System.Management.Automation/engine/hostifaces/Parameter.cs @@ -1,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 Microsoft.Management.Infrastructure; @@ -63,7 +62,6 @@ namespace System.Management.Automation.Runspaces Value = value; } - #endregion Public constructors #region Public properties @@ -308,4 +306,3 @@ namespace System.Management.Automation.Runspaces } } - diff --git a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs b/src/System.Management.Automation/engine/hostifaces/Pipeline.cs index fd7e2e4cd4..2c9e9905b8 100644 --- a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/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.ObjectModel; @@ -206,7 +205,6 @@ namespace System.Management.Automation.Runspaces Reason = pipelineStateInfo.Reason; } - #endregion constructors #region public_properties @@ -461,7 +459,6 @@ namespace System.Management.Automation.Runspaces #region methods - /// /// Invoke the pipeline, synchronously, returning the results as an array of /// objects. @@ -745,4 +742,3 @@ namespace System.Management.Automation.Runspaces } } - diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index f6c5bb988e..51cc2b38d3 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation Invoke(input, output, null); } - /// /// Invoke the synchronously and collect /// output data into the buffer @@ -3097,7 +3094,6 @@ namespace System.Management.Automation return _batchAsyncResult; } - /// /// Batch invocation callback /// @@ -4260,7 +4256,6 @@ namespace System.Management.Automation 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 a13c97a8a2..2d2846b03d 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.Management.Automation.Remoting; 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 17001670df..d8b717ff84 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 3ee11cfd8a..5469e83f26 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 @@ namespace System.Management.Automation } } - - - diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs index 33966d9057..c527414050 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 @@ namespace System.Management.Automation.Runspaces _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 4b1096c40d..f7ac95f810 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 17d17cb90f..41626e9cc3 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 90a6b90c17..89a9c57dea 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 @@ namespace System.Management.Automation.Runspaces #region concurrent pipeline check - private bool _performNestedCheck = true; /// @@ -1019,7 +1017,6 @@ namespace System.Management.Automation.Runspaces } } - /// /// 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 9bf1630c92..cb4a29eba6 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 @@ namespace System.Management.Automation.Interpreter } /// - /// 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 @@ namespace System.Management.Automation.Interpreter // 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 @@ namespace System.Management.Automation.Interpreter if (_hasFinally) { - // Push finally. + // Push finally. frame.PushContinuation(_labelIndex); } int prevInstrIndex = frame.InstructionIndex; @@ -535,10 +535,10 @@ namespace System.Management.Automation.Interpreter _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 @@ namespace System.Management.Automation.Interpreter 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 @@ namespace System.Management.Automation.Interpreter 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 @@ namespace System.Management.Automation.Interpreter } } - internal sealed class ThrowInstruction : Instruction { internal static readonly ThrowInstruction Throw = new ThrowInstruction(true, false); @@ -735,7 +734,7 @@ namespace System.Management.Automation.Interpreter // // 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 3a4039bcc9..292e5e5c81 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 0459902698..daa941971b 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 32c317038d..ca17ef48da 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 @@ namespace System.Management.Automation.Interpreter { } } - // *** 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 e986a441cd..e1acba3ec4 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 98e8545277..35c26526fc 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 cddf8dab6d..afd472aace 100644 --- a/src/System.Management.Automation/engine/interpreter/InstructionList.cs +++ b/src/System.Management.Automation/engine/interpreter/InstructionList.cs @@ -1056,7 +1056,6 @@ namespace System.Management.Automation.Interpreter Emit(DynamicInstruction.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 970a757a20..2bcf53ece8 100644 --- a/src/System.Management.Automation/engine/interpreter/LabelInfo.cs +++ b/src/System.Management.Automation/engine/interpreter/LabelInfo.cs @@ -326,7 +326,6 @@ namespace System.Management.Automation.Interpreter } } - 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 09236a3ec5..2dac5e8ee6 100644 --- a/src/System.Management.Automation/engine/interpreter/LightCompiler.cs +++ b/src/System.Management.Automation/engine/interpreter/LightCompiler.cs @@ -366,7 +366,6 @@ namespace System.Management.Automation.Interpreter return new Interpreter(lambdaName, _locals, GetBranchMapping(), _instructions.ToArray(), debugInfos, _compilationThreshold); } - private void CompileConstantExpression(Expression expr) { var node = (ConstantExpression)expr; @@ -1352,7 +1351,6 @@ namespace System.Management.Automation.Interpreter return false; } - // TODO: remove (replace by true fault support) private void CompileAsVoidRemoveRethrow(Expression expr) { @@ -1645,7 +1643,6 @@ namespace System.Management.Automation.Interpreter return; } - throw new System.NotImplementedException(); } @@ -1702,7 +1699,6 @@ namespace System.Management.Automation.Interpreter } } - private void CompileDebugInfoExpression(Expression expr) { var node = (DebugInfoExpression)expr; @@ -1732,7 +1728,6 @@ namespace System.Management.Automation.Interpreter _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 d2169e3ff8..fae037ab9f 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 f883509412..ec907b326d 100644 --- a/src/System.Management.Automation/engine/interpreter/LightLambda.cs +++ b/src/System.Management.Automation/engine/interpreter/LightLambda.cs @@ -273,7 +273,6 @@ namespace System.Management.Automation.Interpreter } } - 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 31ede7fbb0..31a18ba2cb 100644 --- a/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs +++ b/src/System.Management.Automation/engine/interpreter/LightLambdaClosureVisitor.cs @@ -236,7 +236,6 @@ namespace System.Management.Automation.Interpreter 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 1100ce9e3c..a68f801bd0 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 @@ namespace System.Management.Automation.Interpreter 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 6e20600406..e463091ace 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 c29e49856e..e3be59b5be 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 1ea3b176ef..47a4b45a14 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 ee9c4566b5..9990f6a6ad 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 38229a5be7..3be7adb86b 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; @@ -1035,7 +1034,6 @@ namespace System.Management.Automation return BoolToObject(!rType.IsInstanceOfType(lval)); } - /// /// Implementation of the PowerShell -like operator /// @@ -1396,9 +1394,6 @@ namespace System.Management.Automation 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 5c4a5fef5c..2b6d72ae0c 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 @@ namespace System.Management.Automation #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 @@ namespace System.Management.Automation 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 de4255de36..41d476f332 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 be5b90d077..a686e3e4a5 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 df3f8e5faa..67d1e40fd2 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; @@ -414,8 +413,6 @@ namespace System.Management.Automation.Language 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 8f6f0df41d..c81e0b2713 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 7b5868ca46..edc91ebdfb 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 @@ namespace System.Management.Automation.Language { 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 2179b73595..3ea19ad3a4 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 2734567448..f16f64f54a 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 91ee67d9af..8cfd53815b 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 b347cbd3e0..3de2460342 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 @@ namespace System.Management.Automation.Language } private string _keywordModuleName; - /// /// Parse input that does not come from a file. /// @@ -552,7 +550,6 @@ namespace System.Management.Automation.Language //_v3FeatureUsed = true; } - internal void RequireStatementTerminator() { var terminatorToken = PeekToken(); @@ -1865,7 +1862,6 @@ namespace System.Management.Automation.Language } } - switch (token.Kind) { case TokenKind.If: @@ -2825,7 +2821,6 @@ namespace System.Management.Automation.Language Runspaces.Runspace.DefaultRunspace.ExecutionContext.Engine.EngineParser = currentParser; } - Token lCurly = NextToken(); if (lCurly.Kind != TokenKind.LCurly) { @@ -2857,7 +2852,6 @@ namespace System.Management.Automation.Language 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 c5aa366b7e..445f554900 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 62defcc9a5..25239f547c 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 ed1924382d..92f0a91305 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 86394e5ba0..8656cb6d9c 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 System.Text; using Microsoft.PowerShell; using Microsoft.PowerShell.DesiredStateConfiguration.Internal; - namespace System.Management.Automation.Language { internal class SemanticChecks : AstVisitor2, IAstPostVisitHandler @@ -265,7 +263,6 @@ namespace System.Management.Automation.Language return string.Join(", ", propertyNames); } - public override AstVisitAction VisitParameter(ParameterAst parameterAst) { bool isClassMethod = parameterAst.Parent.Parent is FunctionMemberAst; @@ -1252,7 +1249,6 @@ namespace System.Management.Automation.Language 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 cc8dc8f92e..7e078c76c2 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 @@ namespace System.Management.Automation.Language 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 7369607174..b488a4cbd5 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation results.AddRange(GetMembersByInferredType(new PSTypeName(typeof(object)), isStatic, filterToCall)); } - internal void AddMembersByInferredTypeCimType(PSTypeName typename, List results, Func filterToCall) { string cimNamespace; @@ -924,7 +925,7 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } } - 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 1728c2f812..3cbc539ee1 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 f89c3b8357..8f6e40af6e 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 36f660c0fe..811b802c1d 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 @@ namespace System.Management.Automation.Language SetParent(Alias); } - /// /// Construct a using module statement that aliases an item with module specification as hashtable. /// @@ -6061,7 +6059,6 @@ namespace System.Management.Automation.Language #endregion Visitors } - /// /// Defines types of configuration document /// @@ -6184,7 +6181,6 @@ namespace System.Management.Automation.Language #endregion Visitors - #region Internal methods/properties internal Token LCurlyToken { get; set; } @@ -9416,7 +9412,6 @@ namespace System.Management.Automation.Language // 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 4d4940cc30..76a8a1f529 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 c951d1f996..1a1045afc5 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 @@ namespace System.Management.Automation.Language public Func SemanticCheck { get; set; } } - internal static class DynamicKeywordExtension { internal static bool IsMetaDSCResource(this DynamicKeyword keyword) @@ -681,7 +679,6 @@ namespace System.Management.Automation.Language _positionHelper.LineStartMap = lineStartMap.ToArray(); } - internal TokenizerState StartNestedScan(UnscannedSubExprToken nestedText) { TokenizerState ts = new TokenizerState @@ -775,7 +772,6 @@ namespace System.Management.Automation.Language 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 @@ namespace System.Management.Automation.Language 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 1d00979782..787a925e24 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 31ee5d8dfb..67a69770f5 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 ed2c05091c..3f8a69ebb8 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 11e3b2e52b..78d605b92c 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 4119000e26..ce757b16f7 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 @@ namespace System.Management.Automation Reason = jobStateInfo.Reason; } - #endregion constructors #region public_properties @@ -1730,7 +1728,6 @@ namespace System.Management.Automation this(remoteRunspaceInfos, runspaceHelpers, remoteCommand, 0, name) { } - /// /// Internal constructor for initializing PSRemotingJob using /// computer names @@ -2193,7 +2190,6 @@ namespace System.Management.Automation } } - 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 03b603a607..47cc9e1e6b 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 @@ namespace System.Management.Automation 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 2d7862a931..068fd76edd 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 @@ namespace System.Management.Automation } } - 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 4424e4fa54..84901eb9a7 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 e1d8be0b1b..6e839139a4 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 d0cd4dd183..8125842ffd 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 705eaa49be..b8f8e38038 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 @@ namespace System.Management.Automation.Runspaces.Internal _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 ebc5040c50..219268ebff 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 d2199a6593..6afed69950 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 3f1d865ef2..e7bf878bb9 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 b9740d7506..550bed7dd2 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 a717ba2195..c966574494 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 @@ namespace System.Management.Automation.Remoting } } - - private RemoteRunspacePoolInternal _remoteRunspacePool; /// @@ -233,7 +230,6 @@ namespace System.Management.Automation.Remoting #region connect/close - /// /// Creates a Remote Session Asynchronously. /// @@ -607,4 +603,3 @@ namespace System.Management.Automation.Remoting } } - diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index 1ccc951f89..68a654937d 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 @@ namespace System.Management.Automation.Remoting _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 @@ namespace System.Management.Automation.Remoting } } - /// /// 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 51207d42c2..5971e76823 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 @@ namespace System.Management.Automation eventArgs.Data); } - /// /// 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 a13b0a90e1..050705f6d5 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 @@ namespace System.Management.Automation 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 98089ff1eb..6e7bf9e65e 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 77d39aa223..2daf976fdb 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 0fac991e7a..4870bda095 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 @@ namespace System.Management.Automation.Remoting _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 d68f5506d1..5af18f536b 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 @@ namespace Microsoft.PowerShell.Commands } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -245,7 +243,6 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands [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 f550f163ca..05ef4ced06 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 @@ else tempValue); } - if (sessionType == PSSessionType.Workflow && !isUseSharedProcessSpecified) { UseSharedProcess = true; @@ -1393,7 +1391,6 @@ else } } - /// /// Checks if the current thread is running elevated. If not, throws an error. /// @@ -2998,7 +2995,6 @@ $args[0] | ForEach-Object {{ // 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 @@ function Set-SessionPluginIdleTimeoutQuotas([int] $maxIdleTimeoutms, [int] $idle Set-SessionPluginIdleTimeoutQuotas $args[0] $args[1] $args[2] "; - private const string setSessionConfigurationOptionsSbFormat = @" function Set-SessionPluginOptions([hashtable] $options) {{ if ($options[""UsedSharedProcess""]) {{ @@ -3519,7 +3514,6 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5] 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 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5] accessModeSpecified ? AccessMode : PSSessionConfigurationAccessMode.Disabled, }); - errorList = (ArrayList)Context.DollarErrorVariable; if (errorList.Count > errorCountBefore) @@ -5419,7 +5412,6 @@ Disable-PSRemoting -force:$args[0] -queryForSet $args[1] -captionForSet $args[2] [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 449c4011f3..c01c94af93 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 78b48f4819..17c521aaba 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 227f6168d7..39b7b0962f 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 b906542a2a..02baf4e507 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 @@ namespace Microsoft.PowerShell.Commands [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 30c1fb5b25..ae427f6ec8 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 @@ namespace Microsoft.PowerShell.Commands } } - /// /// 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 f99e6a2043..d97d9aee81 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 065f37b379..fdda2b96e3 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 @@ namespace Microsoft.PowerShell.Commands } #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 0823bc7cad..2362fbe61a 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 7ee8ffc051..3252832cf6 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 @@ namespace System.Management.Automation.Remoting /// 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 4672fb541c..b7fa3ffd81 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 @@ namespace Microsoft.PowerShell.Commands throw new PSArgumentException(RemotingErrorIdStrings.InvalidSSHConnectionParameter); } - /// /// Validates parameter value and returns as integer /// @@ -1168,7 +1166,6 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands /// internal List Operations { get; } = new List(); - /// /// Closes the input streams on all the pipelines /// @@ -2034,7 +2030,6 @@ namespace Microsoft.PowerShell.Commands } } - #endregion Overrides #region "Get PowerShell instance" @@ -2214,7 +2209,6 @@ namespace Microsoft.PowerShell.Commands #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 a4540fd23d..d24cf678d5 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 9733a601c6..4014863e5d 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 3d256fe253..4db5dbb1ae 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 1f814cd9ed..8c9c6b6e19 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 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public PSSession Session { get; set; } - /// /// Session Id of PSSession object to receive data from. /// @@ -99,7 +97,6 @@ namespace Microsoft.PowerShell.Commands ParameterSetName = ReceivePSSessionCommand.IdParameterSet)] public Int32 Id { get; set; } - /// /// Computer name to receive session data from. /// @@ -199,7 +196,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public Guid InstanceId { get; set; } - /// /// Name of PSSession object to receive data from. /// @@ -215,7 +211,6 @@ namespace Microsoft.PowerShell.Commands [ValidateNotNullOrEmpty] public string Name { get; set; } - /// /// Determines how running command output is returned on client. /// @@ -243,7 +238,6 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands } private PSCredential _psCredential; - /// /// Use basic authentication to authenticate the user. /// @@ -286,7 +279,6 @@ namespace Microsoft.PowerShell.Commands } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -307,7 +299,6 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands [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 a26c947ab3..3543071d6e 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 06c3c85cf8..e0d82ce17e 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 fd468499df..86b19b0e99 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 829d69b110..7091c85b55 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 e80f7d1b33..ebb78185b5 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 @@ namespace Microsoft.PowerShell.Commands } 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 f575206786..ad837c3b7b 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 @@ namespace Microsoft.PowerShell.Commands 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 9d6ff32aab..866355a8c4 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 2c5a4672b6..8458f6a0b3 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 @@ namespace Microsoft.PowerShell.Commands } private PSCredential _psCredential; - /// /// Use basic authentication to authenticate the user. /// @@ -227,7 +225,6 @@ namespace Microsoft.PowerShell.Commands } private AuthenticationMechanism _authentication; - /// /// Specifies the certificate thumbprint to be used to impersonate the user on the /// remote machine. @@ -248,7 +245,6 @@ namespace Microsoft.PowerShell.Commands } 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 @@ namespace Microsoft.PowerShell.Commands [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 @@ namespace Microsoft.PowerShell.Commands [Parameter(ParameterSetName = GetPSSessionCommand.ConnectionUriInstanceIdParameterSet)] public Int32 ThrottleLimit { get; set; } = 0; - /// /// Filters returned remote runspaces based on runspace state. /// @@ -305,7 +299,6 @@ namespace Microsoft.PowerShell.Commands [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 21ccb5fe99..9cc14e2afa 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.Management.Automation.Remoting.Client; 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 eff6d69aed..48744a3d94 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 5ee1ea9222..8870806597 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 8bd4b8fe0d..bd35d05590 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 996a179383..a33777339d 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 d6abab8e3e..3a97495d8b 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 5387386967..2aa502507e 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 2ab0002525..6ad0dbd581 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 0088f2f136..05164306f5 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 1c1728d5e5..7e632415e3 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 1f6e49e34a..61a717de16 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 a2452581a7..1eac7c3602 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 a7aa0f3124..f9580a9db4 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 @@ namespace System.Management.Automation.Runspaces 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 @@ namespace System.Management.Automation.Runspaces } } - /// /// 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 8773def9aa..9ed8cc76a6 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 e5ea2c5c3e..69314b706b 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 3fddda979b..418724d8dd 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 @@ namespace System.Management.Automation 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 3ccc625612..3170577b5d 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 fd9ccc8503..1199b6afc3 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 69863ade1b..8392630da8 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 48e13f2b1d..099218f862 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 @@ namespace System.Management.Automation.Remoting 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 8208b3a8af..a0812e5527 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 @@ namespace System.Management.Automation.Remoting } } - /// /// 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 863b00c716..93bb13b532 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation 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 b686d7d979..3e243cb57a 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 43a26a440e..e0d6ff4687 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 4a307b767b..1c7af32710 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 @@ namespace System.Management.Automation.Remoting 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 @@ namespace System.Management.Automation.Remoting { } - #endregion Constructors /// @@ -381,7 +378,6 @@ namespace System.Management.Automation.Remoting } } - /// /// This exception is used by remoting code to indicate an error condition in network operations. /// @@ -414,8 +410,6 @@ namespace System.Management.Automation.Remoting 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 f987027c1d..df0c8ba929 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 @@ namespace System.Management.Automation.Remoting 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 25b9bb0b45..c258bfddaa 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 @@ namespace System.Management.Automation.Remoting.Client } } - 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 1d450d7c9d..bd3260c690 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 System.Management.Automation.Runspaces; using Dbg = System.Management.Automation.Diagnostics; using System.Collections; - namespace System.Management.Automation.Remoting { /// @@ -204,7 +202,6 @@ namespace System.Management.Automation.Remoting 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 ebacbb6ce7..01c67b8eae 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 @@ namespace System.Management.Automation.Remoting #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 dc8acb41f5..ec55520754 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 44dfdac254..544a58c145 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 552668fba4..5fa03c6873 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 @@ namespace System.Management.Automation.Remoting } } - /// /// Prepares receive data streams for a reconnection /// @@ -805,7 +803,6 @@ namespace System.Management.Automation.Remoting } } - /// /// 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 2fcd0a2f88..5047bb1b24 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 @@ namespace System.Management.Automation.Remoting.Client WSMAN_DATA_TYPE_DWORD = 4 }; - [StructLayout(LayoutKind.Sequential)] internal class WSManDataStruct { @@ -787,7 +785,6 @@ namespace System.Management.Automation.Remoting.Client set { _bufferLength = value; } } - private string _text; internal string Text { @@ -1246,7 +1243,6 @@ namespace System.Management.Automation.Remoting.Client this.argsCount = 0; } - /// /// Free resources. /// @@ -2544,7 +2540,6 @@ namespace System.Management.Automation.Remoting.Client IntPtr asyncCallback, [In, Out] ref IntPtr shellOperationHandle); - /// /// /// @@ -2569,7 +2564,6 @@ namespace System.Management.Automation.Remoting.Client 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 @@ namespace System.Management.Automation.Remoting.Client 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 @@ namespace System.Management.Automation.Remoting.Client 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 @@ namespace System.Management.Automation.Remoting.Client int flags, IntPtr asyncCallback); - /// /// Sends a signal. If is null, then the signal will /// be sent to shell. @@ -2904,7 +2895,6 @@ namespace System.Management.Automation.Remoting.Client 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 1abef92b3b..01e7460d81 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 @@ namespace System.Management.Automation.Remoting 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 226438e217..2e0241c546 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 d8d98c2d8e..b94b433a9f 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 923c65894f..2b22ba87d6 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 @@ namespace System.Management.Automation.Remoting 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 bc9c88859f..18723c3eb1 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 @@ namespace System.Management.Automation.Remoting.Client //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 @@ namespace System.Management.Automation.Remoting.Client private int _connectionRetryCount; - private const string resBaseName = "remotingerroridstrings"; // Robust connections maximum retry time value in milliseconds. @@ -822,7 +819,6 @@ namespace System.Management.Automation.Remoting.Client internal bool SupportsDisconnect { get; private set; } - internal override void DisconnectAsync() { Dbg.Assert(!isClosed, "object already disposed"); @@ -2626,7 +2622,6 @@ namespace System.Management.Automation.Remoting.Client _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 85c3beeb9b..c83194af87 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 75fc934800..f6bb4c6c90 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 19e0c78ecd..0449317920 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 765bd6c665..5805327528 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.Remoting; 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 5cfe0c0e53..f15fb2ec88 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 9f5abf2238..7dedde2edc 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 663b76b342..a5d1769e45 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 4d2661c53e..0b0e46cc05 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 7cf5643e2c..cc7e3bf645 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 @@ namespace System.Management.Automation #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 1dcf430923..6bf974adb1 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 01e48b022b..2c0c31cb28 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 d09127c86b..6f0fecc89a 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 ada9ba95ab..02d0a64969 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 e87557155f..4596da52c3 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 @@ namespace System.Management.Automation.Remoting #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 @@ namespace System.Management.Automation.Remoting _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 88010ddb3e..b5cd7f5724 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 a2d9604d14..84bf589089 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 536350cc66..d35d139ed4 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.Text.RegularExpressions; using System.Threading; using System.Xml; - namespace System.Management.Automation.Language { // Item1 - member name @@ -851,7 +849,6 @@ namespace System.Management.Automation.Language BindingRestrictions.GetInstanceRestriction(target.Expression, AutomationNull.Value))).WriteToDebugLog(this); } - var enumerable = PSEnumerableBinder.IsEnumerable(target); if (enumerable == null) { @@ -3746,7 +3743,6 @@ namespace System.Management.Automation.Language } } - internal static DynamicMetaObject ThrowNoConversion(DynamicMetaObject target, Type toType, DynamicMetaObjectBinder binder, int currentVersion, params DynamicMetaObject[] args) { @@ -3884,7 +3880,6 @@ namespace System.Management.Automation.Language } } - public override DynamicMetaObject FallbackGetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion) { if (!target.HasValue || indexes.Any(mo => !mo.HasValue)) @@ -4644,7 +4639,6 @@ namespace System.Management.Automation.Language 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 @@ namespace System.Management.Automation.Language } } - 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 6b69f89d99..c85086cd67 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 @@ namespace System.Management.Automation 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 5c44e281e2..88207bd942 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 28cab722d0..61c2872736 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 df5fc5f837..0f915303f1 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 @@ namespace System.Management.Automation rest.Add(Current(enumerator)); } - return rest.ToArray(); } @@ -2644,7 +2642,6 @@ namespace System.Management.Automation return matches; } - /// /// Implements the ForEach() operator. /// @@ -3217,7 +3214,6 @@ namespace System.Management.Automation } } - /// /// 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 a1957f7732..4040389f36 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 c513cc569d..da826201a8 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 402257788c..d1d1f71399 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 774dfc834f..c9888d1108 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 3d40f11d34..3ba86fcf86 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 cde402ebbd..0d316b1297 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 feadb81279..4da7501687 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 @@ namespace System.Management.Automation return false; } - /// /// /// @@ -2504,7 +2502,6 @@ namespace System.Management.Automation WriteEncodedString(serializer, streamName, property, Convert.ToString(source, CultureInfo.InvariantCulture), entry); } - /// /// Serialize string as item or property /// @@ -2869,7 +2866,6 @@ namespace System.Management.Automation return new String(result, 0, rlen); } - /// /// Writes element string in monad namespace /// @@ -3760,7 +3756,6 @@ namespace System.Management.Automation ); 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 da026404d9..debc0a575b 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 e6c268d2df..e98b135393 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 9c0c8b3c40..f2d67f192c 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 a28dcf990e..994b704c9e 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 @@ namespace System.Management.Automation.Internal #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 4c3521e20b..309dfb59b5 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 4c0967338f..1de757edce 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 @@ namespace System.Management.Automation Microsoft.PowerShell.Commands.ModuleCmdletBase.RemovePrefixFromCommandName(cmdInfo.Name, cmdInfo.Prefix), cmdInfo.HelpCategory) as MamlCommandHelpInfo; - if (null != originalHelpInfo) { result = originalHelpInfo.Copy(); @@ -1330,7 +1328,6 @@ namespace System.Management.Automation CommandTypes.Cmdlet, context); - return searcher; } diff --git a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs index 610bdb5795..9ef8f0e635 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 4586a78a40..3391a73efd 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 ab363ca5e1..ab1df27e6c 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 df48e63425..bc0f3ce470 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 95951fd17c..2015d34665 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 99226dba1a..317620d1b2 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 @@ namespace System.Management.Automation } } - 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 913913466c..41face7da1 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 257dabb14d..fe1338009c 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 cfccf54773..da282fa7f0 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 f73baefd1a..d225d22760 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 e1b4b9a55b..a115243155 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 4675113e04..86b5fe042a 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 895a4515ca..261015364d 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 81221cf37c..6aa264cb80 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 fab35c51f5..c38b1e157e 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 d12f7e3204..92674f32db 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 7e12f26cdb..17f31ff256 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 4bc7c03db3..08214518ae 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 d122a91a12..94f2465ff1 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 @@ namespace System.Management.Automation } } - #endregion #region Component, Role, Features diff --git a/src/System.Management.Automation/help/MamlNode.cs b/src/System.Management.Automation/help/MamlNode.cs index 2bf558910e..e49177a6e2 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 29fe3c165b..7ddf462176 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 ec418adfd8..8572bb4da2 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 b092467768..1c9d43cf9a 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 993376789c..985f32c0a0 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 6ec2faa4d3..1061eac0f8 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 @@ namespace System.Management.Automation } } - /// /// 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 7323aeba6c..6465b30088 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 @@ namespace System.Management.Automation } } - 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 4e581a98cb..5c766d7b39 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 4329fa25b8..b5c66e639d 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 @@ namespace Microsoft.PowerShell.Commands #endregion - #region Implementation /// @@ -269,7 +267,6 @@ namespace Microsoft.PowerShell.Commands 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 8501b963d7..ceecd86b54 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 4e2081dbe2..44fc51b8d3 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 d3cabf516e..9e08244eb9 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 467de5a53f..e49eb2b5cc 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 c525ed0cf5..9c246698d6 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 cadd34fa5e..8e49902029 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 @@ namespace System.Management.Automation.Help /// internal int ProgressPercent { get; } - /// /// Module name /// @@ -675,7 +673,6 @@ namespace System.Management.Automation.Help } } - 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 c8c4286505..25ddb4d85c 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 a7eca22ee3..f962fad270 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 @@ namespace Microsoft.PowerShell.Commands } 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 97af8b6d7a..7d9c3fe595 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 c5445c010e..7cd6dde11e 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 354da12f6b..0ed8ed64d9 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 084f6f2b12..207930cbd0 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 b8c6557dfc..aeec55d303 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 @@ namespace Microsoft.PowerShell.Commands #region protected members - /// /// Gets a alias from session state /// @@ -370,7 +367,6 @@ namespace Microsoft.PowerShell.Commands } 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 b67a2f9f46..c7bfd49226 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider CopyItem(path, copyPath, recurse); } // CopyItem - /// /// Gives the provider to attach additional parameters to /// the copy-item cmdlet. @@ -711,7 +706,6 @@ namespace System.Management.Automation.Provider } } // GetChildItemsDynamicParameters - /// /// Gets names of the children of the specified path. /// @@ -840,7 +834,6 @@ namespace System.Management.Automation.Provider } } // GetChildNamesDynamicParameters - /// /// Renames the item at the specified path to the new name provided. /// @@ -1126,7 +1119,6 @@ namespace System.Management.Automation.Provider } } - /// /// 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 3ecbd9c516..a5183f6852 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 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation } #endregion Transaction Support - /// /// Gets or sets the Force property that is passed to providers. /// @@ -1276,4 +1272,3 @@ namespace System.Management.Automation } // CmdletProviderContext } - diff --git a/src/System.Management.Automation/namespaces/DriveProviderBase.cs b/src/System.Management.Automation/namespaces/DriveProviderBase.cs index 323bcaeddf..a94f1ce4d3 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 @@ namespace System.Management.Automation.Provider } // TraceMethod } // RemoveDrive - /// /// Gives the provider the ability to map drives after initialization. /// @@ -264,4 +262,3 @@ namespace System.Management.Automation.Provider #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 5f4dcf71db..6be3c30143 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 @@ namespace Microsoft.PowerShell.Commands #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 7402e52bf9..ae20178e83 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 @@ namespace Microsoft.PowerShell.Commands _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 904bbf83cf..0b332eeb5c 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 @@ namespace Microsoft.PowerShell.Commands // 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands #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 @@ namespace Microsoft.PowerShell.Commands driveName = drive.Root; } - // You need to actually remove the drive. int code = NativeMethods.WNetCancelConnection2(driveName, flags, true); @@ -1005,7 +1000,6 @@ namespace Microsoft.PowerShell.Commands return results; } // InitializeDefaultDrives - #endregion DriveCmdletProvider methods #region ItemCmdletProvider methods @@ -1041,7 +1035,6 @@ namespace Microsoft.PowerShell.Commands return false; } - //Normalize the path path = NormalizePath(path); path = EnsureDriveIsRooted(path); @@ -1407,7 +1400,6 @@ namespace Microsoft.PowerShell.Commands } // GetChildItems #endregion GetChildItems - #region GetChildNames /// /// Gets the path names for all children of the specified @@ -1752,7 +1744,6 @@ namespace Microsoft.PowerShell.Commands }// 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 @@ namespace Microsoft.PowerShell.Commands fileMode = FileMode.Create; } - string action = FileSystemProviderStrings.NewItemActionFile; string resource = StringUtil.Format(FileSystemProviderStrings.NewItemActionTemplate, path); @@ -2537,7 +2527,6 @@ namespace Microsoft.PowerShell.Commands HardLink }; - private static ItemType GetItemType(string input) { ItemType itemType = ItemType.Unknown; @@ -2733,7 +2722,6 @@ namespace Microsoft.PowerShell.Commands return result; } // CreateIntermediateDirectories - #endregion NewItem #region RemoveItem @@ -3354,7 +3342,6 @@ namespace Microsoft.PowerShell.Commands } } // ItemExistsDynamicParameters - #endregion ItemExists #region HasChildItems @@ -4849,7 +4836,6 @@ namespace Microsoft.PowerShell.Commands return result; } - private static bool IsUNCPath(string path) { return path.StartsWith("\\\\", StringComparison.Ordinal); @@ -4966,7 +4952,6 @@ namespace Microsoft.PowerShell.Commands throw PSTraceSource.NewArgumentException("path"); } - if (basePath == null) { basePath = String.Empty; @@ -5578,7 +5563,6 @@ namespace Microsoft.PowerShell.Commands return leafElement; } // CreateNormalizedRelativePathFromStack - /// /// Gets the name of the leaf element of the specified path. /// @@ -5743,13 +5727,11 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands string resource = StringUtil.Format(FileSystemProviderStrings.MoveItemResourceFileTemplate, file.FullName, destination); - // Confirm the move with the user if (ShouldProcess(resource, action)) @@ -7751,7 +7732,6 @@ namespace Microsoft.PowerShell.Commands } // DelimiterSpecified } // class FileSystemContentReaderDynamicParameters - /// /// Provides the dynamic parameters for test-path on the file system. /// @@ -9753,7 +9733,6 @@ namespace System.Management.Automation.Internal 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 22f07c89cf..7e89463287 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 0ec824c536..c81caa237b 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 @@ namespace Microsoft.PowerShell.Commands } 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 dee126fffa..fb908a4401 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 359bb89f55..0597b1990a 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 03e89f6829..e5720c71db 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 274b147b3d..058aa5bdb3 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 29b6f33aad..08dab58e8d 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 47f92c7fb7..9e260bb837 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 @@ namespace System.Management.Automation.Provider #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 9dff69f286..07f3f8dedb 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider #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 5afeb0cd22..584e2d904c 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 @@ namespace System.Management.Automation context.Drive = drive; } - Collection paths = new Collection(); foreach (PathInfo currentPath in @@ -1051,10 +1049,8 @@ namespace System.Management.Automation } } // GetGlobbedProviderPathsFromProviderPath - #endregion Provider path to provider paths globbing - #region Path manipulation /// @@ -1113,7 +1109,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation bool result = false; - if (_sessionState.Drive.Current != null) { driveName = _sessionState.Drive.Current.Name; @@ -1846,7 +1840,6 @@ namespace System.Management.Automation #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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation continue; } - // Process the current directory symbol "." if (path.Equals(currentDirSymbol, StringComparison.OrdinalIgnoreCase)) @@ -2563,7 +2554,6 @@ namespace System.Management.Automation return result; } // GetProviderSpecificPath - /// /// Parses the provider-qualified path into the provider name and /// the provider-internal path. @@ -2614,7 +2604,6 @@ namespace System.Management.Automation return result; } // ParseProviderPath - #endregion Path manipulation methods #endregion private fields and methods @@ -3329,7 +3318,6 @@ namespace System.Management.Automation throw PSTraceSource.NewArgumentNullException("path"); } - if (drive == null) { throw PSTraceSource.NewArgumentNullException("drive"); @@ -3481,7 +3469,6 @@ namespace System.Management.Automation throw PSTraceSource.NewArgumentNullException("path"); } - if (provider == null) { throw PSTraceSource.NewArgumentNullException("provider"); @@ -3671,7 +3658,6 @@ namespace System.Management.Automation context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -3712,7 +3698,6 @@ namespace System.Management.Automation continue; } - // Loop through each child to see if they match the glob expression foreach (PSObject childObject in childNamesObjectArray) @@ -3800,7 +3785,6 @@ namespace System.Management.Automation childPath = GetMshQualifiedPath(childPath, drive); } - if (_sessionState.Internal.ItemExists(childPath, context)) { s_tracer.WriteLine("Adding child path to dirs {0}", childPath); @@ -3812,7 +3796,6 @@ namespace System.Management.Automation } // foreach (dir in currentDirs) } // if (StringContainsGlobCharacters(leafElement)) - return newDirs; } // GenerateNewPSPathsWithGlobLeaf @@ -4210,7 +4193,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation context.Include, WildcardOptions.IgnoreCase); - // Construct the exclude filter Collection excludeMatcher = @@ -4416,7 +4397,6 @@ namespace System.Management.Automation context); } - if (provider.ItemExists(childPath, context)) { s_tracer.WriteLine("Adding child path to dirs {0}", childPath); @@ -4429,7 +4409,6 @@ namespace System.Management.Automation } // 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 46eca2d3d0..14f6ed59fd 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 @@ namespace System.Management.Automation.Provider } 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 @@ namespace System.Management.Automation.Provider } } // GetChildName - /// /// Determines if the item specified by the path is a container. /// @@ -887,7 +884,6 @@ namespace System.Management.Automation.Provider } } - /// /// Moves the item specified by path to the specified destination. /// @@ -964,7 +960,6 @@ namespace System.Management.Automation.Provider } } // 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 2643dbd94b..bb370a0050 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 @@ namespace System.Management.Automation { 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 69ba4aaa60..a299513149 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider 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 @@ namespace System.Management.Automation.Provider return contentProvider.ClearContentDynamicParameters(path); } // ClearContentDynamicParameters - #endregion IContentCmdletProvider method wrappers #endregion internal members @@ -1330,7 +1326,6 @@ namespace System.Management.Automation.Provider Context != null, "The context should always be set"); - return new CommandInvocationIntrinsics(Context.ExecutionContext); } // TraceProperty } // get @@ -1782,7 +1777,6 @@ namespace System.Management.Automation.Provider } } // WriteVerbose - /// public void WriteProgress(ProgressRecord progressRecord) { @@ -1801,7 +1795,6 @@ namespace System.Management.Automation.Provider } } // WriteProgress - /// public void WriteDebug(string text) { @@ -1988,7 +1981,6 @@ namespace System.Management.Automation.Provider string childName = navProvider.GetChildName(path, Context); - result.AddOrSetProperty("PSChildName", childName); providerBaseTracer.WriteLine("Attaching {0} = {1}", "PSChildName", childName); } @@ -2137,7 +2129,6 @@ namespace System.Management.Automation.Provider #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 8f7ec8e2f9..aa0906e5ad 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 @@ namespace System.Management.Automation.Provider { #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 @@ namespace System.Management.Automation.Provider 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 cfdbc77057..df3c474386 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 681cc60041..c614c153b1 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 @@ namespace Microsoft.PowerShell.Commands WriteRegistryItemObject(result, path); } // GetItem - /// /// Sets registry values at to the specified. /// @@ -811,7 +809,6 @@ namespace Microsoft.PowerShell.Commands return result.ToString(); } // EscapeSpecialChars - /// /// Escapes the characters in the registry key name that are used by globbing and /// path. @@ -929,7 +926,6 @@ namespace Microsoft.PowerShell.Commands } // ShouldProcess } // RenameItem - /// /// Creates a new registry key or value at the specified . /// @@ -1366,7 +1362,6 @@ namespace Microsoft.PowerShell.Commands key.Close(); } // CopyItem - private bool CopyRegistryKey( IRegistryWrapper key, string path, @@ -1428,7 +1423,6 @@ namespace Microsoft.PowerShell.Commands string destinationPath = MakePath(destinationParent, destinationName); - // Confirm the copy item with the user string action = RegistryProviderStrings.CopyKeyAction; @@ -1968,8 +1962,6 @@ namespace Microsoft.PowerShell.Commands key.Close(); } // SetProperty - - /// /// Gives the provider a chance to attach additional parameters to the /// get-itemproperty cmdlet. @@ -2072,7 +2064,6 @@ namespace Microsoft.PowerShell.Commands } } - #region Unimplemented methods /// @@ -2101,7 +2092,6 @@ namespace Microsoft.PowerShell.Commands return null; } - /// /// Gives the provider a chance to attach additional parameters to the /// clear-itemproperty cmdlet. @@ -2363,7 +2353,6 @@ namespace Microsoft.PowerShell.Commands WriteErrorIfPerfectMatchNotFound(hadAMatch, path, propertyName); } - /// /// Renames a property of the item at the specified . /// @@ -2452,7 +2441,6 @@ namespace Microsoft.PowerShell.Commands key.Close(); } - /// /// Copies a property of the item at the specified to a new property on the /// destination . @@ -2558,7 +2546,6 @@ namespace Microsoft.PowerShell.Commands key.Close(); } - /// /// Moves a property on an item specified by . /// @@ -2664,7 +2651,6 @@ namespace Microsoft.PowerShell.Commands destinationKey.Close(); } - /// /// Gets the parent path of the given . /// @@ -2767,7 +2753,6 @@ namespace Microsoft.PowerShell.Commands return result; } - #region Unimplemented methods /// @@ -2934,7 +2919,6 @@ namespace Microsoft.PowerShell.Commands #endregion IDynamicPropertyCmdletProvider - #region Private members private void CopyProperty( @@ -3081,7 +3065,6 @@ namespace Microsoft.PowerShell.Commands throw PSTraceSource.NewArgumentException("path"); } - filteredCollection = new Collection(); key = GetRegkeyForPathWriteIfError(path, writeAccess); @@ -3181,7 +3164,6 @@ namespace Microsoft.PowerShell.Commands } // foreach } - private void WriteErrorIfPerfectMatchNotFound(bool hadAMatch, string path, string requestedValueName) { if (!hadAMatch && !WildcardPattern.ContainsWildcardCharacters(requestedValueName)) @@ -3782,7 +3764,6 @@ namespace Microsoft.PowerShell.Commands SetRegistryValue(key, propertyName, value, kind, path, true); } - /// /// Sets or creates a registry value on a key. /// @@ -3884,7 +3865,6 @@ namespace Microsoft.PowerShell.Commands } } // 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 96bbcb0056..f4778219d5 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 b6dfe795e4..0ba6d7d804 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.Security.AccessControl; 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 4a0f4f706d..2bfa089d45 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 9699241da5..023ddf55d5 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 617825157e..74b2358f90 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 @@ namespace Microsoft.PowerShell.Commands 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 @@ namespace Microsoft.PowerShell.Commands #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 e362f35b1b..a1ba37086e 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 87e03cad77..a0cf6fc851 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 ea523a238c..9ece1e4e24 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 @@ */ - 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 69738ff398..dc794b61a6 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 @@ namespace Microsoft.PowerShell.Commands.Internal } } - /// /// Represents a set of access rights to be audited for a user or group. This class cannot be inherited. /// @@ -167,7 +168,6 @@ namespace Microsoft.PowerShell.Commands.Internal } } - /// /// 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 accf720aa6..702c78cdc5 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 @@ namespace Microsoft.PowerShell.Commands 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 3dfbdf4563..ca8e6c29a1 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal internal uint ftTimeHigh; } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct KERB_S4U_LOGON { @@ -531,7 +531,6 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 @@ namespace Microsoft.PowerShell.Commands.Internal 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 d5f51dc021..a66539b09b 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 @@ namespace System.Management.Automation 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 fea05cfe09..6568116126 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 127adaa9cb..118bd8d9a2 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 @@ namespace System.Management.Automation 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 61b8e56991..a3de69cf00 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.Security.Cryptography.X509Certificates; using System.ComponentModel; using DWORD = System.UInt32; - namespace System.Management.Automation { internal static class Win32Errors @@ -309,7 +306,6 @@ namespace System.Management.Automation 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 ea30e395cf..7489e8b24e 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 19dcfdbe13..068fd97e89 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 @@ namespace Microsoft.PowerShell allowRun = true; break; - case CommandTypes.Function: case CommandTypes.Filter: case CommandTypes.Workflow: @@ -703,7 +701,6 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell 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 @@ namespace Microsoft.PowerShell } } - diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 625590e74d..ecc4f0f40f 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 @@ namespace System.Management.Automation.Internal return ExecutionPolicy.Restricted; } - private static bool? _hasGpScriptParent; /// @@ -972,7 +970,6 @@ namespace Microsoft.PowerShell.Commands } } - namespace System.Management.Automation { using System.Security.Cryptography.Pkcs; @@ -1457,7 +1454,6 @@ namespace System.Management.Automation processedThumbprints.Add(certificate.Thumbprint); } - if (purpose == ResolutionPurpose.Encryption) { // Only let wildcards expand to one recipient. Otherwise, data @@ -1739,27 +1735,23 @@ namespace System.Management.Automation internal static extern int AmsiInitialize( [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string appName, ref System.IntPtr amsiContext); - /// Return Type: void ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* [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 @@ namespace System.Management.Automation 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 7e486e6ef6..2200eb450d 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 @@ namespace System.Management.Automation.Security /// 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 @@ namespace System.Management.Automation.Security internal const int MAX_PATH = 260; } - /// /// pinvoke methods from crypt32.dll /// @@ -128,7 +123,6 @@ namespace System.Management.Automation.Security IntPtr CertEnumCertificatesInStore(IntPtr storeHandle, IntPtr certContext); - /// /// signature of cert find function /// @@ -171,8 +165,6 @@ namespace System.Management.Automation.Security 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 @@ namespace System.Management.Automation.Security // other flags not used }; - [StructLayout(LayoutKind.Sequential)] internal struct CRYPTUI_WIZ_DIGITAL_SIGN_INFO { @@ -601,7 +592,6 @@ namespace System.Management.Automation.Security siex.pszHashAlg = hashAlgorithm; } - return siex; } @@ -682,7 +672,6 @@ namespace System.Management.Automation.Security System.IntPtr pvKey, uint dwGroupId); - [ArchitectureSensitive] internal static DWORD GetCertChoiceFromSigningOption( SigningOption option) @@ -1850,7 +1839,6 @@ namespace System.Management.Automation.Security 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 e79c1678f3..fdbd28346c 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 @@ namespace System.Management.Automation.Security } private static SystemEnforcementMode? s_cachedWldpSystemPolicy = null; - private static SystemEnforcementMode GetAppLockerPolicy(string path, SafeHandle handle) { SaferPolicy result = SaferPolicy.Disallowed; @@ -393,8 +395,6 @@ namespace System.Management.Automation.Security } private static bool s_hadMissingWldpAssembly = false; - - /// /// Gets lockdown policy as applied to a COM object /// @@ -560,7 +560,6 @@ namespace System.Management.Automation.Security [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 @@ namespace System.Management.Automation.Security 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 eee78a4205..1d6160a57b 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 5678451677..74f0a1170a 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 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } } - internal void LoadIndirectResources() { using (RegistryStringResourceIndirect resourceReader = RegistryStringResourceIndirect.GetResourceIndirectReader()) @@ -415,8 +412,6 @@ namespace System.Management.Automation } } - - internal PSSnapInInfo Clone() { PSSnapInInfo cloned = new PSSnapInInfo(Name, @@ -430,7 +425,6 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation } } - - /// /// Internal class to read information about a mshsnapin /// @@ -573,7 +565,6 @@ namespace System.Management.Automation return r; } - /// /// Reads all registered mshsnapin for specified psVersion /// @@ -642,7 +633,6 @@ namespace System.Management.Automation return mshsnapins; } - /// /// Read mshsnapin for specified mshsnapinId and psVersion /// @@ -684,8 +674,6 @@ namespace System.Management.Automation return ReadOne(mshsnapinRoot, mshsnapinId); } - - /// /// Reads the mshsnapin info for a specific key under specific monad version /// @@ -1268,7 +1256,6 @@ namespace System.Management.Automation new DefaultPSSnapInInformation("Microsoft.PowerShell.Core", "System.Management.Automation", null, "CoreMshSnapInResources,Description", "CoreMshSnapInResources,Vendor"); - /// /// /// @@ -1326,4 +1313,3 @@ namespace System.Management.Automation } } - diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs index c3ac0e252d..179d9f7615 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 5843ec7308..1e10b2e4eb 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 724ce27bb3..6b28170ffa 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 1aca451d08..cb24f0a37a 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 41fdfed9ef..a57925ba6b 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 @@ namespace System.Management.Automation #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 ece59d5a15..f0bda37657 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 591de52d81..95ba718862 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 2a6acccd55..c29cb7c31c 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 @@ namespace System.Management.Automation.Internal 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 @@ namespace System.Management.Automation.Internal byte[] pbData, ref uint pdwDataLen); - /// Return Type: BOOL->int ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int ///pbData: BYTE* @@ -188,7 +185,6 @@ namespace System.Management.Automation.Internal uint dwFlags, ref PSSafeCryptKey phKey); - /// Return Type: BOOL->int ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int ///pdwReserved: DWORD* @@ -1101,7 +1097,6 @@ namespace System.Management.Automation.Internal #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 126314d7d3..583d3282e1 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 c80c9e038e..d846144d98 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 783f7b6909..e36d698a82 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 9af3de5e71..efdf60c06c 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 @@ namespace System.Management.Automation.Runspaces } } - - diff --git a/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs b/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs index 42facc4501..5abc98beda 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 f5fdbb88d8..50bfa4cae8 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 @@ namespace System.Management.Automation.Host SetDefaultErrorRecord(); } - /// /// /// Initializes a new instance of the HostException class and defines the error message and @@ -190,7 +188,6 @@ namespace System.Management.Automation.Host 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 5962ce5a65..02616bda78 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 b33282bacb..9f07707787 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 @@ namespace System.Management.Automation.Runspaces } } - diff --git a/src/System.Management.Automation/utils/MetadataExceptions.cs b/src/System.Management.Automation/utils/MetadataExceptions.cs index 5253113fe6..d9f9b94212 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 @@ namespace System.Management.Automation SetErrorCategory(ErrorCategory.MetadataError); } - internal MetadataException(string errorId, Exception innerException, string resourceStr, params object[] arguments) : base(StringUtil.Format(resourceStr, arguments), innerException) { @@ -82,10 +80,8 @@ namespace System.Management.Automation 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 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation /// 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 @@ namespace System.Management.Automation /// 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 9be5db46b1..25b643df1f 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 ac439801f6..a1bafc6a2f 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 3bf01bf663..5389bb60f6 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 a05810a5fc..46a1ce7684 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 f5ab26deaa..d27afc36b6 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 93cc975460..bb2641b31c 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 0a83ba5db2..73fabe371d 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 8d2f5c888f..0fe78e7a46 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 @@ namespace System.Management.Automation #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 @@ namespace System.Management.Automation 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 d5594fc42d..8b481ed757 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 cc70e79af5..e3389b4be8 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 35fc754f5d..1ed4087bee 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 9458ae964e..a9c8cc022b 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 9558e6e02c..229f24803a 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 @@ namespace Microsoft.PowerShell.Telemetry.Internal 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 6be313afee..995de89a16 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 b23db53835..8023f72c8f 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 52a208466f..88de64a8f1 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 @@ namespace System.Management.Automation _errors = (ParseError[])info.GetValue("Errors", typeof(ParseError[])); } - /// /// Add private data for serialization. /// @@ -170,7 +168,6 @@ namespace System.Management.Automation } } // 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 6b8b0de42d..2177f89dbb 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 @@ namespace System.Management.Automation } } // 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 028d768c0b..a428af3cc1 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 39990d8a30..487cef5e37 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 @@ namespace System.Management.Automation.Tracing PowerShellTraceTask.None, message, instanceId); } - /// /// /// diff --git a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs index 0278962d6b..b3c4b95d7d 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 70d5a7cde2..b6ede8c993 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 373947dca2..6dfd4a6023 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 5301160327..9a0e04decc 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 @@ namespace System.Management.Automation _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 f19ff72be2..a6082744ee 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 685866297d..7af181038f 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 @@ namespace System.Management.Automation.Internal return String.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o); } - - internal static string Format(string formatSpec, object o1, object o2) @@ -27,8 +24,6 @@ namespace System.Management.Automation.Internal return String.Format(System.Globalization.CultureInfo.CurrentCulture, formatSpec, o1, o2); } - - internal static string Format(string formatSpec, params object[] o) @@ -36,8 +31,6 @@ namespace System.Management.Automation.Internal 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 1eb71840bd..cca0627e99 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 @@ namespace System.Management.Automation 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 8b1997f3a5..3c609e58f1 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 @@ namespace System.Management.Automation public const string Watch = "Watch"; }//VerbsCommon - /// /// Verbs that are commonly used in cmdlet names when the cmdlet manipulates data. /// @@ -497,7 +495,6 @@ namespace System.Management.Automation 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 5985b4e39c..ce5312a771 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 868ee0aef6..9c1e4d718e 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 @@ namespace System.Management.Automation.PerformanceData 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 @@ namespace System.Management.Automation.PerformanceData } } - /// /// 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 f6bf886ced..f5bc7ea2df 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 @@ namespace System.Management.Automation.PerformanceData /// protected abstract CounterSetInstanceBase CreateCounterSetInstance(); - #endregion #region Constructors @@ -187,7 +185,6 @@ namespace System.Management.Automation.PerformanceData [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 @@ namespace System.Management.Automation.PerformanceData #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 @@ namespace System.Management.Automation.PerformanceData } } - #endregion #region CounterSetRegistrarBase Overrides @@ -279,7 +273,6 @@ namespace System.Management.Automation.PerformanceData #endregion - #endregion } } diff --git a/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs b/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs index 17a7e50404..52b19a14f7 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 @@ namespace System.Management.Automation.PerformanceData } } - #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 75db5129b6..cd8dcf2204 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 @@ namespace System.Management.Automation.Tracing } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs index 8ae9dd9248..22badeaa20 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 @@ namespace System.Management.Automation.Tracing } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs index 682accc7d8..ac4440d7de 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 @@ namespace System.Management.Automation.Tracing } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs index 7ffdf90953..d22830c5e6 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 @@ namespace System.Management.Automation.Tracing } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs index 1da52df320..0b07aad161 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 @@ namespace System.Management.Automation.Tracing } } - #endif diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs index 8ba057e94b..787c275a92 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 @@ namespace System.Management.Automation.Tracing 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 574508a004..3d043b3510 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 7507c1c440..c473fb9334 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 @@ namespace System.Management.Automation.Tracing } } - - /// /// 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 cd6d9d7392..ca1b5c8680 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 b93061723c..d3a1cbecf1 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 d277e047bd..8eed00ccc0 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 @@ namespace System.Management.Automation.Tracing WriteEvent(WriteTransferEventEvent, currentActivityId, parentActivityId); } - /// /// DebugMessage (EventId: 0xc000/49152) /// @@ -255,7 +256,6 @@ namespace System.Management.Automation.Tracing WriteEvent(DebugMessageEvent, message); } - /// /// AbortingWorkflowExecution (EventId: 0xb038/45112) /// @@ -983,5 +983,4 @@ namespace System.Management.Automation.Tracing } // 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 2078ab07dd..710f50baaf 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 @@ namespace System.Management.Automation } } - diff --git a/src/libpsl-native/src/createhardlink.cpp b/src/libpsl-native/src/createhardlink.cpp index d3bd84685e..2d1f990458 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 b8e62ddcc2..c286934622 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 b0cc2e8152..299cfd2811 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 9755d8cc48..af6afe4099 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 22ea389a30..a652417e83 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 d40821d837..6f9252c85f 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 033160fae6..215130b3fe 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 fac7f5244f..27f034477f 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 b1fda7d9f0..89c54aa356 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 363210921b..17d456080f 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 6ef7ddb685..0bc168e2e7 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 ece2f5c358..b0092d19b0 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 84d5b6f4ae..c1863949a0 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 9a6c94e9e3..3ac3064836 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 52abf3e5dc..f436899a70 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 fe7a9437f4..4310bdc443 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 56de5d3f05..1443f3074c 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 7da83dccca..1d4578844d 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 12a3483ed7..51df25a07f 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 b44ab68fd5..a9fb263251 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 56d76a79bb..3534eac3b6 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 f849e29c2d..ed21b61bf6 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 8a04dec009..6c4283b51a 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 6a3c8b8e41..1b3dfd9030 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 c562f4c7e2..824da6fce7 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 46c9cfc9cd..7b7244f4b0 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 f147d7d801..a3b4a21eca 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 d573a8292b..939345eb03 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 56d3c6b1aa..dba95262a7 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 7f680470d9..12270e0e61 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 89b49ea5db..871f71f86f 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 65ce612daa..1c58dcb30e 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 e2bbe95bd4..ed694f16a5 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 1326298f42..e9461c715e 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 1cb75a72a4..1123dc5af6 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 fdf52b22b1..a89e902183 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 81e00fba23..c412379750 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 f5fcb5b742..c04a478525 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 0c3aecf46a..531282d585 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 1aa6677c2f..a7f5adf082 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 9e63e6e074..ce8143582b 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 7c3e3ade86..c2c8971826 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 cc6c126ea8..7fd518704f 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 1106484580..d0a1830ac0 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 15df49d742..130481d0e7 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 71b222fa4d..d2613007ce 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 0770003569..2323be806f 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 916795cb4d..97709ad558 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 ad0389a6a6..250cf515e5 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 9bb465e024..45569a6b58 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 bb9a3fbe52..37e488e76d 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 42f186b295..3b570c8b2d 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 9c1d676cbd..235220cf35 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 a1d10a0bee..22ea7be7d0 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 7488d192dd..a044defdff 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 c13675467f..ab1cf820ca 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 443ad23302..8378f3a685 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 d005e31488..741c0c5526 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 ca6d866c63..2b908cd909 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 3f4751276f..f3adf3ba16 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 24ab647113..a9f4a294ed 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 0ccfd40317..e86e7250f4 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 3c87c09507..756c20f7c0 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 68055227a7..0bddaeab98 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 9a2ab4ae4c..1abc92feb9 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 5bfbf0e6b9..30bc2f1a10 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 6001cc3f8b..e543db457a 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 33b79046a4..f212917e55 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 e73a4c8d70..e406b88650 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 421ce8275f..2f66ed10fd 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 d08620b732..ff2e82bf4d 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 55702b062c..d8bb368abe 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 52021a19af..63b4b583ed 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 5f65d70777..3692773571 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 ec8b2bf9c0..0d60b8838c 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 81d9d903a8..94c6cf2cc1 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 7ea1bb6d92..6cba4b4934 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 102074108f..a5d9350850 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 84033f7f03..7f6de26f54 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 74355bb6af..a55de1645c 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 c6105729be..8bb3430c07 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 edae970c29..8289ae858f 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 169e9803ae..6594c8a76e 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 bfc12fb27c..7029157cb0 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 faf7b2378a..1c73e6b602 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 7cfa8c5ce2..6306dddf95 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 e208c9cd75..d7a9ae34a4 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 4b8e4a2013..c5af7817c2 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 0604aeb104..532186898d 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 @@ namespace TestPSReadLine 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 edd2648731..1096d51587 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 a6baa1c179..45d4ed51ac 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 f1682e6001..82144630e3 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 @@ namespace PSTests.Parallel 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 04fd1259eb..08c6beb78b 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 340c648356..b01095bd71 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 ffc5bf825d..8bf6788384 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 ed0255950f..e474ff699a 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 80714e7d7e..81d9980e53 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 0407cbae6c..c9f0611240 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 @@ namespace PSTests.Parallel } } - [Fact] public void TestRunspaceWithPowerShellAndInitialSessionState() { diff --git a/test/csharp/test_SecuritySupport.cs b/test/csharp/test_SecuritySupport.cs index 040c90dcc4..8d82799dd6 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 452bfc188c..52281a29b7 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 ea9fc91506..2bd76217f8 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 06e61b8935..f624e3e413 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 5cb9927d30..e1a4a9baab 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 977da42dfe..4a944c2c63 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 44cc506951..09d0889afd 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 bb8fe6d6a9..5779f4e496 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 587867b2fb..1df44bd89d 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 739c4b85a0..aaa8202e8d 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 291dc1165c..171c3edefb 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 b199918dd7..d95717f81c 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 bf1eba54d0..ac8168a2f8 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 f54aefda07..52a0efb47a 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 d10e5a2ed4..c54964860c 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 4a6cb7053f..9813455286 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 b9655a8bcc..941998df8e 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 3274bf8094..e4fc11e4f5 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 258354c506..ccb6b5c17f 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 45162a1dcb..9cd054ea1b 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 c25cb49c5c..d28c898aa5 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 d37635616c..7d88e5ccb7 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 4c014092ec..69619df096 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 f16a39db1c..b62f45311c 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 13e71cc3bb..e2dfc8d928 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 b4120d072d..57c99f91e8 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 daf8fbb432..7e6c3d3af8 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 a15b57a4ce..71b4acc7b4 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 9cc0b6fccd..75a2f426a4 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 b8a609008f..fb1283287c 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 c3357854ac..06c78de8c0 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 effa2b742a..d847422be4 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 e132043838..907ebf18b7 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 25ffd6d05a..ca87e3b500 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 b394843077..40e4752091 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 3c8c0f12f7..3dc9be6c14 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 b546f34c42..5cade9d22e 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 2cd7b0ce1e..1284faaf16 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 288f3c45cc..20f041a3ba 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 7ec310f877..c894460dcc 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 b259b5b07c..7ae9e3564b 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 95b9eb2950..0edc62fda6 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 0cd3bbbb47..9737a09010 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 0b7d9a7f9e..d393a03ea8 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 8f270d79f3..217b440208 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 da0b7be068..3018088c16 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 e2f2a22c7e..2167560661 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 3edf8d8aae..bdb1938e48 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 7006cec930..d2d2013b78 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 04cc587302..93fdf966c7 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 f7e5b4dfc9..732d47a702 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 6abd496919..51c88a9c0c 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 268fffc138..163f94ad7a 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 53b0dfeca2..488de208b4 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 5d883b8548..d0c278646c 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 ff9398b078..1450708dfe 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 d2075145bb..fe40314b0e 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 595e7d660e..393639b33c 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 a1192217b0..47e08ee6e1 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 7f487ee718..de3b28082e 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 53b1fea953..ec11d8732d 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 c23fa88f60..44099722df 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 ba533cc39d..9a85a03560 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 c9ba850a16..3e4d1a46bb 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 b2dc681a6a..9ba3e4a272 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 2c7ec462b8..181b433bf1 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 984bd88521..a899630cb1 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 8fd95be9e6..e9a629be15 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 f3823b9356..5f3000073f 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 a333adb409..db49c9f207 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 f4aa0b5d99..93357815a4 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 1adeba8604..d301bc3a14 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 c70951e6b9..1c40c70108 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 e6e4d01e9a..68d0388df5 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 2fbf79f845..589597013f 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 192b2b273f..d4a25d04a7 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 e8dfdcaba2..3e54716545 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 0b85062626..ff315f5e52 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 4030372105..435ccea893 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 6d72b89642..ed6537102e 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 5d27a66fa7..fa82524fc6 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 db5a5a32c2..8fc59e40a6 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 c60063f17a..e109664856 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 0751cf9d86..b104ec8268 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 1b76c0d95b..4d496bb95e 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 d0027a1a30..2fb84285d3 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 483342b703..ba6b3be51b 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 a0ed821d9f..51289834d9 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 4ca7a747df..2900806507 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 29f5771406..d2e201d5b8 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 856992eca7..1898dd3bd5 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 444064559e..a7fc59fa04 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 b9b6d1e12a..aed53b3586 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 ea6088ef11..8344fb38cc 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 aad3d5c773..0ff2204904 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 836042a397..bf838df1e8 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 11b0e6f784..bea1baca67 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 e48f0473f8..d0765d7b84 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 9089a97d30..85178d0b34 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 7d1f24c93a..40077617bf 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 18dbc260e0..13ac15770a 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 0a07e9f940..843f4ed3de 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 a4479bd3fe..e78f3d968f 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 0de45d4cb1..74eb6200e5 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 1601287a65..64864a4cd9 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 445921971e..a0ea2f786b 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 302f17c890..4452da3b5b 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 62ec93be8b..2c313a053b 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 996088c517..3eb9fd66f2 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 e050af1c52..86d649a681 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 96316367ac..78924f8181 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 219e36c3e7..8bd2ee56bd 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 762ecc4048..e376153aec 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 b09c6eae3a..608e580d33 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 f514e1e45c..5aad92b50e 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 5979d64562..8b061fa034 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 e77b9bff23..20b956efc9 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 12f5f9a8f3..34abbc9639 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 537b3beef3..9aa3503ffc 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 93ef537a1f..e34271cc4b 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 0c940302a8..bcf6c2f1c1 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 6c21fffc48..b1c46df828 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 ceec9a084b..095d6466c9 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 6e0ec064c5..be7548a102 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 1b4cd9221a..afd99b6f00 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 99163036b0..c5c2beb16f 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 6dab82f532..bf4ae5981f 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 d35d25639e..1c20a8852c 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 eea6f06525..b8a709d051 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 d2981962d4..71cc6a5dc3 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 95db7dbf0c..824d25924f 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 1c64851191..65acb0c4c2 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 af4180fb52..9b0b6863e8 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 fab6e4ce6a..a88c8b1a64 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 95e4fd181c..6d48b39bda 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 c49d4a24d4..214bd3b42f 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 b4d3539b94..6ab94fe478 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 a3310c7ba7..646ccd10ab 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 1717da27e1..ba9dd490e1 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 86c96add0b..d8cda5d81e 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 b764afdbf9..212f18c409 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 e80671b7e3..25e655ba6e 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 4400605177..56081d9e84 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 a63295fde4..846ad828a7 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 6598ea0c38..68496bf064 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 be9e0965c0..dfc26ada21 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 e3f189a65d..a43caaa779 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 432441be97..9d28dc46fe 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 ba5f358392..1b3641e9fe 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 5b9136337c..b129fc5c3c 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 12fdd4676f..c0a38194c3 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 9f2aeb9395..547b7e68f0 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 9f4c7f5841..510c91fde9 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 38bb26c3ee..deb66de4b0 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 eb7c543055..fe76526a8a 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 2a1341b11d..1fd5e449e3 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 5b2a99e05c..c7cff63563 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 60701788de..af6bb488cc 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 debe15d28a..ff73e42cee 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 712310c8e5..f85e46e948 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 1014ee7b76..5d47512684 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 fbd7ff7982..b378d50eed 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 87de82a6a0..6d9231d444 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 aecbaf3e29..c4ba990084 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 953d5fd3d4..efa75bd89b 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 f2abc78aae..ae1da14c82 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 4dadbac234..c58e5cf4eb 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 fe48cbc407..9fe5fc0d02 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 53de520ee1..141e1f837f 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 54634705e0..18e075415e 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 e5f7d933de..5d9aac7222 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 04be98def0..5eae4c376e 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 64e01dc5d6..27836bb2e5 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 9f3e2154d0..fbe8be135e 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 a13c306788..403e8bb55f 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 3bbed5132f..456e189eea 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 11de104cbd..234108aa92 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 9d41fa95a3..dd1aaa77aa 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 eaa55227a9..092a40baa2 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 eabc644476..7cec247c7e 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 6d11e51e73..4f069c2205 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 b07c1cc9ec..df5cb2c142 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 cb8e693737..0294366cd6 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 2cf79380c3..8ea69c7814 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 d2fcbd26a5..e0c4d8383d 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 a09f66eaea..4cd16da9f3 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 0748bb61b5..11ad3091c4 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 7761cf4ac2..457074cde6 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 51bc86de14..0e7380cb69 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 c38a9b6643..3369500026 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 f11d7f9b88..6a6ab2d61a 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 40afe24a3f..fe7b1dca72 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 2b401fc7c6..eeb26f0f88 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 0076ce50e9..118326da91 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 5106eeb41c..6c87a75cc4 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 9c18379671..c111d721bf 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 509562adca..a5c0d82d10 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 af39ab06d3..66176a476c 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 11874b2189..b05d6ac3a2 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 821ea5a57e..c19b8976e8 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 a4b12df450..214c57f390 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 d03e9bb36b..5e08a78f16 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 c43b7d41dd..5757e3baef 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 964b95ebbe..00c43985ae 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 4714eb9537..06628db01d 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 d5d6df3a21..5dc58c47a7 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 9bcb4e9688..550d8911af 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 723360c105..703d2b4a0e 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 26db1fe49a..4f4f5a4957 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 55dbb02ef9..586a1dae9b 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 c9618be51e..064e71015c 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 38d68130e7..f1443f3444 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 7a812348f9..efc1f8d9ab 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 4166feeb92..4146a919ff 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 94a2f20d3c..2b72bb83cf 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 c8190f3b6f..35cd18884d 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 c62bd6a15f..db38f33b9e 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 49fd4d45c9..cf0bc73f09 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 8283479c7b..909363b7be 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 b55f2b8030..e63f7d6335 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 b9e83d924e..030534357e 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 ba7fde492e..c0ee88abe4 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 d18919f914..6791d790a1 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 71e06773eb..42895219e5 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 31391ba6f5..ec2f34ae3a 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 d24ff173c7..facd177f41 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 f68203c2de..ee6411ed86 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 a85575054a..9cab87f089 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 64b3468107..c5bf5edd2c 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 95b0fdfef6..d4925947de 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 b9bd916036..82a57e5312 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 46f32b84ac..38704ad782 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 825627852b..e29723bd52 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 e257fe89ce..a2d1fe1284 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 d4a4135706..53e2c66b2d 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 3defda9031..587a9ca251 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 3487db2d61..4ec75cfd81 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 2044dc01a1..ee10db3972 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 913cf57c7a..5b91a18ace 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 4cf4ecaa74..9a113970d1 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 642295d147..cd43e2c54a 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 130ac8b64d..17b85f019f 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 626ee055e6..304f68221e 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 5aca83dcb6..07f301a63d 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 7c7709eee0..825b168c65 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 9513a0846d..46454251eb 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 72c04a00a5..aaa6f60bab 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 d6ce401f2a..4564490c86 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 cb4c782d1d..21ecb6cbb3 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 c5950aa716..e3de326fea 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 d25630ff4c..a5bb84d2f1 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 e3fa2e97e5..dab857ca09 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 8fc0b98d74..875454e7fb 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 8ead15e5e7..e535f973cd 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 64410db8ef..c408bc14f0 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 63d255ac23..7032e0acba 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 df88082b08..b9109204b3 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 11bf4e4cec..670773072c 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 f53f4177c0..e2af8a3d85 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 28b726f7b6..8ceba23cfd 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 433684e21d..3e8f843c7d 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 3ce80a0dbd..a0bddee2da 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 b8441a8712..6bdde9c2a6 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 f1a6f920bf..7675ef8d2b 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 96b8913188..21a1466d5c 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 a66501ff97..97b56290a3 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 3d00127011..cfe3e63910 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 4fac1469d2..4a5fa6a281 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 d8507e9573..dab0d03c22 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 dbb14c2779..b32452cf39 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 83d0ad3c97..5d14185cd3 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 562a0c5015..ff4b864857 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 5f1bf4e5f3..beb014b3dd 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 1ddc40d5c2..9eef635039 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 912a8a552b..76e091fe8a 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 ee14efb97a..b4f8d95848 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 e3493397a0..14381b2f41 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 0303da96da..3a4713bb42 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 4f5840346c..eaa8397269 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 f37280a802..a4c4eaecb2 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 f31ee6855c..b004e64764 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 bd22747771..c2d332b3bf 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 e17dabc801..027373f630 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 a3f1fd8c5e..2aabc48ad6 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 25492465ad..32215a217a 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 e9449563a7..d64b4935fa 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 d6338dcd45..50e4e04f4f 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 25da1e0d1d..9619ebf5c0 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 082cecb1c2..0cbc8c5756 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 fd7f7393f0..09ae998846 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 b8202054a9..84c8a8e624 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 af71d73d6b..b6f1abad79 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 2b33e8f9ef..a39cba58d3 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 9040cafde6..300ebdec92 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 2f14eba077..9555e99ff0 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 00c86e807b..10931fc9e3 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 78080390cf..7868a25f8e 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 bf952ac2ca..5db70192ec 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 04ebb0b982..003d9ba262 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 9abb8717f4..61046788c9 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 cc83b7c37b..d7bf4709ff 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 af91d1f4bc..44e5694d37 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 9704df5f8e..de542d01ca 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 78434566ed..5e4e233498 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 3659e18301..0840bd451a 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 3612efb4c6..cfbc37ab62 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 d111d3a912..56db6f98cb 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 309f2c26af..8ab4836441 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 7a718852f5..cbd4d10f92 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 981b4ffceb..172ce82953 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 217197d728..87755ed0a0 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 e0d277a290..d6477f998c 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 8e2e0d5955..349139efd1 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 3998c527e4..83f2af544c 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 72efe1388d..5dc7794ef5 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 c267ca51a4..fb784a4390 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 439df6c230..ffa094722f 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 a48268f862..b72a98616b 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 0f38be9a5e..3f193728fc 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 eb0ac84654..72eb53a0f4 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 ade31fa71f..6dd7142d67 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 ce69ee44ed..6cbde262bd 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 1276906a40..1d823f35ab 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 744e0d1a3f..53df7081da 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 8c274b0e72..149a2f7a29 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 52544a3cad..863908fa93 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 2c76e1f0dc..eebbde9024 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 17e35879fb..3a165a47b6 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 47a572cd94..9795b2aa04 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 2aaf432e06..14a6e87587 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 18697e7f21..b2f02cff4f 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 ff78ef011a..88cf35be5e 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 d516803d6c..dd2a16f787 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 1b041d3e8c..2eaa9be66b 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 df2d2d6639..d538fd58ba 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 f0431b5649..4689904e67 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 2ba5ee9b3b..e7e849b06c 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 29737b2627..0f6c3367f8 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 e3f757f3b4..9bd8992c3d 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 d125ba0a82..ae242d3712 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 44845b3548..d03788a4d5 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 d386be36f0..d58bf385fc 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 7c01620721..99c4d798e2 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 67e4e49cee..a50245439d 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 3c8a2cdee3..c2154dc46d 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 bd3fd21eae..cbab044244 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 17ac9e6a21..0b970f245c 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 a275fec845..45e4db5b84 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 6343395e22..2296feccc5 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 d80cbb4017..9ac4577044 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 0199dab600..711bf72f16 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 b682235617..11d1268250 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 54aed0c665..95856f0e20 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 0b92431fd9..89fd1db07d 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 7822bd2300..8899fb7216 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 bd2ae5219f..40167a86d6 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 bb6c3d3c86..ea4276318d 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 @@ namespace mvc.Controllers 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 c75eff0b7e..a7172d1aac 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 1acbf56602..d272eecd8a 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 b715f5db6c..22cab21c79 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 310276bd15..2298c89254 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 b139a1a719..e093d396f2 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 59df91e0f6..24a3edb3bf 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 2a8a7a3e29..88c12d7ebd 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 3242e35326..a24b1895a1 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 c56c6e68c9..f94e539893 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.AspNetCore.Mvc; 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 faa7747a7a..ac5e14f26a 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.AspNetCore.Http.Extensions; 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 cfef8d1aaf..40bf06a2cc 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 04de81a727..e53f10f627 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 beab309b00..89e9e353fb 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 c15976beb7..4fd39034e3 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 3c4066e0ec..3a501f2367 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 e0706c9a37..74135b2f2c 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.AspNetCore.Server.Kestrel.Https; 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 1c2417a45c..9cf4844d57 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 e56c00ab7c..ab67f16e7f 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 12f6188e9a..6b3054846c 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 6a9409b45c..a72db5a358 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 ecb6a30a6e..b423a2a561 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 ed4d5ac37e..c8ed87b004 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 444832f09b..9090016aa7 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 49c929f7ec..fccf1a40f4 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 46dfff836f..dc96def14f 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 74b3762e79..5c5ff76131 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 5db03c7eb4..1ff7ba872c 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 3f54e2d610..25079028ed 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 11da58df02..db55a2d99a 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 8e7dd922b0..28716f0390 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 bb02231f2e..b5b2032772 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 2fdc90fed1..ba4eef8665 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 6cf637cb5b..32419153f6 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 e4a1e47f3f..ddbe1475e5 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 1f05c44f39..1869ac90f6 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 9e4795d970..9005dbdc4d 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\]'