From 2c217713046772b8dbbc81e3632f8838be325f29 Mon Sep 17 00:00:00 2001 From: James Truher Date: Wed, 15 Jan 2020 08:57:12 -0800 Subject: [PATCH 001/275] Use correct isError parameter with Write-Log when logging an error --- build.psm1 | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/build.psm1 b/build.psm1 index bdc98a191f6..349bc79cb2c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -314,7 +314,7 @@ function Start-PSBuild { } if ($Clean) { - Write-Log "Cleaning your working directory. You can also do it with 'git clean -fdX --exclude .vs/PowerShell/v16/Server/sqlite3'" + Write-Log -message "Cleaning your working directory. You can also do it with 'git clean -fdX --exclude .vs/PowerShell/v16/Server/sqlite3'" Push-Location $PSScriptRoot try { # Excluded sqlite3 folder is due to this Roslyn issue: https://github.com/dotnet/roslyn/issues/23060 @@ -408,7 +408,7 @@ Fix steps: # handle ResGen # Heuristic to run ResGen on the fresh machine if ($ResGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost/gen")) { - Write-Log "Run ResGen (generating C# bindings for resx files)" + Write-Log -message "Run ResGen (generating C# bindings for resx files)" Start-ResGen } @@ -416,7 +416,7 @@ Fix steps: # .inc file name must be different for Windows and Linux to allow build on Windows and WSL. $incFileName = "powershell_$($Options.Runtime).inc" if ($TypeGen -or -not (Test-Path "$PSScriptRoot/src/TypeCatalogGen/$incFileName")) { - Write-Log "Run TypeGen (generating CorePsTypeCatalog.cs)" + Write-Log -message "Run TypeGen (generating CorePsTypeCatalog.cs)" Start-TypeGen -IncFileName $incFileName } @@ -439,14 +439,14 @@ Fix steps: $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" } - Write-Log "Run dotnet $Arguments from $PWD" + Write-Log -message "Run dotnet $Arguments from $PWD" Start-NativeExecution { dotnet $Arguments } - Write-Log "PowerShell output: $($Options.Output)" + Write-Log -message "PowerShell output: $($Options.Output)" if ($CrossGen) { ## fxdependent package cannot be CrossGen'ed Start-CrossGen -PublishPath $publishPath -Runtime $script:Options.Runtime - Write-Log "pwsh.exe with ngen binaries is available at: $($Options.Output)" + Write-Log -message "pwsh.exe with ngen binaries is available at: $($Options.Output)" } } else { $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path @@ -457,14 +457,14 @@ Fix steps: $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" } - Write-Log "Run dotnet $Arguments from $PWD" + Write-Log -message "Run dotnet $Arguments from $PWD" Start-NativeExecution { dotnet $Arguments } - Write-Log "PowerShell output: $($Options.Output)" + Write-Log -message "PowerShell output: $($Options.Output)" try { Push-Location $globalToolSrcFolder $Arguments += "--output", $publishPath - Write-Log "Run dotnet $Arguments from $PWD to build global tool entry point" + Write-Log -message "Run dotnet $Arguments from $PWD to build global tool entry point" Start-NativeExecution { dotnet $Arguments } } finally { @@ -633,7 +633,7 @@ function Restore-PSPackage $ProjectDirs | ForEach-Object { $project = $_ - Write-Log "Run dotnet restore $project $RestoreArguments" + Write-Log -message "Run dotnet restore $project $RestoreArguments" $retryCount = 0 $maxTries = 5 while($retryCount -lt $maxTries) @@ -644,7 +644,7 @@ function Restore-PSPackage } catch { - Write-Log "Failed to restore $project, retrying..." + Write-Log -message "Failed to restore $project, retrying..." $retryCount++ if($retryCount -ge $maxTries) { @@ -653,7 +653,7 @@ function Restore-PSPackage continue } - Write-Log "Done restoring $project" + Write-Log -message "Done restoring $project" break } } @@ -668,7 +668,7 @@ function Restore-PSModuleToBuild $PublishPath ) - Write-Log "Restore PowerShell modules to $publishPath" + Write-Log -message "Restore PowerShell modules to $publishPath" $modulesDir = Join-Path -Path $publishPath -ChildPath "Modules" Copy-PSGalleryModules -Destination $modulesDir -CsProjPath "$PSScriptRoot\src\Modules\PSGalleryModules.csproj" @@ -1424,12 +1424,12 @@ function Show-PSPesterError throw 'Unknown Show-PSPester parameter set' } - Write-Log -Error ("Description: " + $description) - Write-Log -Error ("Name: " + $name) - Write-Log -Error "message:" - Write-Log -Error $message - Write-Log -Error "stack-trace:" - Write-Log -Error $StackTrace + Write-Log -isError -message ("Description: " + $description) + Write-Log -isError -message ("Name: " + $name) + Write-Log -isError -message "message:" + Write-Log -isError -message $message + Write-Log -isError -message "stack-trace:" + Write-Log -isError -message $StackTrace } @@ -1469,12 +1469,12 @@ function Test-XUnitTestResults $message = $failure.test.failure.message.'#cdata-section' $StackTrace = $failure.test.failure.'stack-trace'.'#cdata-section' - Write-Log -Error ("Description: " + $description) - Write-Log -Error ("Name: " + $name) - Write-Log -Error "message:" - Write-Log -Error $message - Write-Log -Error "stack-trace:" - Write-Log -Error $StackTrace + Write-Log -isError -message ("Description: " + $description) + Write-Log -isError -message ("Name: " + $name) + Write-Log -isError -message "message:" + Write-Log -isError -message $message + Write-Log -isError -message "stack-trace:" + Write-Log -isError -message $StackTrace } throw "$($failedTests.failed) tests failed" @@ -1510,7 +1510,7 @@ function Test-PSPesterResults $x = [xml](Get-Content -raw $testResultsFile) if ([int]$x.'test-results'.failures -gt 0) { - Write-Log -Error "TEST FAILURES" + Write-Log -isError -message "TEST FAILURES" # switch between methods, SelectNode is not available on dotnet core if ( "System.Xml.XmlDocumentXPathExtensions" -as [Type] ) { @@ -1535,7 +1535,7 @@ function Test-PSPesterResults } elseif ($ResultObject.FailedCount -gt 0) { - Write-Log -Error 'TEST FAILURES' + Write-Log -isError -message 'TEST FAILURES' $ResultObject.TestResult | Where-Object {$_.Passed -eq $false} | ForEach-Object { Show-PSPesterError -testFailureObject $_ @@ -1691,7 +1691,7 @@ function Start-PSBootstrap { [switch]$Force ) - Write-Log "Installing PowerShell build dependencies" + Write-Log -message "Installing PowerShell build dependencies" Push-Location $PSScriptRoot/tools @@ -1835,20 +1835,20 @@ function Start-PSBootstrap { if(!$dotNetExists -or $dotNetVersion -ne $dotnetCLIRequiredVersion -or $Force.IsPresent) { if($Force.IsPresent) { - Write-Log "Installing dotnet due to -Force." + Write-Log -message "Installing dotnet due to -Force." } elseif(!$dotNetExists) { - Write-Log "dotnet not present. Installing dotnet." + Write-Log -message "dotnet not present. Installing dotnet." } else { - Write-Log "dotnet out of date ($dotNetVersion). Updating dotnet." + Write-Log -message "dotnet out of date ($dotNetVersion). Updating dotnet." } $DotnetArguments = @{ Channel=$Channel; Version=$Version; NoSudo=$NoSudo } Install-Dotnet @DotnetArguments } else { - Write-Log "dotnet is already installed. Skipping installation." + Write-Log -message "dotnet is already installed. Skipping installation." } # Install Windows dependencies if `-Package` or `-BuildWindowsNative` is specified @@ -1856,7 +1856,7 @@ function Start-PSBootstrap { ## The VSCode build task requires 'pwsh.exe' to be found in Path if (-not (Get-Command -Name pwsh.exe -CommandType Application -ErrorAction Ignore)) { - Write-Log "pwsh.exe not found. Install latest PowerShell release and add it to Path" + Write-Log -message "pwsh.exe not found. Install latest PowerShell release and add it to Path" $psInstallFile = [System.IO.Path]::Combine($PSScriptRoot, "tools", "install-powershell.ps1") & $psInstallFile -AddToPath } @@ -2410,7 +2410,7 @@ function Copy-PSGalleryModules foreach ($m in $psGalleryProj.Project.ItemGroup.PackageReference) { $name = $m.Include $version = $m.Version - Write-Log "Name='$Name', Version='$version', Destination='$Destination'" + Write-Log -message "Name='$Name', Version='$version', Destination='$Destination'" # Remove the build revision from the src (nuget drops it). $srcVer = if ($version -match "(\d+.\d+.\d+).0") { @@ -3105,7 +3105,7 @@ function New-TestPackage else { $null = New-Item -Path $Destination -ItemType Directory -Force - Write-Verbose -Message "Creating destination folder: $Destination" + Write-Verbose -message "Creating destination folder: $Destination" } $rootFolder = $env:TEMP @@ -3126,12 +3126,12 @@ function New-TestPackage $null = Publish-PSTestTools -runtime $Runtime $powerShellTestRoot = Join-Path $PSScriptRoot 'test' Copy-Item $powerShellTestRoot -Recurse -Destination $packageRoot -Force - Write-Verbose -Message "Copied test directory" + Write-Verbose -message "Copied test directory" # Copy assests folder to package root for wix related tests. $assetsPath = Join-Path $PSScriptRoot 'assets' Copy-Item $assetsPath -Recurse -Destination $packageRoot -Force - Write-Verbose -Message "Copied assests directory" + Write-Verbose -message "Copied assests directory" # Create expected folder structure for resx files in package root. $srcRootForResx = New-Item -Path "$packageRoot/src" -Force -ItemType Directory @@ -3147,7 +3147,7 @@ function New-TestPackage $assemblyPart = $assemblyPart.TrimStart([io.path]::DirectorySeparatorChar) $resxDestPath = Join-Path $srcRootForResx $assemblyPart $null = New-Item -Path $resxDestPath -Force -ItemType Directory - Write-Verbose -Message "Created resx directory : $resxDestPath" + Write-Verbose -message "Created resx directory : $resxDestPath" Copy-Item -Path "$directoryFullName\*" -Recurse $resxDestPath -Force } From a5a97a593984a8f4ace4cbc19d11429170859503 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Wed, 5 Feb 2020 15:27:57 -0800 Subject: [PATCH 002/275] Fix `Invoke-Command` missing error on session termination. (#11586) --- .../engine/remoting/client/Job.cs | 14 ++++++++++- test/powershell/engine/Job/Jobs.Tests.ps1 | 24 ++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 6ff1f9953e1..0cf3977f40a 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -3382,8 +3382,11 @@ protected void ProcessJobFailure(ExecutionCmdletHelper helper, out Exception fai fullyQualifiedErrorId, ErrorCategory.OpenError, null, null, null, null, null, errorDetails, null); } - else if (pipeline.PipelineStateInfo.State == PipelineState.Failed) + else if ((pipeline.PipelineStateInfo.State == PipelineState.Failed) || + ((pipeline.PipelineStateInfo.State == PipelineState.Stopped) && + (pipeline.PipelineStateInfo.Reason != null && !(pipeline.PipelineStateInfo.Reason is PipelineStoppedException)))) { + // Pipeline stopped state is also an error condition if the associated exception is not 'PipelineStoppedException'. object targetObject = runspace.ConnectionInfo.ComputerName; failureException = pipeline.PipelineStateInfo.Reason; if (failureException != null) @@ -3394,6 +3397,15 @@ protected void ProcessJobFailure(ExecutionCmdletHelper helper, out Exception fai if (rException != null) { errorRecord = rException.ErrorRecord; + + // A RemoteException will hide a PipelineStoppedException, which should be ignored. + if (errorRecord != null && + errorRecord.FullyQualifiedErrorId.Equals("PipelineStopped", StringComparison.OrdinalIgnoreCase)) + { + // PipelineStoppedException should not be reported as error. + failureException = null; + return; + } } else { diff --git a/test/powershell/engine/Job/Jobs.Tests.ps1 b/test/powershell/engine/Job/Jobs.Tests.ps1 index df7363b5cd3..52e1f545386 100644 --- a/test/powershell/engine/Job/Jobs.Tests.ps1 +++ b/test/powershell/engine/Job/Jobs.Tests.ps1 @@ -311,8 +311,24 @@ Describe 'Basic Job Tests' -Tags 'Feature' { @{ property = 'InstanceId'} @{ property = 'State'} ) - # '-Seconds 100' is chosen to be substantially large, so that the job is in running state when Stop-Job is called. - $jobToStop = Start-Job -ScriptBlock { Start-Sleep -Seconds 100 } -Name 'JobToStop' + } + + BeforeEach { + # 20 seconds is chosen to be large, so that the job is in running state when Stop-Job is called. + $jobToStop = Start-Job -ScriptBlock { + 1..80 | ForEach-Object { + Write-Output $_ + Start-Sleep -Milliseconds 250 + } + } -Name 'JobToStop' + # Wait until the job is actually running and executing the script + do { + $data = Receive-Job -Job $jobToStop + } while (($data.Count -eq 0) -and ($jobToStop.State -eq 'Running')) + } + + AfterEach { + Remove-Job $jobToStop -Force -ErrorAction SilentlyContinue } It 'Can Stop-Job with ' -TestCases $stopJobTestCases { @@ -321,9 +337,5 @@ Describe 'Basic Job Tests' -Tags 'Feature' { Stop-Job @splat ValidateJobInfo -job $jobToStop -state 'Stopped' -hasMoreData $false } - - AfterAll { - Remove-Job $jobToStop -Force -ErrorAction SilentlyContinue - } } } From e2f838e3c5baabffc4d14fa747902d18628044bc Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 5 Feb 2020 23:49:34 +0000 Subject: [PATCH 003/275] Update changelog generation script (#11736) # PR Summary * Fix regression from #11652 * Fix [MD022](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md032---lists-should-be-surrounded-by-blank-lines) / [MD032](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md032---lists-should-be-surrounded-by-blank-lines) rule violations * Modify `Get-ChangeLog` to generate the changelog according to the format from #11652. ## PR Context Follow-up to #11652 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- CHANGELOG/6.2.md | 3 ++- tools/releaseTools.psm1 | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG/6.2.md b/CHANGELOG/6.2.md index 2aca4fc7475..74a33e3c311 100644 --- a/CHANGELOG/6.2.md +++ b/CHANGELOG/6.2.md @@ -1,6 +1,6 @@ # 6.2 Changelog -## v6.2.4 - 01/27/2020 +## [6.2.4] - 2020-01-27 ### General Cmdlet Updates and Fixes @@ -794,6 +794,7 @@ - Update `CONTRIBUTION.md` about adding an empty line after the copyright header (#7706) (Thanks @iSazonov!) - Update docs about .NET Core version `2.0` to be about version `2.x` (#7467) (Thanks @bergmeister!) +[6.2.4]: https://github.com/PowerShell/PowerShell/compare/v6.2.3...v6.2.4 [6.2.3]: https://github.com/PowerShell/PowerShell/compare/v6.2.2...v6.2.3 [6.2.2]: https://github.com/PowerShell/PowerShell/compare/v6.2.1...v6.2.2 [6.2.1]: https://github.com/PowerShell/PowerShell/compare/v6.2.0...v6.2.1 diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index 1e7f68710e9..0366c71227d 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -137,9 +137,12 @@ function New-CommitNode function Get-ChangeLog { param( - [Parameter(Mandatory)] + [Parameter(Mandatory = $true)] [string]$LastReleaseTag, + [Parameter(Mandatory = $true)] + [string]$ThisReleaseTag, + [Parameter(Mandatory)] [string]$Token, @@ -328,6 +331,12 @@ function Get-ChangeLog throw "Some PRs are tagged multiple times or have no tags." } + # Write output + + $version = $ThisReleaseTag.TrimStart('v') + + Write-Output "## [${version}] - $(Get-Date -Format yyyy-MM-dd)`n" + PrintChangeLog -clSection $clUntagged -sectionTitle 'UNTAGGED - Please classify' PrintChangeLog -clSection $clBreakingChange -sectionTitle 'Breaking Changes' PrintChangeLog -clSection $clEngine -sectionTitle 'Engine Updates and Fixes' @@ -339,11 +348,13 @@ function Get-ChangeLog PrintChangeLog -clSection $clTest -sectionTitle 'Tests' PrintChangeLog -clSection $clBuildPackage -sectionTitle 'Build and Packaging Improvements' PrintChangeLog -clSection $clDocs -sectionTitle 'Documentation and Help Content' + + Write-Output "[${version}]: https://github.com/PowerShell/PowerShell/compare/${$LastReleaseTag}...${ThisReleaseTag}`n" } function PrintChangeLog($clSection, $sectionTitle) { if ($clSection.Count -gt 0) { - "### $sectionTitle" + "### $sectionTitle`n" $clSection | ForEach-Object -MemberName ChangeLogMessage "" } From 60387f1ad3a4560647bdcc848345b9a81ab319d3 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 7 Feb 2020 01:49:45 +0500 Subject: [PATCH 004/275] Use `Dictionary.TryAdd()` where possible (#11767) --- .../GetCounterCommand.cs | 5 +---- .../host/msh/ConsoleHostUserInterfacePromptForChoice.cs | 5 +---- .../common/Utilities/MshParameterAssociation.cs | 3 +-- .../engine/ComInterop/ComTypeDesc.cs | 5 +---- .../engine/hostifaces/InternalHostUserInterface.cs | 5 +---- .../engine/runtime/ScriptBlockToPowerShell.cs | 5 +---- src/System.Management.Automation/security/CatalogHelper.cs | 3 +-- 7 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index 5cd197d1cce..cb0eacff8e8 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -391,10 +391,7 @@ private void ProcessListSetPerMachine(string machine) Dictionary counterInstanceMapping = new Dictionary(); foreach (string counter in counterSetCounters) { - if (!counterInstanceMapping.ContainsKey(counter)) - { - counterInstanceMapping.Add(counter, instanceArray); - } + counterInstanceMapping.TryAdd(counter, instanceArray); } PerformanceCounterCategoryType categoryType = PerformanceCounterCategoryType.Unknown; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs index 660877be1e1..44264828fc1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs @@ -199,10 +199,7 @@ public Collection PromptForChoice(string caption, defaultChoice); } - if (!defaultChoiceKeys.ContainsKey(defaultChoice)) - { - defaultChoiceKeys.Add(defaultChoice, true); - } + defaultChoiceKeys.TryAdd(defaultChoice, true); } } diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs index 7a04c4537cb..9d0c5d18028 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs @@ -159,9 +159,8 @@ internal static List ExpandAll(PSObje List retVal = new List(); foreach (string property in displayedProperties) { - if (!duplicatesFinder.ContainsKey(property)) + if (duplicatesFinder.TryAdd(property, null)) { - duplicatesFinder.Add(property, null); PSPropertyExpression expr = new PSPropertyExpression(property, true); retVal.Add(new MshResolvedExpressionParameterAssociation(null, expr)); } diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs index 474efd75881..c10df104cd9 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs @@ -192,10 +192,7 @@ internal string[] GetMemberNames(bool dataOnly) { foreach (string name in Events.Keys) { - if (!names.ContainsKey(name)) - { - names.Add(name, null); - } + names.TryAdd(name, null); } } } diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index 366a76902c5..c37b85260f5 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -921,10 +921,7 @@ private Collection EmulatePromptForMultipleChoice(string caption, defaultChoice); } - if (!defaultChoiceKeys.ContainsKey(defaultChoice)) - { - defaultChoiceKeys.Add(defaultChoice, true); - } + defaultChoiceKeys.TryAdd(defaultChoice, true); } } diff --git a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs index 0b2dae82d1e..9a41f13d0fd 100644 --- a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs +++ b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs @@ -409,10 +409,7 @@ private static Tuple, object[]> GetUsingValues(Ast bo // Collect UsingExpression value as a dictionary string usingAstKey = PsUtils.GetUsingExpressionKey(usingAst); - if (!usingValueMap.ContainsKey(usingAstKey)) - { - usingValueMap.Add(usingAstKey, value); - } + usingValueMap.TryAdd(usingAstKey, value); } } catch (RuntimeException rte) diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index 1ed0a8ef148..acd0711d236 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -631,9 +631,8 @@ internal static void ProcessPathFile(FileInfo fileToHash, DirectoryInfo dirInfo, fileHash = CalculateFileHash(fileToHash.FullName, hashAlgorithm); } - if (!fileHashes.ContainsKey(relativePath)) + if (fileHashes.TryAdd(relativePath, fileHash)) { - fileHashes.Add(relativePath, fileHash); _cmdlet.WriteVerbose(StringUtil.Format(CatalogStrings.FoundFileInPath, relativePath, fileHash)); } else From 69bf7043c0c7471679265778e12053c1c40b0000 Mon Sep 17 00:00:00 2001 From: mikeTWC1984 <31977106+mikeTWC1984@users.noreply.github.com> Date: Thu, 6 Feb 2020 18:38:17 -0500 Subject: [PATCH 005/275] Update `CmsCommands` to use Store vs cert provider (#11643) --- .../Microsoft.PowerShell.Security.psd1 | 2 +- .../security/SecuritySupport.cs | 260 ++++++------------ .../CmsMessage2.Tests.ps1 | 177 ++++++++++++ .../engine/Basic/DefaultCommands.Tests.ps1 | 6 +- 4 files changed, 262 insertions(+), 183 deletions(-) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 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 d5961d1008d..c287a6cef3c 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -7,7 +7,7 @@ ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() -CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" +CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" , "Protect-CmsMessage", "Unprotect-CmsMessage", "Get-CmsMessage" AliasesToExport = @() NestedModules="Microsoft.PowerShell.Security.dll" HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113533' diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index ee1058be350..b7b08491e5f 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -142,15 +142,20 @@ internal static void SetExecutionPolicy(ExecutionPolicyScope scope, ExecutionPol switch (policy) { case ExecutionPolicy.Restricted: - executionPolicy = "Restricted"; break; + executionPolicy = "Restricted"; + break; case ExecutionPolicy.AllSigned: - executionPolicy = "AllSigned"; break; + executionPolicy = "AllSigned"; + break; case ExecutionPolicy.RemoteSigned: - executionPolicy = "RemoteSigned"; break; + executionPolicy = "RemoteSigned"; + break; case ExecutionPolicy.Unrestricted: - executionPolicy = "Unrestricted"; break; + executionPolicy = "Unrestricted"; + break; case ExecutionPolicy.Bypass: - executionPolicy = "Bypass"; break; + executionPolicy = "Bypass"; + break; } // Set the execution policy @@ -359,12 +364,18 @@ internal static string GetExecutionPolicy(ExecutionPolicy policy) { switch (policy) { - case ExecutionPolicy.Bypass: return "Bypass"; - case ExecutionPolicy.Unrestricted: return "Unrestricted"; - case ExecutionPolicy.RemoteSigned: return "RemoteSigned"; - case ExecutionPolicy.AllSigned: return "AllSigned"; - case ExecutionPolicy.Restricted: return "Restricted"; - default: return "Restricted"; + case ExecutionPolicy.Bypass: + return "Bypass"; + case ExecutionPolicy.Unrestricted: + return "Unrestricted"; + case ExecutionPolicy.RemoteSigned: + return "RemoteSigned"; + case ExecutionPolicy.AllSigned: + return "AllSigned"; + case ExecutionPolicy.Restricted: + return "Restricted"; + default: + return "Restricted"; } } @@ -595,7 +606,7 @@ internal static void CheckIfFileExists(string filePath) /// True on success, false otherwise. internal static bool CertIsGoodForSigning(X509Certificate2 c) { - if (!CertHasPrivatekey(c)) + if (!c.HasPrivateKey) { return false; } @@ -620,16 +631,20 @@ internal static bool CertIsGoodForEncryption(X509Certificate2 c) private static bool CertHasOid(X509Certificate2 c, string oid) { - Collection ekus = GetCertEKU(c); - - foreach (string testOid in ekus) + foreach (var extension in c.Extensions) { - if (testOid == oid) + if (extension is X509EnhancedKeyUsageExtension ext) { - return true; + foreach (Oid ekuOid in ext.EnhancedKeyUsages) + { + if (ekuOid.Value == oid) + { + return true; + } + } + break; } } - return false; } @@ -644,82 +659,12 @@ private static bool CertHasKeyUsage(X509Certificate2 c, X509KeyUsageFlags keyUsa { return true; } - break; } } - return false; } - /// - /// Check if the specified cert has a private key in it. - /// - /// Certificate object. - /// True on success, false otherwise. - internal static bool CertHasPrivatekey(X509Certificate2 cert) - { - return cert.HasPrivateKey; - } - - /// - /// Get the EKUs of a cert. - /// - /// Certificate object. - /// A collection of cert eku strings. - [ArchitectureSensitive] - internal static Collection GetCertEKU(X509Certificate2 cert) - { - Collection ekus = new Collection(); - IntPtr pCert = cert.Handle; - int structSize = 0; - IntPtr dummy = IntPtr.Zero; - - if (Security.NativeMethods.CertGetEnhancedKeyUsage(pCert, 0, dummy, - out structSize)) - { - if (structSize > 0) - { - IntPtr ekuBuffer = Marshal.AllocHGlobal(structSize); - - try - { - if (Security.NativeMethods.CertGetEnhancedKeyUsage(pCert, 0, - ekuBuffer, - out structSize)) - { - Security.NativeMethods.CERT_ENHKEY_USAGE ekuStruct = - (Security.NativeMethods.CERT_ENHKEY_USAGE) - Marshal.PtrToStructure(ekuBuffer); - IntPtr ep = ekuStruct.rgpszUsageIdentifier; - IntPtr ekuptr; - - for (int i = 0; i < ekuStruct.cUsageIdentifier; i++) - { - ekuptr = Marshal.ReadIntPtr(ep, i * Marshal.SizeOf(ep)); - string eku = Marshal.PtrToStringAnsi(ekuptr); - ekus.Add(eku); - } - } - else - { - throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); - } - } - finally - { - Marshal.FreeHGlobal(ekuBuffer); - } - } - } - else - { - throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); - } - - return ekus; - } - /// /// Convert an int to a DWORD. /// @@ -1138,8 +1083,10 @@ public void Resolve(SessionState sessionState, ResolutionPurpose purpose, out Er // Process the certificate if that was supplied exactly if (_pendingCertificate != null) { - ProcessResolvedCertificates(purpose, - new List { _pendingCertificate }, out error); + ProcessResolvedCertificates( + purpose, + new X509Certificate2Collection(_pendingCertificate), + out error); if ((error != null) || (Certificates.Count != 0)) { return; @@ -1162,15 +1109,8 @@ public void Resolve(SessionState sessionState, ResolutionPurpose purpose, out Er return; } - // Then by thumbprint - ResolveFromThumbprint(sessionState, purpose, out error); - if ((error != null) || (Certificates.Count != 0)) - { - return; - } - - // Then by Subject Name - ResolveFromSubjectName(sessionState, purpose, out error); + // Then by cert store + ResolveFromStoreById(purpose, out error); if ((error != null) || (Certificates.Count != 0)) { return; @@ -1215,7 +1155,7 @@ private void ResolveFromBase64Encoding(ResolutionPurpose purpose, out ErrorRecor return; } - List certificatesToProcess = new List(); + var certificatesToProcess = new X509Certificate2Collection(); try { X509Certificate2 newCertificate = new X509Certificate2(messageBytes); @@ -1289,7 +1229,7 @@ private void ResolveFromPath(SessionState sessionState, ResolutionPurpose purpos resolvedPaths.Remove(path); } - List certificatesToProcess = new List(); + var certificatesToProcess = new X509Certificate2Collection(); foreach (string path in resolvedPaths) { X509Certificate2 certificate = null; @@ -1311,99 +1251,51 @@ private void ResolveFromPath(SessionState sessionState, ResolutionPurpose purpos } } - private void ResolveFromThumbprint(SessionState sessionState, ResolutionPurpose purpose, out ErrorRecord error) + private void ResolveFromStoreById(ResolutionPurpose purpose, out ErrorRecord error) { - // Quickly check that this is a thumbprint-like pattern (just hex) - if (!System.Text.RegularExpressions.Regex.IsMatch(_identifier, "^[a-f0-9]+$", Text.RegularExpressions.RegexOptions.IgnoreCase)) - { - error = null; - return; - } - - Collection certificates = new Collection(); + error = null; + WildcardPattern subjectNamePattern = WildcardPattern.Get(_identifier, WildcardOptions.IgnoreCase); try { - // Get first from 'My' store - string certificatePath = sessionState.Path.Combine("Microsoft.PowerShell.Security\\Certificate::CurrentUser\\My", _identifier); - if (sessionState.InvokeProvider.Item.Exists(certificatePath)) - { - foreach (PSObject certificateObject in sessionState.InvokeProvider.Item.Get(certificatePath)) - { - certificates.Add(certificateObject); - } - } + var certificatesToProcess = new X509Certificate2Collection(); - // Second from 'LocalMachine' store - certificatePath = sessionState.Path.Combine("Microsoft.PowerShell.Security\\Certificate::LocalMachine\\My", _identifier); - if (sessionState.InvokeProvider.Item.Exists(certificatePath)) + using (var storeCU = new X509Store("my", StoreLocation.CurrentUser)) { - foreach (PSObject certificateObject in sessionState.InvokeProvider.Item.Get(certificatePath)) + storeCU.Open(OpenFlags.ReadOnly); + X509Certificate2Collection storeCerts = storeCU.Certificates; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - certificates.Add(certificateObject); + using (var storeLM = new X509Store("my", StoreLocation.LocalMachine)) + { + storeLM.Open(OpenFlags.ReadOnly); + storeCerts.AddRange(storeLM.Certificates); + } } - } - } - catch (SessionStateException) - { - // If we got an ItemNotFound / etc., then this didn't represent a valid path. - } - List certificatesToProcess = new List(); - foreach (PSObject certificateObject in certificates) - { - X509Certificate2 certificate = certificateObject.BaseObject as X509Certificate2; - if (certificate != null) - { - certificatesToProcess.Add(certificate); - } - } - - ProcessResolvedCertificates(purpose, certificatesToProcess, out error); - } - - private void ResolveFromSubjectName(SessionState sessionState, ResolutionPurpose purpose, out ErrorRecord error) - { - Collection certificates = new Collection(); - WildcardPattern subjectNamePattern = WildcardPattern.Get(_identifier, WildcardOptions.IgnoreCase); - - try - { - // Get first from 'My' store, then 'LocalMachine' - string[] certificatePaths = new string[] { - "Microsoft.PowerShell.Security\\Certificate::CurrentUser\\My", - "Microsoft.PowerShell.Security\\Certificate::LocalMachine\\My" }; + certificatesToProcess.AddRange(storeCerts.Find(X509FindType.FindByThumbprint, _identifier, validOnly: false)); - foreach (string certificatePath in certificatePaths) - { - foreach (PSObject certificateObject in sessionState.InvokeProvider.ChildItem.Get(certificatePath, false)) + if (certificatesToProcess.Count == 0) { - if (subjectNamePattern.IsMatch(certificateObject.Properties["Subject"].Value.ToString())) + foreach (var cert in storeCerts) { - certificates.Add(certificateObject); + if (subjectNamePattern.IsMatch(cert.Subject) || subjectNamePattern.IsMatch(cert.GetNameInfo(X509NameType.SimpleName, forIssuer: false))) + { + certificatesToProcess.Add(cert); + } } } + + ProcessResolvedCertificates(purpose, certificatesToProcess, out error); } } catch (SessionStateException) { - // If we got an ItemNotFound / etc., then this didn't represent a valid path. } - - List certificatesToProcess = new List(); - foreach (PSObject certificateObject in certificates) - { - X509Certificate2 certificate = certificateObject.BaseObject as X509Certificate2; - if (certificate != null) - { - certificatesToProcess.Add(certificate); - } - } - - ProcessResolvedCertificates(purpose, certificatesToProcess, out error); } - private void ProcessResolvedCertificates(ResolutionPurpose purpose, List certificatesToProcess, out ErrorRecord error) + private void ProcessResolvedCertificates(ResolutionPurpose purpose, X509Certificate2Collection certificatesToProcess, out ErrorRecord error) { error = null; HashSet processedThumbprints = new HashSet(); @@ -1418,9 +1310,14 @@ private void ProcessResolvedCertificates(ResolutionPurpose purpose, List Date: Fri, 7 Feb 2020 12:03:16 -0800 Subject: [PATCH 006/275] Fix `NativeDllHandler` to not throw when file is not found (#11787) # PR Summary Fix `NativeDllHandler` to not throw when file is not found. Today, the `NativeDllHandler` calls `NativeLibrary.Load(fullName)` even if the file doesn't exist. This is not right, it should return `IntPtr.Zero` to let the runtime try the next resolution approach, if there is one. Also, this behavior results in the exception message to be `Unable to load DLL 'F:\win-x64\nativedll.dll' or one of its dependencies: The specified module could not be found`, which is confusing because there was never an explicit loading of a dll with that path. The real exception generated from runtime should be `Unable to load DLL 'nativedll' or one of its dependencies: The specified module could not be found.` ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../CoreCLR/CorePsAssemblyLoadContext.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index c034d355559..ed5719b13b7 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -235,11 +235,11 @@ internal IEnumerable GetAssembly(string namespaceQualifiedTypeName) /// internal static IntPtr NativeDllHandler(Assembly assembly, string libraryName) { - var folder = Path.GetDirectoryName(assembly.Location); s_nativeDllSubFolder ??= GetNativeDllSubFolderName(out s_nativeDllExtension); - var fullName = Path.Combine(folder, s_nativeDllSubFolder, libraryName) + s_nativeDllExtension; + string folder = Path.GetDirectoryName(assembly.Location); + string fullName = Path.Combine(folder, s_nativeDllSubFolder, libraryName) + s_nativeDllExtension; - return NativeLibrary.Load(fullName); + return NativeLibrary.TryLoad(fullName, out IntPtr pointer) ? pointer : IntPtr.Zero; } #endregion Internal_Methods From f6a897331702a8f11f7447d3a77b46fd21286a5d Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Feb 2020 20:09:52 +0000 Subject: [PATCH 007/275] Specifiy csharp_preferred_modifier_order in EditorConfig (#11775) --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index ab87f961068..a00fd02dd66 100644 --- a/.editorconfig +++ b/.editorconfig @@ -48,6 +48,9 @@ indent_size = 2 # Sort using and Import directives with System.* appearing first dotnet_sort_system_directives_first = true +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion + # Avoid "this." and "Me." if not necessary dotnet_style_qualification_for_field = false:suggestion dotnet_style_qualification_for_property = false:suggestion From 4db018762fa5e767580008de1d5ff61717c7250a Mon Sep 17 00:00:00 2001 From: Bruce Payette <50499275+bpayette@users.noreply.github.com> Date: Mon, 10 Feb 2020 13:22:21 -0800 Subject: [PATCH 008/275] Add information about how Amazon AWS uses PowerShell. (#11365) --- ADOPTERS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ADOPTERS.md b/ADOPTERS.md index 56ea9850a7d..ba8b569b859 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -25,5 +25,8 @@ This is a list of adopters of using PowerShell in production or in their product Enable non-admins like help desk and tier 1 support teams to execute secure web based tools on any platform `without admin rights`. Configure flexible RBAC permissions from an intuitive interface, without a complex learning curve. Script output along with all actions are audited. Manage up to 5,000 nodes for free with the [Community Edition](https://systemfrontier.com/solutions/community-edition/). +* [Amazon AWS](https://aws.com) supports PowerShell in a wide variety of its products including [AWS tools for PowerShell](https://github.com/aws/aws-tools-for-powershell), + [AWS Lambda Support For PowerShell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) and [AWS PowerShell Tools for `CodeBuild`](https://docs.aws.amazon.com/powershell/latest/reference/items/CodeBuild_cmdlets.html) + as well as supporting PowerShell Core in both Windows and Linux EC2 Images. * [Azure Resource Manager Deployment Scripts](https://docs.microsoft.com/azure/azure-resource-manager/templates/deployment-script-template) Complete the "last mile" of your Azure Resource Manager (ARM) template deployments with a Deployment Script, which enables you to run an arbitrary PowerShell script in the context of a deployment. Designed to let you complete tasks that should be part of a deployment, but are not possible in an ARM template today — for example, creating a Key Vault certificate or querying an external API for a new CIDR block. From 35c7b7842e7e206f8a6ccc2ab7077a49ad9e7fa6 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 10 Feb 2020 13:24:50 -0800 Subject: [PATCH 009/275] Fix how COM objects are enumerated (#11795) --- .../engine/COM/ComUtil.cs | 36 +------------------ .../engine/runtime/Operations/MiscOps.cs | 23 ++++++++---- .../powershell/engine/COM/COM.Basic.Tests.ps1 | 7 ++++ 3 files changed, 25 insertions(+), 41 deletions(-) diff --git a/src/System.Management.Automation/engine/COM/ComUtil.cs b/src/System.Management.Automation/engine/COM/ComUtil.cs index 44e307a69b5..a1fa5a0125a 100644 --- a/src/System.Management.Automation/engine/COM/ComUtil.cs +++ b/src/System.Management.Automation/engine/COM/ComUtil.cs @@ -411,41 +411,7 @@ internal static ComEnumerator Create(object comObject) // The passed-in COM object could already be a IEnumVARIANT interface. // e.g. user call '_NewEnum()' on a COM collection interface. var enumVariant = comObject as COM.IEnumVARIANT; - if (enumVariant != null) - { - return new ComEnumerator(enumVariant); - } - - // The passed-in COM object could be a collection. - var enumerable = comObject as IEnumerable; - var target = comObject as IDispatch; - if (enumerable != null && target != null) - { - try - { - var comTypeInfo = ComTypeInfo.GetDispatchTypeInfo(comObject); - if (comTypeInfo != null && comTypeInfo.NewEnumInvokeKind.HasValue) - { - // The COM object is a collection and also a IDispatch interface, so we try to get a - // IEnumVARIANT interface out of it by invoking its '_NewEnum (DispId: -4)' function. - var result = ComInvoker.Invoke(target, ComTypeInfo.DISPID_NEWENUM, - args: Array.Empty(), byRef: null, - invokeKind: comTypeInfo.NewEnumInvokeKind.Value); - enumVariant = result as COM.IEnumVARIANT; - if (enumVariant != null) - { - return new ComEnumerator(enumVariant); - } - } - } - catch (Exception) - { - // Ignore exceptions. In case of exception, no enumerator can be created - // for the passed-in COM object, and we will return null eventually. - } - } - - return null; + return enumVariant != null ? new ComEnumerator(enumVariant) : null; } } } diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 8466c6b1794..98b2cb74ccd 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -3291,17 +3291,28 @@ internal object GetNonEnumerableObject() internal static IEnumerator GetCOMEnumerator(object obj) { object targetValue = PSObject.Base(obj); + try + { + var enumerator = (targetValue as IEnumerable)?.GetEnumerator(); + if (enumerator != null) + { + return enumerator; + } + } + catch (Exception) + { + } // We use ComEnumerator to enumerate COM collections because the following code doesn't work in .NET Core - // IEnumerable enumerable = targetValue as IEnumerable; - // if (enumerable != null) + // IEnumerator enumerator = targetValue as IEnumerator; + // if (enumerator != null) // { - // var enumerator = enumerable.GetEnumerator(); + // enumerable.MoveNext(); // ... // } - // The call to 'GetEnumerator()' throws exception because COM is not supported in .NET Core. - // See https://github.com/dotnet/corefx/issues/19731 for more information. - // When COM support is back to .NET Core, we need to change back to the original implementation. + // The call to 'MoveNext()' throws exception because COM is not fully supported in .NET Core. + // See https://github.com/dotnet/runtime/issues/21690 for more information. + // When COM support is fully back to .NET Core, we need to change back to directly use the type cast. return ComEnumerator.Create(targetValue) ?? NonEnumerableObjectEnumerator.Create(obj); } diff --git a/test/powershell/engine/COM/COM.Basic.Tests.ps1 b/test/powershell/engine/COM/COM.Basic.Tests.ps1 index 7b1599a5d99..b69e2674fb8 100644 --- a/test/powershell/engine/COM/COM.Basic.Tests.ps1 +++ b/test/powershell/engine/COM/COM.Basic.Tests.ps1 @@ -49,6 +49,13 @@ try { $element | Should -Be $drives.Item($element.DriveLetter) } + It "Should be able to enumerate 'IADsMembers' object" { + $group = [ADSI]"WinNT://./Users,Group" + $members = $group.Invoke('Members') + $names = $members | ForEach-Object { $_.GetType().InvokeMember('Name', 'GetProperty', $null, $_, $null) } + $names | Should -Contain 'INTERACTIVE' + } + It "ToString() should return method paramter names" { $shell = New-Object -ComObject "Shell.Application" $fullSignature = $shell.AddToRecent.ToString() From 4a0eda7fa9044e2f281f2be7a7f2bef3953d60d9 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Tue, 11 Feb 2020 11:40:43 -0800 Subject: [PATCH 010/275] Handle cases where `CustomEvent` was not initially sent (#11807) --- .../utils/Telemetry.cs | 11 ++++++++ .../engine/Basic/Telemetry.Tests.ps1 | 25 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index bf4f0be1f55..14431a0c149 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -87,6 +87,9 @@ public static class ApplicationInsightsTelemetry // the session identifier private static string s_sessionId { get; set; } + // private semaphore to determine whether we sent the startup telemetry event + private static int s_startupEventSent = 0; + /// Use a hashset for quick lookups. /// We send telemetry only a known set of modules. /// If it's not in the list (initialized in the static constructor), then we report anonymous. @@ -583,6 +586,8 @@ internal static void SendTelemetryMetric(TelemetryType metricId, string data) return; } + SendPSCoreStartupTelemetry("hosted"); + string metricName = metricId.ToString(); try { @@ -645,6 +650,12 @@ private static string GetModuleName(string moduleNameToValidate) /// The "mode" of the startup. internal static void SendPSCoreStartupTelemetry(string mode) { + // Check if we already sent startup telemetry + if (Interlocked.CompareExchange(ref s_startupEventSent, 1, 0) == 1) + { + return; + } + if (!CanSendTelemetry) { return; diff --git a/test/powershell/engine/Basic/Telemetry.Tests.ps1 b/test/powershell/engine/Basic/Telemetry.Tests.ps1 index 5a0ee2d2d24..b07ba07c304 100644 --- a/test/powershell/engine/Basic/Telemetry.Tests.ps1 +++ b/test/powershell/engine/Basic/Telemetry.Tests.ps1 @@ -128,4 +128,29 @@ Describe "Telemetry for shell startup" -Tag CI { $result = & $PWSH -NoProfile -Command '[Microsoft.PowerShell.Telemetry.ApplicationInsightsTelemetry]::CanSendTelemetry' $result | Should -Be $expectedValue } + + It "Should resend startup event if the semaphore says we haven't sent telemetry" { + + $resultJson = & $PWSH -NoProfile -c { + $telemetryType = [Microsoft.PowerShell.Telemetry.ApplicationInsightsTelemetry] + $bindingFlags = [System.Reflection.BindingFlags]"NonPublic,Static" + $initialValue = ${telemetryType}.GetMember("s_startupEventSent", $bindingFlags)[0].GetValue($null) + # force a resend of the startup telemetry + $null = ${telemetryType}.GetMember("s_startupEventSent", $bindingFlags)[0].SetValue($null,0) + $null = Get-Date | Out-String + # now check it again, it should be true now that something has executed + $finalValue = ${telemetryType}.GetMember("s_startupEventSent", $bindingFlags)[0].GetValue($null) + @{ + initialValue = $initialValue + finalValue = $finalValue + } | ConvertTo-Json -Compress + } + + $result = $resultJson | ConvertFrom-Json + + $result.InitialValue | Should -Be 1 -Because "Should have sent telemetry on console startup" + + $result.FinalValue | Should -Be 1 -Because "Should have resent telemetry" + } + } From d2cb3c3636e39e5c1ca23468f70dba39b8c92cb9 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 11 Feb 2020 11:44:30 -0800 Subject: [PATCH 011/275] Sync current directory in `WinCompat` remote session (#11809) --- .../engine/Modules/ImportModuleCommand.cs | 16 +++++++++++ .../engine/Modules/ModuleCmdletBase.cs | 28 ++++++++++++++++--- .../CompatiblePSEditions.Module.Tests.ps1 | 28 +++++++++++++++++++ 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index 745c69bbf64..21fd37e27ad 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -1978,6 +1978,22 @@ internal override IList ImportModulesUsingWinCompat(IEnumerable 0) + { + // make sure that we add registration only once to a multicast delegate + SyncCurrentLocationDelegate ??= SyncCurrentLocationHandler; + var alreadyregistered = this.SessionState.InvokeCommand.LocationChangedAction?.GetInvocationList().Contains(SyncCurrentLocationDelegate); + + if (!alreadyregistered ?? true) + { + this.SessionState.InvokeCommand.LocationChangedAction += SyncCurrentLocationDelegate; + + // first sync has to be triggered manually + SyncCurrentLocationHandler(sender: this, args: new LocationChangedEventArgs(sessionState: null, oldPath: null, newPath: this.SessionState.Path.CurrentLocation)); + } + } #endif return moduleProxyList; } diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 6fc4dcd0b14..8c71d4be4b7 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -4792,7 +4792,7 @@ internal static Collection GetResolvedPathCollection(string filePath, Ex return filePaths; } - internal PSSession GetWindowsPowerShellCompatRemotingSession() + internal static PSSession GetWindowsPowerShellCompatRemotingSession() { PSSession result = null; var commandInfo = new CmdletInfo("Get-PSSession", typeof(GetPSSessionCommand)); @@ -4807,7 +4807,7 @@ internal PSSession GetWindowsPowerShellCompatRemotingSession() return result; } - internal PSSession CreateWindowsPowerShellCompatResources() + internal static PSSession CreateWindowsPowerShellCompatResources() { PSSession compatSession = null; lock (s_WindowsPowerShellCompatSyncObject) @@ -4832,13 +4832,18 @@ internal PSSession CreateWindowsPowerShellCompatResources() return compatSession; } - internal void CleanupWindowsPowerShellCompatResources() + internal static void CleanupWindowsPowerShellCompatResources(SessionState sessionState) { lock (s_WindowsPowerShellCompatSyncObject) { var compatSession = GetWindowsPowerShellCompatRemotingSession(); if (compatSession != null) { + if (sessionState?.InvokeCommand.LocationChangedAction != null) + { + sessionState.InvokeCommand.LocationChangedAction -= SyncCurrentLocationDelegate; + } + var commandInfo = new CmdletInfo("Remove-PSSession", typeof(RemovePSSessionCommand)); using var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace); ps.AddCommand(commandInfo); @@ -4848,6 +4853,21 @@ internal void CleanupWindowsPowerShellCompatResources() } } + internal static void SyncCurrentLocationHandler(object sender, LocationChangedEventArgs args) + { + PSSession compatSession = GetWindowsPowerShellCompatRemotingSession(); + if (compatSession?.Runspace.RunspaceStateInfo.State == RunspaceState.Opened) + { + using var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace); + ps.AddCommand(new CmdletInfo("Invoke-Command", typeof(InvokeCommandCommand))); + ps.AddParameter("Session", compatSession); + ps.AddParameter("ScriptBlock", ScriptBlock.Create(string.Format("Set-Location -Path '{0}'", args.NewPath.Path))); + ps.Invoke(); + } + } + + internal static System.EventHandler SyncCurrentLocationDelegate; + internal virtual IList ImportModulesUsingWinCompat(IEnumerable moduleNames, IEnumerable moduleFullyQualifiedNames, ImportModuleOptions importModuleOptions) { throw new System.NotImplementedException(); } private void RemoveTypesAndFormatting( @@ -4944,7 +4964,7 @@ internal void RemoveModule(PSModuleInfo module, string moduleNameInRemoveModuleC if (module.IsWindowsPowerShellCompatModule && (System.Threading.Interlocked.Decrement(ref s_WindowsPowerShellCompatUsageCounter) == 0)) { - CleanupWindowsPowerShellCompatResources(); + CleanupWindowsPowerShellCompatResources(this.SessionState); } // First remove cmdlets from the session state diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index bbecf39d792..7ae3a77de9d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -327,6 +327,34 @@ Describe "Import-Module from CompatiblePSEditions-checked paths" -Tag "CI" { [System.Management.Automation.Internal.InternalTestHooks]::SetTestHook("TestWindowsPowerShellVersionString", $null) } } + + It "Current location in Windows PS mirrors local current location" -TestCases $failCases -Skip:(-not $IsWindows) { + param($Editions, $ModuleName, $Result) + $pwdBackup = $PWD + $location = Join-Path $TestDrive "Custom dir" (New-Guid).ToString() + $null = New-Item -Path $location -ItemType Directory + Push-Location -Path $location + try + { + # right after module import remote $PWD should be synchronized + Import-Module $ModuleName -UseWindowsPowerShell + $s = Get-PSSession -Name WinPSCompatSession + (Invoke-Command -Session $s {Get-Location}).Path | Should -BeExactly $PWD.Path + + # after local $PWD changes remote $PWD should be synchronized + Set-Location -Path .. + (Invoke-Command -Session $s {Get-Location}).Path | Should -BeExactly $PWD.Path + + # after WinCompat cleanup local $PWD changes should not cause errors + Remove-module $ModuleName -Force + + Pop-Location + } + finally + { + Set-Location $pwdBackup + } + } } Context "Imports from absolute path" { From 9ffc693b1e66c254e30079efafad3fbffca125f3 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2020 12:16:03 -0800 Subject: [PATCH 012/275] Bump `PSReadLine` from `2.0.0-rc2` to `2.0.0` (#11831) --- src/Modules/PSGalleryModules.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index 8d1e2e5cdb0..e6c99f5feea 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -6,7 +6,7 @@ - + From fbb1559fd398e80f82211287c8d22dd076b5915c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2020 14:55:47 -0800 Subject: [PATCH 013/275] Bump `Microsoft.PowerShell.Archive` from `1.2.4.0` to `1.2.5` (#11833) Bumps Microsoft.PowerShell.Archive from 1.2.4.0 to 1.2.5. Signed-off-by: dependabot-preview[bot] --- src/Modules/PSGalleryModules.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index e6c99f5feea..cf9c8cb98a5 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -5,7 +5,7 @@ - + From 78a210121b134e44a441242a6f4f0fc8ea4eeaa0 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 11 Feb 2020 16:13:21 -0800 Subject: [PATCH 014/275] Update the NuGet package generation to include `cimcmdlet.dll` and most of the built-in modules (#11832) --- test/hosting/test_HostingBasic.cs | 25 +++++++++++++++++ tools/packaging/packaging.psm1 | 45 ++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/test/hosting/test_HostingBasic.cs b/test/hosting/test_HostingBasic.cs index b214c13a9ae..d2948d5887f 100644 --- a/test/hosting/test_HostingBasic.cs +++ b/test/hosting/test_HostingBasic.cs @@ -182,5 +182,30 @@ public static void TestConsoleShellScenario() int ret = ConsoleShell.Start("Hello", string.Empty, new string[] { "-noprofile", "-c", "exit 42" }); Assert.Equal(42, ret); } + + [Fact] + public static void TestBuiltInModules() + { + var iss = System.Management.Automation.Runspaces.InitialSessionState.CreateDefault2(); + if (System.Management.Automation.Platform.IsWindows) + { + iss.ExecutionPolicy = Microsoft.PowerShell.ExecutionPolicy.RemoteSigned; + } + + using var runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(iss); + runspace.Open(); + + using var ps = System.Management.Automation.PowerShell.Create(runspace); + var results_1 = ps.AddScript("Write-Output Hello > $null; Get-Module").Invoke(); + Assert.Single(results_1); + + var module = results_1[0]; + Assert.Equal("Microsoft.PowerShell.Utility", module.Name); + + ps.Commands.Clear(); + var results_2 = ps.AddScript("Join-Path $PSHOME 'Modules' 'Microsoft.PowerShell.Utility' 'Microsoft.PowerShell.Utility.psd1'").Invoke(); + var moduleManifestPath = results_2[0]; + Assert.Equal(moduleManifestPath, module.Path, ignoreCase: true); + } } } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index f7d1ed4c30f..ad7519a2683 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1659,6 +1659,7 @@ function New-ILNugetPackage } $fileList = @( + "Microsoft.Management.Infrastructure.CimCmdlets.dll", "Microsoft.PowerShell.Commands.Diagnostics.dll", "Microsoft.PowerShell.Commands.Management.dll", "Microsoft.PowerShell.Commands.Utility.dll", @@ -1672,6 +1673,7 @@ function New-ILNugetPackage "Microsoft.PowerShell.MarkdownRender.dll") $linuxExceptionList = @( + "Microsoft.Management.Infrastructure.CimCmdlets.dll", "Microsoft.PowerShell.Commands.Diagnostics.dll", "Microsoft.PowerShell.CoreCLR.Eventing.dll", "Microsoft.WSMan.Management.dll", @@ -1679,7 +1681,6 @@ function New-ILNugetPackage if ($PSCmdlet.ShouldProcess("Create nuget packages at: $PackagePath")) { - $refBinPath = New-TempFolder $SnkFilePath = "$RepoRoot\src\signing\visualstudiopublic.snk" @@ -1715,6 +1716,43 @@ function New-ILNugetPackage $contentFolder = New-Item (Join-Path $filePackageFolder "contentFiles\any\any") -ItemType Directory -Force $dotnetRefAsmFolder = Join-Path -Path $WinFxdBinPath -ChildPath "ref" Copy-Item -Path $dotnetRefAsmFolder -Destination $contentFolder -Recurse -Force + Write-Log "Copied the reference assembly folder to contentFiles for the SDK package" + + # Copy the built-in module folders to the NuGet package, so 'dotnet publish' can deploy those modules to the $pshome module path. + # This is for enabling applications that hosts PowerShell to ship the built-in modules. + + $winBuiltInModules = @( + "CimCmdlets", + "Microsoft.PowerShell.Diagnostics", + "Microsoft.PowerShell.Host", + "Microsoft.PowerShell.Management", + "Microsoft.PowerShell.Security", + "Microsoft.PowerShell.Utility", + "Microsoft.WSMan.Management", + "PSDiagnostics" + ) + + $unixBuiltInModules = @( + "Microsoft.PowerShell.Host", + "Microsoft.PowerShell.Management", + "Microsoft.PowerShell.Security", + "Microsoft.PowerShell.Utility" + ) + + $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\netcoreapp3.1\Modules") -ItemType Directory -Force + $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\netcoreapp3.1\Modules") -ItemType Directory -Force + + foreach ($module in $winBuiltInModules) { + $source = Join-Path $WinFxdBinPath "Modules\$module" + Copy-Item -Path $source -Destination $winModuleFolder -Recurse -Force + } + + foreach ($module in $unixBuiltInModules) { + $source = Join-Path $LinuxFxdBinPath "Modules\$module" + Copy-Item -Path $source -Destination $unixModuleFolder -Recurse -Force + } + + Write-Log "Copied the built-in modules to contentFiles for the SDK package" } #region nuspec @@ -1722,6 +1760,10 @@ function New-ILNugetPackage $deps = [System.Collections.ArrayList]::new() switch ($fileBaseName) { + 'Microsoft.Management.Infrastructure.CimCmdlets' { + $deps.Add([tuple]::Create([tuple]::Create('id', 'System.Management.Automation'), [tuple]::Create('version', $PackageVersion))) > $null + } + 'Microsoft.PowerShell.Commands.Diagnostics' { $deps.Add([tuple]::Create([tuple]::Create('id', 'System.Management.Automation'), [tuple]::Create('version', $PackageVersion))) > $null } @@ -1771,6 +1813,7 @@ function New-ILNugetPackage } $deps.Add([tuple]::Create([tuple]::Create('id', 'Microsoft.WSMan.Management'), [tuple]::Create('version', $PackageVersion))) > $null $deps.Add([tuple]::Create([tuple]::Create('id', 'Microsoft.PowerShell.Commands.Diagnostics'), [tuple]::Create('version', $PackageVersion))) > $null + $deps.Add([tuple]::Create([tuple]::Create('id', 'Microsoft.Management.Infrastructure.CimCmdlets'), [tuple]::Create('version', $PackageVersion))) > $null } 'Microsoft.PowerShell.Security' { From 9770477d437dccbfb2942bbc78c0fc0083588521 Mon Sep 17 00:00:00 2001 From: Ilya Date: Wed, 12 Feb 2020 08:17:44 +0500 Subject: [PATCH 015/275] Add new tests for Get-ChildItem (FileSystemProvider) (#11602) --- .../FileSystem.Tests.ps1 | 25 + .../FileSystemProviderExtended.Tests.ps1 | 653 ++++++++++++++++++ 2 files changed, 678 insertions(+) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index 0f0718be4e3..b8abc993a2e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -570,11 +570,26 @@ Describe "Hard link and symbolic link tests" -Tags "CI", "RequireAdminOnWindows" $ci[1].Name | Should -MatchExactly $filenamePattern $ci[2].Name | Should -MatchExactly $filenamePattern } + It "Get-ChildItem -Name gets content of linked-to directory" { + # The test depends on the files created in previous test: + #$filenamePattern = "AlphaFile[12]\.txt" + #New-Item -ItemType SymbolicLink -Path $alphaLink -Value $alphaDir + $ci = Get-ChildItem $alphaLink -Name + $ci.Count | Should -Be 3 + $ci[1] | Should -MatchExactly $filenamePattern + $ci[2] | Should -MatchExactly $filenamePattern + } It "Get-ChildItem does not recurse into symbolic links not explicitly given on the command line" { New-Item -ItemType SymbolicLink -Path $betaLink -Value $betaDir $ci = Get-ChildItem $alphaLink -Recurse $ci.Count | Should -BeExactly 7 } + It "Get-ChildItem -Name does not recurse into symbolic links not explicitly given on the command line" -Pending { + # The test depends on the files created in previous test: + #New-Item -ItemType SymbolicLink -Path $betaLink -Value $betaDir + $ci = Get-ChildItem $alphaLink -Recurse -Name + $ci.Count | Should -BeExactly 7 # returns 10 - unexpectly recurce in link-alpha\link-Beta. See https://github.com/PowerShell/PowerShell/issues/11614 + } It "Get-ChildItem will recurse into symlinks given -FollowSymlink, avoiding link loops" { New-Item -ItemType Directory -Path $gammaDir New-Item -ItemType SymbolicLink -Path $uponeLink -Value $betaDir @@ -584,6 +599,16 @@ Describe "Hard link and symbolic link tests" -Tags "CI", "RequireAdminOnWindows" $ci.Count | Should -BeExactly 13 $w.Count | Should -BeExactly 3 } + It "Get-ChildItem -Name will recurse into symlinks given -FollowSymlink, avoiding link loops" -Pending { + # The test depends on the files created in previous test: + # New-Item -ItemType Directory -Path $gammaDir + # New-Item -ItemType SymbolicLink -Path $uponeLink -Value $betaDir + # New-Item -ItemType SymbolicLink -Path $uptwoLink -Value $alphaDir + # New-Item -ItemType SymbolicLink -Path $omegaLink -Value $omegaDir + $ci = Get-ChildItem -Path $alphaDir -FollowSymlink -Recurse -WarningVariable w -WarningAction SilentlyContinue -Name # unexpectly dead cycle. See https://github.com/PowerShell/PowerShell/issues/11614 + $ci.Count | Should -BeExactly 13 + $w.Count | Should -BeExactly 3 + } } Context "Remove-Item and hard/symbolic links" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 new file mode 100644 index 00000000000..4bd34631c4e --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 @@ -0,0 +1,653 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI" { + BeforeAll { + $restoreLocation = Get-Location + + $DirSep = [IO.Path]::DirectorySeparatorChar + + $rootDir = Join-Path "TestDrive:" "TestDir" + New-Item -Path $rootDir -ItemType Directory > $null + + Set-Location $rootDir + + New-Item -Path "file1.txt" -ItemType File > $null + (New-Item -Path "filehidden1.doc" -ItemType File).Attributes = "Hidden" + (New-Item -Path "filereadonly1.asd" -ItemType File).Attributes = "ReadOnly" + + New-Item -Path "subDir2" -ItemType Directory > $null + Set-Location "subDir2" + New-Item -Path "file2.txt" -ItemType File > $null + (New-Item -Path "filehidden2.asd" -ItemType File).Attributes = "Hidden" + (New-Item -Path "filereadonly2.doc" -ItemType File).Attributes = "ReadOnly" + (New-Item -Path "subDir21" -ItemType Directory).Attributes = "Hidden" + Set-Location "subDir21" + New-Item -Path "file21.txt" -ItemType File > $null + + Set-Location $rootDir + New-Item -Path "subDir3" -ItemType Directory > $null + Set-Location "subDir3" + New-Item -Path "file3.asd" -ItemType File > $null + (New-Item -Path "filehidden3.txt" -ItemType File).Attributes = "Hidden" + (New-Item -Path "filereadonly3.doc" -ItemType File).Attributes = "ReadOnly" + + Set-Location $rootDir + } + + AfterAll { + #restore the previous location + Set-Location -Path $restoreLocation + } + + Context 'Validate Get-ChildItem -Path' { + It "Get-ChildItem -Path" { + $result = Get-ChildItem -Path $rootDir + $result.Count | Should -Be 4 + $result[0] | Should -BeOfType System.IO.DirectoryInfo + } + + It "Get-ChildItem -Path -Hidden" { + $result = Get-ChildItem -Path $rootDir -Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "filehidden1.doc" + } + + It "Get-ChildItem -Path -Attribute Hidden" { + $result = Get-ChildItem -Path $rootDir -Attributes Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "filehidden1.doc" + } + + It "Get-ChildItem -Path -Force" { + $result = Get-ChildItem -Path $rootDir -Force + $result.Count | Should -Be 5 + $result.Name | Should -Contain "filehidden1.doc" + } + } + + Context 'Validate Get-ChildItem -Path -Directory/-File' { + It "Get-ChildItem -Path -Directory" { + $result = Get-ChildItem -Path $rootDir -Directory + $result.Count | Should -Be 2 + } + + It "Get-ChildItem -Path -File" { + $result = Get-ChildItem -Path $rootDir -File + $result.Count | Should -Be 2 + } + + It "Get-ChildItem -Path -File -Hidden" { + $result = Get-ChildItem -Path $rootDir -File -Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "filehidden1.doc" + } + } + + Context 'Validate Get-ChildItem -Path -Name' { + It "Get-ChildItem -Path -Name" { + $result = Get-ChildItem -Path $rootDir -Name + $result.Count | Should -Be 4 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Name -Hidden" { + $result = Get-ChildItem -Path $rootDir -Name -Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.String + $result | Should -BeExactly "filehidden1.doc" + } + + It "Get-ChildItem -Path -Name -Attributes Hidden" { + $result = Get-ChildItem -Path $rootDir -Name -Attributes Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.String + $result | Should -BeExactly "filehidden1.doc" + } + + It "Get-ChildItem -Path -Name -Force" { + $result = Get-ChildItem -Path $rootDir -Name -Force + $result.Count | Should -Be 5 + $result | Should -BeOfType System.String + $result | Should -Contain "filehidden1.doc" + } + + It "Get-ChildItem -Path -Directory -Name" { + $result = Get-ChildItem -Path $rootDir -Directory -Name + $result.Count | Should -Be 2 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -File -Name" { + $result = Get-ChildItem -Path $rootDir -File -Name + $result.Count | Should -Be 2 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -File -Name -Hidden" { + $result = Get-ChildItem -Path $rootDir -File -Name -Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.String + $result | Should -BeExactly "filehidden1.doc" + } + } + + Context 'Validate Get-ChildItem -Path -Recurse' { + It "Get-ChildItem -Path -Recurse" { + $result = Get-ChildItem -Path $rootDir -Recurse + $result.Count | Should -Be 8 + } + + It "Get-ChildItem -Path -Recurse -Hidden" { + $result = Get-ChildItem -Path $rootDir -Recurse -Hidden + $result.Count | Should -Be 4 + $result.Where({ $_.Name -eq "filehidden1.doc"}) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "subDir21" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It "Get-ChildItem -Path -Recurse -Attributes Hidden" { + $result = Get-ChildItem -Path $rootDir -Recurse -Attributes Hidden + $result.Count | Should -Be 4 + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" })| Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "subDir21" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It "Get-ChildItem -Path -Recurse -Force" { + $result = Get-ChildItem -Path $rootDir -Recurse -Force + $result.Count | Should -Be 13 + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "subDir21" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It "Get-ChildItem -Path -Recurse -Directory" { + $result = Get-ChildItem -Path $rootDir -Recurse -Directory + $result.Count | Should -Be 2 + $result | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir2" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir3" }) | Should -BeOfType System.IO.DirectoryInfo + } + + It "Get-ChildItem -Path -Recurse -File" { + $result = Get-ChildItem -Path $rootDir -Recurse -File + $result.Count | Should -Be 6 + $result | Should -BeOfType System.IO.FileInfo + } + + It "Get-ChildItem -Path -Recurse -File -Hidden" { + $result = Get-ChildItem -Path $rootDir -Recurse -File -Hidden + $result.Count | Should -Be 3 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + } + + Context 'Validate Get-ChildItem -Path -Depth' { + It "Get-ChildItem -Path -Depth 0" { + $result = Get-ChildItem -Path $rootDir -Depth 0 + $result.Count | Should -Be 4 + } + + It "Get-ChildItem -Path -Depth 0 -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 0 -Force + $result.Count | Should -Be 5 + } + + It "Get-ChildItem -Path -Depth 1" { + $result = Get-ChildItem -Path $rootDir -Depth 1 + $result.Count | Should -Be 8 + } + + It "Get-ChildItem -Path -Depth 1 -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 1 -Force + $result.Count | Should -Be 12 + } + + It "Get-ChildItem -Path -Depth 2" { + $result = Get-ChildItem -Path $rootDir -Depth 2 + $result.Count | Should -Be 8 + } + + It "Get-ChildItem -Path -Depth 2 -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 2 -Force + $result.Count | Should -Be 13 + } + } + + Context 'Validate Get-ChildItem -Path -Recurse -Name' { + It "Get-ChildItem -Path -Recurse -Name" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name + $result.Count | Should -Be 8 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -Hidden" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -Hidden + $result.Count | Should -Be 4 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "filehidden1.doc" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)filehidden2.asd" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" }) | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -Force" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -Force + $result.Count | Should -Be 13 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "filehidden1.doc" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)filehidden2.asd" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" }) | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -Directory" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -Directory + $result.Count | Should -Be 2 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir3" }) | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -Attributes Directory" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -Attributes Directory + $result.Count | Should -Be 2 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir3" }) | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -File" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -File + $result.Count | Should -Be 6 + $result | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Recurse -Name -File -Hidden" { + $result = Get-ChildItem -Path $rootDir -Recurse -Name -File -Hidden + $result.Count | Should -Be 3 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "filehidden1.doc" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)filehidden2.asd" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" }) | Should -BeOfType System.String + } + } + + Context 'Validate Get-ChildItem -Path -Depth -Name' { + It "Get-ChildItem -Path -Depth 0 -Name" { + $result = Get-ChildItem -Path $rootDir -Depth 0 -Name + $result.Count | Should -Be 4 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Depth 0 -Name -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 0 -Name -Force + $result.Count | Should -Be 5 + } + + It "Get-ChildItem -Path -Depth 1 -Name" { + $result = Get-ChildItem -Path $rootDir -Depth 1 -Name + $result.Count | Should -Be 8 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Depth 1 -Name -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 1 -Name -Force + $result.Count | Should -Be 12 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Depth 2 -Name" { + $result = Get-ChildItem -Path $rootDir -Depth 2 -Name + $result.Count | Should -Be 8 + $result[0] | Should -BeOfType System.String + } + + It "Get-ChildItem -Path -Depth 2 -Name -Force" { + $result = Get-ChildItem -Path $rootDir -Depth 2 -Name -Force + $result.Count | Should -Be 13 + $result[0] | Should -BeOfType System.String + } + } + + Context 'Validate Get-ChildItem -Path -Filter' { + It 'Get-ChildItem -Path -Filter "*.txt"' { + $result = Get-ChildItem -Path $rootDir -Filter "*.txt" + $result.Count | Should -Be 1 + $result[0] | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "file1.txt" + } + + It 'Get-ChildItem -Path -Filter "file*"' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" + $result.Count | Should -Be 2 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filereadonly1.asd" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Filter "file?.txt"' { + $result = Get-ChildItem -Path $rootDir -Filter "file?.txt" + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "file1.txt" + } + + It 'Get-ChildItem -Path -Filter "file*" -Hidden' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Hidden + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "filehidden1.doc" + } + + It 'Get-ChildItem -Path -Filter "file*" -Force' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Force + $result.Count | Should -Be 3 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filereadonly1.asd" }) | Should -BeOfType System.IO.FileInfo + } + } + + Context 'Validate Get-ChildItem -Path -Filter -Recurse' { + It 'Get-ChildItem -Path -Filter "*.txt" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Filter "*.txt" -Recurse + $result.Count | Should -Be 2 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file2.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Filter "file*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Recurse + $result.Count | Should -Be 6 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filereadonly1.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file2.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filereadonly2.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file3.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filereadonly3.doc" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Filter "file?.*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Filter "file?.*" -Recurse + $result.Count | Should -Be 3 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file2.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file3.asd" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path $rootDir -Filter "file*" -Hidden -Recurse' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Hidden -Recurse + $result.Count | Should -Be 3 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path $rootDir -Filter "file*" -Force -Recurse' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Force -Recurse + $result.Count | Should -Be 10 + $result | Should -BeOfType System.IO.FileInfo + } + } + + Context 'Validate Get-ChildItem -Path -Filter -Recurse -Name' { + It 'Get-ChildItem -Path -Filter "*.txt" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Filter "*.txt" -Recurse -Name + $result.Count | Should -Be 2 + $result | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "file1.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Filter "file*" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Recurse -Name + $result.Count | Should -Be 6 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "file1.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "filereadonly1.asd" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)filereadonly2.doc" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3$($DirSep)file3.asd" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3$($DirSep)filereadonly3.doc" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Filter "file????only3.*" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Filter "file????only3.*" -Recurse -Name + $result.Count | Should -Be 1 + $result | Should -BeOfType System.String + $result | Should -BeExactly "subDir3$($DirSep)filereadonly3.doc" + } + + It 'Get-ChildItem -Path -Filter "file*" -Hidden -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Hidden -Recurse -Name + $result.Count | Should -Be 3 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "filehidden1.doc" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)filehidden2.asd" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Filter "file*" -Force -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Filter "file*" -Force -Recurse -Name + $result.Count | Should -Be 10 + $result | Should -BeOfType System.String + } + } + + Context 'Validate Get-ChildItem -Path -Include' { + It 'Get-ChildItem -Path $-Include "*.txt"' -Pending:$true { # Pending due to a bug + $result = Get-ChildItem -Path $rootDir -Include "*.txt" + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "file1.txt" + } + + It 'Get-ChildItem -Path -Include "*.txt" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Include "*.txt" -Recurse + $result.Count | Should -Be 2 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file2.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Include "*.txt" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Include "*.txt" -Recurse -Name + $result.Count | Should -Be 2 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "file1.txt" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -BeOfType System.String + } + + It 'Get-ChildItem -Path -Include "*.t?t" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Include "*.t?t" -Recurse -Name + $result.Count | Should -Be 2 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "file1.txt" }) | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -BeOfType System.String + } + } + + Context 'Validate Get-ChildItem -Path -Include' { + It 'Get-ChildItem -Path -Include "*.txt" -Force' -Pending:$true { # Pending due to a bug + $result = Get-ChildItem -Path $rootDir -Include "*.txt" -Force + $result.Count | Should -Be 1 + $result | Should -BeOfType System.IO.FileInfo + $result.Name | Should -BeExactly "file1.txt" + } + + It 'Get-ChildItem -Path -Include "*.txt" -Recurse -Force' { + $result = Get-ChildItem -Path $rootDir -Include "*.txt" -Recurse -Force + $result.Count | Should -Be 4 + $result | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file1.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file2.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "file21.txt" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden3.txt" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Include "*.txt" -Recurse -Name -Force' { + $result = Get-ChildItem -Path $rootDir -Include "*.txt" -Recurse -Name -Force + $result.Count | Should -Be 4 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "file1.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21$($DirSep)file21.txt" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Include "*.t?t" -Recurse -Name -Force' { + $result = Get-ChildItem -Path $rootDir -Include "*.t?t" -Recurse -Name -Force + $result.Count | Should -Be 4 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "file1.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)file2.txt" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3$($DirSep)filehidden3.txt" } ) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21$($DirSep)file21.txt" }) | Should -Not -BeNullOrEmpty + } + } + + Context 'Validate Get-ChildItem -Path -Exclude' { + It 'Get-ChildItem -Path $rootDir -Exclude "*.txt"' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" + $result.Count | Should -Be 3 + } + + It 'Get-ChildItem -Path $rootDir -Exclude "file*"' { + $result = Get-ChildItem -Path $rootDir -Exclude "file*" + $result.Count | Should -Be 2 + $result | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir2" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir3" }) | Should -BeOfType System.IO.DirectoryInfo + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Recurse + $result.Count | Should -Be 6 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.tx?" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.tx?" -Recurse + $result.Count | Should -Be 6 + $result.Where({ $_.Name -like "*.tx?" }) | Should -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Recurse -Name + $result | Should -BeOfType System.String + $result.Count | Should -Be 6 + $result.Where({ $_ -like "*.txt" }) | Should -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Recurse -Hidden' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Recurse -Hidden + $result.Count | Should -Be 3 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -eq "filehidden1.doc" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "filehidden2.asd" }) | Should -BeOfType System.IO.FileInfo + $result.Where({ $_.Name -eq "subDir21" }) | Should -BeOfType System.IO.DirectoryInfo + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Recurse -Hidden -Name' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Recurse -Hidden -Name + $result.Count | Should -Be 3 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_ -eq "filehidden1.doc" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)filehidden2.asd" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Include "file*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Include "file*" -Recurse + $result.Count | Should -Be 4 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "file*" }) | Should -BeOfType System.IO.FileInfo + } + } + + Context 'Validate Get-ChildItem -Path -Exclude -Force' { + It 'Get-ChildItem -Path -Exclude "*.txt" -Force' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Force + $result.Count | Should -Be 4 + } + + It 'Get-ChildItem -Path -Exclude "file*" -Recurse -Force' { + $result = Get-ChildItem -Path $rootDir -Exclude "file*" -Recurse -Force + $result.Count | Should -Be 3 + $result | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir2" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir3" }) | Should -BeOfType System.IO.DirectoryInfo + $result.Where({ $_.Name -eq "subDir21" }) | Should -BeOfType System.IO.DirectoryInfo + } + + It 'Get-ChildItem -Path -Exclude "file*" -Force -Recurse -Name' { + $result = Get-ChildItem -Path $rootDir -Exclude "file*" -Force -Recurse -Name + $result.Count | Should -Be 3 + $result | Should -BeOfType System.String + $result.Where({ $_ -eq "subDir2" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir3" }) | Should -Not -BeNullOrEmpty + $result.Where({ $_ -eq "subDir2$($DirSep)subDir21" }) | Should -Not -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Recurse + $result.Count | Should -Be 6 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Force -Include "file*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Force -Include "file*" -Recurse + $result.Count | Should -Be 6 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "file*" }) | Should -BeOfType System.IO.FileInfo + } + } + + Context 'Validate Get-ChildItem -Path -Exclude/-Include with some filters' { + It 'Get-ChildItem -Path -Exclude "*.txt","*.asd" -Force -Include "file*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt","*.asd" -Force -Include "file*" -Recurse + $result.Count | Should -Be 3 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "*.asd" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "file*" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Exclude "*.txt","*.asd" -Include "file*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt","*.asd" -Include "file*" -Recurse + $result.Count | Should -Be 2 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "*.asd" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "file*" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Force -Include "*2.*","*3.*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Force -Include "*2.*","*3.*" -Recurse + $result.Count | Should -Be 4 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "*2.*" -or $_.Name -like "*3.*" }) | Should -BeOfType System.IO.FileInfo + } + + It 'Get-ChildItem -Path -Exclude "*.txt" -Include "*2.*","*3.*" -Recurse' { + $result = Get-ChildItem -Path $rootDir -Exclude "*.txt" -Include "*2.*","*3.*" -Recurse + $result.Count | Should -Be 3 + $result.Where({ $_.Name -like "*.txt" }) | Should -BeNullOrEmpty + $result.Where({ $_.Name -like "*2.*" -or $_.Name -like "*3.*" }) | Should -BeOfType System.IO.FileInfo + } + } +} From 5edafb6afd12034198a44e303e0d0625a4082327 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 11 Feb 2020 22:48:58 -0800 Subject: [PATCH 016/275] Fix ConciseView to handle case where there isn't a console to obtain the width (#11784) --- .../PowerShellCore_format_ps1xml.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 67d6da5d551..3fdff3e13c4 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1151,15 +1151,23 @@ function Get-ConciseViewPositionMessage { # replace newlines in message so it lines up correct $message = $message.Replace($newline, ' ').Replace(""`t"", ' ') - if ([Console]::WindowWidth -gt 0 -and ($message.Length - $prefixVTLength) -gt [Console]::WindowWidth) { + try { + $windowWidth = [Console]::WindowWidth + } + catch { + # fails if there is no console + $windowWidth = 120 + } + + if ($windowWidth -gt 0 -and ($message.Length - $prefixVTLength) -gt $windowWidth) { $sb = [Text.StringBuilder]::new() - $substring = Get-TruncatedString -string $message -length ([Console]::WindowWidth + $prefixVTLength) + $substring = Get-TruncatedString -string $message -length ($windowWidth + $prefixVTLength) $null = $sb.Append($substring) $remainingMessage = $message.Substring($substring.Length).Trim() $null = $sb.Append($newline) - while (($remainingMessage.Length + $prefixLength) -gt [Console]::WindowWidth) { + while (($remainingMessage.Length + $prefixLength) -gt $windowWidth) { $subMessage = $prefix + $remainingMessage - $substring = Get-TruncatedString -string $subMessage -length ([Console]::WindowWidth + $prefixVtLength) + $substring = Get-TruncatedString -string $subMessage -length ($windowWidth + $prefixVtLength) $null = $sb.Append($substring) $null = $sb.Append($newline) $remainingMessage = $remainingMessage.Substring($substring.Length - $prefix.Length).Trim() From 63dd5a19e20af5c84cefba7d733eafb99161cafc Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 12 Feb 2020 14:15:54 -0800 Subject: [PATCH 017/275] Fix package sorting for syncing to private Module Feed (#11838) --- .../SyncGalleryToAzArtifacts.psm1 | 45 ++++++++++++++++++- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index 8a2d98f473e..351f5ce78c2 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -34,7 +34,7 @@ function SyncGalleryToAzArtifacts { foreach ($package in $packages) { try { # Get module from gallery - $foundPackageOnGallery = Find-Package -ProviderName NuGet -Source $galleryUrl -AllVersions -Name $package.Name -Force -AllowPreReleaseVersion | Sort-Object -Property Version -Descending | Select-Object -First 1 + $foundPackageOnGallery = Find-Package -ProviderName NuGet -Source $galleryUrl -AllVersions -Name $package.Name -Force -AllowPreReleaseVersion | SortPackage | Select-Object -First 1 Write-Verbose -Verbose "Found module $($package.Name) - $($foundPackageOnGallery.Version) in gallery" $galleryPackages += $foundPackageOnGallery } catch { @@ -51,7 +51,7 @@ function SyncGalleryToAzArtifacts { # Get module from Az Artifacts # There seems to be a bug in the feed with RequiredVersion matching. Adding workaround with post filtering. # Issue: https://github.com/OneGet/oneget/issues/397 - $foundPackageOnAz = Find-Package -ProviderName NuGet -Source $azArtifactsUrl -AllVersions -Name $package.Name -Force -Credential $azDevOpsCreds -AllowPreReleaseVersion | Sort-Object -Property Version -Descending | Select-Object -First 1 + $foundPackageOnAz = Find-Package -ProviderName NuGet -Source $azArtifactsUrl -AllVersions -Name $package.Name -Force -Credential $azDevOpsCreds -AllowPreReleaseVersion | SortPackage | Select-Object -First 1 Write-Verbose -Verbose "Found module $($package.Name) - $($foundPackageOnAz.Version) in azArtifacts" $azArtifactsPackages += $foundPackageOnAz } catch { @@ -120,6 +120,47 @@ function SyncGalleryToAzArtifacts { } + + +Function SortPackage { + param( + [Parameter(ValueFromPipeline = $true)] + [Microsoft.PackageManagement.Packaging.SoftwareIdentity[]] + $packages + ) + + Begin { + $allPackages = @() + } + + Process { + $allPackages += $packages + } + + End { + $versions = $allPackages.Version | + Foreach-Object { ($_ -split '-')[0] } | + Select-Object -Unique | + Sort-Object -Descending -Property Version + + foreach ($version in $versions) { + $exactMatch = $allPackages | Where-Object { + Write-Verbose "testing $($_.version) -eq $version" + $_.version -eq $version + } + + if ($exactMatch) { + Write-Output $exactMatch + } + + $allPackages | Where-Object { + $_.version -like "${version}-*" + } | Sort-Object -Descending -Property Version | Write-Output + } + } +} + + function NormalizeVersion { param ([string] $version) From 2cfe8a4781e037671b871e48343c658f80c9d8d2 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Wed, 12 Feb 2020 14:32:07 -0800 Subject: [PATCH 018/275] Restore the `PowerShellStreamType` enum with an `ObsoleteAttribute` (#11836) --- .../engine/PowerShellStreamType.cs | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/System.Management.Automation/engine/PowerShellStreamType.cs diff --git a/src/System.Management.Automation/engine/PowerShellStreamType.cs b/src/System.Management.Automation/engine/PowerShellStreamType.cs new file mode 100644 index 00000000000..6d8bfc21184 --- /dev/null +++ b/src/System.Management.Automation/engine/PowerShellStreamType.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace System.Management.Automation +{ + /// + /// Enumeration of the possible PowerShell stream types. + /// This enumeration is obsolete. + /// + /// + /// This enumeration is a public type formerly used in PowerShell Workflow, + /// but kept due to its generic name and public accessibility. + /// It is not used by any other PowerShell API, and is now obsolete + /// and should not be used if possible. + /// + [Obsolete("This enum type was used only in PowerShell Workflow and is now obsolete.", error: true)] + public enum PowerShellStreamType + { + /// + /// PSObject. + /// + Input = 0, + + /// + /// PSObject. + /// + Output = 1, + + /// + /// ErrorRecord. + /// + Error = 2, + + /// + /// WarningRecord. + /// + Warning = 3, + + /// + /// VerboseRecord. + /// + Verbose = 4, + + /// + /// DebugRecord. + /// + Debug = 5, + + /// + /// ProgressRecord. + /// + Progress = 6, + + /// + /// InformationRecord. + /// + Information = 7 + } +} From cec9deb72ae04be1d69a5085bdbadc6759dba4ad Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 15:59:18 -0800 Subject: [PATCH 019/275] Bump `Microsoft.PowerShell.Native` from `7.0.0-rc.2` to `7.0.0` (#11839) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index cda0fcbe6d8..1210a95eac4 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -28,7 +28,7 @@ - + From a578347b5a9d4b7c48f2cd303f876dfa6f27cdce Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 12 Feb 2020 18:35:24 -0800 Subject: [PATCH 020/275] Update `Get-PlatformInfo` helper and tests for Debian 10, 11 and CentOS 8 (#11842) --- test/powershell/Host/Startup.Tests.ps1 | 2 +- .../Test-Connection.Tests.ps1 | 2 +- .../Get-Date.Tests.ps1 | 2 +- .../MOF-Compilation.Tests.ps1 | 7 ++++++- .../PSDesiredStateConfiguration.Tests.ps1 | 7 ++++++- .../engine/Remoting/PSSession.Tests.ps1 | 8 ++++++-- .../Remoting/RemoteSession.Basic.Tests.ps1 | 16 ++++++++++++---- .../Modules/HelpersCommon/HelpersCommon.psm1 | 18 +++++++++++++----- 8 files changed, 46 insertions(+), 16 deletions(-) diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 87704901f42..9a4cf05da0a 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -103,7 +103,7 @@ Describe "Validate start of console host" -Tag CI { } It "No new assemblies are loaded" { - if ( (Get-PlatformInfo) -eq "alpine" ) { + if ( (Get-PlatformInfo).Platform -eq "alpine" ) { Set-ItResult -Pending -Because "Missing MI library causes list to be different" return } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index 822f97166dd..20634b1dd67 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -64,7 +64,7 @@ Describe "Test-Connection" -tags "CI" { { $result = Test-Connection "fakeHost" -Count 1 -Quiet -ErrorAction Stop } | Should -Throw -ErrorId "TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand" # Error code = 11001 - Host not found. - if ((Get-PlatformInfo) -match "raspbian") { + if ((Get-PlatformInfo).Platform -match "raspbian") { $code = 11 } elseif (!$IsWindows) { 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 a71fe68ccb3..fbf71dead4f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -35,7 +35,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { $seconds | Should -Be "1577836800" if ($IsLinux) { $dateString = "01/01/2020 UTC" - if ( (Get-PlatformInfo) -eq "alpine" ) { + if ( (Get-PlatformInfo).Platform -eq "alpine" ) { $dateString = "2020-01-01" } $expected = date --date=${dateString} +%s diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 index 092cef295b7..771f9f86e42 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 @@ -7,7 +7,12 @@ Describe "DSC MOF Compilation" -tags "CI" { } BeforeAll { - $SkipAdditionalPlatforms = (Get-PlatformInfo) -match "alpine|raspbian" + $platformInfo = Get-PlatformInfo + $SkipAdditionalPlatforms = + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + Import-Module PSDesiredStateConfiguration $dscModule = Get-Module PSDesiredStateConfiguration $baseSchemaPath = Join-Path $dscModule.ModuleBase 'Configuration' diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 index fd0d0a09742..fd51ff77012 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 @@ -28,7 +28,12 @@ Function Test-IsInvokeDscResourceEnable { Describe "Test PSDesiredStateConfiguration" -tags CI { BeforeAll { $MissingLibmi = $false - if ((Get-PlatformInfo) -match "alpine|raspbian") { + $platformInfo = Get-PlatformInfo + if ( + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + ) { $MissingLibmi = $true } } diff --git a/test/powershell/engine/Remoting/PSSession.Tests.ps1 b/test/powershell/engine/Remoting/PSSession.Tests.ps1 index 4207c914fee..7d17a7f444d 100644 --- a/test/powershell/engine/Remoting/PSSession.Tests.ps1 +++ b/test/powershell/engine/Remoting/PSSession.Tests.ps1 @@ -74,8 +74,12 @@ Describe "SkipCACheck and SkipCNCheck PSSession options are required for New-PSS param ($scriptBlock, $expectedErrorCode) $platformInfo = Get-PlatformInfo - if (($platformInfo -eq "alpine") -or ($platformInfo -eq "raspbian")) { - Set-ItResult -Skipped -Because "MI library not available for Alpine or Raspberry Pi" + if ( + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + ) { + Set-ItResult -Skipped -Because "MI library not available for Alpine, Raspberry Pi, Debian 10 and 11, and CentOS 8" return } diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index 91b1fa02e4e..7277735e115 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -6,8 +6,12 @@ Import-Module HelpersCommon Describe "New-PSSession basic test" -Tag @("CI") { It "New-PSSession should not crash powershell" { $platformInfo = Get-PlatformInfo - if (($platformInfo -eq "alpine") -or ($platformInfo -eq "raspbian")) { - Set-ItResult -Skipped -Because "MI library not available for Alpine or Raspberry Pi" + if ( + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + ) { + Set-ItResult -Skipped -Because "MI library not available for Alpine, Raspberry Pi, Debian 10 and 11, and CentOS 8" return } @@ -19,8 +23,12 @@ Describe "New-PSSession basic test" -Tag @("CI") { Describe "Basic Auth over HTTP not allowed on Unix" -Tag @("CI") { It "New-PSSession should throw when specifying Basic Auth over HTTP on Unix" -skip:($IsWindows) { $platformInfo = Get-PlatformInfo - if (($platformInfo -eq "alpine") -or ($platformInfo -eq "raspbian")) { - Set-ItResult -Skipped -Because "MI library not available for Alpine or Raspberry Pi" + if ( + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + ) { + Set-ItResult -Skipped -Because "MI library not available for Alpine, Raspberry Pi, Debian 10 and 11, and CentOS 8" return } diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index 195e17f0d62..c9de2db3f51 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -365,18 +365,26 @@ function New-ComplexPassword } # return a specific string with regard to platform information -function Get-PlatformInfo -{ +function Get-PlatformInfo { if ( $IsWindows ) { - return "windows" + return @{Platform = "windows"; Version = '' } } if ( $IsMacOS ) { - return "macos" + return @{Platform = "macos"; Version = '' } } if ( $IsLinux ) { $osrelease = Get-Content /etc/os-release | ConvertFrom-StringData if ( -not [string]::IsNullOrEmpty($osrelease.ID) ) { - return $osrelease.ID + + $versionId = if (-not $osrelease.Version_ID ) { + '' + } else { + $osrelease.Version_ID.trim('"') + } + + $platform = $osrelease.ID.trim('"') + + return @{Platform = $platform; Version = $versionId } } return "unknown" } From d91af727268516528180ff1294da523f380e13f3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 13 Feb 2020 18:46:10 -0800 Subject: [PATCH 021/275] Make sure `LTS` packages have symlink for `pwsh` and `pwsh-lts` (#11843) --- tools/ci.psm1 | 2 +- tools/packaging/packaging.psm1 | 68 ++++++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 66df43551ef..096128566a0 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -441,7 +441,7 @@ function Invoke-CIFinish [string] $NuGetKey ) - if($IsLinux -or $IsMacOS) + if($PSEdition -eq 'Core' -and ($IsLinux -or $IsMacOS)) { return New-LinuxPackage -NugetKey $NugetKey } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index ad7519a2683..268af8eb5fa 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -826,14 +826,15 @@ function New-UnixPackage { } # Destination for symlink to powershell executable - $Link = Get-PwshExecutablePath -IsPreview:$IsPreview -IsLTS:$LTS - $linkSource = "/tmp/pwsh" + $Link = Get-PwshExecutablePath -IsPreview:$IsPreview + $links = @(New-LinkInfo -LinkDestination $Link -LinkTarget "$Destination/pwsh") + + if($LTS) { + $links += New-LinkInfo -LinkDestination (Get-PwshExecutablePath -IsLTS:$LTS) -LinkTarget "$Destination/pwsh" + } if ($PSCmdlet.ShouldProcess("Create package file system")) { - # refers to executable, does not vary by channel - New-Item -Force -ItemType SymbolicLink -Path $linkSource -Target "$Destination/pwsh" > $null - # Generate After Install and After Remove scripts $AfterScriptInfo = New-AfterScripts -Link $Link -Distribution $DebDistro New-PSSymbolicLinks -Distribution $DebDistro -Staging $Staging @@ -899,8 +900,7 @@ function New-UnixPackage { -Destination $Destination ` -ManGzipFile $ManGzipInfo.GzipFile ` -ManDestination $ManGzipInfo.ManFile ` - -LinkSource $LinkSource ` - -LinkDestination $Link ` + -LinkInfo $Links ` -AppsFolder $AppsFolder ` -Distribution $DebDistro ` -ErrorAction Stop @@ -922,7 +922,7 @@ function New-UnixPackage { # this is continuation of a fpm hack for a weird bug if (Test-Path $hack_dest) { Write-Warning "Move $hack_dest to $symlink_dest (fpm utime bug)" - Start-NativeExecution ([ScriptBlock]::Create("$sudo mv $hack_dest $symlink_dest")) + Start-NativeExecution -sb ([ScriptBlock]::Create("$sudo mv $hack_dest $symlink_dest")) -VerboseOutputOnError } } if ($AfterScriptInfo.AfterInstallScript) { @@ -956,6 +956,35 @@ function New-UnixPackage { } } +Function New-LinkInfo +{ + [CmdletBinding(SupportsShouldProcess=$true)] + param( + [Parameter(Mandatory)] + [string] + $LinkDestination, + [Parameter(Mandatory)] + [string] + $linkTarget + ) + + $linkDir = Join-Path -path '/tmp' -ChildPath ([System.IO.Path]::GetRandomFileName()) + $null = New-Item -ItemType Directory -Path $linkDir + $linkSource = Join-Path -Path $linkDir -ChildPath 'pwsh' + + Write-Log "Creating link to target '$LinkTarget', with a temp source of '$LinkSource' and a Package Destination of '$LinkDestination'" + if ($PSCmdlet.ShouldProcess("Create package symbolic from $linkDestination to $linkTarget")) + { + # refers to executable, does not vary by channel + New-Item -Force -ItemType SymbolicLink -Path $linkSource -Target $LinkTarget > $null + } + + [LinkInfo] @{ + Source = $linkSource + Destination = $LinkDestination + } +} + function New-MacOsDistributionPackage { param( @@ -1027,6 +1056,13 @@ function New-MacOsDistributionPackage return (Get-Item $newPackagePath) } + +Class LinkInfo +{ + [string] $Source + [string] $Destination +} + function Get-FpmArguments { param( @@ -1060,10 +1096,7 @@ function Get-FpmArguments [String]$ManDestination, [Parameter(Mandatory,HelpMessage='Symlink to powershell executable')] - [String]$LinkSource, - - [Parameter(Mandatory,HelpMessage='Destination for symlink to powershell executable')] - [String]$LinkDestination, + [LinkInfo[]]$LinkInfo, [Parameter(HelpMessage='Packages required to install this package. Not applicable for MacOS.')] [ValidateScript({ @@ -1147,10 +1180,15 @@ function Get-FpmArguments $Arguments += @( "$Staging/=$Destination/", - "$ManGzipFile=$ManDestination", - "$LinkSource=$LinkDestination" + "$ManGzipFile=$ManDestination" ) + foreach($link in $LinkInfo) + { + $linkArgument = "$($link.Source)=$($link.Destination)" + $Arguments += $linkArgument + } + if ($AppsFolder) { $Arguments += "$AppsFolder=/" @@ -1476,7 +1514,7 @@ function Get-PwshExecutablePath $executableName = if ($IsPreview) { "pwsh-preview" - } elseif ($LTS) { + } elseif ($IsLTS) { "pwsh-lts" } else { "pwsh" From 1e5655b48cdad707ee3678435c4b587c0856a35c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 14 Feb 2020 08:44:43 -0800 Subject: [PATCH 022/275] Refactor packaging pipeline (#11852) Co-authored-by: Travis Plunk Co-authored-by: Dongbo Wang --- .../releaseBuild/azureDevOps/releaseBuild.yml | 53 +++-- .../templates/windows-hosted-build.yml | 62 ++++++ .../templates/windows-packaging.yml | 199 ++++++++++++++++++ 3 files changed, 301 insertions(+), 13 deletions(-) create mode 100644 tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml create mode 100644 tools/releaseBuild/azureDevOps/templates/windows-packaging.yml diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index c18b19bd109..6fece8bbeb2 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -39,42 +39,69 @@ jobs: - template: templates/mac.yml -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: x64 -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: x86 -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: arm -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: arm64 -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: fxdependent -- template: templates/windows-build.yml +- template: templates/windows-hosted-build.yml parameters: Architecture: fxdependentWinDesktop +- template: templates/windows-packaging.yml + parameters: + Architecture: x64 + parentJob: build_windows_x64 + +- template: templates/windows-packaging.yml + parameters: + Architecture: x86 + parentJob: build_windows_x86 + +- template: templates/windows-packaging.yml + parameters: + Architecture: arm + parentJob: build_windows_arm + +- template: templates/windows-packaging.yml + parameters: + Architecture: arm64 + parentJob: build_windows_arm64 -- template: templates/windows-component-governance.yml +- template: templates/windows-packaging.yml + parameters: + Architecture: fxdependent + parentJob: build_windows_fxdependent + +- template: templates/windows-packaging.yml + parameters: + Architecture: fxdependentWinDesktop + parentJob: build_windows_fxdependentWinDesktop - template: templates/windows-package-signing.yml parameters: parentJobs: - - build_windows_x64 - - build_windows_x86 - - build_windows_arm - - build_windows_arm64 - - build_windows_fxdependent - - build_windows_fxdependentWinDesktop + - sign_windows_x64 + - sign_windows_x86 + - sign_windows_arm + - sign_windows_arm64 + - sign_windows_fxdependent + - sign_windows_fxdependentWinDesktop - template: templates/mac-package-signing.yml diff --git a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml new file mode 100644 index 00000000000..594513ea225 --- /dev/null +++ b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml @@ -0,0 +1,62 @@ +parameters: + BuildConfiguration: release + BuildPlatform: any cpu + Architecture: x64 + +jobs: +- job: build_windows_${{ parameters.Architecture }} + displayName: Build Windows - ${{ parameters.Architecture }} + condition: succeeded() + pool: + vmImage: windows-latest + variables: + BuildConfiguration: ${{ parameters.BuildConfiguration }} + BuildPlatform: ${{ parameters.BuildPlatform }} + Architecture: ${{ parameters.Architecture }} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + + steps: + + - checkout: self + clean: true + persistCredentials: true + + - template: SetVersionVariables.yml + parameters: + ReleaseTagVar: $(ReleaseTagVar) + + - template: insert-nuget-config-azfeed.yml + + - powershell: | + Write-Host "##vso[task.setvariable variable=PowerShellRoot]/PowerShell" + $null = New-Item -ItemType Directory -Path /Powershell -Force + git clone $env:BUILD_REPOSITORY_LOCALPATH /PowerShell + displayName: Clone PowerShell Repo to /PowerShell + + - powershell: | + + $runtime = switch ($env:Architecture) + { + "x64" { "win7-x64" } + "x86" { "win7-x86" } + "arm" { "win-arm"} + "arm64" { "win-arm64" } + "fxdependent" { "fxdependent" } + "fxdependentWinDesktop" { "fxdependent-win-desktop" } + } + + tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -location '$(PowerShellRoot)' -destination '$(Build.ArtifactStagingDirectory)/Symbols_$(Architecture)' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' -Symbols + displayName: 'Build Windows Universal - $(Architecture) Symbols zip' + + - powershell: | + $packageName = (Get-ChildItem '$(Build.ArtifactStagingDirectory)\Symbols_$(Architecture)').FullName + $vstsCommandString = "vso[artifact.upload containerfolder=results;artifactname=results]$packageName" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" + displayName: Upload symbols package + + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + displayName: 'Component Detection' + inputs: + sourceScanPath: '$(Build.SourcesDirectory)' + snapshotForceEnabled: true diff --git a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml new file mode 100644 index 00000000000..ccc2ed1ae33 --- /dev/null +++ b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml @@ -0,0 +1,199 @@ +parameters: + BuildConfiguration: release + BuildPlatform: any cpu + Architecture: x64 + parentJob: '' + +jobs: +- job: sign_windows_${{ parameters.Architecture }} + displayName: Package Windows - ${{ parameters.Architecture }} + condition: succeeded() + dependsOn: ${{ parameters.parentJob }} + pool: + name: Package ES Standard Build + variables: + BuildConfiguration: ${{ parameters.BuildConfiguration }} + BuildPlatform: ${{ parameters.BuildPlatform }} + Architecture: ${{ parameters.Architecture }} + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + + steps: + + - checkout: self + clean: true + persistCredentials: true + + - template: shouldSign.yml + - template: SetVersionVariables.yml + parameters: + ReleaseTagVar: $(ReleaseTagVar) + + - task: PkgESSetupBuild@10 + displayName: 'Initialize build' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + useDfs: false + productName: PowerShellCore + branchVersion: true + disableWorkspace: true + disableBuildTools: true + disableNugetPack: true + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + $pkgFilter = if ( '$(Architecture)' -eq 'arm' ) { + "arm32" + } + else { + '$(Architecture)' + } + + $vstsCommandString = "vso[task.setvariable variable=PkgFilter]$pkgFilter" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" + displayName: Set packageName variable + + - task: DownloadBuildArtifacts@0 + inputs: + artifactName: 'results' + itemPattern: '**/*$(PkgFilter).zip' + downloadPath: '$(System.ArtifactsDirectory)\Symbols' + + - powershell: | + Write-Host "##vso[task.setvariable variable=PowerShellRoot]/PowerShell" + + if ((Test-Path "\PowerShell")) { + Remove-Item -Path "\PowerShell" -Force -Recurse -Verbose + } + else { + Write-Verbose -Verbose -Message "No cleanup required." + } + + git clone --quiet $env:BUILD_REPOSITORY_LOCALPATH '\PowerShell' + + displayName: Clone PowerShell Repo to /PowerShell + errorActionPreference: silentlycontinue + + - powershell: | + # cleanup previous install + if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) { + Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force + } + + $toolsDir = New-Item -ItemType Directory -Path '$(Build.ArtifactStagingDirectory)\tools' + $wixUri = 'https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip' + Invoke-RestMethod -Uri $wixUri -OutFile '$(Build.ArtifactStagingDirectory)\tools\wix.zip' + + Import-Module '$(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1' + Install-WixZip -zipPath '$(Build.ArtifactStagingDirectory)\tools\wix.zip' + + $msixUrl = '$(makeappUrl)' + Invoke-RestMethod -Uri $msixUrl -OutFile '\makeappx.zip' + Expand-Archive '\makeappx.zip' -destination '\' -Force + + displayName: Install packaging tools + + - powershell: | + $zipPath = Get-Item '$(System.ArtifactsDirectory)\Symbols\results\*$(PkgFilter).zip' + Write-Verbose -Verbose "Zip Path: $zipPath" + + $expandedFolder = $zipPath.BaseName + Write-Host "sending.. vso[task.setvariable variable=SymbolsFolder]$expandedFolder" + Write-Host "##vso[task.setvariable variable=SymbolsFolder]$expandedFolder" + + Expand-Archive -Path $zipPath -Destination "$(System.ArtifactsDirectory)\$expandedFolder" -Force + displayName: Expand symbols zip + + - powershell: | + if ("$env:Architecture" -like 'fxdependent*') + { + $(Build.SourcesDirectory)\tools\releaseBuild\updateSigning.ps1 -SkipPwshExe + } + else + { + $(Build.SourcesDirectory)\tools\releaseBuild\updateSigning.ps1 + } + displayName: 'Update Signing Xml' + + - task: PkgESCodeSign@10 + displayName: 'CodeSign $(Architecture)' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + signConfigXml: '$(Build.SourcesDirectory)\tools\releaseBuild\signing.xml' + inPathRoot: '$(System.ArtifactsDirectory)\$(SymbolsFolder)' + outPathRoot: '$(System.ArtifactsDirectory)\signed' + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + New-Item -ItemType Directory -Path $(System.ArtifactsDirectory)\signedZip -Force + displayName: 'Create empty signed folder' + condition: and(succeeded(), ne(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + Import-Module $(PowerShellRoot)/build.psm1 -Force + Import-Module $(PowerShellRoot)/tools/packaging -Force + + $signedFilesPath = '$(System.ArtifactsDirectory)\signed\' + $destFolder = '$(System.ArtifactsDirectory)\signedZip' + $BuildPath = '$(System.ArtifactsDirectory)\$(SymbolsFolder)' + + New-Item -ItemType Directory -Path $destFolder -Force + + $BuildPackagePath = New-PSSignedBuildZip -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath -DestinationFolder $destFolder + + Write-Verbose -Verbose "New-PSSignedBuildZip returned `$BuildPackagePath as: $BuildPackagePath" + Write-Host "##vso[artifact.upload containerfolder=results;artifactname=results]$BuildPackagePath" + + $vstsCommandString = "vso[task.setvariable variable=BuildPackagePath]$BuildPackagePath" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" + displayName: Compress signed files + + - powershell: | + $runtime = switch ($env:Architecture) + { + "x64" { "win7-x64" } + "x86" { "win7-x86" } + "arm" { "win-arm"} + "arm64" { "win-arm64" } + "fxdependent" { "fxdependent" } + "fxdependentWinDesktop" { "fxdependent-win-desktop" } + } + + $signedPkg = "$(BuildPackagePath)" + + Write-Verbose -Verbose -Message "signedPkg = $signedPkg" + + $(PowerShellRoot)/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 -BuildZip $signedPkg -location '$(PowerShellRoot)' -destination '$(System.ArtifactsDirectory)\pkgSigned' -Runtime $runtime -ReleaseTag '$(ReleaseTagVar)' + displayName: 'Build Windows Universal - $(Architecture) Package' + + - powershell: | + Get-ChildItem '$(System.ArtifactsDirectory)\pkgSigned' | ForEach-Object { + $packagePath = $_.FullName + Write-Host "Uploading $packagePath" + Write-Host "##vso[artifact.upload containerfolder=signed;artifactname=signed]$packagePath" + } + displayName: Upload packages + + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + displayName: 'Component Detection' + inputs: + sourceScanPath: '$(Build.SourcesDirectory)' + snapshotForceEnabled: true + + - powershell: | + if ((Test-Path "\PowerShell")) { + Remove-Item -Path "\PowerShell" -Force -Recurse -Verbose + } + else { + Write-Verbose -Verbose -Message "No cleanup required." + } + + if((Test-Path "${env:ProgramFiles(x86)}\WiX Toolset xcopy")) { + Write-Verbose -Verbose "Cleaning up Wix tools" + Remove-Item "${env:ProgramFiles(x86)}\WiX Toolset xcopy" -Recurse -Force + } + displayName: Clean up local Clone + condition: always() From 8522038cd88f2f201335f2270a912a8b280db494 Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+NextTurn@users.noreply.github.com> Date: Wed, 19 Feb 2020 05:07:09 +0800 Subject: [PATCH 023/275] Fix error message (#11862) --- .../commands/management/Service.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 72473902466..31c025f843b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -2473,7 +2473,7 @@ protected override void ProcessRecord() service, exception, "CouldNotRemoveService", - ServiceResources.CouldNotSetService, + ServiceResources.CouldNotRemoveService, ErrorCategory.PermissionDenied); return; } From 5edff316c12b0fd5643ba221b3b86c150d76e9bd Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 18 Feb 2020 14:11:22 -0800 Subject: [PATCH 024/275] Skip directory creation at root test on macOS (#11878) --- .../Microsoft.PowerShell.Management/FileSystem.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index b8abc993a2e..62bb57fe074 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -1462,7 +1462,7 @@ Describe "Verify sub-directory creation under root" -Tag 'CI','RequireSudoOnUnix } } - It "Can create a sub directory under root path" { + It "Can create a sub directory under root path" -Skip:$IsMacOs { New-Item -Path $dirPath -ItemType Directory -Force > $null $dirPath | Should -Exist } From 3cb1b23a13f49c66ebceec4c330dac996e87685c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 18 Feb 2020 15:01:08 -0800 Subject: [PATCH 025/275] Set default value of `LTSRelease` to false (#11874) --- tools/metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/metadata.json b/tools/metadata.json index 082c90def83..6906313d50a 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -3,5 +3,6 @@ "PreviewReleaseTag": "v7.0.0-rc.2", "ServicingReleaseTag": "v6.1.6", "ReleaseTag": "v6.2.4", - "NextReleaseTag": "v7.0.0-preview.7" + "NextReleaseTag": "v7.0.0-preview.7", + "LTSRelease": false } From 84aeff861e68c2f282e99d80eb00a60018e4712b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 18 Feb 2020 15:01:54 -0800 Subject: [PATCH 026/275] Update `LTS` logic to depend on `metadata.json` (#11877) --- tools/packaging/packaging.psm1 | 16 ++-------------- .../GenericLinuxFiles/PowerShellPackage.ps1 | 11 +++++------ .../releaseBuild/macOS/PowerShellPackageVsts.ps1 | 10 ++++------ 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 268af8eb5fa..06e40538b77 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -306,7 +306,6 @@ function Start-PSPackage { PackageNameSuffix = 'fxdependent' Version = $Version Force = $Force - LTS = $LTS } if ($PSCmdlet.ShouldProcess("Create tar.gz Package")) { @@ -369,7 +368,6 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - LTS = $LTS } if ($PSCmdlet.ShouldProcess("Create tar.gz Package")) { @@ -384,7 +382,6 @@ function Start-PSPackage { Force = $Force Architecture = "arm32" ExcludeSymbolicLinks = $true - LTS = $LTS } if ($PSCmdlet.ShouldProcess("Create tar.gz Package")) { @@ -399,7 +396,6 @@ function Start-PSPackage { Force = $Force Architecture = "arm64" ExcludeSymbolicLinks = $true - LTS = $LTS } if ($PSCmdlet.ShouldProcess("Create tar.gz Package")) { @@ -414,7 +410,6 @@ function Start-PSPackage { Force = $Force Architecture = "alpine-x64" ExcludeSymbolicLinks = $true - LTS = $LTS } if ($PSCmdlet.ShouldProcess("Create tar.gz Package")) { @@ -502,20 +497,13 @@ function New-TarballPackage { [switch] $Force, - [switch] $ExcludeSymbolicLinks, - - [switch] $LTS + [switch] $ExcludeSymbolicLinks ) if ($PackageNameSuffix) { $packageName = "$Name-$Version-{0}-$Architecture-$PackageNameSuffix.tar.gz" } else { - $packageName = if ($LTS) { - "$Name-lts-$Version-{0}-$Architecture.tar.gz" - } - else { - "$Name-$Version-{0}-$Architecture.tar.gz" - } + $packageName = "$Name-$Version-{0}-$Architecture.tar.gz" } if ($Environment.IsWindows) { diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index 63d2b5046e4..23e4225acdf 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -32,12 +32,11 @@ if ($ReleaseTag) $version = $ReleaseTag -replace '^v' $semVersion = [System.Management.Automation.SemanticVersion] $version -## All even minor versions are LTS -$LTS = if ( $semVersion.PreReleaseLabel -eq $null -and $semVersion.Minor % 2 -eq 0) { - $true -} else { - $false -} +$metadata = Get-Content "$location/tools/metadata.json" -Raw | ConvertFrom-Json + +$LTS = $metadata.LTSRelease + +Write-Verbose -Verbose -Message "LTS is set to: $LTS" function BuildPackages { param( diff --git a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 index 90bb91436c8..be9ade24519 100644 --- a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 @@ -40,12 +40,10 @@ if ($Build.IsPresent) { $version = $ReleaseTag -replace '^v' $semVersion = [System.Management.Automation.SemanticVersion] $version - ## All even minor versions are LTS - $LTS = if ( $semVersion.PreReleaseLabel -eq $null -and $semVersion.Minor % 2 -eq 0) { - $true - } else { - $false - } + $metadata = Get-Content "$location/tools/metadata.json" -Raw | ConvertFrom-Json + $LTS = $metadata.LTSRelease + + Write-Verbose -Verbose -Message "LTS is set to: $LTS" } } From 895d4b3f3ebb51193d68095d2a95549b0b92c5fc Mon Sep 17 00:00:00 2001 From: John Dennis Date: Wed, 19 Feb 2020 12:28:43 -0800 Subject: [PATCH 027/275] Allow cross-platform `CAPI-compatible` remote key exchange (#11185) --- .../server/OutOfProcServerMediator.cs | 9 +- .../remoting/server/serverremotesession.cs | 4 - .../resources/SecuritySupportStrings.resx | 12 + .../utils/CryptoUtils.cs | 913 +++++------------- test/xUnit/csharp/test_CryptoUtils.cs | 38 + 5 files changed, 297 insertions(+), 679 deletions(-) create mode 100644 test/xUnit/csharp/test_CryptoUtils.cs diff --git a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs index 4d564ab4d21..09c47a789a3 100644 --- a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs +++ b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs @@ -569,14 +569,7 @@ internal static void Run(string initialCommand) s_singletonInstance = new SSHProcessMediator(); } - PSRemotingCryptoHelperServer cryptoHelper; -#if !UNIX - cryptoHelper = new PSRemotingCryptoHelperServer(); -#else - cryptoHelper = null; -#endif - - s_singletonInstance.Start(initialCommand, cryptoHelper); + s_singletonInstance.Start(initialCommand, new PSRemotingCryptoHelperServer()); } #endregion diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs index dc740ec962a..b951edf142a 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -132,12 +132,8 @@ internal ServerRemoteSession(PSSenderInfo senderInfo, _senderInfo = senderInfo; _configProviderId = configurationProviderId; _initParameters = initializationParameters; -#if !UNIX _cryptoHelper = (PSRemotingCryptoHelperServer)transportManager.CryptoHelper; _cryptoHelper.Session = this; -#else - _cryptoHelper = null; -#endif Context = new ServerRemoteSessionContext(); SessionDataStructureHandler = new ServerRemoteSessionDSHandlerImpl(this, transportManager); diff --git a/src/System.Management.Automation/resources/SecuritySupportStrings.resx b/src/System.Management.Automation/resources/SecuritySupportStrings.resx index d263c3895b7..cd8a65a5c90 100644 --- a/src/System.Management.Automation/resources/SecuritySupportStrings.resx +++ b/src/System.Management.Automation/resources/SecuritySupportStrings.resx @@ -141,4 +141,16 @@ Session key not available to encrypt secure string. + + Invalid buffer offset. + + + Invalid public key data. + + + Cannot import public key. + + + Invalid session key data. + diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs index 55706f0d178..67ef04258ef 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -2,440 +2,266 @@ // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Linq; using System.Management.Automation.Remoting; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Security; +using System.Security.Cryptography; using System.Text; using System.Threading; -using Microsoft.Win32.SafeHandles; - using Dbg = System.Management.Automation.Diagnostics; namespace System.Management.Automation.Internal { /// - /// Class that encapsulates native crypto provider handles and provides a - /// mechanism for resources released by them. + /// This class provides the converters for all Native CAPI key blob formats. /// - // [SecurityPermission(SecurityAction.Demand, UnmanagedCode=true)] - // [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)] - internal class PSSafeCryptProvHandle : SafeHandleZeroOrMinusOneIsInvalid + internal static class PSCryptoNativeConverter { + #region Constants + /// - /// This safehandle instance "owns" the handle, hence base(true) - /// is being called. When safehandle is no longer in use it will - /// call this class's ReleaseHandle method which will release - /// the resources. + /// The blob version is fixed. /// - internal PSSafeCryptProvHandle() : base(true) { } + public const uint CUR_BLOB_VERSION = 0x00000002; /// - /// Release the crypto handle held by this instance. + /// RSA Key. /// - /// True on success, false otherwise. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() - { - return PSCryptoNativeUtils.CryptReleaseContext(handle, 0); - } - } + public const uint CALG_RSA_KEYX = 0x000000a4; - /// - /// Class the encapsulates native crypto key handles and provides a - /// mechanism to release resources used by it. - /// - // [SecurityPermission(SecurityAction.Demand, UnmanagedCode=true)] - // [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode=true)] - internal class PSSafeCryptKey : SafeHandleZeroOrMinusOneIsInvalid - { /// - /// This safehandle instance "owns" the handle, hence base(true) - /// is being called. When safehandle is no longer in use it will - /// call this class's ReleaseHandle method which will release the - /// resources. + /// AES 256 symmetric key. /// - internal PSSafeCryptKey() : base(true) { } + public const uint CALG_AES_256 = 0x00000010; /// - /// Release the crypto handle held by this instance. + /// Option for exporting public key blob. /// - /// True on success, false otherwise. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() - { - return PSCryptoNativeUtils.CryptDestroyKey(handle); - } + public const uint PUBLICKEYBLOB = 0x00000006; + + /// + /// PUBLICKEYBLOB header length. + /// + public const int PUBLICKEYBLOB_HEADER_LEN = 20; /// - /// Equivalent of IntPtr.Zero for the safe crypt key. + /// Option for exporting a session key. /// - internal static PSSafeCryptKey Zero { get; } = new PSSafeCryptKey(); - } + public const uint SIMPLEBLOB = 0x00000001; + + /// + /// SIMPLEBLOB header length. + /// + public const int SIMPLEBLOB_HEADER_LEN = 12; + + #endregion Constants - /// - /// This class provides the wrapper for all Native CAPI functions. - /// - internal class PSCryptoNativeUtils - { #region Functions -#if UNIX - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///Algid: ALG_ID->unsigned int - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - public static bool CryptGenKey( - PSSafeCryptProvHandle hProv, - uint Algid, - uint dwFlags, - ref PSSafeCryptKey phKey) + private static int ToInt32LE(byte[] bytes, int offset) { - throw new PSCryptoException(); + return (bytes[offset + 3] << 24) | (bytes[offset + 2] << 16) | (bytes[offset + 1 ] << 8) | bytes[offset]; } - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - public static bool CryptDestroyKey(IntPtr hKey) + private static uint ToUInt32LE(byte[] bytes, int offset) { - throw new PSCryptoException(); + return (uint)((bytes[offset + 3] << 24) | (bytes[offset + 2] << 16) | (bytes[offset + 1] << 8) | bytes[offset]); } - /// Return Type: BOOL->int - ///phProv: HCRYPTPROV* - ///szContainer: LPCWSTR->WCHAR* - ///szProvider: LPCWSTR->WCHAR* - ///dwProvType: DWORD->unsigned int - ///dwFlags: DWORD->unsigned int - public static bool CryptAcquireContext(ref PSSafeCryptProvHandle phProv, - [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string szContainer, - [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string szProvider, - uint dwProvType, - uint dwFlags) + private static byte[] GetBytesLE(int val) { - throw new PSCryptoException(); + return new [] { + (byte)(val & 0xff), + (byte)((val >> 8) & 0xff), + (byte)((val >> 16) & 0xff), + (byte)((val >> 24) & 0xff) + }; } - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///dwFlags: DWORD->unsigned int - public static bool CryptReleaseContext(IntPtr hProv, uint dwFlags) + private static byte[] CreateReverseByteArray(byte[] data) { - throw new PSCryptoException(); + byte[] reverseData = new byte[data.Length]; + Array.Copy(data, reverseData, data.Length); + Array.Reverse(reverseData); + return reverseData; } - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hHash: HCRYPTHASH->ULONG_PTR->unsigned int - ///Final: BOOL->int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - ///dwBufLen: DWORD->unsigned int - public static bool CryptEncrypt(PSSafeCryptKey hKey, - IntPtr hHash, - [MarshalAsAttribute(UnmanagedType.Bool)] bool Final, - uint dwFlags, - byte[] pbData, - ref int pdwDataLen, - int dwBufLen) + internal static RSA FromCapiPublicKeyBlob(byte[] blob) { - throw new PSCryptoException(); + return FromCapiPublicKeyBlob(blob, 0); } - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hHash: HCRYPTHASH->ULONG_PTR->unsigned int - ///Final: BOOL->int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - public static bool CryptDecrypt(PSSafeCryptKey hKey, - IntPtr hHash, - [MarshalAsAttribute(UnmanagedType.Bool)] bool Final, - uint dwFlags, - byte[] pbData, - ref int pdwDataLen) + private static RSA FromCapiPublicKeyBlob(byte[] blob, int offset) { - throw new PSCryptoException(); - } + if (blob == null) + { + throw new ArgumentNullException(nameof(blob)); + } - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hExpKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///dwBlobType: DWORD->unsigned int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - public static bool CryptExportKey(PSSafeCryptKey hKey, - PSSafeCryptKey hExpKey, - uint dwBlobType, - uint dwFlags, - byte[] pbData, - ref uint pdwDataLen) - { - throw new PSCryptoException(); - } + if (offset > blob.Length) + { + throw new ArgumentException(SecuritySupportStrings.InvalidOffset); + } - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///pbData: BYTE* - ///dwDataLen: DWORD->unsigned int - ///hPubKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - public static bool CryptImportKey(PSSafeCryptProvHandle hProv, - byte[] pbData, - int dwDataLen, - PSSafeCryptKey hPubKey, - uint dwFlags, - ref PSSafeCryptKey phKey) - { - throw new PSCryptoException(); - } + var rsap = GetParametersFromCapiPublicKeyBlob(blob, offset); - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///pdwReserved: DWORD* - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - public static bool CryptDuplicateKey(PSSafeCryptKey hKey, - ref uint pdwReserved, - uint dwFlags, - ref PSSafeCryptKey phKey) - { - throw new PSCryptoException(); + try + { + RSA rsa = RSA.Create(); + rsa.ImportParameters(rsap); + return rsa; + } + catch (Exception ex) + { + throw new CryptographicException(SecuritySupportStrings.CannotImportPublicKey, ex); + } } - /// Return Type: DWORD->unsigned int - public static uint GetLastError() + private static RSAParameters GetParametersFromCapiPublicKeyBlob(byte[] blob, int offset) { - throw new PSCryptoException(); - } -#else - - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///Algid: ALG_ID->unsigned int - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - [DllImportAttribute(PinvokeDllNames.CryptGenKeyDllName, EntryPoint = "CryptGenKey")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptGenKey(PSSafeCryptProvHandle hProv, - uint Algid, - uint dwFlags, - ref PSSafeCryptKey phKey); - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - [DllImportAttribute(PinvokeDllNames.CryptDestroyKeyDllName, EntryPoint = "CryptDestroyKey")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptDestroyKey(IntPtr hKey); - - /// Return Type: BOOL->int - ///phProv: HCRYPTPROV* - ///szContainer: LPCWSTR->WCHAR* - ///szProvider: LPCWSTR->WCHAR* - ///dwProvType: DWORD->unsigned int - ///dwFlags: DWORD->unsigned int - [DllImportAttribute(PinvokeDllNames.CryptAcquireContextDllName, EntryPoint = "CryptAcquireContext")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptAcquireContext(ref PSSafeCryptProvHandle phProv, - [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string szContainer, - [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string szProvider, - uint dwProvType, - uint dwFlags); - - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///dwFlags: DWORD->unsigned int - [DllImportAttribute(PinvokeDllNames.CryptReleaseContextDllName, EntryPoint = "CryptReleaseContext")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptReleaseContext(IntPtr hProv, uint dwFlags); - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hHash: HCRYPTHASH->ULONG_PTR->unsigned int - ///Final: BOOL->int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - ///dwBufLen: DWORD->unsigned int - [DllImportAttribute(PinvokeDllNames.CryptEncryptDllName, EntryPoint = "CryptEncrypt")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptEncrypt(PSSafeCryptKey hKey, - IntPtr hHash, - [MarshalAsAttribute(UnmanagedType.Bool)] bool Final, - uint dwFlags, - byte[] pbData, - ref int pdwDataLen, - int dwBufLen); - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hHash: HCRYPTHASH->ULONG_PTR->unsigned int - ///Final: BOOL->int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - [DllImportAttribute(PinvokeDllNames.CryptDecryptDllName, EntryPoint = "CryptDecrypt")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptDecrypt(PSSafeCryptKey hKey, - IntPtr hHash, - [MarshalAsAttribute(UnmanagedType.Bool)] bool Final, - uint dwFlags, - byte[] pbData, - ref int pdwDataLen); - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///hExpKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///dwBlobType: DWORD->unsigned int - ///dwFlags: DWORD->unsigned int - ///pbData: BYTE* - ///pdwDataLen: DWORD* - [DllImportAttribute(PinvokeDllNames.CryptExportKeyDllName, EntryPoint = "CryptExportKey")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptExportKey(PSSafeCryptKey hKey, - PSSafeCryptKey hExpKey, - uint dwBlobType, - uint dwFlags, - byte[] pbData, - ref uint pdwDataLen); - - /// Return Type: BOOL->int - ///hProv: HCRYPTPROV->ULONG_PTR->unsigned int - ///pbData: BYTE* - ///dwDataLen: DWORD->unsigned int - ///hPubKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - [DllImportAttribute(PinvokeDllNames.CryptImportKeyDllName, EntryPoint = "CryptImportKey")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptImportKey(PSSafeCryptProvHandle hProv, - byte[] pbData, - int dwDataLen, - PSSafeCryptKey hPubKey, - uint dwFlags, - ref PSSafeCryptKey phKey); - - /// Return Type: BOOL->int - ///hKey: HCRYPTKEY->ULONG_PTR->unsigned int - ///pdwReserved: DWORD* - ///dwFlags: DWORD->unsigned int - ///phKey: HCRYPTKEY* - [DllImportAttribute(PinvokeDllNames.CryptDuplicateKeyDllName, EntryPoint = "CryptDuplicateKey")] - [return: MarshalAsAttribute(UnmanagedType.Bool)] - public static extern bool CryptDuplicateKey(PSSafeCryptKey hKey, - ref uint pdwReserved, - uint dwFlags, - ref PSSafeCryptKey phKey); - - /// Return Type: DWORD->unsigned int - [DllImportAttribute(PinvokeDllNames.GetLastErrorDllName, EntryPoint = "GetLastError")] - public static extern uint GetLastError(); -#endif + if (blob == null) + { + throw new ArgumentNullException(nameof(blob)); + } - #endregion Functions + if (offset > blob.Length) + { + throw new ArgumentException(SecuritySupportStrings.InvalidOffset); + } - #region Constants + if (blob.Length < PUBLICKEYBLOB_HEADER_LEN) + { + throw new ArgumentException(SecuritySupportStrings.InvalidPublicKey); + } - /// - /// Do not use persisted private key. - /// - public const uint CRYPT_VERIFYCONTEXT = 0xF0000000; + try + { + if ((blob[offset] != PUBLICKEYBLOB) || // PUBLICKEYBLOB (0x06) + (blob[offset + 1] != CUR_BLOB_VERSION) || // Version (0x02) + (blob[offset + 2] != 0x00) || // Reserved (word) + (blob[offset + 3] != 0x00) || + (ToUInt32LE(blob, offset + 8) != 0x31415352)) // DWORD magic = RSA1 + { + throw new CryptographicException(SecuritySupportStrings.InvalidPublicKey); + } - /// - /// Mark the key for export. - /// - public const uint CRYPT_EXPORTABLE = 0x00000001; + // DWORD bitlen + int bitLen = ToInt32LE(blob, offset + 12); + + // DWORD public exponent + RSAParameters rsap = new RSAParameters(); + rsap.Exponent = new byte[3]; + rsap.Exponent[0] = blob[offset + 18]; + rsap.Exponent[1] = blob[offset + 17]; + rsap.Exponent[2] = blob[offset + 16]; + + int pos = offset + 20; + int byteLen = (bitLen >> 3); + rsap.Modulus = new byte[byteLen]; + Buffer.BlockCopy(blob, pos, rsap.Modulus, 0, byteLen); + Array.Reverse(rsap.Modulus); + + return rsap; + } + catch (Exception ex) + { + throw new CryptographicException(SecuritySupportStrings.InvalidPublicKey, ex); + } + } - /// - /// Automatically assign a salt value when creating a - /// session key. - /// - public const int CRYPT_CREATE_SALT = 4; + internal static byte[] ToCapiPublicKeyBlob(RSA rsa) + { + if (rsa == null) + { + throw new ArgumentNullException(nameof(rsa)); + } - /// - /// RSA Provider. - /// - public const int PROV_RSA_FULL = 1; + RSAParameters p = rsa.ExportParameters(false); + int keyLength = p.Modulus.Length; // in bytes + byte[] blob = new byte[PUBLICKEYBLOB_HEADER_LEN + keyLength]; - /// - /// RSA Provider that supports AES - /// encryption. - /// - public const int PROV_RSA_AES = 24; + blob[0] = (byte)PUBLICKEYBLOB; // Type - PUBLICKEYBLOB (0x06) + blob[1] = (byte)CUR_BLOB_VERSION; // Version - Always CUR_BLOB_VERSION (0x02) + // [2], [3] // RESERVED - Always 0 + blob[5] = (byte)CALG_RSA_KEYX; // ALGID - Always 00 a4 00 00 (for CALG_RSA_KEYX) + blob[8] = 0x52; // Magic - RSA1 (ASCII in hex) + blob[9] = 0x53; + blob[10] = 0x41; + blob[11] = 0x31; - /// - /// Public key to be used for encryption. - /// - public const int AT_KEYEXCHANGE = 1; + byte[] bitlen = GetBytesLE(keyLength << 3); + blob[12] = bitlen[0]; // bitlen + blob[13] = bitlen[1]; + blob[14] = bitlen[2]; + blob[15] = bitlen[3]; - /// - /// RSA Key. - /// - public const int CALG_RSA_KEYX = - (PSCryptoNativeUtils.ALG_CLASS_KEY_EXCHANGE | - (PSCryptoNativeUtils.ALG_TYPE_RSA | PSCryptoNativeUtils.ALG_SID_RSA_ANY)); + // public exponent (DWORD) + int pos = 16; + int n = p.Exponent.Length; - /// - /// Create a key for encryption. - /// - public const int ALG_CLASS_KEY_EXCHANGE = (5) << (13); + Dbg.Assert(n <= 4, "RSA exponent byte length cannot exceed allocated segment"); - /// - /// Create a RSA key pair. - /// - public const int ALG_TYPE_RSA = (2) << (9); + while (n > 0) + { + blob[pos++] = p.Exponent[--n]; + } - /// - /// - public const int ALG_SID_RSA_ANY = 0; + // modulus + pos = 20; + byte[] key = p.Modulus; + Array.Reverse(key); + Buffer.BlockCopy(key, 0, blob, pos, keyLength); - /// - /// Option for exporting public key blob. - /// - public const int PUBLICKEYBLOB = 6; + return blob; + } - /// - /// Option for exporting a session key. - /// - public const int SIMPLEBLOB = 1; + internal static byte[] FromCapiSimpleKeyBlob(byte[] blob) + { + if (blob == null) + { + throw new ArgumentNullException(nameof(blob)); + } - /// - /// AES 256 symmetric key. - /// - public const int CALG_AES_256 = (ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256); + if (blob.Length < SIMPLEBLOB_HEADER_LEN) + { + throw new ArgumentException(SecuritySupportStrings.InvalidSessionKey); + } - /// - /// ALG_CLASS_DATA_ENCRYPT. - /// - public const int ALG_CLASS_DATA_ENCRYPT = (3) << (13); + // just ignore the header of the capi blob and go straight for the key + return CreateReverseByteArray(blob.Skip(SIMPLEBLOB_HEADER_LEN).ToArray()); + } - /// - /// ALG_TYPE_BLOCK. - /// - public const int ALG_TYPE_BLOCK = (3) << (9); + internal static byte[] ToCapiSimpleKeyBlob(byte[] encryptedKey) + { + if (encryptedKey == null) + { + throw new ArgumentNullException(nameof(encryptedKey)); + } - /// - /// ALG_SID_AES_256 -> 16. - /// - public const int ALG_SID_AES_256 = 16; + // formulate the PUBLICKEYSTRUCT + byte[] blob = new byte[SIMPLEBLOB_HEADER_LEN + encryptedKey.Length]; - /// CALG_AES_128 -> (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128) - public const int CALG_AES_128 = (ALG_CLASS_DATA_ENCRYPT - | (ALG_TYPE_BLOCK | ALG_SID_AES_128)); + blob[0] = (byte)SIMPLEBLOB; // Type - SIMPLEBLOB (0x01) + blob[1] = (byte)CUR_BLOB_VERSION; // Version - Always CUR_BLOB_VERSION (0x02) + // [2], [3] // RESERVED - Always 0 + blob[4] = (byte)CALG_AES_256; // AES-256 algo id (0x10) + blob[5] = 0x66; // ?? + // [6], [7], [8] // 0x00 + blob[9] = (byte)CALG_RSA_KEYX; // 0xa4 + // [10], [11] // 0x00 - /// ALG_SID_AES_128 -> 14 - public const int ALG_SID_AES_128 = 14; + // create a reversed copy and add the encrypted key + byte[] reversedKey = CreateReverseByteArray(encryptedKey); + Buffer.BlockCopy(reversedKey, 0, blob, SIMPLEBLOB_HEADER_LEN, reversedKey.Length); - #endregion Constants + return blob; + } + + #endregion Functions } /// @@ -540,32 +366,26 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont } /// - /// One of the issues with RSACryptoServiceProvider is that it never uses CRYPT_VERIFYCONTEXT - /// to create ephemeral keys. This class is a facade written on top of native CAPI APIs - /// to create ephemeral keys. + /// A reverse compatible implementation of session key exchange. This supports the CAPI + /// keyblob formats but uses dotnet std abstract AES and RSA classes for all crypto operations. /// internal class PSRSACryptoServiceProvider : IDisposable { #region Private Members - private PSSafeCryptProvHandle _hProv; - // handle to the provider - private bool _canEncrypt = false; // this flag indicates that this class has a key - // imported from the remote end and so can be - // used for encryption - private PSSafeCryptKey _hRSAKey; - // handle to the RSA key with which the session - // key is exchange. This can either be generated - // or imported - private PSSafeCryptKey _hSessionKey; - // handle to the session key. This can either - // be generated or imported - private bool _sessionKeyGenerated = false; + // handle session key encryption/decryption + private RSA _rsa; + + // handle to the AES provider object (houses session key and iv) + private readonly Aes _aes; + + // this flag indicates that this class has a key imported from the + // remote end and so can be used for encryption + private bool _canEncrypt; + // bool indicating if session key was generated before + private bool _sessionKeyGenerated = false; - private static PSSafeCryptProvHandle s_hStaticProv; - private static PSSafeCryptKey s_hStaticRSAKey; - private static bool s_keyPairGenerated = false; private static object s_syncObject = new object(); #endregion Private Members @@ -581,22 +401,11 @@ private PSRSACryptoServiceProvider(bool serverMode) { if (serverMode) { - _hProv = new PSSafeCryptProvHandle(); - - // We need PROV_RSA_AES to support AES-256 symmetric key - // encryption. PROV_RSA_FULL supports only RC2 and RC4 - bool ret = PSCryptoNativeUtils.CryptAcquireContext(ref _hProv, - null, - null, - PSCryptoNativeUtils.PROV_RSA_AES, - PSCryptoNativeUtils.CRYPT_VERIFYCONTEXT); - - CheckStatus(ret); - - _hRSAKey = new PSSafeCryptKey(); + GenerateKeyPair(); } - _hSessionKey = new PSSafeCryptKey(); + _aes = Aes.Create(); + _aes.IV = new byte[16]; // iv should be 0 } #endregion Constructors @@ -604,37 +413,16 @@ private PSRSACryptoServiceProvider(bool serverMode) #region Internal Methods /// - /// Get the public key as a base64 encoded string. + /// Get the public key, in CAPI-compatible form, as a base64 encoded string. /// /// Public key as base64 encoded string. internal string GetPublicKeyAsBase64EncodedString() { - uint publicKeyLength = 0; - - // Get key length first - bool ret = PSCryptoNativeUtils.CryptExportKey(_hRSAKey, - PSSafeCryptKey.Zero, - PSCryptoNativeUtils.PUBLICKEYBLOB, - 0, - null, - ref publicKeyLength); - CheckStatus(ret); - - // Create enough buffer and get the actual data - byte[] publicKey = new byte[publicKeyLength]; - ret = PSCryptoNativeUtils.CryptExportKey(_hRSAKey, - PSSafeCryptKey.Zero, - PSCryptoNativeUtils.PUBLICKEYBLOB, - 0, - publicKey, - ref publicKeyLength); - CheckStatus(ret); - - // Convert the public key into base64 encoding so that it can be exported to - // the other end. - string result = Convert.ToBase64String(publicKey); - - return result; + Dbg.Assert(_rsa != null, "No public key available."); + + byte[] capiPublicKeyBlob = PSCryptoNativeConverter.ToCapiPublicKeyBlob(_rsa); + + return Convert.ToBase64String(capiPublicKeyBlob); } /// @@ -649,13 +437,9 @@ internal void GenerateSessionKey() { if (!_sessionKeyGenerated) { - bool ret = PSCryptoNativeUtils.CryptGenKey(_hProv, - PSCryptoNativeUtils.CALG_AES_256, - 0x01000000 | // key length = 256 bits - PSCryptoNativeUtils.CRYPT_EXPORTABLE | - PSCryptoNativeUtils.CRYPT_CREATE_SALT, - ref _hSessionKey); - CheckStatus(ret); + // Aes object gens key automatically on construction, so this is somewhat redundant, + // but at least the actionable key will not be in-memory until it's requested fwiw. + _aes.GenerateKey(); _sessionKeyGenerated = true; _canEncrypt = true; // we can encrypt and decrypt once session key is available } @@ -672,35 +456,17 @@ internal void GenerateSessionKey() /// and encoded as a base 64 string. internal string SafeExportSessionKey() { + Dbg.Assert(_rsa != null, "No public key available."); + // generate one if not already done. GenerateSessionKey(); - uint length = 0; - - // get key length first - bool ret = PSCryptoNativeUtils.CryptExportKey(_hSessionKey, - _hRSAKey, - PSCryptoNativeUtils.SIMPLEBLOB, - 0, - null, - ref length); - CheckStatus(ret); - - // allocate buffer and export the key - byte[] sessionkey = new byte[length]; - ret = PSCryptoNativeUtils.CryptExportKey(_hSessionKey, - _hRSAKey, - PSCryptoNativeUtils.SIMPLEBLOB, - 0, - sessionkey, - ref length); - CheckStatus(ret); - - // now we can encrypt as we have the session key - _canEncrypt = true; + // encrypt it + byte[] encryptedKey = _rsa.Encrypt(_aes.Key, RSAEncryptionPadding.Pkcs1); - // convert the key to base64 before exporting - return Convert.ToBase64String(sessionkey); + // convert the key to capi simpleblob format before exporting + byte[] simpleKeyBlob = PSCryptoNativeConverter.ToCapiSimpleKeyBlob(encryptedKey); + return Convert.ToBase64String(simpleKeyBlob); } /// @@ -712,16 +478,8 @@ internal void ImportPublicKeyFromBase64EncodedString(string publicKey) { Dbg.Assert(!string.IsNullOrEmpty(publicKey), "key cannot be null or empty"); - byte[] convertedBase64 = Convert.FromBase64String(publicKey); - - bool ret = PSCryptoNativeUtils.CryptImportKey(_hProv, - convertedBase64, - convertedBase64.Length, - PSSafeCryptKey.Zero, - 0, - ref _hRSAKey); - - CheckStatus(ret); + byte[] publicKeyBlob = Convert.FromBase64String(publicKey); + _rsa = PSCryptoNativeConverter.FromCapiPublicKeyBlob(publicKeyBlob); } /// @@ -734,15 +492,10 @@ internal void ImportSessionKeyFromBase64EncodedString(string sessionKey) { Dbg.Assert(!string.IsNullOrEmpty(sessionKey), "key cannot be null or empty"); - byte[] convertedBase64 = Convert.FromBase64String(sessionKey); + byte[] sessionKeyBlob = Convert.FromBase64String(sessionKey); + byte[] rsaEncryptedKey = PSCryptoNativeConverter.FromCapiSimpleKeyBlob(sessionKeyBlob); - bool ret = PSCryptoNativeUtils.CryptImportKey(_hProv, - convertedBase64, - convertedBase64.Length, - _hRSAKey, - 0, - ref _hSessionKey); - CheckStatus(ret); + _aes.Key = _rsa.Decrypt(rsaEncryptedKey, RSAEncryptionPadding.Pkcs1); // now we have imported the key and will be able to // encrypt using the session key @@ -756,58 +509,19 @@ internal void ImportSessionKeyFromBase64EncodedString(string sessionKey) /// Encrypted byte array. internal byte[] EncryptWithSessionKey(byte[] data) { - // first make a copy of the original data.This is needed - // as CryptEncrypt uses the same buffer to write the encrypted data - // into. Dbg.Assert(_canEncrypt, "Remote key has not been imported to encrypt"); - byte[] encryptedData = new byte[data.Length]; - Array.Copy(data, 0, encryptedData, 0, data.Length); - - int dataLength = encryptedData.Length; - - // encryption always happens using the session key - bool ret = PSCryptoNativeUtils.CryptEncrypt(_hSessionKey, - IntPtr.Zero, - true, - 0, - encryptedData, - ref dataLength, - data.Length); - - // if encryption failed, then dataLength will contain the length - // of buffer needed to store the encrypted contents. Recreate - // the buffer - if (false == ret) + using (ICryptoTransform encryptor = _aes.CreateEncryptor()) + using (MemoryStream targetStream = new MemoryStream()) + using (MemoryStream sourceStream = new MemoryStream(data)) { - // before reallocating the encryptedData buffer, - // zero out its contents - for (int i = 0; i < encryptedData.Length; i++) + using (CryptoStream cryptoStream = new CryptoStream(targetStream, encryptor, CryptoStreamMode.Write)) { - encryptedData[i] = 0; + sourceStream.CopyTo(cryptoStream); } - encryptedData = new byte[dataLength]; - - Array.Copy(data, 0, encryptedData, 0, data.Length); - dataLength = data.Length; - ret = PSCryptoNativeUtils.CryptEncrypt(_hSessionKey, - IntPtr.Zero, - true, - 0, - encryptedData, - ref dataLength, - encryptedData.Length); - - CheckStatus(ret); + return targetStream.ToArray(); } - - // make sure we copy only appropriate data - // dataLength will contain the length of the encrypted - // data buffer - byte[] result = new byte[dataLength]; - Array.Copy(encryptedData, 0, result, 0, dataLength); - return result; } /// @@ -817,53 +531,17 @@ internal byte[] EncryptWithSessionKey(byte[] data) /// Decrypted buffer. internal byte[] DecryptWithSessionKey(byte[] data) { - // first make a copy of the original data.This is needed - // as CryptDecrypt uses the same buffer to write the decrypted data - // into. - byte[] decryptedData = new byte[data.Length]; - - Array.Copy(data, 0, decryptedData, 0, data.Length); - - int dataLength = decryptedData.Length; - - bool ret = PSCryptoNativeUtils.CryptDecrypt(_hSessionKey, - IntPtr.Zero, - true, - 0, - decryptedData, - ref dataLength); - - // if decryption failed, then dataLength will contain the length - // of buffer needed to store the decrypted contents. Recreate - // the buffer - if (false == ret) + using (ICryptoTransform decryptor = _aes.CreateDecryptor()) + using (MemoryStream sourceStream = new MemoryStream(data)) + using (MemoryStream targetStream = new MemoryStream()) { - decryptedData = new byte[dataLength]; - - Array.Copy(data, 0, decryptedData, 0, data.Length); - ret = PSCryptoNativeUtils.CryptDecrypt(_hSessionKey, - IntPtr.Zero, - true, - 0, - decryptedData, - ref dataLength); - CheckStatus(ret); - } - - // make sure we copy only appropriate data - // dataLength will contain the length of the encrypted - // data buffer - byte[] result = new byte[dataLength]; - - Array.Copy(decryptedData, 0, result, 0, dataLength); - - // zero out the decryptedData buffer - for (int i = 0; i < decryptedData.Length; i++) - { - decryptedData[i] = 0; - } + using (CryptoStream csDecrypt = new CryptoStream(sourceStream, decryptor, CryptoStreamMode.Read)) + { + csDecrypt.CopyTo(targetStream); + } - return result; + return targetStream.ToArray(); + } } /// @@ -872,39 +550,8 @@ internal byte[] DecryptWithSessionKey(byte[] data) /// internal void GenerateKeyPair() { - if (!s_keyPairGenerated) - { - lock (s_syncObject) - { - if (!s_keyPairGenerated) - { - s_hStaticProv = new PSSafeCryptProvHandle(); - // We need PROV_RSA_AES to support AES-256 symmetric key - // encryption. PROV_RSA_FULL supports only RC2 and RC4 - bool ret = PSCryptoNativeUtils.CryptAcquireContext(ref s_hStaticProv, - null, - null, - PSCryptoNativeUtils.PROV_RSA_AES, - PSCryptoNativeUtils.CRYPT_VERIFYCONTEXT); - - CheckStatus(ret); - - s_hStaticRSAKey = new PSSafeCryptKey(); - ret = PSCryptoNativeUtils.CryptGenKey(s_hStaticProv, - PSCryptoNativeUtils.AT_KEYEXCHANGE, - 0x08000000 | PSCryptoNativeUtils.CRYPT_EXPORTABLE, // key length -> 2048 - ref s_hStaticRSAKey); - - CheckStatus(ret); - - // key needs to be generated once - s_keyPairGenerated = true; - } - } - } - - _hProv = s_hStaticProv; - _hRSAKey = s_hStaticRSAKey; + _rsa = RSA.Create(); + _rsa.KeySize = 2048; } /// @@ -937,13 +584,7 @@ internal bool CanEncrypt /// the client side. internal static PSRSACryptoServiceProvider GetRSACryptoServiceProviderForClient() { - PSRSACryptoServiceProvider cryptoProvider = new PSRSACryptoServiceProvider(false); - - // set the handles for provider and rsa key - cryptoProvider._hProv = s_hStaticProv; - cryptoProvider._hRSAKey = s_hStaticRSAKey; - - return cryptoProvider; + return new PSRSACryptoServiceProvider(false); } /// @@ -954,36 +595,11 @@ internal static PSRSACryptoServiceProvider GetRSACryptoServiceProviderForClient( /// the server side. internal static PSRSACryptoServiceProvider GetRSACryptoServiceProviderForServer() { - PSRSACryptoServiceProvider cryptoProvider = new PSRSACryptoServiceProvider(true); - - return cryptoProvider; + return new PSRSACryptoServiceProvider(true); } #endregion Internal Static Methods - #region Private Methods - - /// - /// Checks the status of a call, if it had resulted in an error - /// then obtains the last error, wraps it in an exception and - /// throws the same. - /// - /// Value to examine. - private void CheckStatus(bool value) - { - if (value) - { - return; - } - - uint errorCode = PSCryptoNativeUtils.GetLastError(); - StringBuilder errorMessage = new StringBuilder(new ComponentModel.Win32Exception(unchecked((int)errorCode)).Message); - - throw new PSCryptoException(errorCode, errorMessage); - } - - #endregion Private Methods - #region IDisposable /// @@ -1000,45 +616,14 @@ protected void Dispose(bool disposing) { if (disposing) { - if (_hSessionKey != null) - { - if (!_hSessionKey.IsInvalid) - { - _hSessionKey.Dispose(); - } - - _hSessionKey = null; - } - - // we need to dismiss the provider and key - // only if the static members are not allocated - // since otherwise, these are just references - // to the static members - - if (s_hStaticRSAKey == null) + if (_rsa != null) { - if (_hRSAKey != null) - { - if (!_hRSAKey.IsInvalid) - { - _hRSAKey.Dispose(); - } - - _hRSAKey = null; - } + _rsa.Dispose(); } - if (s_hStaticProv == null) + if (_aes != null) { - if (_hProv != null) - { - if (!_hProv.IsInvalid) - { - _hProv.Dispose(); - } - - _hProv = null; - } + _aes.Dispose(); } } } @@ -1324,11 +909,7 @@ internal class PSRemotingCryptoHelperServer : PSRemotingCryptoHelper /// internal PSRemotingCryptoHelperServer() { -#if UNIX - _rsaCryptoProvider = null; -#else _rsaCryptoProvider = PSRSACryptoServiceProvider.GetRSACryptoServiceProviderForServer(); -#endif } #endregion Constructors @@ -1455,8 +1036,6 @@ internal class PSRemotingCryptoHelperClient : PSRemotingCryptoHelper internal PSRemotingCryptoHelperClient() { _rsaCryptoProvider = PSRSACryptoServiceProvider.GetRSACryptoServiceProviderForClient(); - - // _session = new RemoteSession(); } #endregion Constructors diff --git a/test/xUnit/csharp/test_CryptoUtils.cs b/test/xUnit/csharp/test_CryptoUtils.cs new file mode 100644 index 00000000000..aac3be4e29d --- /dev/null +++ b/test/xUnit/csharp/test_CryptoUtils.cs @@ -0,0 +1,38 @@ +using System; +using System.Management.Automation.Internal; +using System.Text; +using Xunit; + +namespace PSTests.Parallel +{ + public static class CryptoUntilsTests + { + [Fact] + public static void TestSessionKeyExchange() + { + using (var cryptoClient = PSRSACryptoServiceProvider.GetRSACryptoServiceProviderForClient()) + using (var cryptoServer = PSRSACryptoServiceProvider.GetRSACryptoServiceProviderForServer()) + { + // generate, export, import public key + cryptoClient.GenerateKeyPair(); + // public key generated by client + string publicKey = cryptoClient.GetPublicKeyAsBase64EncodedString(); + cryptoServer.ImportPublicKeyFromBase64EncodedString(publicKey); // sent to and imported by server + + // generate, export, import session key + cryptoServer.GenerateSessionKey(); // server provides the session key? + string sessionKey = cryptoServer.SafeExportSessionKey(); + cryptoClient.ImportSessionKeyFromBase64EncodedString(sessionKey); + + // encrypt + byte[] plainText = Encoding.UTF8.GetBytes("here is a message"); + byte[] cipherText = cryptoClient.EncryptWithSessionKey(plainText); + + // decrypt + byte[] decrypt = cryptoServer.DecryptWithSessionKey(cipherText); + + Assert.Equal(plainText, decrypt); + } + } + } +} From f854f5499c3c2b60458b3e3228c527f90d779bba Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2020 12:32:06 -0800 Subject: [PATCH 028/275] Bump `System.Data.SqlClient` from `4.8.0` to `4.8.1` (#11879) --- src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 96a91f1178f..e694bc1a620 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -16,7 +16,7 @@ - + From ac552296441a02fcbc4e4c5c4a71d1bd55ee61b1 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 19 Feb 2020 12:45:17 -0800 Subject: [PATCH 029/275] Fix daily package build (#11882) --- tools/releaseBuild/azureDevOps/templates/windows-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml index ccc2ed1ae33..36fcef54c4c 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml @@ -127,7 +127,7 @@ jobs: condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) - powershell: | - New-Item -ItemType Directory -Path $(System.ArtifactsDirectory)\signedZip -Force + New-Item -ItemType Directory -Path $(System.ArtifactsDirectory)\signed -Force displayName: 'Create empty signed folder' condition: and(succeeded(), ne(variables['SHOULD_SIGN'], 'true')) From 349783fe36e71eafe1142163577f7c19f4b2d378 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Wed, 19 Feb 2020 14:20:35 -0800 Subject: [PATCH 030/275] Make sure to test whether we skip a test using consistent logic (#11892) --- .../engine/Remoting/RemoteSession.Basic.Tests.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index 7277735e115..7b0ce019699 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -44,8 +44,12 @@ Describe "Basic Auth over HTTP not allowed on Unix" -Tag @("CI") { It "New-PSSession should NOT throw a ConnectFailed exception when specifying Basic Auth over HTTPS on Unix" -skip:($IsWindows) { $platformInfo = Get-PlatformInfo - if (($platformInfo -eq "alpine") -or ($platformInfo -eq "raspbian") ) { - Set-ItResult -Skipped -Because "MI library not available for Alpine or Raspberry Pi" + if ( + ($platformInfo.Platform -match "alpine|raspbian") -or + ($platformInfo.Platform -eq "debian" -and ($platformInfo.Version -eq '10' -or $platformInfo.Version -eq '')) -or # debian 11 has empty Version ID + ($platformInfo.Platform -eq 'centos' -and $platformInfo.Version -eq '8') + ) { + Set-ItResult -Skipped -Because "MI library not available for Alpine, Raspberry Pi, Debian 10 and 11, and CentOS 8" return } From d4536cfb777cb08ab1007c08d7732b2dfb8d268d Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 19 Feb 2020 15:07:11 -0800 Subject: [PATCH 031/275] Make LTS package always not a preview (#11895) --- build.psm1 | 9 ++++++++- tools/packaging/packaging.psm1 | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index bdc98a191f6..dd9e3ad7dad 100644 --- a/build.psm1 +++ b/build.psm1 @@ -205,9 +205,16 @@ function Test-IsPreview param( [parameter(Mandatory)] [string] - $Version + $Version, + + [switch]$IsLTS ) + if ($IsLTS.IsPresent) { + ## If we are building a LTS package, then never consider it preview. + return $false + } + return $Version -like '*-*' } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 06e40538b77..751f4a8da55 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -775,7 +775,7 @@ function New-UnixPackage { } # Determine if the version is a preview version - $IsPreview = Test-IsPreview -Version $Version + $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS # Preview versions have preview in the name $Name = if($LTS) { @@ -1440,7 +1440,7 @@ function New-MacOSLauncher [switch]$LTS ) - $IsPreview = Test-IsPreview -Version $Version + $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS $packageId = Get-MacOSPackageId -IsPreview:$IsPreview # Define folder for launcher application. From d1e1ee70db8314063ac595f285586f7edfdd07a1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2020 15:33:15 -0800 Subject: [PATCH 032/275] Bump `Microsoft.ApplicationInsights` from `2.12.1` to `2.13.0` (#11894) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 1210a95eac4..f99481c0845 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -14,7 +14,7 @@ - + From 8e683972284a5a7f773ea6d027d9aac14d7e7524 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 19 Feb 2020 15:34:29 -0800 Subject: [PATCH 033/275] Add `LTSRelease` value from `metadata.json` to `release.json` (#11897) --- tools/releaseBuild/azureDevOps/releaseBuild.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 6fece8bbeb2..37a14c4118f 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -141,7 +141,9 @@ jobs: ReleaseTagVar: $(ReleaseTagVar) - powershell: | - @{ ReleaseVersion = "$(Version)" } | ConvertTo-Json | Out-File "$(Build.StagingDirectory)\release.json" + $metadata = Get-Content '$(Build.SourcesDirectory)/tools/metadata.json' -Raw | ConvertFrom-Json + $LTS = $metadata.LTSRelease + @{ ReleaseVersion = "$(Version)"; LTSRelease = $LTS } | ConvertTo-Json | Out-File "$(Build.StagingDirectory)\release.json" Get-Content "$(Build.StagingDirectory)\release.json" Write-Host "##vso[artifact.upload containerfolder=metadata;artifactname=metadata]$(Build.StagingDirectory)\release.json" displayName: Create and upload release.json file to build artifact From 34f9b43514445a8ceac05794827072b35d0ea577 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Wed, 19 Feb 2020 19:38:28 -0800 Subject: [PATCH 034/275] Fix ConciseView where error message is wider than window width and doesn't have whitespace (#11880) --- .../PowerShellCore_format_ps1xml.cs | 24 ++++++++++++------- .../engine/Formatting/ErrorView.Tests.ps1 | 12 ++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) 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 3fdff3e13c4..09cc323b936 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1151,12 +1151,10 @@ function Get-ConciseViewPositionMessage { # replace newlines in message so it lines up correct $message = $message.Replace($newline, ' ').Replace(""`t"", ' ') - try { - $windowWidth = [Console]::WindowWidth - } - catch { - # fails if there is no console - $windowWidth = 120 + + $windowWidth = 120 + if ($Host.UI.RawUI -ne $null) { + $windowWidth = $Host.UI.RawUI.WindowSize.Width } if ($windowWidth -gt 0 -and ($message.Length - $prefixVTLength) -gt $windowWidth) { @@ -1168,9 +1166,17 @@ function Get-ConciseViewPositionMessage { while (($remainingMessage.Length + $prefixLength) -gt $windowWidth) { $subMessage = $prefix + $remainingMessage $substring = Get-TruncatedString -string $subMessage -length ($windowWidth + $prefixVtLength) - $null = $sb.Append($substring) - $null = $sb.Append($newline) - $remainingMessage = $remainingMessage.Substring($substring.Length - $prefix.Length).Trim() + + if ($substring.Length - $prefix.Length -gt 0) + { + $null = $sb.Append($substring) + $null = $sb.Append($newline) + $remainingMessage = $remainingMessage.Substring($substring.Length - $prefix.Length).Trim() + } + else + { + break + } } $null = $sb.Append($prefix + $remainingMessage.Trim()) $message = $sb.ToString() diff --git a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 index 10e8b5136cb..112d45fc172 100644 --- a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 +++ b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 @@ -87,6 +87,18 @@ Describe 'Tests for $ErrorView' -Tag CI { # validate line number is shown $e | Should -BeLike '* 2 *' } + + It "Long exception message gets rendered" { + + $msg = "1234567890" + while ($msg.Length -le $Host.UI.RawUI.WindowSize.Width) + { + $msg += $msg + } + + $e = { throw "$msg" } | Should -Throw $msg -PassThru | Out-String + $e | Should -BeLike "*$msg*" + } } Context 'NormalView tests' { From a09855017f943a9e08a04fad8f8a0a9b39bfa6b8 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 20 Feb 2020 06:57:26 -0800 Subject: [PATCH 035/275] Generate guid for FormatViewDefinition InstanceId if not provided (#11896) --- .../DisplayDatabase/displayDescriptionData.cs | 1 + .../Export-FormatData.Tests.ps1 | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs index beb774bfe51..a3e8e7400ee 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs @@ -697,6 +697,7 @@ public FormatViewDefinition(string name, PSControl control) Name = name; Control = control; + InstanceId = Guid.NewGuid(); } } 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 447a8ae4021..7fc6722d0f1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 @@ -153,4 +153,22 @@ Describe "Export-FormatData" -Tags "CI" { $runspace.Close() } } + + It 'Should be able to export multiple views' { + $listControl = [System.Management.Automation.ListControl]::Create().StartEntry().AddItemProperty('test').AddItemProperty('test2').EndEntry().EndList() + $tableControl = [System.Management.Automation.TableControl]::Create().StartRowDefinition().AddPropertyColumn('test').AddPropertyColumn('test2').EndRowDefinition().EndTable() + + $listView = [System.Management.Automation.FormatViewDefinition]::new('Default', $listControl) + $tableView = [System.Management.Automation.FormatViewDefinition]::new('Default', $tableControl) + + $list = New-Object System.Collections.Generic.List[System.Management.Automation.FormatViewDefinition] + $list.Add($listView) + $list.Add($tableView) + + $typeDef = [System.Management.Automation.ExtendedTypeDefinition]::new('TestTypeName', $list) + $filePath = Join-Path $TestDrive "test.format.ps1xml" + $typeDef | Export-FormatData -Path $filePath + [xml]$xml = Get-Content -Path $filePath + @($xml.Configuration.ViewDefinitions.View).Count | Should -Be 2 + } } From 59ad53181e124cd99744161286a910983ce1c050 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 21 Feb 2020 00:39:15 +0500 Subject: [PATCH 036/275] Remove old dead code from FullCLR (#11886) --- .../security/ExecutionPolicyCommands.cs | 2 -- .../engine/parser/Parser.cs | 4 ---- .../fanin/InitialSessionStateProvider.cs | 3 --- .../remoting/fanin/WSManPluginFacade.cs | 20 ------------------- .../help/UpdatableHelpCommandBase.cs | 6 +----- 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs index 80d125b0f5e..21da73e205c 100644 --- a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs @@ -233,10 +233,8 @@ protected override void ProcessRecord() } } -#if !CORECLR PSEtwLog.LogSettingsEvent(MshLog.GetLogContext(Context, MyInvocation), EtwLoggingStrings.ExecutionPolicyName, executionPolicy, null); -#endif } } diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index b0b84572dd5..314680c932c 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -8,14 +8,10 @@ using System.Globalization; using System.IO; using System.Linq; -using System.Linq.Expressions; using System.Management.Automation.Runspaces; using System.Reflection; using System.Runtime.CompilerServices; using System.Threading.Tasks; -#if !CORECLR -using Microsoft.CodeAnalysis; -#endif namespace System.Management.Automation.Language { diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 27bd8066da8..0d25baf5f83 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -243,9 +243,6 @@ internal static ConfigurationDataFromXML Create(string initializationParameters) readerSettings.IgnoreProcessingInstructions = true; readerSettings.MaxCharactersInDocument = 10000; readerSettings.ConformanceLevel = ConformanceLevel.Fragment; -#if !CORECLR // No XmlReaderSettings.XmlResolver in CoreCLR - readerSettings.XmlResolver = null; -#endif using (XmlReader reader = XmlReader.Create(new StringReader(initializationParameters), readerSettings)) { diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs index 3700da98e89..c318cfb2b57 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs @@ -435,27 +435,7 @@ public static int InitPlugin( { return WSManPluginConstants.ExitCodeFailure; } -#if !CORECLR - // For long-path support, Full .NET requires some AppContext switches; - // (for CoreCLR this is Not needed, because CoreCLR supports long paths by default) - // internally in .NET they are cached once retrieved and are typically hit very early during an application run; - // so per .NET team's recommendation, we are setting them as soon as we enter managed code. - // We build against CLR4.5 so we can run on Win7/Win8, but we want to use apis added to CLR 4.6, so we use reflection - try - { - Type appContextType = Type.GetType("System.AppContext"); // type is in mscorlib, so it is sufficient to supply the type name qualified by its namespace - - object[] blockLongPathsSwitch = new object[] { "Switch.System.IO.BlockLongPaths", false }; - object[] useLegacyPathHandlingSwitch = new object[] { "Switch.System.IO.UseLegacyPathHandling", false }; - appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, blockLongPathsSwitch, CultureInfo.InvariantCulture); - appContextType.InvokeMember("SetSwitch", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.InvokeMethod, null, null, useLegacyPathHandlingSwitch, CultureInfo.InvariantCulture); - } - catch (Exception) - { - // If there are any non-critical exceptions (e.g. we are running on CLR prior to 4.6.2), we won't be able to use long paths - } -#endif Marshal.StructureToPtr(workerPtrs.UnmanagedStruct, wkrPtrs, false); return WSManPluginConstants.ExitCodeSuccess; } diff --git a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs index ad6a1af315e..6de08213888 100644 --- a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs +++ b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs @@ -823,12 +823,8 @@ internal void ValidatePathProvider(PathInfo path) /// Message to log. internal void LogMessage(string message) { -#if !CORECLR // TODO:CORECLR Uncomment when we add PSEtwLog support - List details = new List(); - - details.Add(message); + List details = new List() { message }; PSEtwLog.LogPipelineExecutionDetailEvent(MshLog.GetLogContext(Context, Context.CurrentCommandProcessor.Command.MyInvocation), details); -#endif } #endregion From 45bc965af8af4b18977c347b18c304ad4574c143 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 21 Feb 2020 00:57:00 +0500 Subject: [PATCH 037/275] Fix NREs in SuspendStoppingPipeline() and RestoreStoppingPipeline() (#11870) --- .../engine/runtime/Operations/MiscOps.cs | 16 ++++++++++---- .../Eventing.Tests.ps1 | 21 ++++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 98b2cb74ccd..940ac0dcbf6 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -1575,15 +1575,23 @@ private static int FindMatchingHandlerByType(Type exceptionType, Type[] types) internal static bool SuspendStoppingPipeline(ExecutionContext context) { LocalPipeline lpl = (LocalPipeline)context.CurrentRunspace.GetCurrentlyRunningPipeline(); - bool oldIsStopping = lpl.Stopper.IsStopping; - lpl.Stopper.IsStopping = false; - return oldIsStopping; + if (lpl != null) + { + bool oldIsStopping = lpl.Stopper.IsStopping; + lpl.Stopper.IsStopping = false; + return oldIsStopping; + } + + return false; } internal static void RestoreStoppingPipeline(ExecutionContext context, bool oldIsStopping) { LocalPipeline lpl = (LocalPipeline)context.CurrentRunspace.GetCurrentlyRunningPipeline(); - lpl.Stopper.IsStopping = oldIsStopping; + if (lpl != null) + { + lpl.Stopper.IsStopping = oldIsStopping; + } } internal static void CheckActionPreference(FunctionContext funcContext, Exception exception) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 index 6509b226c83..eeffcf70ed3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -Describe "Event Subscriber Tests" -tags "CI" { + +Describe "Event Subscriber Tests" -Tags "Feature" { BeforeEach { Get-EventSubscriber | Unregister-Event } @@ -13,7 +14,7 @@ Describe "Event Subscriber Tests" -tags "CI" { Get-EventSubscriber | Should -BeNullOrEmpty $messageData = new-object psobject $job = Start-Job { Start-Sleep -Seconds 5; 1..5 } - $eventtest = Register-ObjectEvent $job -EventName StateChanged -SourceIdentifier EventSIDTest -Action {} -MessageData $messageData + $null = Register-ObjectEvent $job -EventName StateChanged -SourceIdentifier EventSIDTest -Action {} -MessageData $messageData new-event EventSIDTest wait-event EventSIDTest @@ -27,7 +28,7 @@ Describe "Event Subscriber Tests" -tags "CI" { It "Access a global variable from an event action." { Get-EventSubscriber | Should -BeNullOrEmpty set-variable incomingGlobal -scope global -value globVarValue - $eventtest = register-engineevent -SourceIdentifier foo -Action {set-variable -scope global -name aglobalvariable -value $incomingGlobal} + $null = register-engineevent -SourceIdentifier foo -Action {set-variable -scope global -name aglobalvariable -value $incomingGlobal} new-event foo $getvar = get-variable aglobalvariable -scope global $getvar.Name | Should -Be aglobalvariable @@ -35,4 +36,18 @@ Describe "Event Subscriber Tests" -tags "CI" { Unregister-Event foo Get-EventSubscriber | Should -BeNullOrEmpty } + + It 'Should not throw when having finally block in Powershell.Exiting Action scriptblock' { + $pwsh = "$PSHOME/pwsh" + $output = & $pwsh { + Register-EngineEvent -SourceIdentifier Powershell.Exiting -Action { + try{ + try{} finally{} + } + catch{ Write-Host "Exception" -Nonewline } + } + } | Out-String + + $output | Should -Not -BeLike "*Exception*" + } } From 3c3293df24c74a8159cde763d239654413e442a8 Mon Sep 17 00:00:00 2001 From: Alejandro Pauly Date: Thu, 20 Feb 2020 15:02:48 -0500 Subject: [PATCH 038/275] Update Adopters.md to include info on Azure Pipelines and GitHub Actions (#11888) --- ADOPTERS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ADOPTERS.md b/ADOPTERS.md index ba8b569b859..48cec93627b 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -30,3 +30,5 @@ This is a list of adopters of using PowerShell in production or in their product as well as supporting PowerShell Core in both Windows and Linux EC2 Images. * [Azure Resource Manager Deployment Scripts](https://docs.microsoft.com/azure/azure-resource-manager/templates/deployment-script-template) Complete the "last mile" of your Azure Resource Manager (ARM) template deployments with a Deployment Script, which enables you to run an arbitrary PowerShell script in the context of a deployment. Designed to let you complete tasks that should be part of a deployment, but are not possible in an ARM template today — for example, creating a Key Vault certificate or querying an external API for a new CIDR block. +* [Azure Pipelines Hosted Agents](https://docs.microsoft.com/azure/devops/pipelines/agents/hosted?view=azure-devops) Windows, Ubuntu, and MacOS Agents used by Azure Pipelines customers have PowerShell pre-installed so that customers can make use of it for all their CI/CD needs. +* [GitHub Actions Virtual-Environments for Hosted Runners](https://help.github.com/actions/reference/virtual-environments-for-github-hosted-runners) Windows, Ubuntu, and MacOS virtual environments used by customers of GitHub Actions include Powershell out of the box. From d3ad083833ecba0b8d3d2f7a8588367bd9d771fc Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Thu, 20 Feb 2020 14:10:58 -0800 Subject: [PATCH 039/275] Fix SSH remoting error on Windows platform (#11907) --- .../engine/remoting/common/RunspaceConnectionInfo.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index f7312183c71..937fa7dfab0 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -2548,7 +2548,12 @@ private static Process CreateProcessWithRedirectedStd( try { - var cmdLine = string.Format(CultureInfo.InvariantCulture, @"""{0}"" {1}", startInfo.FileName, startInfo.Arguments); + // Create process start command line with filename and argument list. + var cmdLine = string.Format( + CultureInfo.InvariantCulture, + @"""{0}"" {1}", + startInfo.FileName, + string.Join(' ', startInfo.ArgumentList)); lpStartupInfo.hStdInput = new SafeFileHandle(stdInPipeClient.DangerousGetHandle(), false); lpStartupInfo.hStdOutput = new SafeFileHandle(stdOutPipeClient.DangerousGetHandle(), false); From da94afaf5b176fc85887fd314d0643fcd80bccda Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 20 Feb 2020 14:28:38 -0800 Subject: [PATCH 040/275] Update the map between console color to `VT` sequences (#11891) --- .../utils/VTUtils.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/System.Management.Automation/utils/VTUtils.cs b/src/System.Management.Automation/utils/VTUtils.cs index 2ff110dd423..379d5984c07 100644 --- a/src/System.Management.Automation/utils/VTUtils.cs +++ b/src/System.Management.Automation/utils/VTUtils.cs @@ -22,24 +22,24 @@ public enum VT Inverse } - private static readonly Dictionary ConsoleColors = new Dictionary + private static readonly Dictionary ForegroundColorMap = new Dictionary { - { ConsoleColor.Black, "\x1b[2;30m" }, - { ConsoleColor.Gray, "\x1b[2;37m" }, - { ConsoleColor.Red, "\x1b[1;31m" }, - { ConsoleColor.Green, "\x1b[1;32m" }, - { ConsoleColor.Yellow, "\x1b[1;33m" }, - { ConsoleColor.Blue, "\x1b[1;34m" }, - { ConsoleColor.Magenta, "\x1b[1;35m" }, - { ConsoleColor.Cyan, "\x1b[1;36m" }, - { ConsoleColor.White, "\x1b[1;37m" }, - { ConsoleColor.DarkRed, "\x1b[2;31m" }, - { ConsoleColor.DarkGreen, "\x1b[2;32m" }, - { ConsoleColor.DarkYellow, "\x1b[2;33m" }, - { ConsoleColor.DarkBlue, "\x1b[2;34m" }, - { ConsoleColor.DarkMagenta, "\x1b[2;35m" }, - { ConsoleColor.DarkCyan, "\x1b[2;36m" }, - { ConsoleColor.DarkGray, "\x1b[1;30m" }, + { ConsoleColor.Black, "\x1b[30m" }, + { ConsoleColor.Gray, "\x1b[37m" }, + { ConsoleColor.Red, "\x1b[91m" }, + { ConsoleColor.Green, "\x1b[92m" }, + { ConsoleColor.Yellow, "\x1b[93m" }, + { ConsoleColor.Blue, "\x1b[94m" }, + { ConsoleColor.Magenta, "\x1b[95m" }, + { ConsoleColor.Cyan, "\x1b[96m" }, + { ConsoleColor.White, "\x1b[97m" }, + { ConsoleColor.DarkRed, "\x1b[31m" }, + { ConsoleColor.DarkGreen, "\x1b[32m" }, + { ConsoleColor.DarkYellow, "\x1b[33m" }, + { ConsoleColor.DarkBlue, "\x1b[34m" }, + { ConsoleColor.DarkMagenta, "\x1b[35m" }, + { ConsoleColor.DarkCyan, "\x1b[36m" }, + { ConsoleColor.DarkGray, "\x1b[90m" }, }; private static readonly Dictionary VTCodes = new Dictionary @@ -60,7 +60,7 @@ public enum VT public static string GetEscapeSequence(ConsoleColor color) { string value = string.Empty; - ConsoleColors.TryGetValue(color, out value); + ForegroundColorMap.TryGetValue(color, out value); return value; } From 697dc5b37149d0dd98c34c33a87c833a23fe467e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 21 Feb 2020 15:58:15 -0800 Subject: [PATCH 041/275] Update `README.md` and `metadata.json` next release (#11918) --- README.md | 34 +++++++++++++++++----------------- tools/metadata.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 840ebff097a..05602d7c1ec 100644 --- a/README.md +++ b/README.md @@ -77,23 +77,23 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [rl-raspbian64]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-x86.msi -[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview_7.0.0-rc.2-1.ubuntu.18.04_amd64.deb -[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview_7.0.0-rc.2-1.ubuntu.16.04_amd64.deb -[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview_7.0.0-rc.2-1.debian.9_amd64.deb -[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview_7.0.0-rc.2-1.debian.10_amd64.deb -[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview-7.0.0_rc.2-1.rhel.7.x86_64.rpm -[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-preview-7.0.0_rc.2-1.centos.8.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-osx-x64.pkg -[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-arm32.zip -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/PowerShell-7.0.0-rc.2-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-osx-x64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x86.msi +[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.ubuntu.18.04_amd64.deb +[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.ubuntu.16.04_amd64.deb +[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.debian.9_amd64.deb +[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.debian.10_amd64.deb +[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview-7.0.0_rc.3-1.rhel.7.x86_64.rpm +[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview-7.0.0_rc.3-1.centos.8.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-osx-x64.pkg +[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-arm32.zip +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-osx-x64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 diff --git a/tools/metadata.json b/tools/metadata.json index 6906313d50a..a63d548370f 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,6 +1,6 @@ { "StableReleaseTag": "v6.2.4", - "PreviewReleaseTag": "v7.0.0-rc.2", + "PreviewReleaseTag": "v7.0.0-rc.3", "ServicingReleaseTag": "v6.1.6", "ReleaseTag": "v6.2.4", "NextReleaseTag": "v7.0.0-preview.7", From d87472d368eb27a30101baa727900e520858c845 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 17:36:39 -0800 Subject: [PATCH 042/275] Bump `Microsoft.ApplicationInsights` from `2.13.0` to `2.13.1` (#11925) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index f99481c0845..3eef012f9b2 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -14,7 +14,7 @@ - + From 2db8516a8c71ff023242a77e4162c5270ac73e7f Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Wed, 26 Feb 2020 08:07:57 -0800 Subject: [PATCH 043/275] Fix ConciseView to not show the line information within the error messages (#11952) --- .../DefaultFormatters/PowerShellCore_format_ps1xml.cs | 3 ++- test/powershell/engine/Formatting/ErrorView.Tests.ps1 | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 09cc323b936..e7003f47585 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1100,7 +1100,8 @@ function Get-ConciseViewPositionMessage { $offsetInLine = 0 } else { - $positionMessage = $myinv.PositionMessage.Split($newline) + # use newline char instead of $newline because that is what is in the message + $positionMessage = $myinv.PositionMessage.Split(""`n"") $line = $positionMessage[1].Substring(1) # skip the '+' at the start $highlightLine = $positionMessage[$positionMessage.Count - 1].Substring(1) $offsetLength = $highlightLine.Trim().Length diff --git a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 index 112d45fc172..29b7ee98d5e 100644 --- a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 +++ b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 @@ -99,6 +99,12 @@ Describe 'Tests for $ErrorView' -Tag CI { $e = { throw "$msg" } | Should -Throw $msg -PassThru | Out-String $e | Should -BeLike "*$msg*" } + + It "Position message does not contain line information" { + + $e = & "$PSHOME/pwsh" -noprofile -command "foreach abc" | Out-String + $e | Should -Not -BeLike "*At line*" + } } Context 'NormalView tests' { From e5116ae4ea043daf0e0aea7a310933adf399fccc Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Wed, 26 Feb 2020 15:14:25 -0800 Subject: [PATCH 044/275] Add helper functions for SSH remoting tests (#11955) --- .../HelpersRemoting/HelpersRemoting.psd1 | 2 +- .../HelpersRemoting/HelpersRemoting.psm1 | 336 +++++++++++++++++- 2 files changed, 334 insertions(+), 4 deletions(-) diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 index 772d2145cc2..8697076839b 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 @@ -16,7 +16,7 @@ Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' Description = 'Temporary module for remoting tests' -FunctionsToExport = 'New-RemoteRunspace', 'New-RemoteSession', 'Enter-RemoteSession', 'Invoke-RemoteCommand', 'Connect-RemoteSession', 'New-RemoteRunspacePool', 'Get-PipePath' +FunctionsToExport = 'New-RemoteRunspace', 'New-RemoteSession', 'Enter-RemoteSession', 'Invoke-RemoteCommand', 'Connect-RemoteSession', 'New-RemoteRunspacePool', 'Get-PipePath', 'Install-SSHRemoting' AliasesToExport = @() diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 index 6bf0728806c..b056819f89e 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 @@ -1,8 +1,9 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -# -# This module include help functions for writing remoting tests -# + +## +## WinRM Remoting helper functions for writing remoting tests +## $Script:CIRemoteCred = $null @@ -258,3 +259,332 @@ function Get-PipePath { } "$([System.IO.Path]::GetTempPath())CoreFxPipe_$PipeName" } + +## +## SSH Remoting helper functions for writing remoting tests +## + +function Get-WindowsOpenSSHLink +{ + # From the Win OpenSSH Wiki page (https://github.com/PowerShell/Win32-OpenSSH/wiki/How-to-retrieve-links-to-latest-packages) + $origSecurityProtocol = [Net.ServicePointManager]::SecurityProtocol + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + try + { + $url = 'https://github.com/PowerShell/Win32-OpenSSH/releases/latest/' + $request = [System.Net.WebRequest]::Create($url) + $request.AllowAutoRedirect = $false + $response = & { $request.GetResponse() } 2>$null + + if ($null -ne $response) + { + $location = [string] $response.GetResponseHeader("Location") + if (! [string]::IsNullOrEmpty($location)) + { + return $location.Replace('tag', 'download') + '/OpenSSH-Win64.zip' + } + } + } + finally + { + [Net.ServicePointManager]::SecurityProtocol = $origSecurityProtocol + } + + # Default to last known latest release + Write-Warning "Unable to get latest OpenSSH release link. Using default release link." + return 'https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.1.0.0p1-Beta/OpenSSH-Win64.zip' +} + +function Install-WindowsOpenSSH +{ + param ( + [switch] $Force + ) + + $destPath = Join-Path -Path $env:ProgramFiles -ChildPath 'OpenSSH-Win64' + if (Test-Path -Path $destPath) + { + if (! $Force) + { + Write-Verbose -Verbose "OpenSSH-Win64 already exists, skipping install step" + return + } + + Write-Verbose -Verbose "Force re-install OpenSSH-Win64 ..." + Stop-Service -Name sshd -ErrorAction SilentlyContinue + Remove-Item -Path $destPath -Recurse -Force + } + + # Get link to latest OpenSSH release + Write-Verbose -Verbose "Downloading latest OpenSSH-Win64 package link ..." + $downLoadLink = Get-WindowsOpenSSHLink + + # Download and extract OpenSSH package + Write-Verbose -Verbose "Downloading OpenSSH-Win64 zip package ..." + $packageFilePath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'OpenSSH-Win64.zip' + $oldProgressPreference = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + try + { + Invoke-WebRequest -Uri $downLoadLink -OutFile $packageFilePath + Expand-Archive -Path $packageFilePath -DestinationPath $env:ProgramFiles + } + finally + { + $ProgressPreference = $oldProgressPreference + } + + # Install and start SSHD service + Push-Location $destPath + try + { + Write-Verbose -Verbose "Running install-sshd.ps1 ..." + .\install-sshd.ps1 + + $netRule = Get-NetFirewallRule -Name sshd -ErrorAction SilentlyContinue + if ($null -eq $netRule) + { + Write-Verbose -Verbose "Creating firewall rule for SSHD ..." + New-NetFirewallRule -Name sshd -DisplayName "OpenSSH Server (sshd)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 + } + + Write-Verbose -Verbose "Starting SSHD service ..." + Restart-Service -Name sshd + } + finally + { + Pop-Location + } + + # Current release of Windows OpenSSH configures SSHD to change AuthorizedKeyFiles for administrators + # Comment it out so that normal key based authentication works per user as with Linux platforms. + # Match Group administrators + # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + $sshdFilePath = "$env:ProgramData\ssh\sshd_config" + $sshdContent = Get-Content $sshdFilePath + $sshdNewContent = [string[]] @() + $modified = $false + foreach ($item in $sshdContent) + { + if ($item.TrimStart().StartsWith('Match Group administrators') -or + $item.TrimStart().StartsWith('AuthorizedKeysFile __PROGRAMDATA')) + { + if (!$modified) { $modified = $true } + $sshdNewContent += "#" + $item + } + else + { + $sshdNewContent += $item + } + } + if ($modified) + { + $sshdNewContent | Set-Content -Path $sshdFilePath -Force + } +} + +function Install-SSHRemotingOnWindows +{ + param ( + [Parameter(Mandatory=$true)] + [string] $PowerShellPath + ) + + # Install sshd service + if ($null -eq (Get-Command -Name sshd -ErrorAction SilentlyContinue)) + { + Write-Verbose -Verbose "Installing SSHD service ..." + Install-WindowsOpenSSH -Force + } + + if (! (Test-Path -Path "$env:ProgramData\ssh\sshd_config")) + { + throw "Unable to install SSH service. Config file $env:ProgramData\ssh\sshd_config does not exist." + } + + # Configure SSH to authenticate with keys for this user. + # PubkeyAuthentication should be enabled by default. + # RSA keys should be enabled by default. + + # Create user .ssh directory. + if (! (Test-Path -Path "$HOME\.ssh")) + { + Write-Verbose -Verbose "Creating $HOME\.ssh directory ..." + New-Item -Path "$HOME\.ssh" -ItemType Directory -Force + } + + # Create new rsa keys for current user. + if ( !(Test-Path "$HOME\.ssh\id_rsa")) + { + Write-Verbose -Verbose "Creating rsa keys ..." + cmd /c "ssh-keygen -t rsa -f $HOME\.ssh\id_rsa -q -N `"`"" + } + if (! (Test-Path "$HOME\.ssh\id_rsa")) + { + throw "id_rsa private key file was not created." + } + if (! (Test-Path "$HOME\.ssh\id_rsa.pub")) + { + throw "id_rsa.pub public key file was not created." + } + + # Create authorized keys file. + Write-Verbose -Verbose "Creating authorized_keys ..." + Get-Content -Path "$HOME\.ssh\id_rsa.pub" | Set-Content -Path "$HOME\.ssh\authorized_keys" -Force + + # Create known_hosts file for 'localhost' connection. + Write-Verbose -Verbose "Creating known_hosts ..." + ssh-keyscan -H localhost | Set-Content -Path "$HOME\.ssh\known_hosts" -Force + + # Install Microsoft.PowerShell.RemotingTools module. + if ($null -eq (Get-Module -Name Microsoft.PowerShell.RemotingTools -ListAvailable)) + { + Write-Verbose -Verbose "Installing Microsoft.PowerShell.RemotingTools ..." + Install-Module -Name Microsoft.PowerShell.RemotingTools -Force -SkipPublisherCheck + } + + # Add PowerShell endpoint to SSHD. + Write-Verbose -Verbose "Running Enable-SSHRemoting ..." + Enable-SSHRemoting -SSHDConfigFilePath "$env:ProgramData\ssh\sshd_config" -PowerShellFilePath $PowerShellPath -Force + + Write-Verbose -Verbose "Restarting sshd service ..." + Restart-Service -Name sshd + + # Test SSH remoting. + Write-Verbose -Verbose "Testing SSH remote connection ..." + $session = New-PSSession -HostName localhost + try + { + if ($null -eq $session) + { + throw "Could not successfully create SSH remoting connection." + } + } + finally + { + Remove-PSSession $session + } +} + +function Install-SSHRemotingOnLinux +{ + param ( + [Parameter(Mandatory=$true)] + [string] $PowerShellPath + ) + + # Install ssh daemon. + if (! (Test-Path -Path /etc/ssh/sshd_config)) + { + Write-Verbose -Verbose "Installing openssh-server ..." + sudo apt-get install --yes openssh-server + sudo systemctl restart ssh + } + if (! (Test-Path -Path /etc/ssh/sshd_config)) + { + throw "Unable to install SSH daemon. Config file /etc/ssh/sshd_config does not exist." + } + + # Configure SSH to authenticate with keys for this user. + # PubkeyAuthentication should be enabled by default. + # RSA keys should be enabled by default. + + # Create user .ssh directory. + if (! (Test-Path -Path "$HOME/.ssh")) + { + Write-Verbose -Verbose "Creating $HOME/.ssh directory ..." + New-Item -Path "$HOME/.ssh" -ItemType Directory -Force + } + + # Create new rsa keys for current user. + if ( !(Test-Path "$HOME/.ssh/id_rsa")) + { + Write-Verbose -Verbose "Creating rsa keys ..." + bash -c "ssh-keygen -t rsa -f $HOME/.ssh/id_rsa -q -N ''" + } + if (! (Test-Path "$HOME/.ssh/id_rsa")) + { + throw "id_rsa private key file was not created." + } + if (! (Test-Path "$HOME/.ssh/id_rsa.pub")) + { + throw "id_rsa.pub public key file was not created." + } + + # Create authorized keys file. + Write-Verbose -Verbose "Creating authorized_keys ..." + Get-Content -Path "$HOME/.ssh/id_rsa.pub" | Set-Content -Path "$HOME/.ssh/authorized_keys" -Force + + # Create known_hosts file for 'localhost' connection. + Write-Verbose -Verbose "Updating known_hosts ..." + ssh-keyscan -H localhost | Set-Content -Path "$HOME/.ssh/known_hosts" -Force + + # Install Microsoft.PowerShell.RemotingTools module. + if ($null -eq (Get-Module -Name Microsoft.PowerShell.RemotingTools -ListAvailable)) + { + Write-Verbose -Verbose "Installing Microsoft.PowerShell.RemotingTools ..." + Install-Module -Name Microsoft.PowerShell.RemotingTools -Force -SkipPublisherCheck + } + + # Add PowerShell endpoint to SSHD. + Write-Verbose -Verbose "Running Enable-SSHRemoting ..." + sudo pwsh -c 'Enable-SSHRemoting -SSHDConfigFilePath /etc/ssh/sshd_config -PowerShellFilePath $PowerShellPath -Force' + + Write-Verbose -Verbose "Restarting sshd ..." + sudo systemctl restart ssh + + # Test SSH remoting. + Write-Verbose -Verbose "Testing SSH remote connection ..." + $session = New-PSSession -HostName localhost + try + { + if ($null -eq $session) + { + throw "Could not successfully create SSH remoting connection." + } + } + finally + { + Remove-PSSession $session + } +} + +<# +.Synopsis + Installs and configures SSH components, and creates an SSH PowerShell remoting endpoint. +.Description + This cmdlet assumes SSH client is installed on the machine, but will check for SSHD service and + install it if needed. + Next, it will configure SSHD for key based user authentication, for the current user context. + Then it configures SSHD for a PowerShell endpoint based on the provided PowerShell file path. + If no PowerShell file path is provided, the current PowerShell instance ($PSHOME) is used. + Finally, it will test the new SSH remoting endpoint connection to ensure it works. + Currently, only Ubuntu and Windows platforms are supported. +.Parameter PowerShellPath + Specifies a PowerShell, pwsh(.exe), executable path that will be used for the remoting endpoint. +#> +function Install-SSHRemoting +{ + param ( + [string] $PowerShellFilePath + ) + + if ($IsWindows) + { + if ([string]::IsNullOrEmpty($PowerShellFilePath)) { $PowerShellFilePath = "$PSHOME/pwsh.exe" } + Install-SSHRemotingOnWindows -PowerShellPath $PowerShellFilePath + return + } + elseif ($IsLinux) + { + $LinuxInfo = Get-Content /etc/os-release -Raw | ConvertFrom-StringData + if ($LinuxInfo.ID -match 'ubuntu') + { + if ([string]::IsNullOrEmpty($PowerShellFilePath)) { $PowerShellFilePath = "$PSHOME/pwsh" } + Install-SSHRemotingOnLinux -PowerShellPath $PowerShellFilePath + return + } + } + + Write-Error "Platform not supported. Only Windows and Ubuntu plaforms are currently supported." +} From 23b0299b2af889fab8a640597cf679b49086caee Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 26 Feb 2020 15:20:01 -0800 Subject: [PATCH 045/275] Ensure the man gzip has the correct name for LTS release (#11956) --- tools/packaging/packaging.psm1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 751f4a8da55..62d9cb758f0 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -842,7 +842,7 @@ function New-UnixPackage { } # Generate gzip of man file - $ManGzipInfo = New-ManGzip -IsPreview:$IsPreview + $ManGzipInfo = New-ManGzip -IsPreview:$IsPreview -IsLTS:$LTS # Change permissions for packaging Write-Log "Setting permissions..." @@ -1376,15 +1376,20 @@ function New-ManGzip { param( [switch] - $IsPreview + $IsPreview, + + [switch] + $IsLTS ) Write-Log "Creating man gz..." # run ronn to convert man page to roff $RonnFile = "$RepoRoot/assets/pwsh.1.ronn" - if ($IsPreview.IsPresent) + + if ($IsPreview.IsPresent -or $IsLTS.IsPresent) { - $newRonnFile = $RonnFile -replace 'pwsh', 'pwsh-preview' + $prodName = if ($IsLTS) { 'pwsh-lts' } else { 'pwsh-preview' } + $newRonnFile = $RonnFile -replace 'pwsh', $prodName Copy-Item -Path $RonnFile -Destination $newRonnFile -force $RonnFile = $newRonnFile } From 4e896983c7d902ea0053abd2813782621cc0590d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 26 Feb 2020 15:45:28 -0800 Subject: [PATCH 046/275] Enable `Ctrl+C` to work for global tool (#11959) --- src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs b/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs index 79c13b4efc5..c7d89aa65fa 100644 --- a/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs +++ b/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs @@ -36,6 +36,11 @@ public static int Main(string[] args) if (File.Exists(pwshPath)) { + Console.CancelKeyPress += (sender, e) => + { + e.Cancel = true; + }; + var process = System.Diagnostics.Process.Start("dotnet", processArgs); process.WaitForExit(); return process.ExitCode; From 277b277b57ea9ee7ec9f867a287dfb897ffb1451 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 26 Feb 2020 15:45:56 -0800 Subject: [PATCH 047/275] Bump .NET core framework to `3.1.2` (#11963) --- .devcontainer/Dockerfile | 2 +- assets/files.wxs | 6 +++--- global.json | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 97c6efee968..1ad81125758 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.101 +FROM mcr.microsoft.com/dotnet/core/sdk:3.1.102 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/assets/files.wxs b/assets/files.wxs index ebf22a299a0..36357ec070b 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3071,8 +3071,8 @@ - - + + @@ -4063,7 +4063,7 @@ - + diff --git a/global.json b/global.json index c685cffc7ac..5360f36edb7 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.101" + "version": "3.1.102" } } diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index af082eb385b..a262d481dcc 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,7 +7,7 @@ - + From c97f2d7fd78576709cd776c9c4d6b44a7a5a1999 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 27 Feb 2020 10:13:29 -0800 Subject: [PATCH 048/275] Publish PowerShell `vPack` for stable and better builds (#11960) --- .../azureDevOps/templates/vpackReleaseJob.yml | 86 +++++++++++++++++++ .../releaseBuild/azureDevOps/vpackRelease.yml | 55 ++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml create mode 100644 tools/releaseBuild/azureDevOps/vpackRelease.yml diff --git a/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml new file mode 100644 index 00000000000..97d3bea8d1d --- /dev/null +++ b/tools/releaseBuild/azureDevOps/templates/vpackReleaseJob.yml @@ -0,0 +1,86 @@ +parameters: + architecture: x64 + +jobs: +- job: vpack_${{ parameters.architecture }} + displayName: Build and Publish VPack - ${{ parameters.architecture }} + condition: succeeded() + pool: Package ES Standard Build + steps: + + - template: ./SetVersionVariables.yml + parameters: + ReleaseTagVar: $(ReleaseTagVar) + + - pwsh: | + $azcopy = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe" + + Write-Host "running: $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:****** /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY)" + & $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:$(StorageAccountKey) /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY) + displayName: 'Download Azure Artifacts' + + - pwsh: 'Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name' + displayName: 'Capture Artifact Listing' + + - pwsh: | + $message = @() + Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip, *.msi | ForEach-Object { + if($_.Name -notmatch 'PowerShell-\d\.\d\.\d\-([a-z]*.\d+\-)?win\-(fxdependent|x64|arm32|arm64|x86|fxdependentWinDesktop)\.(msi|zip){1}') + { + $messageInstance = "$($_.Name) is not a valid package name" + $message += $messageInstance + Write-Warning $messageInstance + } + } + + if($message.count -gt 0){throw ($message | out-string)} + displayName: 'Validate Zip and MSI Package Names' + + - pwsh: | + Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -include *.zip, *.msi | ForEach-Object { + if($_.Name -match 'PowerShell-\d\.\d\.\d\-([a-z]*.\d+\-)?win\-(${{ parameters.architecture }})\.(zip){1}') + { + $destDir = "$(System.ArtifactsDirectory)\vpack${{ parameters.architecture }}" + $null = new-item -ItemType Directory -Path $destDir + Expand-Archive -Path $_.FullName -DestinationPath $destDir + $vstsCommandString = "vso[task.setvariable variable=vpackDir]$destDir" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + } + } + displayName: 'Extract Zip' + + - pwsh: | + $vpackVersion = '$(version)' + + if('$(VPackPublishOverride)' -ne '' -and '$(VPackPublishOverride)' -ne 'None' ) + { + Write-Host "Using VPackPublishOverride varabile" + $vpackVersion = '$(VPackPublishOverride)' + } + + $vstsCommandString = "vso[task.setvariable variable=vpackVersion]$vpackVersion" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: 'Set vpackVersion' + + - pwsh: | + Get-ChildItem -Path env: + displayName: Capture Environment + condition: succeededOrFailed() + + - task: PkgESVPack@10 + displayName: 'Package ES - VPack ' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + sourceDirectory: '$(vpackDir)' + description: PowerShell ${{ parameters.architecture }} $(version) + pushPkgName: 'PowerShell.${{ parameters.architecture }}' + configurations: Release + platforms: x64 + target: '$(System.ArtifactsDirectory)' + owner: tplunk + provData: false + version: '$(vpackVersion)' + condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) diff --git a/tools/releaseBuild/azureDevOps/vpackRelease.yml b/tools/releaseBuild/azureDevOps/vpackRelease.yml new file mode 100644 index 00000000000..48b9e833844 --- /dev/null +++ b/tools/releaseBuild/azureDevOps/vpackRelease.yml @@ -0,0 +1,55 @@ +name: vpack-$(Build.BuildId) +trigger: + branches: + include: + - master + - release* +pr: + branches: + include: + - master + - release* + +variables: + - name: DOTNET_CLI_TELEMETRY_OPTOUT + value: 1 + - name: POWERSHELL_TELEMETRY_OPTOUT + value: 1 + - group: Azure Blob variable group + +# Set AzDevOps Agent to clean the machine after the end of the build +resources: +- repo: self + clean: true + +jobs: +- job: rename + displayName: Name the build + condition: succeeded() + pool: + vmImage: 'windows-latest' + steps: + + - template: ./templates/SetVersionVariables.yml + parameters: + ReleaseTagVar: $(ReleaseTagVar) + + - powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + displayName: Set Build Name for Non-PR + condition: ne(variables['Build.Reason'], 'PullRequest') + +- template: ./templates/vpackReleaseJob.yml + parameters: + architecture: x64 + +- template: ./templates/vpackReleaseJob.yml + parameters: + architecture: x86 + +- template: ./templates/vpackReleaseJob.yml + parameters: + architecture: arm32 + +- template: ./templates/vpackReleaseJob.yml + parameters: + architecture: arm64 From 91c9be996abaca1939b3f14aa4df72dc76e2df90 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 27 Feb 2020 17:23:55 -0800 Subject: [PATCH 049/275] Ignore last exit code in the build step as `dotnet` may return error when SDK is not installed (#11972) --- build.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index dd9e3ad7dad..b8b10de0cc1 100644 --- a/build.psm1 +++ b/build.psm1 @@ -342,7 +342,7 @@ function Start-PSBuild { } # Verify if the dotnet in-use is the required version - $dotnetCLIInstalledVersion = (dotnet --version) + $dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode If ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) { Write-Warning @" The currently installed .NET Command Line Tools is not the required version. @@ -1837,7 +1837,7 @@ function Start-PSBootstrap { $dotNetExists = precheck 'dotnet' $null $dotNetVersion = [string]::Empty if($dotNetExists) { - $dotNetVersion = (dotnet --version) + $dotNetVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode } if(!$dotNetExists -or $dotNetVersion -ne $dotnetCLIRequiredVersion -or $Force.IsPresent) { @@ -2017,7 +2017,7 @@ function Find-Dotnet() { if (precheck dotnet) { # Must run from within repo to ensure global.json can specify the required SDK version Push-Location $PSScriptRoot - $dotnetCLIInstalledVersion = (dotnet --version) + $dotnetCLIInstalledVersion = Start-NativeExecution -sb { dotnet --version } -IgnoreExitcode Pop-Location if ($dotnetCLIInstalledVersion -ne $dotnetCLIRequiredVersion) { Write-Warning "The 'dotnet' in the current path can't find SDK version ${dotnetCLIRequiredVersion}, prepending $dotnetPath to PATH." From 00b60c44fa91606a7458c3e9a428f8d05c0639d7 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Fri, 28 Feb 2020 12:26:08 -0800 Subject: [PATCH 050/275] Remove hop restriction for interactive sessions (#11920) --- .../remoting/commands/PushRunspaceCommand.cs | 19 ----------- .../remoting/common/remotingexceptions.cs | 1 - .../remoting/server/ServerRemoteHost.cs | 33 ------------------- .../server/ServerRunspacePoolDriver.cs | 3 -- .../resources/RemotingErrorIdStrings.resx | 3 -- 5 files changed, 59 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs index eb5b85659fa..70601f5f321 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs @@ -246,25 +246,6 @@ protected override void ProcessRecord() return; } - // Check if current host is remote host. Enter-PSSession on remote host is not - // currently supported. - if (!IsParameterSetForVM() && - !IsParameterSetForContainer() && - !IsParameterSetForVMContainerSession() && - this.Context != null && - this.Context.EngineHostInterface != null && - this.Context.EngineHostInterface.ExternalHost != null && - this.Context.EngineHostInterface.ExternalHost is System.Management.Automation.Remoting.ServerRemoteHost) - { - WriteError( - new ErrorRecord( - new ArgumentException(GetMessage(RemotingErrorIdStrings.RemoteHostDoesNotSupportPushRunspace)), - PSRemotingErrorId.RemoteHostDoesNotSupportPushRunspace.ToString(), - ErrorCategory.InvalidArgument, - null)); - return; - } - // for the console host and Graphical PowerShell host // we want to skip pushing into the the runspace if // the host is in a nested prompt diff --git a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs index 928bf627284..60db14226b8 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs @@ -209,7 +209,6 @@ internal enum PSRemotingErrorId : uint RemoteRunspaceHasMultipleMatchesForSpecifiedName = 955, RemoteRunspaceDoesNotSupportPushRunspace = 956, HostInNestedPrompt = 957, - RemoteHostDoesNotSupportPushRunspace = 958, InvalidVMId = 959, InvalidVMNameNoVM = 960, InvalidVMNameMultipleVM = 961, diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs index 7c375bb18a3..872588ef549 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs @@ -151,17 +151,6 @@ public virtual bool IsRunspacePushed /// internal HostInfo HostInfo { get; } - /// - /// Allows a push runspace on this remote server host instance, regardless of - /// transport being used. - /// - internal virtual bool AllowPushRunspace - { - get { return (_serverDriverRemoteHost != null) ? _serverDriverRemoteHost.AllowPushRunspace : false; } - - set { if (_serverDriverRemoteHost != null) { _serverDriverRemoteHost.AllowPushRunspace = value; } } - } - #endregion #region Method Overrides @@ -328,18 +317,6 @@ public override bool IsRunspacePushed /// RemoteRunspace. public override void PushRunspace(Runspace runspace) { - // Double session hop is currently allowed only for WSMan (non-OutOfProc) sessions, where - // the second session is either through a named pipe or hyperV socket connection. - if (!AllowPushRunspace && - ((_transportManager is OutOfProcessServerSessionTransportManager) || - !(runspace.ConnectionInfo is NamedPipeConnectionInfo || - runspace.ConnectionInfo is VMConnectionInfo || - runspace.ConnectionInfo is ContainerConnectionInfo)) - ) - { - throw new PSNotSupportedException(); - } - if (_debugger == null) { throw new PSInvalidOperationException(RemotingErrorIdStrings.ServerDriverRemoteHostNoDebuggerToPush); @@ -417,16 +394,6 @@ internal Runspace PushedRunspace get { return _pushedRunspace; } } - /// - /// Allows a push runspace on this remote server host instance, regardless of - /// transport being used. - /// - internal override bool AllowPushRunspace - { - get; - set; - } - /// /// When true will propagate pop call to client after popping runspace from this /// host. Used for OutOfProc remote sessions in a restricted (pushed) remote runspace, diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index f1b6e9ea51c..d2aa6430795 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -457,10 +457,7 @@ private void HandleRunspaceCreatedForTypeTable(object sender, RunspaceCreatedEve { // Let exceptions propagate. RemoteRunspace remoteRunspace = HostUtilities.CreateConfiguredRunspace(_configurationName, _remoteHost); - - _remoteHost.AllowPushRunspace = true; _remoteHost.PropagatePop = true; - _remoteHost.PushRunspace(remoteRunspace); } } diff --git a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx index 3f9e9ad1183..d5b70f46a44 100644 --- a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx +++ b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx @@ -1339,9 +1339,6 @@ All WinRM sessions connected to PowerShell session configurations, such as Micro PSSession {0} was created using the EnableNetworkAccess parameter and can only be reconnected from the local computer. - - You are currently in a PowerShell PSSession and cannot use the Enter-PSSession cmdlet to enter another PSSession. - Cannot start job. The language mode for this session is incompatible with the system-wide language mode. From 703b075aac8e5b3f49abb311fa342e162d0277f7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 4 Mar 2020 09:32:21 -0800 Subject: [PATCH 051/275] Update `README.md` and `metadata.json` for the next release (#11992) --- README.md | 108 ++++++++++++++++++++++++-------------------- tools/metadata.json | 7 +-- 2 files changed, 63 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 05602d7c1ec..b2dd36cebcf 100644 --- a/README.md +++ b/README.md @@ -26,21 +26,21 @@ If you are new to PowerShell and would like to learn more, we recommend reviewin You can download and install a PowerShell package for any of the following platforms. -| Supported Platform | Downloads (stable) | Downloads (preview) | How to Install | -| -------------------------------------------| ------------------------| ----------------------| ------------------------------| -| [Windows (x64)][corefx-win] | [.msi][rl-windows-64] | [.msi][pv-windows-64] | [Instructions][in-windows] | -| [Windows (x86)][corefx-win] | [.msi][rl-windows-86] | [.msi][pv-windows-86] | [Instructions][in-windows] | -| [Ubuntu 18.04][corefx-linux] | [.deb][rl-ubuntu18] | [.deb][pv-ubuntu18] | [Instructions][in-ubuntu18] | -| [Ubuntu 16.04][corefx-linux] | [.deb][rl-ubuntu16] | [.deb][pv-ubuntu16] | [Instructions][in-ubuntu16] | -| [Debian 9][corefx-linux] | [.deb][rl-debian9] | [.deb][pv-debian9] | [Instructions][in-deb9] | -| [Debian 10][corefx-linux] | | [.deb][pv-debian10] | | -| [CentOS 7][corefx-linux] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-centos] | -| [CentOS 8][corefx-linux] | | [.rpm][pv-centos8] | | -| [Red Hat Enterprise Linux 7][corefx-linux] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-rhel7] | -| [openSUSE 42.3][corefx-linux] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-opensuse] | -| [Fedora 28][corefx-linux] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-fedora] | -| [macOS 10.13+][corefx-macos] | [.pkg][rl-macos] | [.pkg][pv-macos] | [Instructions][in-macos] | -| Docker | | | [Instructions][in-docker] | +| Supported Platform | Download (LTS) | Downloads (stable) | Downloads (preview) | How to Install | +| -------------------------------------------| ------------------------| ------------------------| ----------------------| ------------------------------| +| [Windows (x64)][corefx-win] | [.msi][rl-windows-64] | [.msi][rl-windows-64] | [.msi][pv-windows-64] | [Instructions][in-windows] | +| [Windows (x86)][corefx-win] | [.msi][rl-windows-86] | [.msi][rl-windows-86] | [.msi][pv-windows-86] | [Instructions][in-windows] | +| [Ubuntu 18.04][corefx-linux] | [.deb][lts-ubuntu18] | [.deb][rl-ubuntu18] | [.deb][pv-ubuntu18] | [Instructions][in-ubuntu18] | +| [Ubuntu 16.04][corefx-linux] | [.deb][lts-ubuntu16] | [.deb][rl-ubuntu16] | [.deb][pv-ubuntu16] | [Instructions][in-ubuntu16] | +| [Debian 9][corefx-linux] | [.deb][lts-debian9] | [.deb][rl-debian9] | [.deb][pv-debian9] | [Instructions][in-deb9] | +| [Debian 10][corefx-linux] | [.deb][lts-debian10] | [.deb][rl-debian10] | [.deb][pv-debian10] | | +| [CentOS 7][corefx-linux] | [.rpm][lts-centos] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-centos] | +| [CentOS 8][corefx-linux] | [.rpm][lts-centos8] | [.rpm][rl-centos8] | [.rpm][pv-centos8] | | +| [Red Hat Enterprise Linux 7][corefx-linux] | [.rpm][lts-centos] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-rhel7] | +| [openSUSE 42.3][corefx-linux] | [.rpm][lts-centos] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-opensuse] | +| [Fedora 30][corefx-linux] | [.rpm][lts-centos] | [.rpm][rl-centos] | [.rpm][pv-centos] | [Instructions][in-fedora] | +| [macOS 10.13+][corefx-macos] | [.pkg][lts-macos] | [.pkg][rl-macos] | [.pkg][pv-macos] | [Instructions][in-macos] | +| Docker | | | | [Instructions][in-docker] | You can download and install a PowerShell package for any of the following platforms, **which are supported by the community.** @@ -58,23 +58,33 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu | macOS | [64-bit][rl-macos-tar] | [64-bit][pv-macos-tar] | [Instructions][in-tar-macos] | | Linux | [64-bit][rl-linux-tar] | [64-bit][pv-linux-tar] | [Instructions][in-tar-linux] | | Windows (arm) **Experimental** | [32-bit][rl-winarm]/[64-bit][rl-winarm64] | [32-bit][pv-winarm]/[64-bit][pv-winarm64] | [Instructions][in-arm] | -| Raspbian (Stretch) **Experimental** | [32-bit][rl-raspbian]/[64-bit][rl-raspbian64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-x86.msi -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell_6.2.4-1.ubuntu.18.04_amd64.deb -[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell_6.2.4-1.ubuntu.16.04_amd64.deb -[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell_6.2.4-1.debian.9_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-1.rhel.7.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-osx-x64.pkg -[rl-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-arm32.zip -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/PowerShell-6.2.4-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-osx-x64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-x64.tar.gz -[rl-raspbian]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-arm32.tar.gz -[rl-raspbian64]: https://github.com/PowerShell/PowerShell/releases/download/v6.2.4/powershell-6.2.4-linux-arm64.tar.gz +| Raspbian (Stretch) **Experimental** | [32-bit][rl-arm32]/[64-bit][rl-arm64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | + +[lts-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.ubuntu.18.04_amd64.deb +[lts-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.ubuntu.16.04_amd64.deb +[lts-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.debian.9_amd64.deb +[lts-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.debian.10_amd64.deb +[lts-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-1.rhel.7.x86_64.rpm +[lts-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-1.centos.8.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-osx-x64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x86.msi +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.ubuntu.18.04_amd64.deb +[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.ubuntu.16.04_amd64.deb +[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.debian.9_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.debian.10_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-1.rhel.7.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-1.centos.8.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-osx-x64.pkg +[rl-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-arm32.zip +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-osx-x64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x64.msi @@ -96,24 +106,24 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview -[in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 -[in-ubuntu14]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1404 -[in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1604 -[in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#ubuntu-1804 -[in-deb9]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#debian-9 -[in-centos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#centos-7 -[in-rhel7]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#red-hat-enterprise-linux-rhel-7 -[in-opensuse]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#opensuse -[in-fedora]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#fedora -[in-archlinux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#arch-linux -[in-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6 +[in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7 +[in-ubuntu14]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1404 +[in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1604 +[in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1804 +[in-deb9]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#debian-9 +[in-centos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#centos-7 +[in-rhel7]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#red-hat-enterprise-linux-rhel-7 +[in-opensuse]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#opensuse +[in-fedora]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#fedora +[in-archlinux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#arch-linux +[in-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7 [in-docker]: https://github.com/PowerShell/PowerShell-Docker -[in-kali]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#kali -[in-windows-zip]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6#zip -[in-tar-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#binary-archives -[in-tar-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6#binary-archives -[in-raspbian]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#raspbian -[in-arm]: https://docs.microsoft.com/powershell/scripting/install/powershell-core-on-arm?view=powershell-6 +[in-kali]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#kali +[in-windows-zip]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7#zip +[in-tar-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#binary-archives +[in-tar-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7#binary-archives +[in-raspbian]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#raspbian +[in-arm]: https://docs.microsoft.com/powershell/scripting/install/powershell-core-on-arm?view=powershell-7 [corefx-win]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#windows [corefx-linux]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux [corefx-macos]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#macos diff --git a/tools/metadata.json b/tools/metadata.json index a63d548370f..4ecb01aca98 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,8 +1,9 @@ { - "StableReleaseTag": "v6.2.4", + "StableReleaseTag": "v7.0.0", "PreviewReleaseTag": "v7.0.0-rc.3", - "ServicingReleaseTag": "v6.1.6", - "ReleaseTag": "v6.2.4", + "ServicingReleaseTag": "v6.2.4", + "ReleaseTag": "v7.0.0", + "LTSReleaseTag" : ["v7.0.0"], "NextReleaseTag": "v7.0.0-preview.7", "LTSRelease": false } From 819585cd129a9df2e82e947c212dc76339ae112d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 3 Mar 2020 21:51:25 +0000 Subject: [PATCH 052/275] Merged PR 11044: Update change log for V7.0.0 # Conflicts: # CHANGELOG/7.0.md --- .spelling | 2 + CHANGELOG/{preview.md => 7.0.md} | 90 +++++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 1 deletion(-) rename CHANGELOG/{preview.md => 7.0.md} (93%) diff --git a/.spelling b/.spelling index caa00537206..e92d5e3cd79 100644 --- a/.spelling +++ b/.spelling @@ -669,6 +669,7 @@ snapin snover sometext source.txt +spongemike2 src ss64.com stackoverflow @@ -732,6 +733,7 @@ typecataloggen typeconversion typegen typematch +ThomasNieto ubuntu unicode unregister-event diff --git a/CHANGELOG/preview.md b/CHANGELOG/7.0.md similarity index 93% rename from CHANGELOG/preview.md rename to CHANGELOG/7.0.md index e0d9c74a518..2712bcfd4d2 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/7.0.md @@ -1,4 +1,90 @@ -# Current preview Changelog +# 7.0 Changelog + +## [7.0.0] - 2020-03-04 + +### General Cmdlet Updates and Fixes + +- Enable `Ctrl+C` to work for global tool (#11959) +- Fix `ConciseView` to not show the line information within the error messages (#11952) + +### Build and Packaging Improvements + +- Publish PowerShell into the Windows engineering system package format (#11960) +- Bump .NET core framework to `3.1.2` (#11963) +- Ensure the man page `gzip` has the correct name for LTS release (#11956) +- Bump `Microsoft.ApplicationInsights` from `2.13.0` to `2.13.1` (#11925) + +## [7.0.0-rc.3] - 2020-02-21 + +### Breaking Changes + +- Fix `Invoke-Command` missing error on session termination (#11586) + +### Engine Updates and Fixes + +- Update the map between console color to `VT` sequences (#11891) +- Fix SSH remoting error on Windows platform (#11907) +- Restore the `PowerShellStreamType` `enum` with an `ObsoleteAttribute` (#11836) +- Handle cases where `CustomEvent` was not initially sent (#11807) +- Fix how COM objects are enumerated (#11795) +- Fix `NativeDllHandler` to not throw when file is not found (#11787) +- Restore `SetBreakpoints` API (#11622) +- Do not needlessly pass `-l login_name` or `-p port` to `ssh` (#11518) (Thanks @LucaFilipozzi!) +- Fix for `JEA` user role in virtual account (#11668) +- Do not resolve types from assemblies that are loaded in separate `AssemblyLoadContext` (#11088) + +### General Cmdlet Updates and Fixes + +- Sync current directory in `WinCompat` remote session (#11809) +- Add `WinCompat` deny list support using a setting in `powershell.config.json` (#11726) +- Fix unnecessary trimming of line resulting in incorrect index with `ConciseView` (#11670) + +### Code Cleanup + +- Change name of `ClrVersion` parameter back to revert change in capitalization (#11623) + +### Tools + +- Update changelog generation script (#11736) (Thanks @xtqqczze!) +- Update to `CredScan v2` (#11765) + +### Tests + +- Make sure to test whether we skip a test using consistent logic (#11892) +- Skip directory creation at root test on macOS (#11878) +- Update `Get-PlatformInfo` helper and tests for Debian 10, 11 and CentOS 8 (#11842) +- Ensure correct `pwsh` is used for test runs (#11486) (Thanks @iSazonov!) + +### Build and Packaging Improvements + +- Add `LTSRelease` value from `metadata.json` to `release.json` (#11897) +- Bump `Microsoft.ApplicationInsights` from `2.12.1` to `2.13.0` (#11894) +- Make LTS package always not a preview (#11895) +- Bump `System.Data.SqlClient` from `4.8.0` to `4.8.1` (#11879) +- Change `LTSRelease` value in `metadata.json` to true for `RC.3` release (Internal 10960) +- Update `LTS` logic to depend on `metadata.json` (#11877) +- Set default value of `LTSRelease` to false (#11874) +- Refactor packaging pipeline (#11852) +- Make sure `LTS` packages have symbolic links for `pwsh` and `pwsh-lts` (#11843) +- Bump `Microsoft.PowerShell.Native` from `7.0.0-rc.2` to `7.0.0` (#11839) +- Update the NuGet package generation to include `cimcmdlet.dll` and most of the built-in modules (#11832) +- Bump `Microsoft.PowerShell.Archive` from `1.2.4.0` to `1.2.5` (#11833) +- Bump `PSReadLine` from `2.0.0-rc2` to `2.0.0` (#11831) +- Add trace source and serialization primitives to the allowed assembly list (Internal 10911) +- Update the `NextReleaseTag` to be v7.0.0-preview.7 (#11372) +- Change packaging to produce `LTS` packages (#11772) +- Build tar packages only when building on Ubuntu (#11766) +- Bump `NJsonSchema` from `10.1.4` to `10.1.5` (#11730) +- Fix symbolic link creation in `packaging.psm1` (#11723) +- Bump `Microsoft.ApplicationInsights` from `2.12.0` to `2.12.1` (#11708) +- Bump `NJsonSchema` from `10.1.3` to `10.1.4` (#11620) +- Move to latest Azure DevOps agent images (#11704) +- Bump `Markdig.Signed` from `0.18.0` to `0.18.1` (#11641) + +### Documentation and Help Content + +- Add links to diffs on Github in changelog (#11652) (Thanks @xtqqczze!) +- Fix markdown-link test failure (#11653) (Thanks @xtqqczze!) ## [7.0.0-rc.2] - 2020-01-16 @@ -871,6 +957,8 @@ - Update docs for `6.2.0-rc.1` release (#9022) - Update release template (#8996) +[7.0.0]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.3...v7.0.0 +[7.0.0-rc.3]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.2...v7.0.0-rc.3 [7.0.0-rc.2]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.1...v7.0.0-rc.2 [7.0.0-rc.1]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-preview.6...v7.0.0-rc.1 [7.0.0-preview.6]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-preview.5...v7.0.0-preview.6 From 348ca859475eb0094f97791d0f6c8717577d2935 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 4 Mar 2020 13:03:08 -0800 Subject: [PATCH 053/275] Fix `ConciseView` to split `PositionMessage` using `[Environment]::NewLine` (#12010) --- .../DefaultFormatters/PowerShellCore_format_ps1xml.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 e7003f47585..09cc323b936 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1100,8 +1100,7 @@ function Get-ConciseViewPositionMessage { $offsetInLine = 0 } else { - # use newline char instead of $newline because that is what is in the message - $positionMessage = $myinv.PositionMessage.Split(""`n"") + $positionMessage = $myinv.PositionMessage.Split($newline) $line = $positionMessage[1].Substring(1) # skip the '+' at the start $highlightLine = $positionMessage[$positionMessage.Count - 1].Substring(1) $offsetLength = $highlightLine.Trim().Length From 268afbdb4d7261d0fb536470842cadd972918904 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 5 Mar 2020 10:59:51 -0800 Subject: [PATCH 054/275] Fix MSIX packaging to determine if a Preview release by inspecting the semantic version string (#11991) --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 62d9cb758f0..ad3a6b01381 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -3049,7 +3049,7 @@ function New-MSIXPackage $displayName = $productName - if ($packageName.Contains('-')) { + if ($ProductSemanticVersion.Contains('-')) { $ProductName += 'Preview' $displayName += ' Preview' } From 6b8dc6d6a299947231edca0398c526b509e6a570 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 6 Mar 2020 11:13:17 -0800 Subject: [PATCH 055/275] Add empty `preview.md` file to fix broken link (#12041) * Add empty `preview.md` file to fix broken link * fix spelling Co-authored-by: Travis Plunk --- .spelling | 3 +++ CHANGELOG/preview.md | 1 + 2 files changed, 4 insertions(+) create mode 100644 CHANGELOG/preview.md diff --git a/.spelling b/.spelling index e92d5e3cd79..a75617ab6f0 100644 --- a/.spelling +++ b/.spelling @@ -379,6 +379,7 @@ locationglobber loopback lossless louistio +LucaFilipozzi lynda.com lzybkr mababio @@ -531,6 +532,7 @@ preview.3 preview.4 preview.5 preview.6 +preview.7 preview1-24530-04 preview7 productversion @@ -569,6 +571,7 @@ raspbian rc rc.1 rc.2 +rc.3 rc2-24027 rc3-24011 readme diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md new file mode 100644 index 00000000000..035db721385 --- /dev/null +++ b/CHANGELOG/preview.md @@ -0,0 +1 @@ +# Current preview release From 74df0f88717646a8be3e1d6ca5241eada1e74f98 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2020 13:11:40 -0800 Subject: [PATCH 056/275] Bump `NJsonSchema` from `10.1.5` to `10.1.7` (#12050) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.5 to 10.1.7. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 0d2f77b8523..1bb587ab9db 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From ee75eff0e4687caa2d4d900103d858d56d824909 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 14:59:46 -0700 Subject: [PATCH 057/275] Bump `Markdig.Signed` from `0.18.1` to `0.18.3` (#12078) Bumps [Markdig.Signed](https://github.com/lunet-io/markdig) from 0.18.1 to 0.18.3. - [Release notes](https://github.com/lunet-io/markdig/releases) - [Changelog](https://github.com/lunet-io/markdig/blob/master/changelog.md) - [Commits](https://github.com/lunet-io/markdig/compare/0.18.1...0.18.3) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.MarkdownRender.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj b/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj index 7c0eca47b7e..18825047bd6 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj +++ b/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj @@ -9,7 +9,7 @@ - + From 86ea202bae8a6452f18fa140342eb3adc291b80c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 17:35:58 -0700 Subject: [PATCH 058/275] Bump `NJsonSchema` from `10.1.7` to `10.1.8` (#12088) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.7 to 10.1.8. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 1bb587ab9db..cef3abea39b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 704b0e74edad12258be477d4a150bd271f47494e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 9 Mar 2020 23:31:44 -0700 Subject: [PATCH 059/275] Miscellaneous minor updates to WinCompat (#11980) * Filter PSModulePath when starting PS 5.1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS). * Make implicit WinCompat respect NoClobber and Scope parameters * Add ErrorAction.Ignore when searching for WinPSCompatSession --- .../engine/Modules/ModuleCmdletBase.cs | 3 +- .../hostifaces/PowerShellProcessInstance.cs | 7 +- .../CompatiblePSEditions.Module.Tests.ps1 | 71 +++++++++++++++++++ .../engine/Module/ModulePath.Tests.ps1 | 6 +- 4 files changed, 81 insertions(+), 6 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 8c71d4be4b7..986e1deff51 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -2359,7 +2359,7 @@ internal PSModuleInfo LoadModuleManifest( { if (importingModule) { - IList moduleProxies = ImportModulesUsingWinCompat(new string[] { moduleManifestPath }, null, new ImportModuleOptions()); + IList moduleProxies = ImportModulesUsingWinCompat(new string[] { moduleManifestPath }, null, options); // we are loading by a single ManifestPath so expect max of 1 if (moduleProxies.Count > 0) @@ -4799,6 +4799,7 @@ internal static PSSession GetWindowsPowerShellCompatRemotingSession() using var ps = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace); ps.AddCommand(commandInfo); ps.AddParameter("Name", WindowsPowerShellCompatRemotingSessionName); + ps.AddParameter("ErrorAction", ActionPreference.Ignore); var results = ps.Invoke(); if (results.Count > 0) { diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs index 5ea05bd2c0f..736a229d09d 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs @@ -93,13 +93,16 @@ public PowerShellProcessInstance(Version powerShellVersion, PSCredential credent LoadUserProfile = true, #endif }; - +#if !UNIX if (startingWindowsPowerShell51) { _startInfo.ArgumentList.Add("-Version"); _startInfo.ArgumentList.Add("5.1"); - } + // if starting Windows PowerShell, need to remove PowerShell specific segments of PSModulePath + _startInfo.Environment["PSModulePath"] = ModuleIntrinsics.GetWindowsPowerShellModulePath(); + } +#endif _startInfo.ArgumentList.Add("-s"); _startInfo.ArgumentList.Add("-NoLogo"); _startInfo.ArgumentList.Add("-NoProfile"); diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index 7ae3a77de9d..c9929eed965 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -355,6 +355,20 @@ Describe "Import-Module from CompatiblePSEditions-checked paths" -Tag "CI" { Set-Location $pwdBackup } } + + It "-NoClobber and -Scope work with implicit WinCompat" -TestCases $failCases -Skip:(-not $IsWindows) { + param($Editions, $ModuleName, $Result) + try + { + Set-Item function:Test-$ModuleName {"OriginalFunctionImplementation"} + Import-Module $ModuleName -Force -WarningAction Ignore -Scope Local -NoClobber + & "Test-$ModuleName" | Should -BeExactly "OriginalFunctionImplementation" + } + finally + { + Remove-Item function:Test-$ModuleName + } + } } Context "Imports from absolute path" { @@ -429,6 +443,7 @@ Describe "Additional tests for Import-Module with WinCompat" -Tag "Feature" { $ModuleName = "DesktopModule" $ModuleName2 = "DesktopModule2" $basePath = Join-Path $TestDrive "WinCompatModules" + $allModules = @($ModuleName, $ModuleName2) Remove-Item -Path $basePath -Recurse -ErrorAction SilentlyContinue # create an incompatible module that generates an error on import New-EditionCompatibleModule -ModuleName $ModuleName -CompatiblePSEditions "Desktop" -Dir $basePath -ErrorGenerationCode '1/0;' @@ -538,6 +553,62 @@ Describe "Additional tests for Import-Module with WinCompat" -Tag "Feature" { $out | Should -BeExactly 'CouldNotAutoloadMatchingModule' } } + + Context "Tests around PSModulePath in WinCompat process" { + BeforeAll { + $pwsh = "$PSHOME/pwsh" + Add-ModulePath $basePath + $ConfigPath = Join-Path $TestDrive 'powershell.config.json' + } + + AfterAll { + Restore-ModulePath + } + + AfterEach { + Get-Module $allModules | Remove-Module -Force + } + + It 'WinCompat process does not inherit PowerShell-Core-specific paths' { + # these paths were copied from test\powershell\engine\Module\ModulePath.Tests.ps1 + $pscoreUserPath = Join-Path -Path $HOME -ChildPath "Documents\PowerShell\Modules" + $pscoreSharedPath = Join-Path -Path $env:ProgramFiles -ChildPath "PowerShell\Modules" + $pscoreSystemPath = Join-Path -Path $PSHOME -ChildPath 'Modules' + + $pscorePaths = $env:psmodulepath + $pscorePaths | Should -BeLike "*$pscoreUserPath*" + $pscorePaths | Should -BeLike "*$pscoreSharedPath*" + $pscorePaths | Should -BeLike "*$pscoreSystemPath*" + + Import-Module $ModuleName2 -UseWindowsPowerShell -Force -WarningAction Ignore + $s = Get-PSSession -Name WinPSCompatSession + $winpsPaths = Invoke-Command -Session $s -ScriptBlock {$env:psmodulepath} + $winpsPaths | Should -Not -BeLike "*$pscoreUserPath*" + $winpsPaths | Should -Not -BeLike "*$pscoreSharedPath*" + $winpsPaths | Should -Not -BeLike "*$pscoreSystemPath*" + } + + It 'WinCompat process inherits user added paths' { + $mypath = Join-Path $env:SystemDrive MyDir + $originalModulePath = $env:PSModulePath + try { + $env:PSModulePath += ";$mypath" + Import-Module $ModuleName2 -UseWindowsPowerShell -Force -WarningAction Ignore + $s = Get-PSSession -Name WinPSCompatSession + $winpsPaths = Invoke-Command -Session $s -ScriptBlock {$env:psmodulepath} + $winpsPaths | Should -BeLike "*$mypath*" + } + finally { + $env:PSModulePath = $originalModulePath + } + } + + It 'Windows PowerShell does not inherit path defined in powershell.config.json' { + '{ "PSModulePath": "C:\\MyTestDir" }' | Out-File -Force $ConfigPath + $winpsPaths = & $pwsh -NoProfile -NonInteractive -settingsFile $ConfigPath -c "Import-Module $ModuleName2 -UseWindowsPowerShell -WarningAction Ignore;`$s = Get-PSSession -Name WinPSCompatSession;Invoke-Command -Session `$s -ScriptBlock {`$env:psmodulepath}" + $winpsPaths | Should -Not -BeLike "*MyTestDir*" + } + } } Describe "PSModulePath changes interacting with other PowerShell processes" -Tag "Feature" { diff --git a/test/powershell/engine/Module/ModulePath.Tests.ps1 b/test/powershell/engine/Module/ModulePath.Tests.ps1 index 00f5d51bf1a..952908edb4f 100644 --- a/test/powershell/engine/Module/ModulePath.Tests.ps1 +++ b/test/powershell/engine/Module/ModulePath.Tests.ps1 @@ -165,9 +165,9 @@ Describe "SxS Module Path Basic Tests" -tags "CI" { It 'Windows PowerShell does not inherit PowerShell paths' -Skip:(!$IsWindows) { $out = powershell.exe -noprofile -command '$env:PSModulePath' - $out | Should -Not -Contain $expectedUserPath - $out | Should -Not -Contain $expectedSharedPath - $out | Should -Not -Contain $expectedSystemPath + $out | Should -Not -BeLike "*$expectedUserPath*" + $out | Should -Not -BeLike "*$expectedSharedPath*" + $out | Should -Not -BeLike "*$expectedSystemPath*" } It 'Windows PowerShell inherits user added paths' -Skip:(!$IsWindows) { From b04f0e4fc5c5ead464dcdb501778b6380ba7e4e1 Mon Sep 17 00:00:00 2001 From: Mattias Karlsson Date: Tue, 10 Mar 2020 07:55:23 +0100 Subject: [PATCH 060/275] Change recommended VS Code extension name from ms-vscode.csharp to ms-dotnettools.csharp (#12083) --- .devcontainer/devcontainer.json | 2 +- .devcontainer/fedora30/devcontainer.json | 2 +- .vscode/extensions.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3daba6f1dd2..80868cb91c2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ "extensions": [ "ms-azure-devops.azure-pipelines", - "ms-vscode.csharp", + "ms-dotnettools.csharp", "ms-vscode.powershell", "DavidAnson.vscode-markdownlint", "vitaliymaz.vscode-svg-previewer" diff --git a/.devcontainer/fedora30/devcontainer.json b/.devcontainer/fedora30/devcontainer.json index 9a4da68c1c9..d9ef8ef5312 100644 --- a/.devcontainer/fedora30/devcontainer.json +++ b/.devcontainer/fedora30/devcontainer.json @@ -8,7 +8,7 @@ "extensions": [ "ms-azure-devops.azure-pipelines", - "ms-vscode.csharp", + "ms-dotnettools.csharp", "ms-vscode.powershell", "DavidAnson.vscode-markdownlint", "vitaliymaz.vscode-svg-previewer" diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 117f430270b..683a979ec46 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,7 @@ "recommendations": [ "ms-azure-devops.azure-pipelines", "ms-vscode.cpptools", - "ms-vscode.csharp", + "ms-dotnettools.csharp", "ms-vscode.PowerShell", "twxs.cmake", "DavidAnson.vscode-markdownlint", From 12bf5f4a0ca5cf341d71a0330378aa32f9fce6b6 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 10 Mar 2020 21:30:53 +0500 Subject: [PATCH 061/275] Bring back `MainWindowTitle` in `PSHostProcessInfo` (#11885) * Bring back MainWindowTitle in PSHostProcessInfo * Add test --- .../engine/remoting/commands/EnterPSHostProcessCommand.cs | 4 ---- .../Get-PSHostProcessInfo.Tests.ps1 | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index 727c5ef709e..cf06c4cda1a 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -765,7 +765,6 @@ public string AppDomainName private set; } -#if !CORECLR /// /// Main window title of the process. /// @@ -774,7 +773,6 @@ public string MainWindowTitle get; private set; } -#endif #endregion @@ -794,7 +792,6 @@ internal PSHostProcessInfo(string processName, int processId, string appDomainNa if (string.IsNullOrEmpty(appDomainName)) { throw new PSArgumentNullException("appDomainName"); } -#if !CORECLR MainWindowTitle = string.Empty; try { @@ -803,7 +800,6 @@ internal PSHostProcessInfo(string processName, int processId, string appDomainNa } catch (ArgumentException) { } catch (InvalidOperationException) { } -#endif this.ProcessName = processName; this.ProcessId = processId; diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 index a8665db1d39..e53e4942ece 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 @@ -29,6 +29,11 @@ Describe "Get-PSHostProcessInfo tests" -Tag CI { (Get-PSHostProcessInfo).ProcessId | Should -Contain $PID } + It "Should return own self window title" { + $expected = (Get-Process -Id $PID).MainWindowTitle + (Get-PSHostProcessInfo -Id $PID).MainWindowTitle | Should -BeExactly $expected + } + It "Should list info for other PowerShell hosted processes" { # Creation of the named pipe is async Wait-UntilTrue { From bb8a7c779d419f285d961228d7a1a5425a715532 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 10 Mar 2020 09:40:12 -0700 Subject: [PATCH 062/275] Update the doc about debugging dotnet core in VSCode (#11969) * Update the doc about debugging dotnet core in VSCode * remove en-us --- docs/debugging/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/debugging/README.md b/docs/debugging/README.md index e5f3b4b30d2..1b13924b854 100644 --- a/docs/debugging/README.md +++ b/docs/debugging/README.md @@ -1,10 +1,9 @@ # Visual Studio Code -[Experimental .NET Core Debugging in VS Code][core-debug] enables -cross-platform debugging with the [Visual Studio Code][vscode] editor. +The [Visual Studio Code][vscode] editor supports cross-platform debugging. This is made possible by the [OmniSharp][] extension for VS Code. -Please review their [detailed instructions][vscclrdebugger]. In +Please review their [detailed instructions][core-debug]. In addition to being able to build PowerShell, you need: - C# Extension for VS Code installed @@ -42,10 +41,9 @@ process named `powershell`, and will attach to it. If you need more fine-grained control, replace `processName` with `processId` and provide a PID. (Please be careful not to commit such a change.) -[core-debug]: https://devblogs.microsoft.com/devops/experimental-net-core-debugging-in-vs-code/ +[core-debug]: https://docs.microsoft.com/dotnet/core/tutorials/with-visual-studio-code#debug [vscode]: https://code.visualstudio.com/ [OmniSharp]: https://github.com/OmniSharp/omnisharp-vscode -[vscclrdebugger]: https://aka.ms/vscclrdebugger ## PowerShell From 23b7dce32032770667a2db7e5b3b9459cac4518b Mon Sep 17 00:00:00 2001 From: Shayde Nofziger Date: Wed, 11 Mar 2020 14:46:19 -0400 Subject: [PATCH 063/275] Improvements to the contribution guide (#12086) * Fix typo in contribution guide * Improve contributing links and wording Various improvements to the contributor's guide, including grammar fixes, making common links for easier updating, and fix for a broken link to VS Code editor documentation. * Update .github/CONTRIBUTING.md Co-authored-by: Travis Plunk --- .github/CONTRIBUTING.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a61bf28408b..09ef94f7263 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,7 +19,7 @@ Please read the rest of this document to ensure a smooth contribution process. ## Quick Start Checklist -* Review the [Contribution License Agreement][CLA] requirement. +* Review the [Contributor License Agreement][CLA] requirement. * Get familiar with the [PowerShell repository](../docs/git). ## Contributing to Issues @@ -115,7 +115,7 @@ Please see [Building PowerShell](../README.md#building-the-repository). #### Testing PowerShell -Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running-tests-outside-of-ci] on how to test you build locally. +Please see PowerShell [Testing Guidelines - Running Tests Outside of CI][running-tests-outside-of-ci] on how to test your build locally. ### Finding or creating an issue @@ -167,11 +167,11 @@ Additional references: An issue title is to briefly describe what is wrong, while a PR title is to briefly describe what is changed. A better example is: "Add Ensure parameter to New-Item cmdlet", with "Fix #5" in the PR's body. * When you create a pull request, - including a summary about your changes in the PR description. + include a summary about your changes in the PR description. The description is used to create change logs, so try to have the first sentence explain the benefit to end users. If the changes are related to an existing GitHub issue, - please reference the issue in PR description (e.g. ```Fix #11```). + please reference the issue in the PR description (e.g. ```Fix #11```). See [this][closing-via-message] for more details. * Please use the present tense and imperative mood when describing your changes: @@ -277,10 +277,10 @@ Additional references: - `Request changes` if you believe the PR merge should be blocked if your feedback is not addressed, - `Approve` if you believe your feedback has been addressed or the code is fine as-is, it is customary (although not required) to leave a simple "Looks good to me" (or "LGTM") as the comment for approval. - `Comment` if you are making suggestions that the *author* does not have to accept. - Early in the review, it is acceptable to provide feedback on coding formatting based on the published [Coding Guidelines](../docs/dev-process/coding-guidelines.md), however, - after the PR has been approved, it is generally _not_ recommended to focus on formatting issues unless they go against the [Coding Guidelines](../docs/dev-process/coding-guidelines.md). + Early in the review, it is acceptable to provide feedback on coding formatting based on the published [Coding Guidelines][coding-guidelines], however, + after the PR has been approved, it is generally _not_ recommended to focus on formatting issues unless they go against the [Coding Guidelines][coding-guidelines]. Non-critical late feedback (after PR has been approved) can be submitted as a new issue or new pull request from the *reviewer*. -1. *Assignee* who are always *Maintainers* ensure that proper review has occurred and if they believe one approval is not sufficient, the *maintainer* is responsible to add more reviewers. +1. *Assignees* who are always *Maintainers* ensure that proper review has occurred and if they believe one approval is not sufficient, the *maintainer* is responsible to add more reviewers. An *assignee* may also be a reviewer, but the roles are distinct. Once the PR has been approved and the CI system is passing, the *assignee* will merge the PR after giving one business day for any critical feedback. For more information on the PowerShell Maintainers' process, see the [documentation](../docs/maintainers). @@ -302,22 +302,22 @@ In these cases: ## Making Breaking Changes When you make code changes, -please pay attention to these that can affect the [Public Contract](../docs/dev-process/breaking-change-contract.md). +please pay attention to these that can affect the [Public Contract][breaking-changes-contract]. For example, changing PowerShell parameters, APIs, or protocols break the public contract. Before making changes to the code, -first review the [breaking changes contract](../docs/dev-process/breaking-change-contract.md) +first review the [breaking changes contract][breaking-changes-contract] and follow the guidelines to keep PowerShell backward compatible. ## Making Design Changes To add new features such as cmdlets or making design changes, -please follow the [PowerShell Request for Comments (RFC)](https://github.com/PowerShell/PowerShell-RFC) process. +please follow the [PowerShell Request for Comments (RFC)][rfc-process] process. ## Common Engineering Practices -Other than the guidelines for ([coding](../docs/dev-process/coding-guidelines.md), -the [RFC process](https://github.com/PowerShell/PowerShell-RFC) for design, -[documentation](#contributing-to-documentation) and [testing](../docs/testing-guidelines/testing-guidelines.md)) discussed above, +Other than the guidelines for [coding][coding-guidelines], +the [RFC process][rfc-process] for design, +[documentation](#contributing-to-documentation) and [testing](../docs/testing-guidelines/testing-guidelines.md) discussed above, we encourage contributors to follow these common engineering practices: * Format commit messages following these guidelines: @@ -359,7 +359,7 @@ is also appropriate, as is using Markdown syntax. If you find code that you think is a good fit to add to PowerShell, file an issue and start a discussion before proceeding. * Create and/or update tests when making code changes. -* Run tests and ensure they are passing before pull request. +* Run tests and ensure they are passing before opening a pull request. * All pull requests **must** pass CI systems before they can be approved. * Avoid making big pull requests. Before you invest a large amount of time, @@ -368,7 +368,7 @@ is also appropriate, as is using Markdown syntax. ## Contributor License Agreement (CLA) To speed up the acceptance of any contribution to any PowerShell repositories, -you should to [sign a Microsoft Contribution Licensing Agreement (CLA)](https://cla.microsoft.com/) ahead of time. +you should sign the Microsoft [Contributor License Agreement (CLA)](https://cla.microsoft.com/) ahead of time. If you've already contributed to PowerShell or Microsoft repositories in the past, congratulations! You've already completed this step. This a one-time requirement for the PowerShell project. @@ -395,8 +395,10 @@ Once you sign a CLA, all your existing and future pull requests will have the st [up-for-grabs]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AUp-for-Grabs [semantic linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/ [PowerShell-Docs]: https://github.com/powershell/powershell-docs/ -[use-vscode-editor]: ../docs/learning-powershell/using-vscode.md#editing-with-visual-studio-code +[use-vscode-editor]: https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode?view=powershell-7#editing-with-vscode [repository-maintainer]: ../docs/community/governance.md#repository-maintainers [area-expert]: ../docs/community/governance.md#area-experts -[ci-system]: ../docs/testing-guidelines/testing-guidelines.md#ci-system [first-time-issue]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AFirst-Time-Issue +[coding-guidelines]: ../docs/dev-process/coding-guidelines.md +[breaking-changes-contract]: ../docs/dev-process/breaking-change-contract.md +[rfc-process]: https://github.com/PowerShell/PowerShell-RFC From 5f46605a2176eac2836d4c6d1119f66c7e4e4255 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Wed, 11 Mar 2020 14:45:14 -0700 Subject: [PATCH 064/275] Add Ubuntu SSH remoting tests CI (#12033) * Add SSH remoting CI * Fix typo * Add install git to Ubuntu CI * Update .vsts-ci/sshremoting-tests.yml Co-Authored-By: Aditya Patwardhan * Fix install git 1 * Add missing tools module import * Change ubuntu service restart * Update ssh install * fix module path * fix module path * change module import * Add tracing * Add service start retry * Fix service restart * Fix options restore * Fix Restore-PSOptions path * Fix Pester test output * fix typo * Fix test output path * Debug 1 * Debug 2 * Debug 3 * Change results path * Fix result publish to use build artifacts directory * Add more New-PSSession tests * Remove User test * Remove env:USER * Add API tests * Fix type for Subsytem API test * Update .vsts-ci/sshremoting-tests.yml Co-Authored-By: Travis Plunk * Update .vsts-ci/sshremoting-tests.yml Co-Authored-By: Travis Plunk * Update .vsts-ci/sshremoting-tests.yml Co-Authored-By: Travis Plunk * Apply suggestions from code review Co-authored-by: Aditya Patwardhan Co-authored-by: Travis Plunk --- .vsts-ci/sshremoting-tests.yml | 86 +++ build.psm1 | 7 +- test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 | 187 +++++++ .../HelpersRemoting/HelpersRemoting.psm1 | 59 +- .../Microsoft.PowerShell.RemotingTools.psd1 | 50 ++ .../Microsoft.PowerShell.RemotingTools.psm1 | 508 ++++++++++++++++++ 6 files changed, 892 insertions(+), 5 deletions(-) create mode 100644 .vsts-ci/sshremoting-tests.yml create mode 100644 test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 create mode 100644 test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 create mode 100644 test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 diff --git a/.vsts-ci/sshremoting-tests.yml b/.vsts-ci/sshremoting-tests.yml new file mode 100644 index 00000000000..016f3bfddca --- /dev/null +++ b/.vsts-ci/sshremoting-tests.yml @@ -0,0 +1,86 @@ +name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) +trigger: + # Batch merge builds together while a merge build is running + batch: true + branches: + include: + - master + - release* + - feature* + paths: + include: + - '/src/System.Management.Automation/engine/*' + - '/test/SSHRemoting/*' +pr: + branches: + include: + - master + - release* + - feature* + paths: + include: + - '/src/System.Management.Automation/engine/*' + - '/test/SSHRemoting/*' + +variables: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + __SuppressAnsiEscapeSequences: 1 + +resources: +- repo: self + clean: true +jobs: +- job: SSHRemotingTests + container: mcr.microsoft.com/powershell/test-deps:ubuntu-18.04 + displayName: SSH Remoting Tests + + steps: + - pwsh: | + Get-ChildItem -Path env: + displayName: Capture Environment + condition: succeededOrFailed() + + - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" + displayName: Set Build Name for Non-PR + condition: ne(variables['Build.Reason'], 'PullRequest') + + - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml + + - pwsh: | + sudo apt-get update + sudo apt-get install -y git + displayName: Install Github + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + displayName: Bootstrap + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Invoke-CIBuild + displayName: Build + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions + $options = (Get-PSOptions) + Import-Module .\test\tools\Modules\HelpersRemoting + Install-SSHRemoting -PowerShellFilePath $options.Output + displayName: Install SSH Remoting + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions + $options = (Get-PSOptions) + Import-Module .\build.psm1 + Start-PSPester -Path test/SSHRemoting -powershell $options.Output -OutputFile "$PWD/sshTestResults.xml" + displayName: Test + condition: succeeded() diff --git a/build.psm1 b/build.psm1 index b8b10de0cc1..482edfcdcd9 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1364,7 +1364,12 @@ function Publish-TestResults if($env:TF_BUILD) { $fileName = Split-Path -Leaf -Path $Path - $tempFilePath = Join-Path ([system.io.path]::GetTempPath()) -ChildPath $fileName + $tempPath = $env:BUILD_ARTIFACTSTAGINGDIRECTORY + if (! $tempPath) + { + $tempPath = [system.io.path]::GetTempPath() + } + $tempFilePath = Join-Path -Path $tempPath -ChildPath $fileName # NUnit allowed values are: Passed, Failed, Inconclusive or Ignored (the spec says Skipped but it doesn' work with Azure DevOps) # https://github.com/nunit/docs/wiki/Test-Result-XML-Format diff --git a/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 new file mode 100644 index 00000000000..9e8bd379eb0 --- /dev/null +++ b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 @@ -0,0 +1,187 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +Describe "SSHRemoting Basic Tests" -tags CI { + + # SSH remoting is set up to automatically authenticate current user via SSH keys + # All tests connect back to localhost machine + + function VerifySession { + param ( + [System.Management.Automation.Runspaces.PSSession] $session + ) + + $session.State | Should -BeExactly 'Opened' + $session.ComputerName | Should -BeExactly 'localhost' + $session.Transport | Should -BeExactly 'SSH' + Invoke-Command -Session $session -ScriptBlock { whoami } | Should -BeExactly $(whoami) + $psRemoteVersion = Invoke-Command -Session $session -ScriptBlock { $PSSenderInfo.ApplicationArguments.PSVersionTable.PSVersion } + $psRemoteVersion.Major | Should -BeExactly $PSVersionTable.PSVersion.Major + $psRemoteVersion.Minor | Should -BeExactly $PSVersionTable.PSVersion.Minor + } + + Context "New-PSSession Tests" { + + AfterEach { + if ($script:session -ne $null) { Remove-PSSession -session $script:session } + if ($script:sessions -ne $null) { Remove-PSSession -session $script:sessions } + } + + It "Verifies new connection with implicit current User" { + $script:session = New-PSSession -HostName localhost -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + } + + It "Verifies new connection with explicit User parameter" { + $script:session = New-PSSession -HostName localhost -UserName (whoami) -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + } + + It "Verifies explicit Name parameter" { + $sessionName = 'TestSessionNameA' + $script:session = New-PSSession -HostName localhost -Name $sessionName -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + $script:session.Name | Should -BeExactly $sessionName + } + + It "Verifies explicit Port parameter" { + $portNum = 22 + $script:session = New-PSSession -HostName localhost -Port $portNum -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + } + + It "Verifies explicit Subsystem parameter" { + $portNum = 22 + $subSystem = 'powershell' + $script:session = New-PSSession -HostName localhost -Port $portNum -SubSystem $subSystem -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + } + + It "Verifies explicit KeyFilePath parameter" { + $keyFilePath = "$HOME/.ssh/id_rsa" + $portNum = 22 + $subSystem = 'powershell' + $script:session = New-PSSession -HostName localhost -Port $portNum -SubSystem $subSystem -KeyFilePath $keyFilePath -ErrorVariable err + $err | Should -HaveCount 0 + VerifySession $script:session + } + + It "Verifies SSHConnection hash table parameters" { + $sshConnection = @( + @{ + HostName = 'localhost' + UserName = whoami + Port = 22 + KeyFilePath = "$HOME/.ssh/id_rsa" + Subsystem = 'powershell' + }, + @{ + HostName = 'localhost' + KeyFilePath = "$HOME/.ssh/id_rsa" + Subsystem = 'powershell' + }) + $script:sessions = New-PSSession -SSHConnection $sshConnection -Name 'Connection1','Connection2' -ErrorVariable err + $err | Should -HaveCount 0 + $script:sessions | Should -HaveCount 2 + $script:sessions[0].Name | Should -BeLike 'Connection*' + $script:sessions[1].Name | Should -BeLike 'Connection*' + VerifySession $script:sessions[0] + VerifySession $script:sessions[1] + } + } + + function VerifyRunspace { + param ( + [runspace] $rs + ) + + $rs.RunspaceStateInfo.State | Should -BeExactly 'Opened' + $rs.RunspaceAvailability | Should -BeExactly 'Available' + $rs.RunspaceIsRemote | Should -BeTrue + $ps = [powershell]::Create() + try + { + $ps.Runspace = $rs + $psRemoteVersion = $ps.AddScript('$PSSenderInfo.ApplicationArguments.PSVersionTable.PSVersion').Invoke() + $psRemoteVersion.Major | Should -BeExactly $PSVersionTable.PSVersion.Major + $psRemoteVersion.Minor | Should -BeExactly $PSVersionTable.PSVersion.Minor + + $ps.Commands.Clear() + $ps.AddScript('whoami').Invoke() | Should -BeExactly $(whoami) + } + finally + { + $ps.Dispose() + } + } + + Context "SSH Remoting API Tests" { + + AfterEach { + if ($script:rs -ne $null) { $script:rs.Dispose() } + } + + $testCases = @( + @{ + testName = 'Verifies connection with implicit user' + UserName = $null + ComputerName = 'localhost' + KeyFilePath = $null + Port = 0 + Subsystem = $null + }, + @{ + testName = 'Verifies connection with UserName' + UserName = whoami + ComputerName = 'localhost' + KeyFilePath = $null + Port = 0 + Subsystem = $null + }, + @{ + testName = 'Verifies connection with KeyFilePath' + UserName = whoami + ComputerName = 'localhost' + KeyFilePath = "$HOME/.ssh/id_rsa" + Port = 0 + Subsystem = $null + }, + @{ + testName = 'Verifies connection with Port specified' + UserName = whoami + ComputerName = 'localhost' + KeyFilePath = "$HOME/.ssh/id_rsa" + Port = 22 + Subsystem = $null + }, + @{ + testName = 'Verifies connection with Subsystem specified' + UserName = whoami + ComputerName = 'localhost' + KeyFilePath = "$HOME/.ssh/id_rsa" + Port = 22 + Subsystem = 'powershell' + } + ) + + It "" -TestCases $testCases { + param ( + $UserName, + $ComputerName, + $KeyFilePath, + $Port, + $SubSystem + ) + + $ci = [System.Management.Automation.Runspaces.SSHConnectionInfo]::new($UserName, $ComputerName, $KeyFilePath, $Port, $Subsystem) + $script:rs = [runspacefactory]::CreateRunspace($host, $ci) + $script:rs.Open() + VerifyRunspace $script:rs + } + } +} diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 index b056819f89e..11f4af410d0 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 @@ -466,6 +466,26 @@ function Install-SSHRemotingOnWindows } } +function WriteVerboseSSHDStatus +{ + param ( + [string] $Msg = 'SSHD service status' + ) + + $sshdStatus = sudo service ssh status + Write-Verbose -Verbose "${Msg}: $sshdStatus" +} + +function DumpTextFile +{ + param ( + [string] $FilePath = '/etc/ssh/sshd_config' + ) + + $content = Get-Content -Path $FilePath -Raw + Write-Verbose -Verbose $content +} + function Install-SSHRemotingOnLinux { param ( @@ -478,7 +498,11 @@ function Install-SSHRemotingOnLinux { Write-Verbose -Verbose "Installing openssh-server ..." sudo apt-get install --yes openssh-server - sudo systemctl restart ssh + + Write-Verbose -Verbose "Restarting sshd service after install ..." + WriteVerboseSSHDStatus "SSHD service status before restart" + sudo service ssh restart + WriteVerboseSSHDStatus "SSHD service status after restart" } if (! (Test-Path -Path /etc/ssh/sshd_config)) { @@ -519,19 +543,40 @@ function Install-SSHRemotingOnLinux Write-Verbose -Verbose "Updating known_hosts ..." ssh-keyscan -H localhost | Set-Content -Path "$HOME/.ssh/known_hosts" -Force + <# # Install Microsoft.PowerShell.RemotingTools module. if ($null -eq (Get-Module -Name Microsoft.PowerShell.RemotingTools -ListAvailable)) { Write-Verbose -Verbose "Installing Microsoft.PowerShell.RemotingTools ..." Install-Module -Name Microsoft.PowerShell.RemotingTools -Force -SkipPublisherCheck } + #> # Add PowerShell endpoint to SSHD. Write-Verbose -Verbose "Running Enable-SSHRemoting ..." - sudo pwsh -c 'Enable-SSHRemoting -SSHDConfigFilePath /etc/ssh/sshd_config -PowerShellFilePath $PowerShellPath -Force' - + Write-Verbose -Verbose "PSScriptRoot: $PSScriptRoot" + $modulePath = "${PSScriptRoot}\..\Microsoft.PowerShell.RemotingTools\Microsoft.PowerShell.RemotingTools.psd1" + $cmdLine = "Import-Module ${modulePath}; Enable-SSHRemoting -SSHDConfigFilePath /etc/ssh/sshd_config -PowerShellFilePath $PowerShellPath -Force" + Write-Verbose -Verbose "CmdLine: $cmdLine" + sudo pwsh -c $cmdLine + + # Restart SSHD service for changes to take effect. + Start-Sleep -Seconds 1 + WriteVerboseSSHDStatus "SSHD service status before restart" Write-Verbose -Verbose "Restarting sshd ..." - sudo systemctl restart ssh + sudo service ssh restart + WriteVerboseSSHDStatus "SSHD service status after restart" + + # Try starting again if needed. + $status = sudo service ssh status + $result = $status | Where-Object { ($_ -like '*not running*') -or ($_ -like '*stopped*') } + if ($null -ne $result) + { + Start-Sleep -Seconds 1 + Write-Verbose -Verbose "Starting sshd again ..." + sudo service ssh start + WriteVerboseSSHDStatus "SSHD service status after second start attempt" + } # Test SSH remoting. Write-Verbose -Verbose "Testing SSH remote connection ..." @@ -542,6 +587,10 @@ function Install-SSHRemotingOnLinux { throw "Could not successfully create SSH remoting connection." } + else + { + Write-Verbose -Verbose "SUCCESS: SSH remote connection" + } } finally { @@ -569,6 +618,8 @@ function Install-SSHRemoting [string] $PowerShellFilePath ) + Write-Verbose -Verbose "Install-SSHRemoting called with PowerShell file path: $PowerShellFilePath" + if ($IsWindows) { if ([string]::IsNullOrEmpty($PowerShellFilePath)) { $PowerShellFilePath = "$PSHOME/pwsh.exe" } diff --git a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 new file mode 100644 index 00000000000..5a6ee4dba02 --- /dev/null +++ b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 @@ -0,0 +1,50 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +@{ + +RootModule = './Microsoft.PowerShell.RemotingTools.psm1' + +ModuleVersion = '0.1.0' + +GUID = 'e11d52a1-d5a0-4e4d-92cd-e87114bf4a5c' + +Author = 'Microsoft Corporation' +CompanyName = 'Microsoft Corporation' +Copyright = '(c) Microsoft Corporation. All rights reserved.' + +Description = ' +This module contains remoting tool cmdlets. + +Enable-SSHRemoting cmdlet: +-------------------------- +PowerShell SSH remoting was implemented in PowerShell 6.0 but requries SSH (client) and SSHD (service) components +to be installed. In addition the sshd_config configuration file must be updated to define a PowerShell endpoint +as a subsystem. Once this is done PowerShell remoting cmdlets can be used to establish a PowerShell remoting +session over SSH that works across platforms. + +$session = New-PSSession -HostName LinuxComputer1 -UserName UserA -SSHTransport + +There are a number of requirements that must be satisfied for PowerShell SSH based remoting: + a. PowerShell 6.0 or greater must be installed on the system. + Since multiple PowerShell installations can appear on a single system, a specific installation can be selected. + b. SSH client must be installed on the system as PowerShell uses it for outgoing connections. + c. SSHD (ssh daemon) must be installed on the system for PowerShell to receive SSH connections. + d. SSHD must be configured with a Subsystem that serves as the PowerShell remoting endpoint. + +The Enable-SSHRemoting cmdlet will do the following: + a. Detect the underlying platform (Windows, Linux, macOS). + b. Detect an installed SSH client, and emit a warning if not found. + c. Detect an installed SSHD daemon, and emit a warning if not found. + d. Accept a PowerShell (pwsh) path to be run as a remoting PowerShell session endpoint. + Or try to use the currently running PowerShell. + e. Update the SSHD configuration file to add a PowerShell subsystem endpoint entry. + +If all of the conditions are satisfied then PowerShell SSH remoting will work to and from the local system. +' + +PowerShellVersion = '6.0' + +FunctionsToExport = 'Enable-SSHRemoting' + +} diff --git a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 new file mode 100644 index 00000000000..5d42ff861cb --- /dev/null +++ b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 @@ -0,0 +1,508 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +## +## Enable-SSHRemoting Cmdlet +## + +class PlatformInfo +{ + [bool] $isCoreCLR + [bool] $isLinux + [bool] $isOSX + [bool] $isWindows + + [bool] $isAdmin + + [bool] $isUbuntu + [bool] $isUbuntu14 + [bool] $isUbuntu16 + [bool] $isCentOS + [bool] $isFedora + [bool] $isOpenSUSE + [bool] $isOpenSUSE13 + [bool] $isOpenSUSE42_1 + [bool] $isRedHatFamily +} + +function DetectPlatform +{ + param ( + [ValidateNotNull()] + [PlatformInfo] $PlatformInfo + ) + + try + { + $Runtime = [System.Runtime.InteropServices.RuntimeInformation] + $OSPlatform = [System.Runtime.InteropServices.OSPlatform] + + $platformInfo.isCoreCLR = $true + $platformInfo.isLinux = $Runtime::IsOSPlatform($OSPlatform::Linux) + $platformInfo.isOSX = $Runtime::IsOSPlatform($OSPlatform::OSX) + $platformInfo.isWindows = $Runtime::IsOSPlatform($OSPlatform::Windows) + } + catch + { + $platformInfo.isCoreCLR = $false + $platformInfo.isLinux = $false + $platformInfo.isOSX = $false + $platformInfo.isWindows = $true + } + + if ($platformInfo.isWindows) + { + $platformInfo.isAdmin = ([System.Security.Principal.WindowsPrincipal]::new([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole( ` + [System.Security.Principal.WindowsBuiltInRole]::Administrator) + } + + if ($platformInfo.isLinux) + { + $LinuxInfo = Get-Content /etc/os-release -Raw | ConvertFrom-StringData + + $platformInfo.isUbuntu = $LinuxInfo.ID -match 'ubuntu' + $platformInfo.isUbuntu14 = $platformInfo.isUbuntu -and ($LinuxInfo.VERSION_ID -match '14.04') + $platformInfo.isUbuntu16 = $platformInfo.isUbuntu -and ($LinuxInfo.VERSION_ID -match '16.04') + $platformInfo.isCentOS = ($LinuxInfo.ID -match 'centos') -and ($LinuxInfo.VERSION_ID -match '7') + $platformInfo.isFedora = ($LinuxInfo.ID -match 'fedora') -and ($LinuxInfo.VERSION_ID -ge '24') + $platformInfo.isOpenSUSE = $LinuxInfo.ID -match 'opensuse' + $platformInfo.isOpenSUSE13 = $platformInfo.isOpenSUSE -and ($LinuxInfo.VERSION_ID -match '13') + $platformInfo.isOpenSUSE42_1 = $platformInfo.isOpenSUSE -and ($LinuxInfo.VERSION_ID -match '42.1') + $platformInfo.isRedHatFamily = $platformInfo.isCentOS -or $platformInfo.isFedora -or $platformInfo.isOpenSUSE + } +} + +class SSHSubSystemEntry +{ + [string] $subSystemLine + [string] $subSystemName + [string] $subSystemCommand + [string[]] $subSystemCommandArgs +} + +class SSHRemotingConfig +{ + [PlatformInfo] $platformInfo + [SSHSubSystemEntry[]] $psSubSystemEntries = @() + [string] $configFilePath + $configComponents = @() + + SSHRemotingConfig( + [PlatformInfo] $platInfo, + [string] $configFilePath) + { + $this.platformInfo = $platInfo + $this.configFilePath = $configFilePath + $this.ParseSSHRemotingConfig() + } + + [string[]] SplitConfigLine([string] $line) + { + $line = $line.Trim() + $lineLength = $line.Length + $rtnStrArray = [System.Collections.Generic.List[string]]::new() + + for ($i=0; $i -lt $lineLength; ) + { + $startIndex = $i + while (($i -lt $lineLength) -and ($line[$i] -ne " ") -and ($line[$i] -ne "`t")) { $i++ } + $rtnStrArray.Add($line.Substring($startIndex, ($i - $startIndex))) + while (($i -lt $lineLength) -and ($line[$i] -eq " ") -or ($line[$i] -eq "`t")) { $i++ } + } + + return $rtnStrArray.ToArray() + } + + ParseSSHRemotingConfig() + { + [string[]] $contents = Get-Content -Path $this.configFilePath + foreach ($line in $contents) + { + $components = $this.SplitConfigLine($line) + $this.configComponents += @{ Line = $line; Components = $components } + + if (($components[0] -eq "Subsystem") -and ($components[1] -eq "powershell")) + { + $entry = [SSHSubSystemEntry]::New() + $entry.subSystemLine = $line + $entry.subSystemName = $components[1] + $entry.subSystemCommand = $components[2] + $entry.subSystemCommandArgs = @() + for ($i=3; $i -lt $components.Count; $i++) + { + $entry.subSystemCommandArgs += $components[$i] + } + + $this.psSubSystemEntries += $entry + } + } + } +} + +function UpdateConfiguration +{ + param ( + [SSHRemotingConfig] $config, + [string] $PowerShellPath + ) + + # + # Update and re-write config file with existing settings plus new PowerShell remoting settings + # + + # Subsystem + [System.Collections.Generic.List[string]] $newContents = [System.Collections.Generic.List[string]]::new() + $psSubSystemEntry = "Subsystem powershell {0} {1} {2} {3}" -f $powerShellPath, "-SSHS", "-NoProfile", "-NoLogo" + $subSystemAdded = $false + + foreach ($lineItem in $config.configComponents) + { + $line = $lineItem.Line + $components = $lineItem.Components + + if ($components[0] -eq "SubSystem") + { + if (! $subSystemAdded) + { + # Add new powershell subsystem entry + $newContents.Add($psSubSystemEntry) + $subSystemAdded = $true + } + + if ($components[1] -eq "powershell") + { + # Remove all existing powershell subsystem entries + continue + } + + # Include existing subsystem entries. + $newContents.Add($line) + } + else + { + # Include all other configuration lines + $newContents.Add($line) + } + } + + if (! $subSystemAdded) + { + $newContents.Add($psSubSystemEntry) + } + + # Copy existing file to a backup version + $uniqueName = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetRandomFileName()) + $backupFilePath = $config.configFilePath + "_backup_" + $uniqueName + Copy-Item -Path $config.configFilePath -Destination $backupFilePath + if ($?) + { + WriteLine "A backup copy of the old sshd_config configuration file has been created at:" + WriteLine $backupFilePath + } + + Set-Content -Path $config.configFilePath -Value $newContents.ToArray() -ErrorAction Stop +} + +function CheckPowerShellVersion +{ + param ( + [string] $FilePath + ) + + if (! (Test-Path $FilePath)) + { + throw "CheckPowerShellVersion failed with invalid path: $FilePath" + } + + $commandToExec = "& '$FilePath' -noprofile -noninteractive -c '`$PSVersionTable.PSVersion.Major'" + $sb = [scriptblock]::Create($commandToExec) + + try + { + $psVersionMajor = [int] (& $sb) 2>$null + Write-Verbose "" + Write-Verbose "CheckPowerShellVersion: $psVersionMajor for FilePath: $FilePath" + } + catch + { + $psVersionMajor = 0 + } + + if ($psVersionMajor -ge 6) + { + return $true + } + else + { + return $false + } +} + +function WriteLine +{ + param ( + [string] $Message, + [int] $PrependLines = 0, + [int] $AppendLines = 0 + ) + + for ($i=0; $i -lt $PrependLines; $i++) + { + Write-Output "" + } + + Write-Output $Message + + for ($i=0; $i -lt $AppendLines; $i++) + { + Write-Output "" + } +} + +# Windows only GetShortPathName PInvoke +$typeDef = @' + using System; + using System.Runtime.InteropServices; + using System.Text; + + namespace NativeUtils + { + public class Path + { + [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] + private static extern int GetShortPathName( + [MarshalAs(UnmanagedType.LPTStr)] + string path, + [MarshalAs(UnmanagedType.LPTStr)] + StringBuilder shortPath, + int shortPathLength); + + public static string ConvertToShortPath( + string longPath) + { + int shortPathLength = 2048; + StringBuilder shortPath = new StringBuilder(shortPathLength); + GetShortPathName( + path: longPath, + shortPath: shortPath, + shortPathLength: shortPathLength); + + return shortPath.ToString(); + } + } + } +'@ + +<# +.Synopsis + Enables PowerShell SSH remoting endpoint on local system +.Description + This cmdlet will set up an SSH based remoting endpoint on the local system, based on + the PowerShell executable file path passed in. Or if no PowerShell file path is provided then + the currently running PowerShell file path is used. + The end point is enabled by adding a 'powershell' subsystem entry to the SSHD configuration, using + the provided or current PowerShell file path. + Both the SSH client and SSHD server components are detected and if not found a terminating + error is emitted, asking the user to install the components. + Then the sshd_config is parsed, and if a new 'powershell' subsystem entry is added. +.Parameter SSHDConfigFilePath + File path to the SSHD service configuration file. This file will be updated to include a + 'powershell' subsystem entry to define a PowerShell SSH remoting endpoint, so current credentials + must have write access to the file. +.Parameter PowerShellFilePath + Specifies the file path to the PowerShell command used to host the SSH remoting PowerShell + endpoint. If no value is specified then the currently running PowerShell executable path is used + in the subsytem command. +.Parameter Force + When true, this cmdlet will update the sshd_config configuration file without prompting. +#> +function Enable-SSHRemoting +{ + [CmdletBinding()] + param ( + [string] $SSHDConfigFilePath, + + [string] $PowerShellFilePath, + + [switch] $Force + ) + + # Detect platform + $platformInfo = [PlatformInfo]::new() + DetectPlatform $platformInfo + Write-Verbose "Platform information" + Write-Verbose "$($platformInfo | Out-String)" + + # Non-Windows platforms must run this cmdlet as 'root' + if (!$platformInfo.isWindows) + { + $user = whoami + if ($user -ne 'root') + { + if (! $PSCmdlet.ShouldContinue("This cmdlet must be run as 'root'. If you continue, PowerShell will restart under 'root'. Do you wish to continue?", "Enable-SSHRemoting")) + { + return + } + + # Spawn new PowerShell with sudo and exit this session. + $modFilePath = (Get-Module -Name Microsoft.PowerShell.RemotingTools | Select-Object -Property Path).Path + $modName = [System.IO.Path]::GetFileNameWithoutExtension($modFilePath) + $modFilePath = Join-Path -Path (Split-Path -Path $modFilePath -Parent) -ChildPath "${modName}.psd1" + + $parameters = "" + foreach ($key in $PSBoundParameters.Keys) + { + $parameters += "-${key} " + $value = $PSBoundParameters[$key] + if ($value -is [string]) + { + $parameters += "'$value' " + } + } + + & sudo "$PSHOME/pwsh" -NoExit -c "Import-Module -Name $modFilePath; Enable-SSHRemoting $parameters" + exit + } + } + + # Detect SSH client installation + if (! (Get-Command -Name ssh -ErrorAction SilentlyContinue)) + { + Write-Warning "SSH client is not installed or not discoverable on this machine. SSH client must be installed before PowerShell SSH based remoting can be enabled." + } + + # Detect SSHD server installation + $SSHDFound = $false + if ($platformInfo.IsWindows) + { + $SSHDFound = $null -ne (Get-Service -Name sshd -ErrorAction SilentlyContinue) + } + elseif ($platformInfo.IsLinux) + { + $sshdStatus = sudo service ssh status + $SSHDFound = $null -ne $sshdStatus + } + else + { + # macOS + $SSHDFound = ($null -ne (launchctl list | Select-String 'com.openssh.sshd')) + } + if (! $SSHDFound) + { + Write-Warning "SSHD service is not found on this machine. SSHD service must be installed and running before PowerShell SSH based remoting can be enabled." + } + + # Validate a SSHD configuration file path + if ([string]::IsNullOrEmpty($SSHDConfigFilePath)) + { + Write-Warning "-SSHDConfigFilePath not provided. Using default configuration file location." + + if ($platformInfo.IsWindows) + { + $SSHDConfigFilePath = Join-Path -Path $env:ProgramData -ChildPath 'ssh' -AdditionalChildPath 'sshd_config' + } + elseif ($platformInfo.isLinux) + { + $SSHDConfigFilePath = '/etc/ssh/sshd_config' + } + else + { + # macOS + $SSHDConfigFilePath = '/private/etc/ssh/sshd_config' + } + } + + # Validate a PowerShell command to use for endpoint + $PowerShellToUse = $PowerShellFilePath + if (! [string]::IsNullOrEmpty($PowerShellToUse)) + { + WriteLine "Validating provided -PowerShellFilePath argument." -AppendLines 1 -PrependLines 1 + + if (! (Test-Path $PowerShellToUse)) + { + throw "The provided PowerShell file path is invalid: $PowerShellToUse" + } + + if (! (CheckPowerShellVersion $PowerShellToUse)) + { + throw "The provided PowerShell file path is an unsupported version of PowerShell. PowerShell version 6.0 or greater is required." + } + } + else + { + WriteLine "Validating current PowerShell to use as endpoint subsystem." -AppendLines 1 + + # Try currently running PowerShell + $PowerShellToUse = Get-Command -Name "$PSHome/pwsh" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source + if (! $PowerShellToUse -or ! (CheckPowerShellVersion $PowerShellToUse)) + { + throw "Current running PowerShell version is not valid for SSH remoting endpoint. SSH remoting is only supported for PowerShell version 6.0 and higher. Specify a valid PowerShell 6.0+ file path with the -PowerShellFilePath parameter." + } + } + + # SSHD configuration file uses the space character as a delimiter. + # Consequently, the configuration Subsystem entry will not allow argument paths containing space characters. + # For Windows platforms, we can a short cut path. + # But for non-Windows platforms, we currently throw an error. + # One possible solution is to crete a symbolic link + # New-Item -ItemType SymbolicLink -Path -Value $ + if ($PowerShellToUse.Contains(' ')) + { + if ($platformInfo.IsWindows) + { + Add-Type -TypeDefinition $typeDef + $PowerShellToUse = [NativeUtils.Path]::ConvertToShortPath($PowerShellToUse) + if (! (Test-Path -Path $PowerShellToUse)) + { + throw "Converting long Windows file path resulted in an invalid path: ${PowerShellToUse}." + } + } + else + { + throw "The PowerShell executable (pwsh) selected for hosting the remoting endpoint has a file path containing space characters, which cannot be used with SSHD configuration." + } + } + + WriteLine "Using PowerShell at this path for SSH remoting endpoint:" + WriteLine "$PowerShellToUse" -AppendLines 1 + + # Validate the SSHD configuration file path + if (! (Test-Path -Path $SSHDConfigFilePath)) + { + throw "The provided SSHDConfigFilePath parameter, $SSHDConfigFilePath, is not a valid path." + } + WriteLine "Modifying SSHD configuration file at this location:" + WriteLine "$SSHDConfigFilePath" -AppendLines 1 + + # Get the SSHD configurtion + $sshdConfig = [SSHRemotingConfig]::new($platformInfo, $SSHDConfigFilePath) + + if ($sshdConfig.psSubSystemEntries.Count -gt 0) + { + WriteLine "The following PowerShell subsystems were found in the sshd_config file:" + foreach ($entry in $sshdConfig.psSubSystemEntries) + { + WriteLine $entry.subSystemLine + } + Writeline "Continuing will overwrite any existing PowerShell subsystem entries with the new subsystem." -PrependLines 1 + WriteLine "The new SSH remoting endpoint will use this PowerShell executable path:" + WriteLine "$PowerShellToUse" -AppendLines 1 + } + + $shouldContinue = $Force + if (! $shouldContinue) + { + $shouldContinue = $PSCmdlet.ShouldContinue("The SSHD service configuration file (sshd_config) will now be updated to enable PowerShell remoting over SSH. Do you wish to continue?", "Enable-SSHRemoting") + } + + if ($shouldContinue) + { + WriteLine "Updating configuration file ..." -PrependLines 1 -AppendLines 1 + + UpdateConfiguration $sshdConfig $PowerShellToUse + + WriteLine "The configuration file has been updated:" -PrependLines 1 + WriteLine $sshdConfig.configFilePath -AppendLines 1 + WriteLine "You must restart the SSHD service for the changes to take effect." -AppendLines 1 + } +} From 5fd89561d040114570f8be13dbb1d737012e1047 Mon Sep 17 00:00:00 2001 From: Damir Ainullin Date: Thu, 12 Mar 2020 16:53:45 +0000 Subject: [PATCH 065/275] Remove unreachable DSC code (#12076) * Remove unreachable code * Update src/System.Management.Automation/DscSupport/CimDSCParser.cs Co-Authored-By: Ilya Co-authored-by: Ilya --- src/System.Management.Automation/DscSupport/CimDSCParser.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index b314aa6087a..dcf52a1ad02 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -1233,8 +1233,7 @@ public static List ImportInstances(string path, int schemaValidatio { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); - throw new ArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (schemaValidationOption < (int)Microsoft.Management.Infrastructure.Serialization.MofDeserializerSchemaValidationOption.Default || @@ -4073,4 +4072,3 @@ function Test-DependsOn "; } } - From 61a589ad8a7d82eefe49dad343111f62d58d18ac Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Fri, 13 Mar 2020 05:58:42 +0530 Subject: [PATCH 066/275] Add the 7.0 change log link to `CHANGELOG/README.md` (#12062) --- CHANGELOG/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG/README.md b/CHANGELOG/README.md index a7028154524..4c271de1a2c 100644 --- a/CHANGELOG/README.md +++ b/CHANGELOG/README.md @@ -1,6 +1,7 @@ # Changelogs * [Current preview changelog](preview.md) +* [7.0 changelog](7.0.md) * [6.2 changelog](6.2.md) * [6.1 changelog](6.1.md) * [6.0 changelog](6.0.md) From 1fa0a00728840dd8de3aea5cd6de85e82554faa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Nikoli=C4=87?= Date: Fri, 13 Mar 2020 02:04:29 +0100 Subject: [PATCH 067/275] Change "PowerShell Core" to "PowerShell" in a resource string (#11928) --- src/System.Management.Automation/resources/Modules.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/resources/Modules.resx b/src/System.Management.Automation/resources/Modules.resx index a74152b9717..345811502b6 100644 --- a/src/System.Management.Automation/resources/Modules.resx +++ b/src/System.Management.Automation/resources/Modules.resx @@ -511,7 +511,7 @@ Some commands from module {0} cannot be imported over a CimSession. To get all the commands, verify that the remote server has PowerShell remote management enabled, and then try adding the PSSession parameter to an Import-Module cmdlet. - Module {0} is loaded in Windows PowerShell using {1} remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell Core please use 'Import-Module -SkipEditionCheck' syntax. + Module {0} is loaded in Windows PowerShell using {1} remoting session; please note that all input and output of commands from this module will be deserialized objects. If you want to load this module into PowerShell please use 'Import-Module -SkipEditionCheck' syntax. Detected Windows PowerShell version {0}. Windows PowerShell 5.1 is required to load modules using Windows PowerShell compatibility feature. Install Windows Management Framework (WMF) 5.1 from https://aka.ms/WMF5Download to enable this feature. From e9152a59a56a4203f756d03fbe719600d25f5c78 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 12 Mar 2020 22:13:34 -0700 Subject: [PATCH 068/275] Remove the version number of PowerShell from LICENSE (#12019) --- LICENSE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.txt b/LICENSE.txt index f8b2ee43481..c0903c1e1d0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -PowerShell 6.0 +PowerShell Copyright (c) Microsoft Corporation. All rights reserved. From 2e8ced48565ceb0102c2b8fc3c59d216be7edf58 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 13 Mar 2020 17:46:05 +0500 Subject: [PATCH 069/275] Use new string.Split() overloads (#11867) --- src/Microsoft.WSMan.Management/ConfigProvider.cs | 12 ++++++------ .../WSManConnections.cs | 4 ++-- src/Microsoft.WSMan.Management/WSManInstance.cs | 16 ++++++++-------- src/Microsoft.WSMan.Management/WsManHelper.cs | 8 ++++---- .../CoreCLR/CorePsAssemblyLoadContext.cs | 2 +- .../CoreCLR/CorePsPlatform.cs | 10 +++++----- .../CommandCompletion/CompletionCompleters.cs | 6 +++--- .../engine/hostifaces/NativeCultureResolver.cs | 3 +-- .../remoting/fanin/PSSessionConfigurationData.cs | 2 +- src/TypeCatalogGen/TypeCatalogGen.cs | 2 +- 10 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index bc6b961adc6..ccb03bc9545 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -1977,8 +1977,8 @@ private void NewItemCreateComputerConnection(string Name) helper.CreateWsManConnection(parametersetName, dynParams.ConnectionURI, dynParams.Port, Name, dynParams.ApplicationName, dynParams.UseSSL, dynParams.Authentication, dynParams.SessionOption, this.Credential, dynParams.CertificateThumbprint); if (dynParams.ConnectionURI != null) { - string[] constrsplit = dynParams.ConnectionURI.OriginalString.Split(new string[] { ":" + dynParams.Port + "/" + dynParams.ApplicationName }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = dynParams.ConnectionURI.OriginalString.Split(":" + dynParams.Port + "/" + dynParams.ApplicationName, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); Name = constrsplit1[1].Trim(); } @@ -2526,9 +2526,9 @@ private string GetHostName(string path) private string GetRootNodeName(string ResourceURI) { string tempuri = string.Empty; - if (ResourceURI.Contains("?")) + if (ResourceURI.Contains('?')) { - ResourceURI = ResourceURI.Split(new char[] { '?' }).GetValue(0).ToString(); + ResourceURI = ResourceURI.Split('?').GetValue(0).ToString(); } string PTRN_URI_LAST = "([a-z_][-a-z0-9._]*)$"; @@ -3164,8 +3164,8 @@ private string SplitAndUpdateStringUsingDelimiter(object sessionobj, string uri, if (!string.IsNullOrEmpty(existingvalue)) { - string[] existingsplitvalues = existingvalue.Split(new string[] { Delimiter }, StringSplitOptions.None); - string[] newvalues = value.Split(new string[] { Delimiter }, StringSplitOptions.None); + string[] existingsplitvalues = existingvalue.Split(Delimiter, StringSplitOptions.None); + string[] newvalues = value.Split(Delimiter, StringSplitOptions.None); foreach (string val in newvalues) { if (Array.IndexOf(existingsplitvalues, val) == -1) diff --git a/src/Microsoft.WSMan.Management/WSManConnections.cs b/src/Microsoft.WSMan.Management/WSManConnections.cs index 3453c5cffa0..57c504d61d8 100644 --- a/src/Microsoft.WSMan.Management/WSManConnections.cs +++ b/src/Microsoft.WSMan.Management/WSManConnections.cs @@ -259,8 +259,8 @@ protected override void BeginProcessing() try { // always in the format http://server:port/applicationname - string[] constrsplit = connectionuri.OriginalString.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionuri.OriginalString.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } catch (IndexOutOfRangeException) diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index b0873b6d1d9..243095bc4fd 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -528,8 +528,8 @@ protected override void ProcessRecord() try { // in the format http(s)://server[:port/applicationname] - string[] constrsplit = connectionuri.OriginalString.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionuri.OriginalString.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } catch (IndexOutOfRangeException) @@ -908,8 +908,8 @@ protected override void ProcessRecord() try { // in the format http(s)://server[:port/applicationname] - string[] constrsplit = connectionuri.OriginalString.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionuri.OriginalString.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } catch (IndexOutOfRangeException) @@ -1202,8 +1202,8 @@ protected override void ProcessRecord() try { // in the format http(s)://server[:port/applicationname] - string[] constrsplit = connectionuri.OriginalString.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionuri.OriginalString.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } catch (IndexOutOfRangeException) @@ -1491,8 +1491,8 @@ protected override void BeginProcessing() try { // in the format http(s)://server[:port/applicationname] - string[] constrsplit = connectionuri.OriginalString.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionuri.OriginalString.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } catch (IndexOutOfRangeException) diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 81762a099f9..3fcd7c4d83d 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -953,8 +953,8 @@ internal void CreateWsManConnection(string ParameterSetName, Uri connectionuri, if (connectionuri != null) { // in the format http(s)://server[:port/applicationname] - string[] constrsplit = connectionStr.Split(new string[] { ":" + port + "/" + applicationname }, StringSplitOptions.None); - string[] constrsplit1 = constrsplit[0].Split(new string[] { "//" }, StringSplitOptions.None); + string[] constrsplit = connectionStr.Split(":" + port + "/" + applicationname, StringSplitOptions.None); + string[] constrsplit1 = constrsplit[0].Split("//", StringSplitOptions.None); computername = constrsplit1[1].Trim(); } @@ -1098,10 +1098,10 @@ internal static void LoadResourceData() string Line = _sr.ReadLine(); if (Line.Contains("=")) { - string[] arr = Line.Split(new char[] { '=' }, 2); + string[] arr = Line.Split('=', count: 2); if (!ResourceValueCache.ContainsKey(arr[0].Trim())) { - string value = arr[1].TrimStart(new char[] { '"' }).TrimEnd(new char[] { '"' }); + string value = arr[1].Trim('"'); ResourceValueCache.Add(arr[0].Trim(), value.Trim()); } } diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index ed5719b13b7..bfc683c0905 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -71,7 +71,7 @@ private PowerShellAssemblyLoadContext(string basePaths) } else { - _probingPaths = basePaths.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + _probingPaths = basePaths.Split(';', StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < _probingPaths.Length; i++) { string basePath = _probingPaths[i]; diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 108574d9f00..7fe897d8ea4 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -785,7 +785,7 @@ public string GetUserName() return username; } - // Get and add the user name to the cache so we don't need to + // Get and add the user name to the cache so we don't need to // have a pinvoke for each file. username = NativeMethods.GetPwUid(UserId); usernameCache.Add(UserId, username); @@ -805,7 +805,7 @@ public string GetGroupName() return groupname; } - // Get and add the group name to the cache so we don't need to + // Get and add the group name to the cache so we don't need to // have a pinvoke for each file. groupname = NativeMethods.GetGrGid(GroupId); groupnameCache.Add(GroupId, groupname); @@ -976,7 +976,7 @@ public static int GetProcFSParentPid(int pid) try { var stat = System.IO.File.ReadAllText(path); - var parts = stat.Split(new[] { ' ' }, 5); + var parts = stat.Split(' ', 5); if (parts.Length < 5) { return invalidPid; @@ -1092,8 +1092,8 @@ internal static extern int GetInodeData([MarshalAs(UnmanagedType.LPStr)]string p /// /// This is a struct from getcommonstat.h in the native library. - /// It presents each member of the stat structure as the largest type of that member across - /// all stat structures on the platforms we support. This allows us to present a common + /// It presents each member of the stat structure as the largest type of that member across + /// all stat structures on the platforms we support. This allows us to present a common /// stat structure for all our platforms. /// [StructLayout(LayoutKind.Sequential)] diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index f52e9f79b28..c63ef8f05f2 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -1687,7 +1687,7 @@ private static void ProcessParameter( string enumString = LanguagePrimitives.EnumSingleTypeConverter.EnumValues(parameterType); string separator = CultureInfo.CurrentUICulture.TextInfo.ListSeparator; - string[] enumArray = enumString.Split(new string[] { separator }, StringSplitOptions.RemoveEmptyEntries); + string[] enumArray = enumString.Split(separator, StringSplitOptions.RemoveEmptyEntries); string wordToComplete = context.WordToComplete; string quote = HandleDoubleAndSingleQuote(ref wordToComplete); @@ -6151,7 +6151,7 @@ internal static List CompleteStatementFlags(TokenKind kind, st string enumString = LanguagePrimitives.EnumSingleTypeConverter.EnumValues(typeof(SwitchFlags)); string separator = CultureInfo.CurrentUICulture.TextInfo.ListSeparator; - string[] enumArray = enumString.Split(new string[] { separator }, StringSplitOptions.RemoveEmptyEntries); + string[] enumArray = enumString.Split(separator, StringSplitOptions.RemoveEmptyEntries); var pattern = WildcardPattern.Get(wordToComplete + "*", WildcardOptions.IgnoreCase); var enumList = new List(); @@ -6626,7 +6626,7 @@ internal static void CompleteMemberHelper( string tooltip = memberInfo.ToString(); if (tooltip.IndexOf("),", StringComparison.Ordinal) != -1) { - var overloads = tooltip.Split(new[] { ")," }, StringSplitOptions.RemoveEmptyEntries); + var overloads = tooltip.Split("),", StringSplitOptions.RemoveEmptyEntries); var newTooltip = new StringBuilder(); foreach (var overload in overloads) { diff --git a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs index f53035d6c22..97afac1e285 100644 --- a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs +++ b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs @@ -236,8 +236,7 @@ internal static CultureInfo GetUICulture(bool filterOutNonConsoleCultures) { try { - string[] fallbacks = langBuffer.Split(new char[] { '\0' }, - StringSplitOptions.RemoveEmptyEntries); + string[] fallbacks = langBuffer.Split('\0', StringSplitOptions.RemoveEmptyEntries); string fallback = fallbacks[0]; string[] fallbacksForParent = null; diff --git a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs index 52a2a9ed805..0f4a29c4ac0 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs @@ -189,7 +189,7 @@ private void Update(string optionName, string optionValue) AssertValueNotAssigned(ModulesToImportToken, _modulesToImport); _modulesToImport = new List(); _modulesToImportInternal = new List(); - object[] modulesToImport = optionValue.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); + object[] modulesToImport = optionValue.Split(',', StringSplitOptions.RemoveEmptyEntries); foreach (var module in modulesToImport) { var s = module as string; diff --git a/src/TypeCatalogGen/TypeCatalogGen.cs b/src/TypeCatalogGen/TypeCatalogGen.cs index 2427f90fa72..668556cafb7 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.cs +++ b/src/TypeCatalogGen/TypeCatalogGen.cs @@ -384,7 +384,7 @@ private static List ResolveReferenceAssemblies(string path) } string allText = File.ReadAllText(referenceListPath); - string[] references = allText.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + string[] references = allText.Split(';', StringSplitOptions.RemoveEmptyEntries); List refAssemblyFiles = new List(120); for (int i = 0; i < references.Length; i++) From f0a8220398e24cfbe6ba181510147993b1ec3c31 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 13 Mar 2020 05:54:27 -0700 Subject: [PATCH 070/275] Fix package syncing to private Module Feed (#11841) --- .../AzArtifactFeed/PSGalleryToAzArtifacts.yml | 7 ++-- .../SyncGalleryToAzArtifacts.psm1 | 36 ++++++++++++++++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml b/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml index e6f5756b9d3..1faffc3d247 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml @@ -7,19 +7,18 @@ resources: queue: name: Hosted VS2017 steps: - - powershell: | + - pwsh: | Install-Module -Name PowerShellGet -MinimumVersion 2.0.1 -Force - Import-Module PowerShellGet -Force -Verbose displayName: Update PSGet and PackageManagement condition: succeededOrFailed() - - powershell: | + - pwsh: | Import-Module -Force "$(Build.SourcesDirectory)/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1" SyncGalleryToAzArtifacts -AzDevOpsFeedUserName $(AzDevOpsFeedUserName) -AzDevOpsPAT $(AzDevOpsFeedPAT) -Destination $(Build.ArtifactStagingDirectory) displayName: Download packages from PSGallery that need to be updated condition: succeededOrFailed() - - powershell: | + - pwsh: | Write-Verbose -Verbose "Packages to upload" if(Test-Path $(Build.ArtifactStagingDirectory)) { Get-ChildItem "$(Build.ArtifactStagingDirectory)/*.nupkg" | ForEach-Object { $_.FullName }} displayName: List packages to upload diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index 351f5ce78c2..60518484c84 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -66,10 +66,10 @@ function SyncGalleryToAzArtifacts { } # Check if Az package version is less that gallery version - if ($foundPackageOnAz.Version -lt $foundPackageOnGallery.Version) { + if (CompareVersions -lt -ReferencePackage $foundPackageOnAz -DifferencePackage $foundPackageOnGallery) { Write-Verbose -Verbose "Module needs to be updated $($package.Name) - $($foundPackageOnGallery.Version)" $modulesToUpdate += $foundPackageOnGallery - } elseif ($foundPackageOnGallery.Version -lt $foundPackageOnAz.Version) { + } elseif (CompareVersions -lt -ReferencePackage $foundPackageOnGallery -DifferencePackage $foundPackageOnAz) { Write-Warning "Newer version found on Az Artifacts - $($foundPackageOnAz.Name) - $($foundPackageOnAz.Version)" } else { Write-Verbose -Verbose "Module is in sync - $($package.Name)" @@ -92,7 +92,7 @@ function SyncGalleryToAzArtifacts { # Remove dependent packages downloaded by Save-Module if there are already present in AzArtifacts feed. try { - Register-PackageSource -Name local -Location $Destination -ProviderName NuGet -Force + $null = Register-PackageSource -Name local -Location $Destination -ProviderName NuGet -Force $packageNamesToKeep = @() $savedPackages = Find-Package -Source local -AllVersions -AllowPreReleaseVersion @@ -120,6 +120,34 @@ function SyncGalleryToAzArtifacts { } +Function CompareVersions { + param ( + [Microsoft.PackageManagement.Packaging.SoftwareIdentity] + $ReferencePackage, + [Microsoft.PackageManagement.Packaging.SoftwareIdentity] + $DifferencePackage, + [Parameter(Mandatory = $true, ParameterSetName='lt')] + [switch] + $lt, + [Parameter(Mandatory = $true, ParameterSetName='gt')] + [switch] + $gt + ) + + if ($ReferencePackage.Version -eq $DifferencePackage.Version) { + return $false + } + + $latest = SortPackage -p @($ReferencePackage,$DifferencePackage) | Select-Object -First 1 + + if ($gt.IsPresent) { + return $ReferencePackage -eq $latest + } elseif ($lt.IsPresent) { + return $DifferencePackage -eq $latest + } else { + throw "Unknown parameter set" + } +} Function SortPackage { @@ -176,4 +204,4 @@ function NormalizeVersion { $sVer } -Export-ModuleMember -Function 'SyncGalleryToAzArtifacts' +Export-ModuleMember -Function 'SyncGalleryToAzArtifacts', 'SortPackage' From 9d592ea3882c478ac87947e8d57d090a67688de0 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 13 Mar 2020 09:00:18 -0700 Subject: [PATCH 071/275] Move to standard internal pool for building (#12119) --- tools/releaseBuild/azureDevOps/WindowsBuild.yml | 4 ++-- tools/releaseBuild/azureDevOps/releaseBuild.yml | 2 ++ tools/releaseBuild/azureDevOps/templates/nuget.yml | 2 +- tools/releaseBuild/azureDevOps/templates/windows-build.yml | 2 +- .../azureDevOps/templates/windows-component-governance.yml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/WindowsBuild.yml b/tools/releaseBuild/azureDevOps/WindowsBuild.yml index bdd6a31d532..cd194ace52c 100644 --- a/tools/releaseBuild/azureDevOps/WindowsBuild.yml +++ b/tools/releaseBuild/azureDevOps/WindowsBuild.yml @@ -4,7 +4,7 @@ jobs: displayName: Build condition: succeeded() pool: - name: PowerShell + name: Package ES Standard Build strategy: matrix: Build (x64,release): @@ -177,7 +177,7 @@ jobs: dependsOn: BuildJob condition: succeeded() pool: - name: PowerShell + name: Package ES Standard Build strategy: matrix: release-anycpu: diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 37a14c4118f..80a2bdd7563 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -135,6 +135,8 @@ jobs: - job: release_json displayName: Create and Upload release.json + pool: + vmImage: 'windows-latest' steps: - template: templates/SetVersionVariables.yml parameters: diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index b4e4193cad3..bfbf237e603 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -7,7 +7,7 @@ jobs: ${{ parameters.parentJobs }} displayName: Build NuGet packages condition: succeeded() - pool: PowerShell + pool: Package ES Standard Build timeoutInMinutes: 90 diff --git a/tools/releaseBuild/azureDevOps/templates/windows-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-build.yml index f0c77272c87..8aab17585f3 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-build.yml @@ -8,7 +8,7 @@ jobs: displayName: Build Windows - ${{ parameters.Architecture }} condition: succeeded() pool: - name: PowerShell + name: Package ES Standard Build variables: BuildConfiguration: ${{ parameters.BuildConfiguration }} BuildPlatform: ${{ parameters.BuildPlatform }} diff --git a/tools/releaseBuild/azureDevOps/templates/windows-component-governance.yml b/tools/releaseBuild/azureDevOps/templates/windows-component-governance.yml index d4698f84a4e..f667c27d859 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-component-governance.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-component-governance.yml @@ -5,7 +5,7 @@ jobs: condition: succeeded() pool: - name: PowerShell + name: Package ES Standard Build steps: From 10e7d1955ba78c35f40c32ef4ceebf49f68c4022 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 13 Mar 2020 21:10:19 +0500 Subject: [PATCH 072/275] Handle the `IOException` in `Get-FileHash` (#11944) --- .../commands/utility/GetHash.cs | 9 +++++++++ .../Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs index 78017d46db2..7afca70e3fe 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs @@ -156,6 +156,15 @@ protected override void ProcessRecord() path); WriteError(errorRecord); } + catch (IOException ioException) + { + var errorRecord = new ErrorRecord( + ioException, + "FileReadError", + ErrorCategory.ReadError, + path); + WriteError(errorRecord); + } finally { openfilestream?.Dispose(); 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 283234005ba..3807d2d2ea0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 @@ -28,6 +28,13 @@ Describe "Get-FileHash" -Tags "CI" { $result.Count | Should -Be 1 $errorVariable.FullyQualifiedErrorId | Should -BeExactly "UnauthorizedAccessError,Microsoft.PowerShell.Commands.GetFileHashCommand" } + + It "Should write non-terminating error if a file is locked" -Skip:(-not $IsWindows) { + $pagefilePath = (Get-CimInstance -ClassName Win32_PageFileusage).Name + $result = $pagefilePath, "${pshome}\pwsh.dll" | Get-FileHash -ErrorVariable errorVariable + $result.Count | Should -Be 1 + $errorVariable.FullyQualifiedErrorId | Should -BeExactly "FileReadError,Microsoft.PowerShell.Commands.GetFileHashCommand" + } } Context "Algorithm tests" { From 47645e0ccf55b1ba664140c36c3b26766aad523b Mon Sep 17 00:00:00 2001 From: Steven Donovan <59343178+stevend811@users.noreply.github.com> Date: Fri, 13 Mar 2020 18:44:15 -0400 Subject: [PATCH 073/275] Replace `VSCode` link in `CONTRIBUTING.md` (#11475) --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 09ef94f7263..7b8a65c596d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -395,7 +395,7 @@ Once you sign a CLA, all your existing and future pull requests will have the st [up-for-grabs]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AUp-for-Grabs [semantic linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/ [PowerShell-Docs]: https://github.com/powershell/powershell-docs/ -[use-vscode-editor]: https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode?view=powershell-7#editing-with-vscode +[use-vscode-editor]: https://docs.microsoft.com/dotnet/core/tutorials/with-visual-studio-code [repository-maintainer]: ../docs/community/governance.md#repository-maintainers [area-expert]: ../docs/community/governance.md#area-experts [first-time-issue]: https://github.com/powershell/powershell/issues?q=is%3Aopen+is%3Aissue+label%3AFirst-Time-Issue From 07962a9749ab50444ebe87101e5bacf5b5f47f88 Mon Sep 17 00:00:00 2001 From: Bryan Berns Date: Sat, 14 Mar 2020 00:57:04 -0400 Subject: [PATCH 074/275] Address UTF-8 Detection In Get-Content -Tail (#11899) - Addresses a comparison failure that causes UTF-8 detection to fail which in turn causes Get-Content -Tail to resort to forward lookups given encoding type cannot be detected. Possible this misdetection is due to the incoming encoding object as being of type System.Text.UTF8Encoding where as the comparison uses the object Encoding.UTF8 which is derived from System.Text.UTF8Encoding+UTF8EncodingSealed. - See https://github.com/PowerShell/PowerShell/issues/11830 - Added 'OEM', 'UTF8BOM', and 'UTF8NoBOM' as explicit encodings for existing Get-Content -Tail tests. * Add Multi-Byte Unicode Tail Character Tests - Modified -Tail encoding test to use three different test sets: utf-8, utf-16, utf-32. The test verifies that the content resulting from -Tail is equal to the same string returned from a regular Get-Content using both an explicit and implicit encoding. * Remove BigEndianUnicode Reference In Comment --- .../namespaces/FileSystemContentStream.cs | 10 ++-- .../Get-Content.Tests.ps1 | 47 +++++++++++-------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index 4d7dae05950..0cb668b7248 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -1434,7 +1434,7 @@ private int RefillByteBuff() int toRead = lengthLeft > BuffSize ? BuffSize : (int)lengthLeft; _stream.Seek(-toRead, SeekOrigin.Current); - if (_currentEncoding.Equals(Encoding.UTF8)) + if (_currentEncoding is UTF8Encoding) { // It's UTF-8, we need to detect the starting byte of a character do @@ -1460,14 +1460,12 @@ private int RefillByteBuff() _byteCount += _stream.Read(_byteBuff, _byteCount, (int)(lengthLeft - _stream.Position)); _stream.Position = _currentPosition; } - else if (_currentEncoding.Equals(Encoding.Unicode) || - _currentEncoding.Equals(Encoding.BigEndianUnicode) || - _currentEncoding.Equals(Encoding.UTF32) || - _currentEncoding.Equals(Encoding.ASCII) || + else if (_currentEncoding is UnicodeEncoding || + _currentEncoding is UTF32Encoding || + _currentEncoding is ASCIIEncoding || IsSingleByteCharacterSet()) { // Unicode -- two bytes per character - // BigEndianUnicode -- two types per character // UTF-32 -- four bytes per character // ASCII -- one byte per character // The BufferSize will be a multiple of 4, so we can just read toRead number of bytes 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 38355416d03..2e8a0de3e48 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 @@ -93,35 +93,44 @@ Describe "Get-Content" -Tags "CI" { { Get-Content -Path Variable:\PSHOME -Tail 1 -TotalCount 5 -ErrorAction Stop} | Should -Throw -ErrorId 'TailAndHeadCannotCoexist,Microsoft.PowerShell.Commands.GetContentCommand' } - It 'Verifies -Tail with content that uses an explicit encoding' -TestCases @( + It 'Verifies -Tail with content that uses an explicit/implicit encoding' -TestCases @( @{EncodingName = 'String'}, + @{EncodingName = 'OEM'}, @{EncodingName = 'Unicode'}, @{EncodingName = 'BigEndianUnicode'}, @{EncodingName = 'UTF8'}, + @{EncodingName = 'UTF8BOM'}, + @{EncodingName = 'UTF8NoBOM'}, @{EncodingName = 'UTF7'}, @{EncodingName = 'UTF32'}, @{EncodingName = 'Ascii'} ){ param($EncodingName) - $content = @" -one -two -foo -bar -baz -"@ - $expected = 'foo' - $tailCount = 3 - - $testPath = Join-Path -Path $TestDrive -ChildPath 'TailWithEncoding.txt' - $content | Set-Content -Path $testPath -Encoding $encodingName - $expected = 'foo' - - $actual = Get-Content -Path $testPath -Tail $tailCount -Encoding $encodingName - $actual | Should -BeOfType string - $actual.Length | Should -Be $tailCount - $actual[0] | Should -BeExactly $expected + $contentSets = + @(@('a1','aa2','aaa3','aaaa4','aaaaa5'), # utf-8 + @('€1','€€2','€€€3','€€€€4','€€€€€5'), # utf-16 + @('𐍈1','𐍈𐍈2','𐍈𐍈𐍈3','𐍈𐍈𐍈𐍈4','𐍈𐍈𐍈𐍈𐍈5')) # utf-32 + ForEach ($content in $contentSets) + { + $tailCount = 3 + $testPath = Join-Path -Path $TestDrive -ChildPath 'TailWithEncoding.txt' + $content | Set-Content -Path $testPath -Encoding $EncodingName + + # read and verify using explicit encoding + $expected = (Get-Content -Path $testPath -Encoding $EncodingName)[-$tailCount] + $actual = Get-Content -Path $testPath -Tail $tailCount -Encoding $EncodingName + $actual | Should -BeOfType string + $actual.Length | Should -Be $tailCount + $actual[0] | Should -BeExactly $expected + + # read and verify using implicit encoding + $expected = (Get-Content -Path $testPath)[-$tailCount] + $actual = Get-Content -Path $testPath -Tail $tailCount + $actual | Should -BeOfType string + $actual.Length | Should -Be $tailCount + $actual[0] | Should -BeExactly $expected + } } It "should Get-Content with a variety of -Tail and -ReadCount: " -TestCases @( From 320656c8deb21d1c9e5d34bc8f6b67a69c06597d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2020 13:22:56 -0700 Subject: [PATCH 075/275] Bump `Microsoft.CodeAnalysis.CSharp` from `3.4.0` to `3.5.0` (#12136) Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/dotnet/roslyn/releases) - [Changelog](https://github.com/dotnet/roslyn/blob/master/docs/Breaking%20API%20Changes.md) - [Commits](https://github.com/dotnet/roslyn/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index cef3abea39b..abfc37d2b41 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -31,7 +31,7 @@ - + From b5d4739b2a79ba6ad1b51ea726b87c1be404c196 Mon Sep 17 00:00:00 2001 From: Ilya Date: Wed, 18 Mar 2020 18:38:55 +0500 Subject: [PATCH 076/275] Use span-based overloads (#11884) --- .../ShowCommand/ViewModel/CommandViewModel.cs | 2 +- .../ShowCommand/ViewModel/ModuleViewModel.cs | 10 +++++----- .../cmdletization/cim/cimConverter.cs | 4 ++-- .../commands/utility/OrderObjectBase.cs | 2 +- .../utility/ShowCommand/ShowCommand.cs | 2 +- .../host/msh/ConsoleHostUserInterface.cs | 5 ++++- .../ConfigProvider.cs | 2 +- .../FormatAndOutput/common/TableWriter.cs | 2 +- .../common/Utilities/MshParameter.cs | 2 +- .../engine/CmdletParameterBinderController.cs | 6 +++--- .../engine/ComInterop/VariantArray.cs | 2 +- .../CommandCompletion/CompletionAnalysis.cs | 9 ++++----- .../CommandCompletion/CompletionCompleters.cs | 12 ++++++------ .../ExperimentalFeature/ExperimentalFeature.cs | 2 +- .../engine/Modules/GetModuleCommand.cs | 2 +- .../engine/Modules/ModuleCmdletBase.cs | 2 +- .../engine/NativeCommandParameterBinder.cs | 2 +- .../engine/ParameterBinderController.cs | 2 +- .../engine/ParameterSetInfo.cs | 2 +- .../engine/debugger/Breakpoint.cs | 2 +- .../engine/hostifaces/MshHostUserInterface.cs | 2 +- .../engine/parser/Parser.cs | 4 ++-- .../engine/parser/Position.cs | 2 +- .../engine/parser/ast.cs | 18 +++++++++--------- .../engine/remoting/client/Job.cs | 2 +- .../client/RemoteRunspacePoolInternal.cs | 2 +- .../commands/EnterPSHostProcessCommand.cs | 2 +- .../remoting/common/RunspaceConnectionInfo.cs | 2 +- .../fanin/InitialSessionStateProvider.cs | 2 +- .../fanin/OutOfProcTransportManager.cs | 4 ++-- .../server/ServerRunspacePoolDriver.cs | 4 ++-- .../engine/runtime/Operations/MiscOps.cs | 4 ++-- .../engine/runtime/Operations/StringOps.cs | 16 ++++++++++------ .../engine/scriptparameterbindercontroller.cs | 2 +- .../namespaces/LocationGlobber.cs | 13 +++++-------- .../namespaces/NavigationProviderBase.cs | 4 ++-- .../namespaces/TransactedRegistryKey.cs | 2 +- .../security/CatalogHelper.cs | 4 ++-- .../security/SecureStringHelper.cs | 2 +- .../utils/ClrFacade.cs | 2 +- 40 files changed, 85 insertions(+), 82 deletions(-) diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs index c5e25028823..d6bb68bbc20 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs @@ -429,7 +429,7 @@ public string GetScript() commandName = this.ModuleName + "\\" + commandName; } - if (commandName.IndexOf(' ') != -1) + if (commandName.Contains(' ')) { builder.AppendFormat("& \"{0}\"", commandName); } diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs index 66a768940c4..dd37c7c09d9 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs @@ -435,21 +435,21 @@ private static bool Matches(WildcardPattern filterPattern, string commandName, s /// Return match result. private static bool MatchesEvenIfInPlural(string commandName, string filter) { - if (commandName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) != -1) + if (commandName.Contains(filter, StringComparison.OrdinalIgnoreCase)) { return true; } if (filter.Length > 5 && filter.EndsWith("es", StringComparison.OrdinalIgnoreCase)) { - filter = filter.Substring(0, filter.Length - 2); - return commandName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) != -1; + ReadOnlySpan filterSpan = filter.AsSpan(0, filter.Length - 2); + return commandName.AsSpan().Contains(filterSpan, StringComparison.OrdinalIgnoreCase); } if (filter.Length > 4 && filter.EndsWith("s", StringComparison.OrdinalIgnoreCase)) { - filter = filter.Substring(0, filter.Length - 1); - return commandName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) != -1; + ReadOnlySpan filterSpan = filter.AsSpan(0, filter.Length - 1); + return commandName.AsSpan().Contains(filterSpan, StringComparison.OrdinalIgnoreCase); } return false; 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 abcb5d33f6c..8fdb0fda75f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs @@ -459,8 +459,8 @@ internal static object ConvertFromCimToDotNet(object cimObject, Type expectedDot return exceptionSafeReturn(delegate { int indexOfLastColon = cimIntrinsicValue.LastIndexOf(':'); - int port = int.Parse(cimIntrinsicValue.Substring(indexOfLastColon + 1), NumberStyles.Integer, CultureInfo.InvariantCulture); - IPAddress address = IPAddress.Parse(cimIntrinsicValue.Substring(0, indexOfLastColon)); + int port = int.Parse(cimIntrinsicValue.AsSpan(indexOfLastColon + 1), NumberStyles.Integer, CultureInfo.InvariantCulture); + IPAddress address = IPAddress.Parse(cimIntrinsicValue.AsSpan(0, indexOfLastColon)); return new IPEndPoint(address, port); }); } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs index a7258cb1bb0..8254f98a7ea 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs @@ -72,7 +72,7 @@ public string Culture if (trimmedValue.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) { if ((trimmedValue.Length > 2) && - int.TryParse(trimmedValue.Substring(2), NumberStyles.AllowHexSpecifier, + int.TryParse(trimmedValue.AsSpan(2), NumberStyles.AllowHexSpecifier, CultureInfo.CurrentCulture, out cultureNumber)) { _cultureInfo = new CultureInfo(cultureNumber); 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 2e260c5953d..8b9213c6fd0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs @@ -377,7 +377,7 @@ private bool CanProcessRecordForOneCommand() try { - _commandViewModelObj = _showCommandProxy.GetCommandViewModel(new ShowCommandCommandInfo(commandInfo), _noCommonParameter.ToBool(), _importedModules, this.Name.IndexOf('\\') != -1); + _commandViewModelObj = _showCommandProxy.GetCommandViewModel(new ShowCommandCommandInfo(commandInfo), _noCommonParameter.ToBool(), _importedModules, this.Name.Contains('\\')); _showCommandProxy.ShowCommandWindow(_commandViewModelObj, _passThrough); } catch (TargetInvocationException ti) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 1addb3dc5b0..7cf189fb984 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1865,8 +1865,11 @@ private char GetCharacterUnderCursor(Coordinates cursorPosition) /// The string with any \0 characters removed... private string RemoveNulls(string input) { - if (input.IndexOf('\0') == -1) + if (input.Contains('\0')) + { return input; + } + StringBuilder sb = new StringBuilder(); foreach (char c in input) { diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index ccb03bc9545..5a6c4d75cb6 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -4105,7 +4105,7 @@ private bool ItemExistListenerOrClientCertificate(object sessionobj, string Reso PSObject obj = (PSObject)objcache[CurrentNode]; CurrentNode = RemainingPath.Substring(pos + 1); - if (CurrentNode.IndexOf(WSManStringLiterals.DefaultPathSeparator) != -1) + if (CurrentNode.Contains(WSManStringLiterals.DefaultPathSeparator)) { // No more directories allowed after listeners objects return false; diff --git a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs index f01cc9b8499..c9974a64834 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs @@ -436,7 +436,7 @@ private string GenerateRow(string[] values, ReadOnlySpan alignment, Display } sb.Append(GenerateRowField(values[k], _si.columnInfo[k].width, alignment[k], dc, addPadding)); - if (values[k].IndexOf(ESC) != -1) + if (values[k].Contains(ESC)) { // Reset the console output if the content of this column contains ESC sb.Append(ResetConsoleVt100Code); diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index c037fa29df8..53f379a59ee 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -177,7 +177,7 @@ internal static bool FindPartialMatch(string key, string normalizedKey) if (key.Length < normalizedKey.Length) { // shorter, could be an abbreviation - if (string.Equals(key, normalizedKey.Substring(0, key.Length), StringComparison.OrdinalIgnoreCase)) + if (key.AsSpan().Equals(normalizedKey.AsSpan(0, key.Length), StringComparison.OrdinalIgnoreCase)) { // found abbreviation return true; diff --git a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs index 4991d2623b1..5914c900e4c 100644 --- a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs +++ b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs @@ -3173,7 +3173,7 @@ private static string BuildLabel(string parameterName, StringBuilder usedHotKeys for (int i = 0; i < parameterName.Length; i++) { // try Upper case - if (char.IsUpper(parameterName[i]) && (usedHotKeysStr.IndexOf(parameterName[i]) == -1)) + if (char.IsUpper(parameterName[i]) && usedHotKeysStr.Contains(parameterName[i])) { label.Insert(i, hotKeyPrefix); usedHotKeys.Append(parameterName[i]); @@ -3187,7 +3187,7 @@ private static string BuildLabel(string parameterName, StringBuilder usedHotKeys // try Lower case for (int i = 0; i < parameterName.Length; i++) { - if (char.IsLower(parameterName[i]) && (usedHotKeysStr.IndexOf(parameterName[i]) == -1)) + if (char.IsLower(parameterName[i]) && usedHotKeysStr.Contains(parameterName[i])) { label.Insert(i, hotKeyPrefix); usedHotKeys.Append(parameterName[i]); @@ -3202,7 +3202,7 @@ private static string BuildLabel(string parameterName, StringBuilder usedHotKeys // try non-letters for (int i = 0; i < parameterName.Length; i++) { - if (!char.IsLetter(parameterName[i]) && (usedHotKeysStr.IndexOf(parameterName[i]) == -1)) + if (!char.IsLetter(parameterName[i]) && usedHotKeysStr.Contains(parameterName[i])) { label.Insert(i, hotKeyPrefix); usedHotKeys.Append(parameterName[i]); diff --git a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs index d8c0a90384b..77f4c6b377a 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs @@ -77,7 +77,7 @@ internal static Type GetStructType(int args) // See if we can find an existing type foreach (Type t in s_generatedTypes) { - int arity = int.Parse(t.Name.Substring("VariantArray".Length), CultureInfo.InvariantCulture); + int arity = int.Parse(t.Name.AsSpan("VariantArray".Length), NumberStyles.Integer, CultureInfo.InvariantCulture); if (size == arity) { return t; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs index 8d533edc3e5..e96914f96b3 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs @@ -1514,19 +1514,18 @@ private List GetResultForString(CompletionContext completionCo var analysis = new CompletionAnalysis(_ast, _tokens, _cursorPosition, _options); var subContext = analysis.CreateCompletionContext(completionContext.TypeInferenceContext); - int subReplaceIndex, subReplaceLength; - var subResult = analysis.GetResultHelper(subContext, out subReplaceIndex, out subReplaceLength, true); + var subResult = analysis.GetResultHelper(subContext, out int subReplaceIndex, out _, true); if (subResult != null && subResult.Count > 0) { result = new List(); replacementIndex = stringStartIndex + 1 + (cursorIndexInString - subInput.Length); replacementLength = subInput.Length; - string prefix = subInput.Substring(0, subReplaceIndex); + ReadOnlySpan prefix = subInput.AsSpan(0, subReplaceIndex); foreach (CompletionResult entry in subResult) { - string completionText = prefix + entry.CompletionText; + string completionText = string.Concat(prefix, entry.CompletionText.AsSpan()); if (entry.ResultType == CompletionResultType.Property) { completionText = TokenKind.DollarParen.Text() + completionText + TokenKind.RParen.Text(); @@ -1565,7 +1564,7 @@ private List GetResultForString(CompletionContext completionCo result = new List(CompletionCompleters.CompleteFilename(completionContext)); // Try command name completion only if the text contains '-' - if (wordToComplete.IndexOf('-') != -1) + if (wordToComplete.Contains('-')) { var commandNameResult = CompletionCompleters.CompleteCommand(completionContext); if (commandNameResult != null && commandNameResult.Count > 0) diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index c63ef8f05f2..86657f92f32 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -1164,7 +1164,7 @@ internal static List CompleteCommandArgument(CompletionContext var tryCmdletCompletion = false; var clearLiteralPathsKey = TurnOnLiteralPathOption(context); - if (context.WordToComplete.IndexOf('-') != -1) + if (context.WordToComplete.Contains('-')) { tryCmdletCompletion = true; } @@ -1224,7 +1224,7 @@ internal static List CompleteCommandArgument(CompletionContext } // Handle member completion with wildcard: echo $a.* - if (pathAst.Value.IndexOf('*') != -1 && secondToLastMemberAst != null && + if (pathAst.Value.Contains('*') && secondToLastMemberAst != null && secondToLastMemberAst.Extent.EndLineNumber == pathAst.Extent.StartLineNumber && secondToLastMemberAst.Extent.EndColumnNumber == pathAst.Extent.StartColumnNumber) { @@ -1328,7 +1328,7 @@ internal static List CompleteCommandArgument(CompletionContext context.Options.Remove("LiteralPaths"); } - if (context.WordToComplete != string.Empty && context.WordToComplete.IndexOf('-') != -1) + if (context.WordToComplete != string.Empty && context.WordToComplete.Contains('-')) { var commandResults = CompleteCommand(context); if (commandResults != null) @@ -3844,7 +3844,7 @@ private static void NativeCompletionTypeName(CompletionContext context, List internal static bool IsEngineFeatureName(string featureName) { - return featureName.Length > 2 && featureName.IndexOf('.') == -1 && featureName.StartsWith("PS", StringComparison.Ordinal); + return featureName.Length > 2 && !featureName.Contains('.') && featureName.StartsWith("PS", StringComparison.Ordinal); } /// diff --git a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs index 2104142987a..08b936a785b 100644 --- a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs @@ -440,7 +440,7 @@ private void AssertNameDoesNotResolveToAPath(string[] names, string stringFormat { foreach (var n in names) { - if (n.IndexOf(StringLiterals.DefaultPathSeparator) != -1 || n.IndexOf(StringLiterals.AlternatePathSeparator) != -1) + if (n.Contains(StringLiterals.DefaultPathSeparator) || n.Contains(StringLiterals.AlternatePathSeparator)) { string errorMessage = StringUtil.Format(stringFormat, n); var argumentException = new ArgumentException(errorMessage); diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 986e1deff51..7506262ac1a 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -925,7 +925,7 @@ internal List GetModule(string[] names, bool all, bool refresh) { foreach (var n in names) { - if (n.IndexOf(StringLiterals.DefaultPathSeparator) != -1 || n.IndexOf(StringLiterals.AlternatePathSeparator) != -1) + if (n.Contains(StringLiterals.DefaultPathSeparator) || n.Contains(StringLiterals.AlternatePathSeparator)) { modulePaths.Add(n); } diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs index 68d1fd2f191..580c1580b56 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -81,7 +81,7 @@ internal void BindParameters(Collection parameters) if (parameter.ParameterNameSpecified) { - Diagnostics.Assert(parameter.ParameterText.IndexOf(' ') == -1, "Parameters cannot have whitespace"); + Diagnostics.Assert(!parameter.ParameterText.Contains(' '), "Parameters cannot have whitespace"); PossiblyGlobArg(parameter.ParameterText, usedQuotes: false); if (parameter.SpaceAfterParameter) diff --git a/src/System.Management.Automation/engine/ParameterBinderController.cs b/src/System.Management.Automation/engine/ParameterBinderController.cs index 6bad34823ba..8524462c81b 100644 --- a/src/System.Management.Automation/engine/ParameterBinderController.cs +++ b/src/System.Management.Automation/engine/ParameterBinderController.cs @@ -345,7 +345,7 @@ internal static void AddArgumentsToCommandProcessor(CommandProcessorBase command { param = CommandParameterInternal.CreateParameterWithArgument( /*parameterAst*/null, paramText.Substring(1, colonIndex - 1), paramText, - /*argumentAst*/null, paramText.Substring(colonIndex + 1).Trim(), + /*argumentAst*/null, paramText.AsSpan(colonIndex + 1).Trim().ToString(), false); } else if (argIndex == arguments.Length - 1 || paramText[paramText.Length - 1] != ':') diff --git a/src/System.Management.Automation/engine/ParameterSetInfo.cs b/src/System.Management.Automation/engine/ParameterSetInfo.cs index 240a242fcd1..f31d2f72417 100644 --- a/src/System.Management.Automation/engine/ParameterSetInfo.cs +++ b/src/System.Management.Automation/engine/ParameterSetInfo.cs @@ -292,7 +292,7 @@ internal static string GetParameterTypeString(Type type, IEnumerable } // If the type is really an array, but the typename didn't include [], then add it. - if (type.IsArray && (parameterTypeString.IndexOf("[]", StringComparison.Ordinal) == -1)) + if (type.IsArray && !parameterTypeString.Contains("[]", StringComparison.Ordinal)) { var t = type; while (t.IsArray) diff --git a/src/System.Management.Automation/engine/debugger/Breakpoint.cs b/src/System.Management.Automation/engine/debugger/Breakpoint.cs index 30d83e57693..ade266e6c53 100644 --- a/src/System.Management.Automation/engine/debugger/Breakpoint.cs +++ b/src/System.Management.Automation/engine/debugger/Breakpoint.cs @@ -220,7 +220,7 @@ private bool CommandInfoMatches(CommandInfo commandInfo) // If the breakpoint looks like it might have specified a module name and the command // we're checking is in a module, try matching the module\command against the pattern // in the breakpoint. - if (!string.IsNullOrEmpty(commandInfo.ModuleName) && Command.IndexOf('\\') != -1) + if (!string.IsNullOrEmpty(commandInfo.ModuleName) && Command.Contains('\\')) { if (CommandPattern.IsMatch(commandInfo.ModuleName + "\\" + commandInfo.Name)) return true; diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 38166d0b8e3..45c0b44df75 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1247,7 +1247,7 @@ internal static void BuildHotkeysAndPlainLabels(Collection ch if (andPos + 1 < choices[i].Label.Length) { splitLabel.Append(choices[i].Label.Substring(andPos + 1)); - hotkeysAndPlainLabels[0, i] = CultureInfo.CurrentCulture.TextInfo.ToUpper(choices[i].Label.Substring(andPos + 1, 1).Trim()); + hotkeysAndPlainLabels[0, i] = CultureInfo.CurrentCulture.TextInfo.ToUpper(choices[i].Label.AsSpan(andPos + 1, 1).Trim().ToString()); } hotkeysAndPlainLabels[1, i] = splitLabel.ToString().Trim(); diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index 314680c932c..94b4e842956 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -68,7 +68,7 @@ public static ScriptBlockAst ParseFile(string fileName, out Token[] tokens, out var parser = new Parser(); if (!string.IsNullOrEmpty(fileName) && fileName.Length > scriptSchemaExtension.Length && fileName.EndsWith(scriptSchemaExtension, StringComparison.OrdinalIgnoreCase)) { - parser._keywordModuleName = Path.GetFileName(fileName.Substring(0, fileName.Length - scriptSchemaExtension.Length)); + parser._keywordModuleName = Path.GetFileName(fileName.AsSpan(0, fileName.Length - scriptSchemaExtension.Length)).ToString(); parseDscResource = true; } @@ -8107,7 +8107,7 @@ internal class ParserEventSource : EventSource internal static string GetFileOrScript(string fileName, string input) { - return fileName ?? input.Substring(0, Math.Min(256, input.Length)).Trim(); + return fileName ?? input.AsSpan(0, Math.Min(256, input.Length)).Trim().ToString(); } } } diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index f26054174e4..b7e63532cc7 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -150,7 +150,7 @@ internal static string VerboseMessage(IScriptExtent position) : sourceLine.Length - position.StartColumnNumber + 1; // Expand tabs before figuring out if we need to truncate the line - if (sourceLine.IndexOf('\t') != -1) + if (sourceLine.Contains('\t')) { var copyLine = new StringBuilder(sourceLine.Length * 2); diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 460ef64f8bb..b1dd14464f9 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -1238,7 +1238,7 @@ internal string ToStringForSerialization(Tuple, stri string varSign = varAst.Splatted ? "@" : "$"; string newVarName = varSign + UsingExpressionAst.UsingPrefix + varName; - newScript.Append(script.Substring(startOffset, astStartOffset - startOffset)); + newScript.Append(script.AsSpan(startOffset, astStartOffset - startOffset)); newScript.Append(newVarName); startOffset = astEndOffset; } @@ -1259,13 +1259,13 @@ internal string ToStringForSerialization(Tuple, stri newParams += ",\n"; } - newScript.Append(script.Substring(startOffset, currentOffset - startOffset)); + newScript.Append(script.AsSpan(startOffset, currentOffset - startOffset)); newScript.Append(newParams); startOffset = currentOffset; } } - newScript.Append(script.Substring(startOffset, endOffset - startOffset)); + newScript.Append(script.AsSpan(startOffset, endOffset - startOffset)); string result = newScript.ToString(); if (Parent != null && initialStartOffset == this.Extent.StartOffset && initialEndOffset == this.Extent.EndOffset) @@ -2304,7 +2304,7 @@ internal string GetParamTextWithDollarUsingHandling(IEnumerator= 0) { - return fullTypeName.Substring(lastDotIndex + 1).Equals(Name, StringComparison.OrdinalIgnoreCase); + return fullTypeName.AsSpan(lastDotIndex + 1).Equals(Name, StringComparison.OrdinalIgnoreCase); } return false; diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 0cf3977f40a..63847c3f69f 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -510,7 +510,7 @@ internal static string GetCommandTextFromInvocationInfo(InvocationInfo invocatio { Dbg.Assert(scriptExtent.StartScriptPosition.ColumnNumber > 0, "Column numbers start at 1"); Dbg.Assert(scriptExtent.StartScriptPosition.ColumnNumber <= scriptExtent.StartScriptPosition.Line.Length, "Column numbers are not greater than the length of a line"); - return scriptExtent.StartScriptPosition.Line.Substring(scriptExtent.StartScriptPosition.ColumnNumber - 1).Trim(); + return scriptExtent.StartScriptPosition.Line.AsSpan(scriptExtent.StartScriptPosition.ColumnNumber - 1).Trim().ToString(); } return invocationInfo.InvocationName; diff --git a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs index 811baef9dc6..b401f0f96b6 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs @@ -2151,7 +2151,7 @@ private static object GetSessionOptions(WSManConnectionInfo wsmanConnectionInfo) private static bool CheckForSSL(WSManConnectionInfo wsmanConnectionInfo) { return (!string.IsNullOrEmpty(wsmanConnectionInfo.Scheme) && - wsmanConnectionInfo.Scheme.IndexOf(WSManConnectionInfo.HttpsScheme, StringComparison.OrdinalIgnoreCase) != -1); + wsmanConnectionInfo.Scheme.Contains(WSManConnectionInfo.HttpsScheme, StringComparison.OrdinalIgnoreCase)); } private static int ConvertPSAuthToWSManAuth(AuthenticationMechanism psAuth) diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index cf06c4cda1a..21614338af9 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -648,7 +648,7 @@ internal static IReadOnlyCollection GetAppDomainNamesFromProc int pAppDomainIndex = namedPipe.IndexOf('.', pIdIndex + 1); if (pAppDomainIndex > -1) { - string idString = namedPipe.Substring(pIdIndex + 1, (pAppDomainIndex - pIdIndex - 1)); + ReadOnlySpan idString = namedPipe.AsSpan(pIdIndex + 1, (pAppDomainIndex - pIdIndex - 1)); int id = -1; if (int.TryParse(idString, out id)) { diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 937fa7dfab0..1b28947623f 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -1439,7 +1439,7 @@ internal bool IsLocalhostAndNetworkAccess return (EnableNetworkAccess && // Interactive token requested (Credential == null && // No credential provided (ComputerName.Equals(DefaultComputerName, StringComparison.OrdinalIgnoreCase) || // Localhost computer name - ComputerName.IndexOf('.') == -1))); // Not FQDN computer name + !ComputerName.Contains('.')))); // Not FQDN computer name } } diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 0d25baf5f83..dfcd8b44960 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -1896,7 +1896,7 @@ private void MergeConfigHashIntoConfigHash(IDictionary childConfigHash) private string GetRoleCapabilityPath(string roleCapability) { string moduleName = "*"; - if (roleCapability.IndexOf('\\') != -1) + if (roleCapability.Contains('\\')) { string[] components = roleCapability.Split(Utils.Separators.Backslash, 2); moduleName = components[0]; diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index 35913a1f7ba..c4f9f9d0d7c 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -760,7 +760,7 @@ protected void HandleOutputDataReceived(string data) try { // Route protocol message based on whether it is a session or command message. - if (data.IndexOf(SESSIONDMESSAGETAG, StringComparison.OrdinalIgnoreCase) > -1) + if (data.Contains(SESSIONDMESSAGETAG, StringComparison.OrdinalIgnoreCase)) { // Session message _sessionMessageQueue.Add(data); @@ -1708,7 +1708,7 @@ private static string ReadError(StreamReader reader) } if ((error.Length == 0) || - error.IndexOf("WARNING:", StringComparison.OrdinalIgnoreCase) > -1) + error.Contains("WARNING:", StringComparison.OrdinalIgnoreCase)) { // Handle as interactive warning message Console.WriteLine(error); diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index d2aa6430795..b3335cb7d02 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -890,8 +890,8 @@ private void HandleCreateAndInvokePowerShell(object _, RemoteDataEventArgs + { + ReadOnlySpan src = args.s.AsSpan(); + int length = src.Length; + for (int i = 0; i < args.times; i++) + { + src.CopyTo(dst); + dst = dst.Slice(length); + } + }); } internal static string FormatOperator(string formatString, object formatArgs) diff --git a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs index d1f8ba6ff25..601fc78667c 100644 --- a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs +++ b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs @@ -274,7 +274,7 @@ private void HandleRemainingArguments(Collection argum // foo "-abc" // This is important when splatting, we reconstruct the parameter if the // value is splatted. - var parameterText = new PSObject(new string(parameter.ParameterText.ToCharArray())); + var parameterText = new PSObject(new string(parameter.ParameterText)); if (parameterText.Properties[NotePropertyNameForSplattingParametersInArgs] == null) { var noteProperty = new PSNoteProperty(NotePropertyNameForSplattingParametersInArgs, diff --git a/src/System.Management.Automation/namespaces/LocationGlobber.cs b/src/System.Management.Automation/namespaces/LocationGlobber.cs index 217d3787e18..f03ff7038dd 100644 --- a/src/System.Management.Automation/namespaces/LocationGlobber.cs +++ b/src/System.Management.Automation/namespaces/LocationGlobber.cs @@ -1869,9 +1869,7 @@ internal string GetDriveRootRelativePathFromPSPath( if (normalizedPath.StartsWith(normalizedRoot, StringComparison.OrdinalIgnoreCase)) { isPathForCurrentDrive = true; - path = path.Substring(normalizedRoot.Length); - path = path.TrimStart(StringLiterals.DefaultPathSeparator); - path = StringLiterals.DefaultPathSeparator + path; + path = string.Concat(StringLiterals.DefaultPathSeparatorString, path.AsSpan(normalizedRoot.Length).TrimStart(StringLiterals.DefaultPathSeparator)); workingDriveForPath = _sessionState.Drive.Current; } } @@ -3087,8 +3085,7 @@ internal static string GetDriveQualifiedPath(string path, PSDriveInfo drive) } else { - string possibleDriveName = path.Substring(0, index); - if (string.Equals(possibleDriveName, drive.Name, StringComparison.OrdinalIgnoreCase)) + if (path.AsSpan(0, index).Equals(drive.Name, StringComparison.OrdinalIgnoreCase)) { treatAsRelative = false; } @@ -4438,17 +4435,17 @@ private static string ConvertMshEscapeToRegexEscape(string path) const char mshEscapeChar = '`'; const char regexEscapeChar = '\\'; - char[] workerArray = path.ToCharArray(); + ReadOnlySpan workerArray = path; StringBuilder result = new StringBuilder(); - for (int index = 0; index < workerArray.GetLength(0); ++index) + for (int index = 0; index < workerArray.Length; ++index) { // look for an escape character if (workerArray[index] == mshEscapeChar) { - if (index + 1 < workerArray.GetLength(0)) + if (index + 1 < workerArray.Length) { if (workerArray[index + 1] == mshEscapeChar) { diff --git a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs index 94f60deaacb..654574c8dec 100644 --- a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs +++ b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs @@ -873,12 +873,12 @@ private string NormalizePath(string path) // normalize it, then we will get a wrong path. // // Fast return if nothing to normalize. - if (path.IndexOf(StringLiterals.AlternatePathSeparator) == -1) + if (!path.Contains(StringLiterals.AlternatePathSeparator)) { return path; } - bool pathHasBackSlash = path.IndexOf(StringLiterals.DefaultPathSeparator) != -1; + bool pathHasBackSlash = path.Contains(StringLiterals.DefaultPathSeparator); string normalizedPath; // There is a mix of slashes & the path is rooted & the path exists without normalization. diff --git a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs index 145d72f0618..67fec931cce 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs @@ -1723,7 +1723,7 @@ internal static void Win32ErrorStatic(int errorCode, string str) internal static string FixupName(string name) { BCLDebug.Assert(name != null, "[FixupName]name!=null"); - if (name.IndexOf('\\') == -1) + if (name.Contains('\\')) return name; StringBuilder sb = new StringBuilder(name); diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index acd0711d236..018720f3910 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -218,7 +218,7 @@ internal static void ProcessFileToBeAddedInCatalogDefinitionFile(FileInfo fileTo if (dirInfo != null) { // Relative path of the file is the path inside the containing folder excluding folder Name - relativePath = fileToHash.FullName.Substring(dirInfo.FullName.Length).TrimStart('\\'); + relativePath = fileToHash.FullName.AsSpan(dirInfo.FullName.Length).TrimStart('\\').ToString(); } else { @@ -613,7 +613,7 @@ internal static void ProcessPathFile(FileInfo fileToHash, DirectoryInfo dirInfo, if (dirInfo != null) { // Relative path of the file is the path inside the containing folder excluding folder Name - relativePath = fileToHash.FullName.Substring(dirInfo.FullName.Length).TrimStart('\\'); + relativePath = fileToHash.FullName.AsSpan(dirInfo.FullName.Length).TrimStart('\\').ToString(); exclude = fileToHash.Name; } else diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index e0992f12f62..6f7bb1180b3 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -131,7 +131,7 @@ internal static byte[] ByteArrayFromString(string s) { for (int i = 0; i < dataLen; i++) { - data[i] = byte.Parse(s.Substring(2 * i, 2), + data[i] = byte.Parse(s.AsSpan(2 * i, 2), NumberStyles.AllowHexSpecifier, System.Globalization.CultureInfo.InvariantCulture); } diff --git a/src/System.Management.Automation/utils/ClrFacade.cs b/src/System.Management.Automation/utils/ClrFacade.cs index db0f8f9f1b2..dd1b806fdc9 100644 --- a/src/System.Management.Automation/utils/ClrFacade.cs +++ b/src/System.Management.Automation/utils/ClrFacade.cs @@ -204,7 +204,7 @@ private static SecurityZone MapSecurityZone(string filePath) // has 'dot' in it, the file will be treated as in Internet security zone. Otherwise, it's // in Intranet security zone. string hostName = uri.Host; - return hostName.IndexOf('.') == -1 ? SecurityZone.Intranet : SecurityZone.Internet; + return hostName.Contains('.') ? SecurityZone.Intranet : SecurityZone.Internet; } string root = Path.GetPathRoot(filePath); From 8ebff6a2a4ea09c5bf4f3c35e227af16f174f157 Mon Sep 17 00:00:00 2001 From: Ilya Date: Wed, 18 Mar 2020 18:40:35 +0500 Subject: [PATCH 077/275] Use async streams in Invoke-RestMethod (#11095) --- .../Common/InvokeRestMethodCommand.Common.cs | 152 +++++++++--------- .../Common/WebRequestPSCmdlet.Common.cs | 2 +- .../InvokeWebRequestCommand.CoreClr.cs | 2 +- .../utility/WebCmdlet/StreamHelper.cs | 86 ++++------ 4 files changed, 113 insertions(+), 129 deletions(-) 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 344323cd939..101cf78c55b 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 @@ -85,7 +85,7 @@ public int MaximumFollowRelLink #region Helper Methods - private bool TryProcessFeedStream(BufferingStreamReader responseStream) + private bool TryProcessFeedStream(Stream responseStream) { bool isRssOrFeed = false; @@ -382,95 +382,95 @@ internal override void ProcessResponse(HttpResponseMessage response) { if (response == null) { throw new ArgumentNullException("response"); } - using (BufferingStreamReader responseStream = new BufferingStreamReader(StreamHelper.GetResponseStream(response))) + var baseResponseStream = StreamHelper.GetResponseStream(response); + + if (ShouldWriteToPipeline) { - if (ShouldWriteToPipeline) + using var responseStream = new BufferingStreamReader(baseResponseStream); + + // First see if it is an RSS / ATOM feed, in which case we can + // stream it - unless the user has overridden it with a return type of "XML" + if (TryProcessFeedStream(responseStream)) { - // First see if it is an RSS / ATOM feed, in which case we can - // stream it - unless the user has overridden it with a return type of "XML" - if (TryProcessFeedStream(responseStream)) + // Do nothing, content has been processed. + } + else + { + // determine the response type + RestReturnType returnType = CheckReturnType(response); + + // Try to get the response encoding from the ContentType header. + Encoding encoding = null; + string charSet = response.Content.Headers.ContentType?.CharSet; + if (!string.IsNullOrEmpty(charSet)) { - // Do nothing, content has been processed. + // NOTE: Don't use ContentHelper.GetEncoding; it returns a + // default which bypasses checking for a meta charset value. + StreamHelper.TryGetEncoding(charSet, out encoding); } - else - { - // determine the response type - RestReturnType returnType = CheckReturnType(response); - - // Try to get the response encoding from the ContentType header. - Encoding encoding = null; - string charSet = response.Content.Headers.ContentType?.CharSet; - if (!string.IsNullOrEmpty(charSet)) - { - // NOTE: Don't use ContentHelper.GetEncoding; it returns a - // default which bypasses checking for a meta charset value. - StreamHelper.TryGetEncoding(charSet, out encoding); - } - if (string.IsNullOrEmpty(charSet) && returnType == RestReturnType.Json) - { - encoding = Encoding.UTF8; - } - - object obj = null; - Exception ex = null; + if (string.IsNullOrEmpty(charSet) && returnType == RestReturnType.Json) + { + encoding = Encoding.UTF8; + } - string str = StreamHelper.DecodeStream(responseStream, ref encoding); + object obj = null; + Exception ex = null; - string encodingVerboseName; - try - { - encodingVerboseName = string.IsNullOrEmpty(encoding.HeaderName) ? encoding.EncodingName : encoding.HeaderName; - } - catch (NotSupportedException) - { - encodingVerboseName = encoding.EncodingName; - } - // NOTE: Tests use this verbose output to verify the encoding. - WriteVerbose(string.Format - ( - System.Globalization.CultureInfo.InvariantCulture, - "Content encoding: {0}", - encodingVerboseName) - ); - bool convertSuccess = false; - - if (returnType == RestReturnType.Json) - { - convertSuccess = TryConvertToJson(str, out obj, ref ex) || TryConvertToXml(str, out obj, ref ex); - } - // default to try xml first since it's more common - else - { - convertSuccess = TryConvertToXml(str, out obj, ref ex) || TryConvertToJson(str, out obj, ref ex); - } + string str = StreamHelper.DecodeStream(responseStream, ref encoding); - if (!convertSuccess) - { - // fallback to string - obj = str; - } + string encodingVerboseName; + try + { + encodingVerboseName = string.IsNullOrEmpty(encoding.HeaderName) ? encoding.EncodingName : encoding.HeaderName; + } + catch (NotSupportedException) + { + encodingVerboseName = encoding.EncodingName; + } + // NOTE: Tests use this verbose output to verify the encoding. + WriteVerbose(string.Format + ( + System.Globalization.CultureInfo.InvariantCulture, + "Content encoding: {0}", + encodingVerboseName) + ); + bool convertSuccess = false; + + if (returnType == RestReturnType.Json) + { + convertSuccess = TryConvertToJson(str, out obj, ref ex) || TryConvertToXml(str, out obj, ref ex); + } + // default to try xml first since it's more common + else + { + convertSuccess = TryConvertToXml(str, out obj, ref ex) || TryConvertToJson(str, out obj, ref ex); + } - WriteObject(obj); + if (!convertSuccess) + { + // fallback to string + obj = str; } - } - if (ShouldSaveToOutFile) - { - StreamHelper.SaveStreamToFile(responseStream, QualifiedOutFile, this); + WriteObject(obj); } + } + else if (ShouldSaveToOutFile) + { + StreamHelper.SaveStreamToFile(baseResponseStream, QualifiedOutFile, this, _cancelToken.Token); + } - if (!string.IsNullOrEmpty(StatusCodeVariable)) - { - PSVariableIntrinsics vi = SessionState.PSVariable; - vi.Set(StatusCodeVariable, (int)response.StatusCode); - } + if (!string.IsNullOrEmpty(StatusCodeVariable)) + { + PSVariableIntrinsics vi = SessionState.PSVariable; + vi.Set(StatusCodeVariable, (int)response.StatusCode); + } - if (!string.IsNullOrEmpty(ResponseHeadersVariable)) - { - PSVariableIntrinsics vi = SessionState.PSVariable; - vi.Set(ResponseHeadersVariable, WebResponseHelper.GetHeadersDictionary(response)); - } + if (!string.IsNullOrEmpty(ResponseHeadersVariable)) + { + PSVariableIntrinsics vi = SessionState.PSVariable; + vi.Set(ResponseHeadersVariable, WebResponseHelper.GetHeadersDictionary(response)); } } 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 5bd4e0226fe..ed73fabc8dc 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 @@ -918,7 +918,7 @@ public abstract partial class WebRequestPSCmdlet : PSCmdlet /// /// Cancellation token source. /// - private CancellationTokenSource _cancelToken = null; + internal CancellationTokenSource _cancelToken = null; /// /// Parse Rel Links. 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 1e98d253745..5edec0bf558 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 @@ -51,7 +51,7 @@ internal override void ProcessResponse(HttpResponseMessage response) if (ShouldSaveToOutFile) { - StreamHelper.SaveStreamToFile(responseStream, QualifiedOutFile, this); + StreamHelper.SaveStreamToFile(responseStream, QualifiedOutFile, this, _cancelToken.Token); } } 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 91a9a0e9975..91662ed7878 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs @@ -9,6 +9,8 @@ using System.Net.Http; using System.Text; using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; namespace Microsoft.PowerShell.Commands { @@ -99,7 +101,7 @@ public override long Length /// /// /// - public override System.Threading.Tasks.Task CopyToAsync(Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) + public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) { Initialize(); return base.CopyToAsync(destination, bufferSize, cancellationToken); @@ -124,7 +126,7 @@ public override int Read(byte[] buffer, int offset, int count) /// /// /// - public override System.Threading.Tasks.Task ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) + public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { Initialize(); return base.ReadAsync(buffer, offset, count, cancellationToken); @@ -175,7 +177,7 @@ public override void Write(byte[] buffer, int offset, int count) /// /// /// - public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) + public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { Initialize(); return base.WriteAsync(buffer, offset, count, cancellationToken); @@ -273,73 +275,55 @@ internal static class StreamHelper #region Static Methods - internal static void WriteToStream(Stream input, Stream output, PSCmdlet cmdlet) + internal static void WriteToStream(Stream input, Stream output, PSCmdlet cmdlet, CancellationToken cancellationToken) { - byte[] data = new byte[ChunkSize]; + if (cmdlet == null) + { + throw new ArgumentNullException(nameof(cmdlet)); + } - int read = 0; - long totalWritten = 0; - do + Task copyTask = input.CopyToAsync(output, cancellationToken); + + ProgressRecord record = new ProgressRecord( + ActivityId, + WebCmdletStrings.WriteRequestProgressActivity, + WebCmdletStrings.WriteRequestProgressStatus); + try { - if (cmdlet != null) + do { - ProgressRecord record = new ProgressRecord(ActivityId, - WebCmdletStrings.WriteRequestProgressActivity, - StringUtil.Format(WebCmdletStrings.WriteRequestProgressStatus, totalWritten)); + record.StatusDescription = StringUtil.Format(WebCmdletStrings.WriteRequestProgressStatus, output.Position); cmdlet.WriteProgress(record); - } - read = input.Read(data, 0, ChunkSize); + Task.Delay(1000).Wait(cancellationToken); + } + while (!copyTask.IsCompleted && !cancellationToken.IsCancellationRequested); - if (0 < read) + if (copyTask.IsCompleted) { - output.Write(data, 0, read); - totalWritten += read; + record.StatusDescription = StringUtil.Format(WebCmdletStrings.WriteRequestComplete, output.Position); + cmdlet.WriteProgress(record); } - } while (read != 0); - - if (cmdlet != null) + } + catch (OperationCanceledException) { - ProgressRecord record = new ProgressRecord(ActivityId, - WebCmdletStrings.WriteRequestProgressActivity, - StringUtil.Format(WebCmdletStrings.WriteRequestComplete, totalWritten)); - record.RecordType = ProgressRecordType.Completed; - cmdlet.WriteProgress(record); } - - output.Flush(); - } - - internal static void WriteToStream(byte[] input, Stream output) - { - output.Write(input, 0, input.Length); - output.Flush(); } /// /// Saves content from stream into filePath. /// Caller need to ensure position is properly set. /// - /// - /// - /// - internal static void SaveStreamToFile(Stream stream, string filePath, PSCmdlet cmdlet) + /// Input stream. + /// Output file name. + /// Current cmdlet (Invoke-WebRequest or Invoke-RestMethod). + /// CancellationToken to track the cmdlet cancellation. + internal static void SaveStreamToFile(Stream stream, string filePath, PSCmdlet cmdlet, CancellationToken cancellationToken) { // If the web cmdlet should resume, append the file instead of overwriting. - if (cmdlet is WebRequestPSCmdlet webCmdlet && webCmdlet.ShouldResume) - { - using (FileStream output = new FileStream(filePath, FileMode.Append, FileAccess.Write, FileShare.Read)) - { - WriteToStream(stream, output, cmdlet); - } - } - else - { - using (FileStream output = File.Create(filePath)) - { - WriteToStream(stream, output, cmdlet); - } - } + FileMode fileMode = cmdlet is WebRequestPSCmdlet webCmdlet && webCmdlet.ShouldResume ? FileMode.Append : FileMode.Create; + using FileStream output = new FileStream(filePath, fileMode, FileAccess.Write, FileShare.Read); + WriteToStream(stream, output, cmdlet, cancellationToken); } private static string StreamToString(Stream stream, Encoding encoding) From 43e0e1a1c54144ae351e1541dd0965b7792d338b Mon Sep 17 00:00:00 2001 From: Ilya Date: Wed, 18 Mar 2020 18:43:01 +0500 Subject: [PATCH 078/275] Fix default formatting for deserialized MatchInfo (#11728) MatchInfo class has ToEmphasizedString() member method to color output line. In remote scenario MatchInfo class is deserialized as Deserialized.Microsoft.PowerShell.Commands.MatchInfo without the method. As result default formating in remote scenario show nothing. The fix is to directly output Line property. --- .../PowerShellCore_format_ps1xml.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 09cc323b936..7dd6914561a 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -46,6 +46,10 @@ internal static IEnumerable GetFormatData() "Microsoft.PowerShell.Commands.MatchInfo", ViewsOf_Microsoft_PowerShell_Commands_MatchInfo()); + yield return new ExtendedTypeDefinition( + "Deserialized.Microsoft.PowerShell.Commands.MatchInfo", + ViewsOf_Deserialized_Microsoft_PowerShell_Commands_MatchInfo()); + yield return new ExtendedTypeDefinition( "System.Management.Automation.PSVariable", ViewsOf_System_Management_Automation_PSVariable()); @@ -382,6 +386,16 @@ private static IEnumerable ViewsOf_Microsoft_PowerShell_Co .EndControl()); } + private static IEnumerable ViewsOf_Deserialized_Microsoft_PowerShell_Commands_MatchInfo() + { + yield return new FormatViewDefinition("MatchInfo", + CustomControl.Create() + .StartEntry() + .AddScriptBlockExpressionBinding(@"$_.Line") + .EndEntry() + .EndControl()); + } + private static IEnumerable ViewsOf_System_Management_Automation_PSVariable() { yield return new FormatViewDefinition("Variable", From c737f3162c756c5d4b1a54e1436d84f67a932477 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 18 Mar 2020 11:18:21 -0700 Subject: [PATCH 079/275] Fix NullReferenceException when binding common parameters of type 'ActionPreference' (#12124) --- .../engine/ReflectionParameterBinder.cs | 18 +++++++++++++--- .../Scripting/ActionPreference.Tests.ps1 | 21 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs index 5336b3ec57e..7a75ca44376 100644 --- a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs +++ b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs @@ -189,9 +189,21 @@ static ReflectionParameterBinder() s_setterMethods.TryAdd(Tuple.Create(typeof(GetModuleCommand), "ListAvailable"), (o, v) => ((GetModuleCommand)o).ListAvailable = (SwitchParameter)v); s_setterMethods.TryAdd(Tuple.Create(typeof(GetModuleCommand), "FullyQualifiedName"), (o, v) => ((GetModuleCommand)o).FullyQualifiedName = (ModuleSpecification[])v); - s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "ErrorAction"), (o, v) => ((CommonParameters)o).ErrorAction = (ActionPreference)v); - s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "WarningAction"), (o, v) => ((CommonParameters)o).WarningAction = (ActionPreference)v); - s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "InformationAction"), (o, v) => ((CommonParameters)o).InformationAction = (ActionPreference)v); + s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "ErrorAction"), + (o, v) => { + v ??= LanguagePrimitives.ThrowInvalidCastException(null, typeof(ActionPreference)); + ((CommonParameters)o).ErrorAction = (ActionPreference)v; + }); + s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "WarningAction"), + (o, v) => { + v ??= LanguagePrimitives.ThrowInvalidCastException(null, typeof(ActionPreference)); + ((CommonParameters)o).WarningAction = (ActionPreference)v; + }); + s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "InformationAction"), + (o, v) => { + v ??= LanguagePrimitives.ThrowInvalidCastException(null, typeof(ActionPreference)); + ((CommonParameters)o).InformationAction = (ActionPreference)v; + }); s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "Verbose"), (o, v) => ((CommonParameters)o).Verbose = (SwitchParameter)v); s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "Debug"), (o, v) => ((CommonParameters)o).Debug = (SwitchParameter)v); s_setterMethods.TryAdd(Tuple.Create(typeof(CommonParameters), "ErrorVariable"), (o, v) => ((CommonParameters)o).ErrorVariable = (string)v); diff --git a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 index bdad4344b7b..c93e63bec4b 100644 --- a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 +++ b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 @@ -186,6 +186,27 @@ Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { { New-Item @params } | Should -Throw -ErrorId "NewItemIOError,Microsoft.PowerShell.Commands.NewItemCommand" Remove-Item "$testdrive\test.txt" -Force } + + It "Parameter binding '-' throws correctly (no NRE) if argument is " -TestCases @( + @{ name = "ErrorAction"; argValue = "null"; arguments = @{ ErrorAction = $null } } + @{ name = "WarningAction"; argValue = "null"; arguments = @{ WarningAction = $null } } + @{ name = "InformationAction"; argValue = "null"; arguments = @{ InformationAction = $null } } + @{ name = "ErrorAction"; argValue = "AutomationNull"; arguments = @{ ErrorAction = [System.Management.Automation.Internal.AutomationNull]::Value } } + @{ name = "WarningAction"; argValue = "AutomationNull"; arguments = @{ WarningAction = [System.Management.Automation.Internal.AutomationNull]::Value } } + @{ name = "InformationAction"; argValue = "AutomationNull"; arguments = @{ InformationAction = [System.Management.Automation.Internal.AutomationNull]::Value } } + ) { + param($arguments) + + $err = $null + try { + Test-Path .\noexistfile.ps1 @arguments + } catch { + $err = $_ + } + + $err.FullyQualifiedErrorId | Should -BeExactly "ParameterBindingFailed,Microsoft.PowerShell.Commands.TestPathCommand" + $err.Exception.InnerException.InnerException | Should -BeOfType "System.Management.Automation.PSInvalidCastException" + } } Describe 'ActionPreference.Break tests' -tag 'CI' { From 5da06978b1b10213cb39285977b4a364313e012c Mon Sep 17 00:00:00 2001 From: Damir Ainullin Date: Thu, 19 Mar 2020 03:54:39 +0000 Subject: [PATCH 080/275] Set correct priority for ?: operator (#12075) --- .../engine/runtime/Binding/Binders.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index 3aaf877e882..cbccd082a77 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -1178,7 +1178,7 @@ private class KeyComparer : IEqualityComparer Date: Thu, 19 Mar 2020 11:27:13 -0700 Subject: [PATCH 081/275] Move to `.NET 5 preview.1` (#12140) --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- PowerShell.Common.props | 2 +- assets/files.wxs | 174 ++++++++++++------ build.psm1 | 6 +- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 +- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 6 +- .../Microsoft.WSMan.Management.csproj | 2 +- src/ResGen/ResGen.csproj | 2 +- .../System.Management.Automation.csproj | 20 +- .../security/nativeMethods.cs | 27 +-- src/TypeCatalogGen/TypeCatalogGen.csproj | 2 +- test/Test.Common.props | 2 +- test/powershell/Host/ConsoleHost.Tests.ps1 | 7 + test/powershell/Host/Startup.Tests.ps1 | 6 - .../Operators/NullConditional.Tests.ps1 | 5 +- .../Operators/TernaryOperator.Tests.ps1 | 4 +- .../WebCmdlets.Tests.ps1 | 30 --- test/tools/OpenCover/OpenCover.psm1 | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- tools/packaging/packaging.psm1 | 16 +- tools/packaging/projects/nuget/package.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 +- .../Microsoft.PowerShell.ConsoleHost.csproj | 2 +- .../System.Management.Automation.csproj | 6 +- 28 files changed, 174 insertions(+), 169 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1ad81125758..572c44334a3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM mcr.microsoft.com/dotnet/core/sdk:3.1.102 +FROM mcr.microsoft.com/dotnet/core/sdk:5.0.0-preview.1.20120.5 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 80868cb91c2..36ae9537336 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ // See https://aka.ms/vscode-remote/devcontainer.json for format details. { - "name": ".NET Core 3.1, including pwsh (Debian 10)", + "name": ".NET Core 5.0, including pwsh (Debian 10)", "dockerFile": "Dockerfile", // Uncomment the next line to run commands after the container is created. diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 05ad339f565..9d27847530c 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -95,7 +95,7 @@ Microsoft Corporation (c) Microsoft Corporation. All rights reserved. - netcoreapp3.1 + netcoreapp5.0 8.0 true diff --git a/assets/files.wxs b/assets/files.wxs index 36357ec070b..79d91d534db 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -2019,9 +2019,6 @@ - - - @@ -2037,6 +2034,12 @@ + + + + + + @@ -2081,9 +2084,6 @@ - - - @@ -2096,6 +2096,12 @@ + + + + + + @@ -2104,9 +2110,6 @@ - - - @@ -2155,6 +2158,12 @@ + + + + + + @@ -2205,15 +2214,18 @@ - - - + + + + + + @@ -2231,9 +2243,6 @@ - - - @@ -2273,6 +2282,12 @@ + + + + + + @@ -2314,9 +2329,6 @@ - - - @@ -2332,6 +2344,12 @@ + + + + + + @@ -2367,9 +2385,6 @@ - - - @@ -2391,6 +2406,12 @@ + + + + + + @@ -2444,12 +2465,15 @@ - - - + + + + + + @@ -2464,9 +2488,6 @@ - - - @@ -2509,6 +2530,12 @@ + + + + + + @@ -2529,9 +2556,6 @@ - - - @@ -2568,6 +2592,12 @@ + + + + + + @@ -2591,9 +2621,6 @@ - - - @@ -2627,6 +2654,12 @@ + + + + + + @@ -2674,9 +2707,6 @@ - - - @@ -2686,6 +2716,12 @@ + + + + + + @@ -2715,9 +2751,6 @@ - - - @@ -2745,6 +2778,12 @@ + + + + + + @@ -2951,9 +2990,6 @@ - - - @@ -3071,8 +3107,14 @@ - - + + + + + + + + @@ -3722,7 +3764,6 @@ - @@ -3742,14 +3783,12 @@ - - @@ -3782,7 +3821,6 @@ - @@ -3790,7 +3828,6 @@ - @@ -3817,7 +3854,6 @@ - @@ -3834,7 +3870,6 @@ - @@ -3859,13 +3894,11 @@ - - @@ -3886,7 +3919,6 @@ - @@ -3906,7 +3938,6 @@ - @@ -3933,7 +3964,6 @@ - @@ -3946,7 +3976,6 @@ - @@ -4023,7 +4052,6 @@ - @@ -4063,7 +4091,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.psm1 b/build.psm1 index 482edfcdcd9..0af6cbc4d79 100644 --- a/build.psm1 +++ b/build.psm1 @@ -712,8 +712,8 @@ function New-PSOptions { [ValidateSet("Debug", "Release", "CodeCoverage", '')] [string]$Configuration, - [ValidateSet("netcoreapp3.1")] - [string]$Framework = "netcoreapp3.1", + [ValidateSet("netcoreapp5.0")] + [string]$Framework = "netcoreapp5.0", # These are duplicated from Start-PSBuild # We do not use ValidateScript since we want tab completion @@ -2410,7 +2410,7 @@ function Copy-PSGalleryModules Restore-PSPackage -ProjectDirs (Split-Path $CsProjPath) -Force:$Force.IsPresent $cache = dotnet nuget locals global-packages -l - if ($cache -match "info : global-packages: (.*)") { + if ($cache -match "global-packages: (.*)") { $nugetCache = $Matches[1] } else { diff --git a/global.json b/global.json index 5360f36edb7..8696bf07ded 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.102" + "version": "5.0.100-preview.1.20155.7" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index a7d3354c36e..aafcb94a14f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index abfc37d2b41..86e254efe5b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 2e025805f4a..44e6378fb23 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index e694bc1a620..2401ed3bc85 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 02720796dab..da504fc8563 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index cb89ac9d875..cbfd8ac696b 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -2,7 +2,7 @@ Generates C# typed bindings for .resx files - netcoreapp3.1 + netcoreapp5.0 resgen Exe true diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 3eef012f9b2..fd612866b5a 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index 6b027579f03..ab5c9cf1375 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -808,7 +808,7 @@ internal struct WINTRUST_BLOB_INFO internal uint cbStruct; /// GUID->_GUID - internal GUID gSubject; + internal Guid gSubject; /// LPCWSTR->WCHAR* [MarshalAsAttribute(UnmanagedType.LPWStr)] @@ -827,23 +827,6 @@ internal struct WINTRUST_BLOB_INFO internal System.IntPtr pbMemSignedMsg; } - [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct GUID - { - /// unsigned int - internal uint Data1; - - /// unsigned short - internal ushort Data2; - - /// unsigned short - internal ushort Data3; - - /// unsigned char[8] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - internal byte[] Data4; - } - [ArchitectureSensitive] internal static WINTRUST_FILE_INFO InitWintrustFileInfoStruct(string fileName) { @@ -864,11 +847,7 @@ internal static WINTRUST_BLOB_INFO InitWintrustBlobInfoStruct(string fileName, s byte[] contentBytes = System.Text.Encoding.Unicode.GetBytes(content); // The GUID of the PowerShell SIP - bi.gSubject.Data1 = 0x603bcc1f; - bi.gSubject.Data2 = 0x4b59; - bi.gSubject.Data3 = 0x4e08; - bi.gSubject.Data4 = new byte[] { 0xb7, 0x24, 0xd2, 0xc6, 0x29, 0x7e, 0xf3, 0x51 }; - + bi.gSubject = new Guid(0x603bcc1f, 0x4b59, 0x4e08, new byte[] { 0xb7, 0x24, 0xd2, 0xc6, 0x29, 0x7e, 0xf3, 0x51 }); bi.cbStruct = (DWORD)Marshal.SizeOf(bi); bi.pcwszDisplayName = fileName; bi.cbMemObject = (uint)contentBytes.Length; @@ -1988,7 +1967,7 @@ internal struct CRYPTCATMEMBER internal string pwszReferenceTag; [MarshalAs(UnmanagedType.LPWStr)] internal string pwszFileName; - internal GUID gSubjectType; + internal Guid gSubjectType; internal DWORD fdwMemberFlags; internal IntPtr pIndirectData; internal DWORD dwCertVersion; diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index 0b703967717..b40cfc0dc04 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -2,7 +2,7 @@ Generates CorePsTypeCatalog.cs given powershell.inc - netcoreapp3.1 + netcoreapp5.0 TypeCatalogGen Exe true diff --git a/test/Test.Common.props b/test/Test.Common.props index 57afccc7772..3f2a14e2271 100644 --- a/test/Test.Common.props +++ b/test/Test.Common.props @@ -4,7 +4,7 @@ Microsoft Corporation (c) Microsoft Corporation. All rights reserved. - netcoreapp3.1 + netcoreapp5.0 8.0 true diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 5041a21f1bb..7f8d92a4bf8 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -1009,3 +1009,10 @@ Describe 'Pwsh startup and PATH' -Tag CI { $path | Should -BeExactly ($PSHOME + [System.IO.Path]::PathSeparator) } } + +Describe 'Console host name' -Tag CI { + It 'Name is pwsh' -Pending { + # waiting on https://github.com/dotnet/runtime/issues/33673 + (Get-Process -id $PID).Name | Should -BeExactly 'pwsh' + } +} diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 9a4cf05da0a..7f0cc7e6b3d 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -13,7 +13,6 @@ Describe "Validate start of console host" -Tag CI { 'netstandard.dll' 'Newtonsoft.Json.dll' 'pwsh.dll' - 'System.Buffers.dll' 'System.Collections.Concurrent.dll' 'System.Collections.dll' 'System.Collections.NonGeneric.dll' @@ -23,7 +22,6 @@ Describe "Validate start of console host" -Tag CI { 'System.ComponentModel.TypeConverter.dll' 'System.Console.dll' 'System.Data.Common.dll' - 'System.Diagnostics.Debug.dll' 'System.Diagnostics.FileVersionInfo.dll' 'System.Diagnostics.Process.dll' 'System.Diagnostics.TraceSource.dll' @@ -46,9 +44,7 @@ Describe "Validate start of console host" -Tag CI { 'System.Reflection.Emit.ILGeneration.dll' 'System.Reflection.Emit.Lightweight.dll' 'System.Reflection.Primitives.dll' - 'System.Resources.ResourceManager.dll' 'System.Runtime.dll' - 'System.Runtime.Extensions.dll' 'System.Runtime.InteropServices.dll' 'System.Runtime.InteropServices.RuntimeInformation.dll' 'System.Runtime.Loader.dll' @@ -62,7 +58,6 @@ Describe "Validate start of console host" -Tag CI { 'System.Text.Encoding.Extensions.dll' 'System.Text.RegularExpressions.dll' 'System.Threading.dll' - 'System.Threading.Tasks.dll' 'System.Threading.Tasks.Parallel.dll' 'System.Threading.Thread.dll' 'System.Threading.ThreadPool.dll' @@ -76,7 +71,6 @@ Describe "Validate start of console host" -Tag CI { 'System.Management.dll' 'System.Security.Claims.dll' 'System.Security.Cryptography.Primitives.dll' - 'System.Security.Principal.dll' 'System.Threading.Overlapped.dll' ) } diff --git a/test/powershell/Language/Operators/NullConditional.Tests.ps1 b/test/powershell/Language/Operators/NullConditional.Tests.ps1 index f78455af6f0..c82b88144e5 100644 --- a/test/powershell/Language/Operators/NullConditional.Tests.ps1 +++ b/test/powershell/Language/Operators/NullConditional.Tests.ps1 @@ -296,7 +296,6 @@ Describe 'NullConditionalMemberAccess' -Tag 'CI' { ${array}?.length | Should -Be 3 ${hash}?.a | Should -Be 1 - (Get-Process -Id $PID)?.Name | Should -BeLike "pwsh*" (Get-Item $TestDrive)?.EnumerateFiles()?.Name | Should -BeExactly 'testfile.txt' [int32]::MaxValue?.ToString() | Should -BeExactly '2147483647' @@ -360,8 +359,8 @@ Describe 'NullConditionalMemberAccess' -Tag 'CI' { It 'Use ?. on a dynamic property name' { $testContent = @' - $propName = 'Name' - (Get-Process -Id $PID)?.$propName | Should -BeLike 'pwsh*' + $propName = 'SI' + (Get-Process -Id $PID)?.$propName | Should -Be (Get-Process -id $PID).SessionId ${doesNotExist}?.$propName() | Should -BeNullOrEmpty '@ diff --git a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 index 9ab4846d6bb..71ce7c1ac25 100644 --- a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 @@ -22,7 +22,7 @@ Describe "Using of ternary operator" -Tags CI { @{ Script = { @{name = 'name'}.Contains('name') ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } @{ Script = { (Test-Path Env:\NonExist) ? 'true' : 'false' }; ExpectedValue = 'false' } @{ Script = { (Test-Path Env:\PSModulePath) ? 'true' : 'false' }; ExpectedValue = 'true' } - @{ Script = { $($p = Get-Process -Id $PID; $p.Name -eq 'pwsh') ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } + @{ Script = { $($p = Get-Process -Id $PID; $p.Id -eq $PID) ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } @{ Script = { ($a = 1) ? 2 : 3 }; ExpectedValue = 2 } @{ Script = { $($a = 1) ? 2 : 3 }; ExpectedValue = 3 } @{ Script = { (Write-Warning -Message warning -WarningAction SilentlyContinue) ? 1 : 2 }; ExpectedValue = 2 } @@ -31,7 +31,7 @@ Describe "Using of ternary operator" -Tags CI { ## Condition: unary and binary expression expressions @{ Script = { -not $IsCoreCLR ? 'Desktop' : 'Core' }; ExpectedValue = 'Core' } @{ Script = { $PSEdition -eq 'Core' ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } - @{ Script = { $IsCoreCLR -and (Get-Process -Id $PID).Name -eq 'pwsh' ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } + @{ Script = { $IsCoreCLR -and (Get-Process -Id $PID).Id -eq $PID ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } @{ Script = { $IsCoreCLR -and 'pwsh' -match 'p.*h' ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } @{ Script = { 1,2,3 -contains 2 ? 'Core' : 'Desktop' }; ExpectedValue = 'Core' } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index a6577f0c118..ba1c5e43e54 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -1901,36 +1901,6 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { } Context "Denial of service" -Tag 'DOS' { - It "Image Parsing" { - $dosUri = Get-WebListenerUrl -Test 'Dos' -query @{ - dosType='img' - dosLength='5000' - } - $script:content = '' - [TimeSpan] $timeSpan = Measure-Command { - $response = Invoke-WebRequest -Uri $dosUri - $script:content = $response.content - $response.Images | out-null - } - - $script:content | Should -Not -BeNullOrEmpty - - # pathological regex - $regex = [RegEx]::new(']*>') - - [TimeSpan] $pathologicalTimeSpan = Measure-Command { - $regex.Match($content) - } - - $pathologicalRatio = $pathologicalTimeSpan.TotalMilliseconds/$timeSpan.TotalMilliseconds - Write-Verbose "Pathological ratio: $pathologicalRatio" -Verbose - - # dosLength 4,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 12 - # dosLength 5,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 21 - # dosLength 10,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 75 - # in some cases we will be running in a Docker container with modest resources - $pathologicalRatio | Should -BeGreaterThan 5 - } It "Charset Parsing" { $dosUri = Get-WebListenerUrl -Test 'Dos' -query @{ dosType='charset' diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index d5fb4d3e202..84ded9e0357 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -624,7 +624,7 @@ function Invoke-OpenCover [parameter()]$OutputLog = "$HOME/Documents/OpenCover.xml", [parameter()]$TestPath = "${script:psRepoPath}/test/powershell", [parameter()]$OpenCoverPath = "$HOME/OpenCover", - [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/netcoreapp3.1/win7-x64/publish", + [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64/publish", [parameter()]$PesterLogElevated = "$HOME/Documents/TestResultsElevated.xml", [parameter()]$PesterLogUnelevated = "$HOME/Documents/TestResultsUnelevated.xml", [parameter()]$PesterLogFormat = "NUnitXml", diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index a262d481dcc..f26bdcb1830 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index ad3a6b01381..9e939b8a242 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -131,14 +131,14 @@ function Start-PSPackage { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "netcoreapp3.1" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne "netcoreapp5.0" ## Last build wasn't for CoreCLR } else { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $crossGenCorrect -or ## Last build didn't specify '-CrossGen' correctly -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "netcoreapp3.1" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne "netcoreapp5.0" ## Last build wasn't for CoreCLR } # Make sure the most recent build satisfies the package requirement @@ -1626,7 +1626,7 @@ function CreateNugetPlatformFolder [string] $PlatformBinPath ) - $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/netcoreapp3.1") + $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/netcoreapp5.0") $fullPath = Join-Path $PlatformBinPath $file if (-not(Test-Path $fullPath)) { @@ -1726,7 +1726,7 @@ function New-ILNugetPackage $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName 'runtimes') -ItemType Directory #region ref - $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/netcoreapp3.1') -ItemType Directory -Force + $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/netcoreapp5.0') -ItemType Directory -Force CopyReferenceAssemblies -assemblyName $fileBaseName -refBinPath $refBinPath -refNugetPath $refFolder -assemblyFileList $fileList #endregion ref @@ -1770,8 +1770,8 @@ function New-ILNugetPackage "Microsoft.PowerShell.Utility" ) - $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\netcoreapp3.1\Modules") -ItemType Directory -Force - $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\netcoreapp3.1\Modules") -ItemType Directory -Force + $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\netcoreapp5.0\Modules") -ItemType Directory -Force + $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\netcoreapp5.0\Modules") -ItemType Directory -Force foreach ($module in $winBuiltInModules) { $source = Join-Path $WinFxdBinPath "Modules\$module" @@ -2140,7 +2140,7 @@ function New-ReferenceAssembly Write-Log "Running: dotnet $arguments" Start-NativeExecution -sb {dotnet $arguments} - $refBinPath = Join-Path $projectFolder "bin/Release/netcoreapp3.1/$assemblyName.dll" + $refBinPath = Join-Path $projectFolder "bin/Release/netcoreapp5.0/$assemblyName.dll" if ($null -eq $refBinPath) { throw "Reference assembly was not built." } @@ -3578,7 +3578,7 @@ function New-GlobalToolNupkg } $packageInfo | ForEach-Object { - $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/netcoreapp3.1/any") -ItemType Directory + $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/netcoreapp5.0/any") -ItemType Directory $packageType = $_.Type diff --git a/tools/packaging/projects/nuget/package.csproj b/tools/packaging/projects/nuget/package.csproj index 57538b4da87..3fd015db7f8 100644 --- a/tools/packaging/projects/nuget/package.csproj +++ b/tools/packaging/projects/nuget/package.csproj @@ -11,6 +11,6 @@ runtime=$(RID);version=$(SemVer);PackageName=$(PackageName) $(StagingPath) True - netcoreapp3.1 + netcoreapp5.0 diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 976389a5e4b..940128ce0a8 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1 + netcoreapp5.0 $(RefAsmVersion) true $(SnkFile) @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj index b148712a5c3..a66e15f0032 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1 + netcoreapp5.0 $(RefAsmVersion) true $(SnkFile) diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index c0d56db2292..00a4d777c4d 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1 + netcoreapp5.0 $(RefAsmVersion) true $(SnkFile) @@ -9,7 +9,7 @@ - - + + From 3ab605aeec1dbd5a9e975f15628b0648b6ee0464 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 19 Mar 2020 17:24:27 -0700 Subject: [PATCH 082/275] Create crossgen symbols for Windows x64 and x86 (#12157) --- assets/files.wxs | 48 +++++++++++++++++++++++++++++++ build.psm1 | 74 ++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 110 insertions(+), 12 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 79d91d534db..b2e46e50405 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3116,6 +3116,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4120,6 +4156,18 @@ + + + + + + + + + + + + diff --git a/build.psm1 b/build.psm1 index 0af6cbc4d79..add627f7311 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2214,16 +2214,54 @@ function Start-CrossGen { # Generate the ngen assembly Write-Verbose "Generating assembly $niAssemblyName" Start-NativeExecution { - & $CrossgenPath /MissingDependenciesOK /in $AssemblyPath /out $outputAssembly /Platform_Assemblies_Paths $platformAssembliesPath + & $CrossgenPath /ReadyToRun /MissingDependenciesOK /in $AssemblyPath /out $outputAssembly /Platform_Assemblies_Paths $platformAssembliesPath } | Write-Verbose + } finally { + Pop-Location + } + } - <# - # TODO: Generate the pdb for the ngen binary - currently, there is a hard dependency on diasymreader.dll, which is available at %windir%\Microsoft.NET\Framework\v4.0.30319. - # However, we still need to figure out the prerequisites on Linux. - Start-NativeExecution { - & $CrossgenPath /Platform_Assemblies_Paths $platformAssembliesPath /CreatePDB $platformAssembliesPath /lines $platformAssembliesPath $niAssemblyName - } | Write-Verbose - #> + function New-CrossGenSymbol { + param ( + [Parameter(Mandatory= $true)] + [ValidateNotNullOrEmpty()] + [String] + $AssemblyPath, + [Parameter(Mandatory= $true)] + [ValidateNotNullOrEmpty()] + [String] + $CrossgenPath + ) + + $platformAssembliesPath = Split-Path $AssemblyPath -Parent + $crossgenFolder = Split-Path $CrossgenPath + + try { + Push-Location $crossgenFolder + + $symbolsPath = [System.IO.Path]::ChangeExtension($assemblyPath, ".pdb") + + $createSymbolOptionName = $null + if($Environment.IsWindows) + { + $createSymbolOptionName = '-CreatePDB' + + } + elseif ($Environment.IsLinux) + { + $createSymbolOptionName = '-CreatePerfMap' + } + + if($createSymbolOptionName) + { + Start-NativeExecution { + & $CrossgenPath -readytorun -platform_assemblies_paths $platformAssembliesPath $createSymbolOptionName $platformAssembliesPath $AssemblyPath + } | Write-Verbose + } + + # Rename the corresponding ni.dll assembly to be the same as the IL assembly + $niSymbolsPath = [System.IO.Path]::ChangeExtension($symbolsPath, "ni.pdb") + Rename-Item $niSymbolsPath $symbolsPath -Force -ErrorAction Stop } finally { Pop-Location } @@ -2235,18 +2273,24 @@ function Start-CrossGen { # Get the path to crossgen $crossGenExe = if ($environment.IsWindows) { "crossgen.exe" } else { "crossgen" } + $generateSymbols = $false # The crossgen tool is only published for these particular runtimes $crossGenRuntime = if ($environment.IsWindows) { if ($Runtime -match "-x86") { "win-x86" + $generateSymbols = $true } elseif ($Runtime -match "-x64") { "win-x64" + $generateSymbols = $true } elseif (!($env:PROCESSOR_ARCHITECTURE -match "arm")) { throw "crossgen for 'win-arm' and 'win-arm64' must be run on that platform" } } elseif ($Runtime -eq "linux-arm") { throw "crossgen is not available for 'linux-arm'" + } elseif ($Runtime -eq "linux-x64") { + $Runtime + # We should set $generateSymbols = $true, but the code needs to be adjusted for different extension on Linux } else { $Runtime } @@ -2362,15 +2406,21 @@ function Start-CrossGen { Remove-Item $assemblyPath -Force -ErrorAction Stop + # Rename the corresponding ni.dll assembly to be the same as the IL assembly + $niAssemblyPath = [System.IO.Path]::ChangeExtension($assemblyPath, "ni.dll") + Rename-Item $niAssemblyPath $assemblyPath -Force -ErrorAction Stop + # No symbols are available for Microsoft.CodeAnalysis.CSharp.dll, Microsoft.CodeAnalysis.dll, # Microsoft.CodeAnalysis.VisualBasic.dll, and Microsoft.CSharp.dll. if ($commonAssembliesForAddType -notcontains $assemblyName) { Remove-Item $symbolsPath -Force -ErrorAction Stop - } - # Rename the corresponding ni.dll assembly to be the same as the IL assembly - $niAssemblyPath = [System.IO.Path]::ChangeExtension($assemblyPath, "ni.dll") - Rename-Item $niAssemblyPath $assemblyPath -Force -ErrorAction Stop + if($generateSymbols) + { + Write-Verbose "Generating Symbols for $assemblyPath" + New-CrossGenSymbol -CrossgenPath $crossGenPath -AssemblyPath $assemblyPath + } + } } } From 78d7a90bddbfd90d850e4881511f7a3a940a5989 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2020 12:22:46 -0700 Subject: [PATCH 083/275] Bump `NJsonSchema` from `10.1.8` to `10.1.11` (#12166) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.8 to 10.1.11. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 86e254efe5b..63225ed24e6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 530977440387eff029f36f20497c4a296ac01fda Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 20 Mar 2020 13:54:39 -0700 Subject: [PATCH 084/275] Disable x86 pdb generation (#12167) --- build.psm1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index add627f7311..081134e02ce 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2279,7 +2279,6 @@ function Start-CrossGen { $crossGenRuntime = if ($environment.IsWindows) { if ($Runtime -match "-x86") { "win-x86" - $generateSymbols = $true } elseif ($Runtime -match "-x64") { "win-x64" $generateSymbols = $true From 7a8094fd3169633e01def7f5db9044df26d405ea Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Sat, 21 Mar 2020 12:36:10 -0700 Subject: [PATCH 085/275] Put symbols in separate package (#12169) --- assets/files.wxs | 72 ----------- tools/ci.psm1 | 2 +- tools/packaging/packaging.psm1 | 117 ++++++++++++++++-- .../PowerShellPackage.ps1 | 6 + .../azureDevOps/templates/upload.yml | 11 ++ .../templates/windows-package-signing.yml | 1 + 6 files changed, 127 insertions(+), 82 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index b2e46e50405..72f696336be 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -127,9 +127,6 @@ - - - @@ -1183,9 +1180,6 @@ - - - @@ -1966,18 +1960,6 @@ - - - - - - - - - - - - @@ -3116,42 +3098,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3197,7 +3143,6 @@ - @@ -3549,7 +3494,6 @@ - @@ -3783,10 +3727,6 @@ - - - - @@ -4156,18 +4096,6 @@ - - - - - - - - - - - - diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 096128566a0..7d39bd47300 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -464,7 +464,7 @@ function Invoke-CIFinish Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -ReleaseTag $preReleaseVersion -Clean # Build packages - $packages = Start-PSPackage -Type msi,nupkg,zip -ReleaseTag $preReleaseVersion -SkipReleaseChecks + $packages = Start-PSPackage -Type msi,nupkg,zip,zip-pdb -ReleaseTag $preReleaseVersion -SkipReleaseChecks $artifacts = New-Object System.Collections.ArrayList foreach ($package in $packages) { diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 9e939b8a242..03b38be32c0 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -26,7 +26,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "msi", "zip", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop")] + [ValidateSet("msix", "deb", "osxpkg", "rpm", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop")] [string[]]$Type, # Generate windows downlevel package @@ -281,6 +281,18 @@ function Start-PSPackage { New-ZipPackage @Arguments } } + "zip-pdb" { + $Arguments = @{ + PackageNameSuffix = $NameSuffix + PackageSourcePath = $Source + PackageVersion = $Version + Force = $Force + } + + if ($PSCmdlet.ShouldProcess("Create Symbols Zip Package")) { + New-PdbZipPackage @Arguments + } + } { $_ -like "fxdependent*" } { ## Remove PDBs from package to reduce size. @@ -526,7 +538,7 @@ function New-TarballPackage { } $Staging = "$PSScriptRoot/staging" - New-StagingFolder -StagingPath $Staging + New-StagingFolder -StagingPath $Staging -PackageSourcePath $PackageSourcePath if (-not $ExcludeSymbolicLinks.IsPresent) { New-PSSymbolicLinks -Distribution 'ubuntu.16.04' -Staging $Staging @@ -803,7 +815,7 @@ function New-UnixPackage { # Setup staging directory so we don't change the original source directory $Staging = "$PSScriptRoot/staging" if ($PSCmdlet.ShouldProcess("Create staging folder")) { - New-StagingFolder -StagingPath $Staging + New-StagingFolder -StagingPath $Staging -PackageSourcePath $PackageSourcePath } # Follow the Filesystem Hierarchy Standard for Linux and macOS @@ -1537,11 +1549,16 @@ function New-StagingFolder param( [Parameter(Mandatory)] [string] - $StagingPath + $StagingPath, + [Parameter(Mandatory)] + [string] + $PackageSourcePath, + [string] + $Filter = '*' ) Remove-Item -Recurse -Force -ErrorAction SilentlyContinue $StagingPath - Copy-Item -Recurse $PackageSourcePath $StagingPath + Copy-Item -Recurse $PackageSourcePath $StagingPath -Filter $Filter } # Function to create a zip file for Nano Server and xcopy deployment @@ -1593,7 +1610,12 @@ function New-ZipPackage { if ($PSCmdlet.ShouldProcess("Create zip package")) { - Compress-Archive -Path $PackageSourcePath\* -DestinationPath $zipLocationPath + $staging = "$PSScriptRoot/staging" + New-StagingFolder -StagingPath $staging -PackageSourcePath $PackageSourcePath + + Get-ChildItem $staging -Filter *.pdb -recurse | Remove-Item -Force + + Compress-Archive -Path $staging\* -DestinationPath $zipLocationPath } if (Test-Path $zipLocationPath) @@ -1613,6 +1635,77 @@ function New-ZipPackage } } +# Function to create a zip file of PDB +function New-PdbZipPackage +{ + [CmdletBinding(SupportsShouldProcess=$true)] + param ( + + # Name of the Product + [ValidateNotNullOrEmpty()] + [string] $PackageName = 'PowerShell-Symbols', + + # Suffix of the Name + [string] $PackageNameSuffix, + + # Version of the Product + [Parameter(Mandatory = $true)] + [string] $PackageVersion, + + # Source Path to the Product Files - required to package the contents into an Zip + [Parameter(Mandatory = $true)] + [string] $PackageSourcePath, + + [switch] $Force + ) + + $ProductSemanticVersion = Get-PackageSemanticVersion -Version $PackageVersion + + $zipPackageName = $PackageName + "-" + $ProductSemanticVersion + if ($PackageNameSuffix) { + $zipPackageName = $zipPackageName, $PackageNameSuffix -join "-" + } + + Write-Verbose "Create Symbols Zip for Product $zipPackageName" + + $zipLocationPath = Join-Path $PWD "$zipPackageName.zip" + + if ($Force.IsPresent) + { + if (Test-Path $zipLocationPath) + { + Remove-Item $zipLocationPath + } + } + + if (Get-Command Compress-Archive -ErrorAction Ignore) + { + if ($PSCmdlet.ShouldProcess("Create zip package")) + { + $staging = "$PSScriptRoot/staging" + New-StagingFolder -StagingPath $staging -PackageSourcePath $PackageSourcePath -Filter *.pdb + + Compress-Archive -Path $staging\* -DestinationPath $zipLocationPath + } + + if (Test-Path $zipLocationPath) + { + Write-Log "You can find the Zip @ $zipLocationPath" + $zipLocationPath + } + else + { + throw "Failed to create $zipLocationPath" + } + } + #TODO: Use .NET Api to do compresss-archive equivalent if the pscmdlet is not present + else + { + Write-Error -Message "Compress-Archive cmdlet is missing in this PowerShell version" + } +} + + function CreateNugetPlatformFolder { param( @@ -2439,7 +2532,7 @@ function New-NugetContentPackage $stagingRoot = New-SubFolder -Path $PSScriptRoot -ChildPath 'nugetStaging' -Clean $contentFolder = Join-Path -path $stagingRoot -ChildPath 'content' if ($PSCmdlet.ShouldProcess("Create staging folder")) { - New-StagingFolder -StagingPath $contentFolder + New-StagingFolder -StagingPath $contentFolder -PackageSourcePath $PackageSourcePath } $projectFolder = Join-Path $PSScriptRoot 'projects/nuget' @@ -2864,6 +2957,12 @@ function New-MSIPackage $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion $assetsInSourcePath = Join-Path $ProductSourcePath 'assets' + + $staging = "$PSScriptRoot/staging" + New-StagingFolder -StagingPath $staging -PackageSourcePath $ProductSourcePath + + Get-ChildItem $staging -Filter *.pdb -recurse | Remove-Item -Force + New-Item $assetsInSourcePath -type directory -Force | Write-Verbose Write-Verbose "Place dependencies such as icons to $assetsInSourcePath" @@ -2875,7 +2974,7 @@ function New-MSIPackage Write-Verbose "Create MSI for Product $productSemanticVersionWithName" - [Environment]::SetEnvironmentVariable("ProductSourcePath", $ProductSourcePath, "Process") + [Environment]::SetEnvironmentVariable("ProductSourcePath", $staging, "Process") # These variables are used by Product.wxs in assets directory [Environment]::SetEnvironmentVariable("ProductDirectoryName", $productDirectoryName, "Process") [Environment]::SetEnvironmentVariable("ProductName", $ProductName, "Process") @@ -2933,7 +3032,7 @@ function New-MSIPackage } Write-Log "verifying no new files have been added or removed..." - Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixHeatExePath dir $ProductSourcePath -dr $productDirectoryName -cg $productDirectoryName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} + Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixHeatExePath dir $staging -dr $productDirectoryName -cg $productDirectoryName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} # We are verifying that the generated $wixFragmentPath and $FilesWxsPath are functionally the same Test-FileWxs -FilesWxsPath $FilesWxsPath -HeatFilesWxsPath $wixFragmentPath diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 285b41d90ae..0e606083446 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -136,6 +136,12 @@ try{ if (!$ComponentRegistration.IsPresent -and $Runtime -notlike 'fxdependent*') { + if (!$Symbols.IsPresent) { + $pspackageParams['Type'] = 'zip-pdb' + Write-Verbose "Starting powershell symbols packaging(zip)..." -verbose + Start-PSPackage @pspackageParams @releaseTagParam + } + $pspackageParams['Type']='zip' $pspackageParams['IncludeSymbols']=$Symbols.IsPresent Write-Verbose "Starting powershell packaging(zip)..." -verbose diff --git a/tools/releaseBuild/azureDevOps/templates/upload.yml b/tools/releaseBuild/azureDevOps/templates/upload.yml index 27e63505766..b16fabaac57 100644 --- a/tools/releaseBuild/azureDevOps/templates/upload.yml +++ b/tools/releaseBuild/azureDevOps/templates/upload.yml @@ -3,6 +3,7 @@ parameters: version: 6.2.0 msi: yes msix: yes + pdb: no steps: - template: upload-final-results.yml @@ -36,6 +37,16 @@ steps: ContainerName: '$(AzureVersion)' condition: succeeded() +- task: AzureFileCopy@3 + displayName: 'upload pbd zip to Azure - ${{ parameters.architecture }}' + inputs: + SourcePath: '$(System.ArtifactsDirectory)\signed\PowerShell-Symbols-${{ parameters.version }}-win-${{ parameters.architecture }}.zip' + azureSubscription: '$(AzureFileCopySubscription)' + Destination: AzureBlob + storage: '$(StorageAccount)' + ContainerName: '$(AzureVersion)' + condition: and(succeeded(), eq('${{ parameters.pdb }}', 'yes')) + - template: upload-final-results.yml parameters: artifactPath: $(Build.StagingDirectory)\signedPackages diff --git a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml index b617d13281a..d8f95928bc3 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml @@ -76,6 +76,7 @@ jobs: parameters: architecture: x64 version: $(version) + pdb: yes - template: upload.yml parameters: From cce214e88409352c8030eec4e7e59d804b6a2dba Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Mon, 23 Mar 2020 14:00:43 -0700 Subject: [PATCH 086/275] Implement `ForEach-Object -Parallel` runspace reuse (#12122) * Implement foreach parallel runspace reuse * Change runspace dispose * Refactor runspace reset check * Fix race condition. * Fix CodFactor issues * Implement -UseNewRunspace parameter switch, add tests * Fix Codacy error --- .../engine/InternalCommands.cs | 13 +- .../engine/hostifaces/PSTask.cs | 184 +++++++++++++++--- .../Foreach-Object-Parallel.Tests.ps1 | 17 ++ 3 files changed, 185 insertions(+), 29 deletions(-) diff --git a/src/System.Management.Automation/engine/InternalCommands.cs b/src/System.Management.Automation/engine/InternalCommands.cs index 406a9b61768..9f861b5b78d 100644 --- a/src/System.Management.Automation/engine/InternalCommands.cs +++ b/src/System.Management.Automation/engine/InternalCommands.cs @@ -260,6 +260,14 @@ public object[] ArgumentList [Parameter(ParameterSetName = ForEachObjectCommand.ParallelParameterSet)] public SwitchParameter AsJob { get; set; } + /// + /// Gets or sets a flag so that a new runspace object is created for each loop iteration, instead of reusing objects + /// from the runspace pool. + /// By default, runspaces are reused from a runspace pool. + /// + [Parameter(ParameterSetName = ForEachObjectCommand.ParallelParameterSet)] + public SwitchParameter UseNewRunspace { get; set; } + #endregion #region Overrides @@ -437,7 +445,8 @@ private void InitParallelParameterSet() _taskJob = new PSTaskJob( Parallel.ToString(), - ThrottleLimit); + ThrottleLimit, + UseNewRunspace); return; } @@ -445,7 +454,7 @@ private void InitParallelParameterSet() // Set up for synchronous processing and data streaming. _taskCollection = new PSDataCollection(); _taskDataStreamWriter = new PSTaskDataStreamWriter(this); - _taskPool = new PSTaskPool(ThrottleLimit); + _taskPool = new PSTaskPool(ThrottleLimit, UseNewRunspace); _taskPool.PoolComplete += (sender, args) => { _taskDataStreamWriter.Close(); diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index c52715927b1..45b3e944917 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.Management.Automation.Host; @@ -320,7 +321,7 @@ internal abstract class PSTaskBase : IDisposable protected PowerShell _powershell; protected PSDataCollection _output; - private const string RunspaceName = "PSTask"; + public const string RunspaceName = "PSTask"; private static int s_taskId; @@ -364,6 +365,11 @@ public PSInvocationState State /// public int Id { get => _id; } + /// + /// Gets Task Runspace. + /// + public Runspace Runspace { get => _runspace; } + #endregion #region Constructor @@ -410,7 +416,6 @@ protected PSTaskBase( /// public void Dispose() { - _runspace.Dispose(); _powershell.Dispose(); _output.Dispose(); } @@ -422,7 +427,8 @@ public void Dispose() /// /// Start task. /// - public void Start() + /// Runspace used to run task. + public void Start(Runspace runspace) { if (_powershell != null) { @@ -430,13 +436,8 @@ public void Start() return; } - // Create and open Runspace for this task to run in - var iss = InitialSessionState.CreateDefault2(); - iss.LanguageMode = (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Enforce) - ? PSLanguageMode.ConstrainedLanguage : PSLanguageMode.FullLanguage; - _runspace = RunspaceFactory.CreateRunspace(iss); - _runspace.Name = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", RunspaceName, s_taskId); - _runspace.Open(); + Dbg.Assert(runspace != null, "Task runspace cannot be null."); + _runspace = runspace; // If available, set current working directory on the runspace. // Temporarily set the newly created runspace as the thread default runspace for any needed module loading. @@ -445,8 +446,8 @@ public void Start() var oldDefaultRunspace = Runspace.DefaultRunspace; try { - Runspace.DefaultRunspace = _runspace; - _runspace.ExecutionContext.SessionState.Internal.SetLocation(_currentLocationPath); + Runspace.DefaultRunspace = runspace; + runspace.ExecutionContext.SessionState.Internal.SetLocation(_currentLocationPath); } finally { @@ -456,7 +457,7 @@ public void Start() // Create the PowerShell command pipeline for the provided script block // The script will run on the provided Runspace in a new thread by default - _powershell = PowerShell.Create(_runspace); + _powershell = PowerShell.Create(runspace); // Initialize PowerShell object data streams and event handlers _output = new PSDataCollection(); @@ -632,8 +633,13 @@ internal sealed class PSTaskPool : IDisposable private readonly ManualResetEvent _stopAll; private readonly object _syncObject; private readonly Dictionary _taskPool; + private readonly ConcurrentQueue _runspacePool; + private readonly ConcurrentDictionary _activeRunspaces; private readonly WaitHandle[] _waitHandles; + private readonly bool _useRunspacePool; private bool _isOpen; + private bool _stopping; + private int _createdRunspaceCount; private const int AddAvailable = 0; private const int Stop = 1; @@ -648,9 +654,13 @@ private PSTaskPool() { } /// Initializes a new instance of the class. /// /// Total number of allowed running objects in pool at one time. - public PSTaskPool(int size) + /// When true, a new runspace object is created for the task instead of reusing one from the pool. + public PSTaskPool( + int size, + bool useNewRunspace) { _sizeLimit = size; + _useRunspacePool = !useNewRunspace; _isOpen = true; _syncObject = new object(); _addAvailable = new ManualResetEvent(true); @@ -661,6 +671,11 @@ public PSTaskPool(int size) _stopAll, // index 1 }; _taskPool = new Dictionary(size); + _activeRunspaces = new ConcurrentDictionary(); + if (_useRunspacePool) + { + _runspacePool = new ConcurrentQueue(); + } } #endregion @@ -684,6 +699,14 @@ public bool IsOpen get => _isOpen; } + /// + /// Gets a value of the count of total runspaces allocated. + /// + public int AllocatedRunspaceCount + { + get => _createdRunspaceCount; + } + #endregion #region IDisposable @@ -695,6 +718,21 @@ public void Dispose() { _addAvailable.Dispose(); _stopAll.Dispose(); + + DisposeRunspaces(); + } + + /// + /// Dispose runspaces. + /// + internal void DisposeRunspaces() + { + foreach (var item in _activeRunspaces) + { + item.Value.Dispose(); + } + + _activeRunspaces.Clear(); } #endregion @@ -721,6 +759,7 @@ public bool Add(PSTaskBase task) switch (index) { case AddAvailable: + var runspace = GetRunspace(task.Id); task.StateChanged += HandleTaskStateChangedDelegate; lock (_syncObject) { @@ -735,7 +774,7 @@ public bool Add(PSTaskBase task) _addAvailable.Reset(); } - task.Start(); + task.Start(runspace); } return true; @@ -763,18 +802,28 @@ public bool Add(PSTaskChildJob childJob) /// public void StopAll() { + _stopping = true; + // Accept no more input Close(); _stopAll.Set(); // Stop all running tasks + PSTaskBase[] tasksToStop; lock (_syncObject) { - foreach (var task in _taskPool.Values) - { - task.Dispose(); - } + tasksToStop = new PSTaskBase[_taskPool.Values.Count]; + _taskPool.Values.CopyTo(tasksToStop, 0); + } + + foreach (var task in tasksToStop) + { + task.Dispose(); } + + // Dispose all active runspaces + DisposeRunspaces(); + _stopping = false; } /// @@ -803,6 +852,7 @@ private void HandleTaskStateChanged(object sender, PSInvocationStateChangedEvent case PSInvocationState.Completed: case PSInvocationState.Stopped: case PSInvocationState.Failed: + ReturnRunspace(task); lock (_syncObject) { _taskPool.Remove(task.Id); @@ -813,7 +863,12 @@ private void HandleTaskStateChanged(object sender, PSInvocationStateChangedEvent } task.StateChanged -= HandleTaskStateChangedDelegate; - task.Dispose(); + if (!_stopping) + { + // StopAll disposes tasks. + task.Dispose(); + } + CheckForComplete(); break; } @@ -842,6 +897,64 @@ private void CheckForComplete() } } + private Runspace GetRunspace(int taskId) + { + var runspaceName = string.Format(CultureInfo.InvariantCulture, "{0}:{1}", PSTask.RunspaceName, taskId); + + if (_useRunspacePool && _runspacePool.TryDequeue(out Runspace runspace)) + { + if (runspace.RunspaceStateInfo.State == RunspaceState.Opened && + runspace.RunspaceAvailability == RunspaceAvailability.Available) + { + try + { + runspace.ResetRunspaceState(); + runspace.Name = runspaceName; + return runspace; + } + catch + { + // If the runspace cannot be reset for any reason, remove it. + } + } + + RemoveActiveRunspace(runspace); + } + + // Create and initialize a new Runspace + var iss = InitialSessionState.CreateDefault2(); + iss.LanguageMode = (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Enforce) + ? PSLanguageMode.ConstrainedLanguage : PSLanguageMode.FullLanguage; + runspace = RunspaceFactory.CreateRunspace(iss); + runspace.Name = runspaceName; + _activeRunspaces.TryAdd(runspace.Id, runspace); + runspace.Open(); + _createdRunspaceCount++; + + return runspace; + } + + private void ReturnRunspace(PSTaskBase task) + { + var runspace = task.Runspace; + Dbg.Assert(runspace != null, "Task runspace cannot be null."); + if (_useRunspacePool && + runspace.RunspaceStateInfo.State == RunspaceState.Opened && + runspace.RunspaceAvailability == RunspaceAvailability.Available) + { + _runspacePool.Enqueue(runspace); + return; + } + + RemoveActiveRunspace(runspace); + } + + private void RemoveActiveRunspace(Runspace runspace) + { + runspace.Dispose(); + _activeRunspaces.TryRemove(runspace.Id, out Runspace _); + } + #endregion } @@ -852,7 +965,7 @@ private void CheckForComplete() /// /// Job for running ForEach-Object parallel task child jobs asynchronously. /// - internal sealed class PSTaskJob : Job + public sealed class PSTaskJob : Job { #region Members @@ -862,6 +975,18 @@ internal sealed class PSTaskJob : Job #endregion + #region Properties + + /// + /// Gets a value of the count of total runspaces allocated. + /// + public int AllocatedRunspaceCount + { + get => _taskPool.AllocatedRunspaceCount; + } + + #endregion + #region Constructor private PSTaskJob() { } @@ -871,11 +996,13 @@ private PSTaskJob() { } /// /// Job command text. /// Pool size limit for task job. - public PSTaskJob( + /// When true, a new runspace object is created for the task instead of reusing one from the pool. + internal PSTaskJob( string command, - int throttleLimit) : base(command, string.Empty) + int throttleLimit, + bool useNewRunspace) : base(command, string.Empty) { - _taskPool = new PSTaskPool(throttleLimit); + _taskPool = new PSTaskPool(throttleLimit, useNewRunspace); _isOpen = true; PSJobTypeName = nameof(PSTaskJob); @@ -949,14 +1076,14 @@ protected override void Dispose(bool disposing) #endregion - #region Public Methods + #region Internal Methods /// /// Add a child job to the collection. /// /// Child job to add. /// True when child job is successfully added. - public bool AddJob(PSTaskChildJob childJob) + internal bool AddJob(PSTaskChildJob childJob) { if (!_isOpen) { @@ -971,7 +1098,7 @@ public bool AddJob(PSTaskChildJob childJob) /// Closes this parent job to adding more child jobs and starts /// the child jobs running with the provided throttle limit. /// - public void Start() + internal void Start() { _isOpen = false; SetJobState(JobState.Running); @@ -1017,6 +1144,9 @@ private void HandleTaskPoolComplete(object sender, EventArgs args) } SetJobState(finalState); + + // Release job task pool runspace resources. + (sender as PSTaskPool).DisposeRunspaces(); } catch (ObjectDisposedException) { } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 index ce8bc8c1ce3..2e6c5404fde 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 @@ -314,6 +314,23 @@ Describe 'ForEach-Object -Parallel -AsJob Basic Tests' -Tags 'CI' { } } +Describe 'ForEach-Object -Parallel runspace pool tests' -Tags 'CI' { + + It "Verifies job allocated runspace count is limited to pool size" { + + $job = 1..4 | ForEach-Object -Parallel { Start-Sleep 1 } -AsJob -ThrottleLimit 2 | Wait-Job + $job.AllocatedRunspaceCount | Should -BeExactly 2 + $job | Remove-Job + } + + It "Verifies job with -UseNewRunspace switch allocates one runspace per iteration" { + + $job = 1..10 | ForEach-Object -Parallel { $_ } -AsJob -ThrottleLimit 2 -UseNewRunspace | Wait-Job + $job.AllocatedRunspaceCount | Should -BeExactly 10 + $job | Remove-Job + } +} + Describe 'ForEach-Object -Parallel Functional Tests' -Tags 'Feature' { It 'Verifies job queuing and throttle limit' { From 68442a33e5f775c80526b2f64475c795f6bb085b Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Mon, 23 Mar 2020 22:13:47 +0000 Subject: [PATCH 087/275] Add documentation for `WebResponseObject` and `BasicHtmlWebResponseObject` properties (#11876) --- .../BasicHtmlWebResponseObject.Common.cs | 18 ++++++++++++------ .../Common/WebResponseObject.Common.cs | 15 +++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) 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 664c3d69d46..54950f84119 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 @@ -57,22 +57,28 @@ public BasicHtmlWebResponseObject(HttpResponseMessage response, Stream contentSt #region Properties /// - /// Gets the Content property. + /// Gets the text body content of this response. /// + /// + /// Content of the response body, decoded using , + /// if the Content-Type response header is a recognized text + /// type. Otherwise null. + /// public new string Content { get; private set; } /// - /// Gets the Encoding that was used to decode the Content. + /// Gets the encoding of the text body content of this response. /// /// - /// The Encoding used to decode the Content; otherwise, a null reference if the content is not text. + /// Encoding of the response body from the Content-Type header, + /// or null if the encoding could not be determined. /// public Encoding Encoding { get; private set; } private WebCmdletElementCollection _inputFields; /// - /// Gets the Fields property. + /// Gets the HTML input field elements parsed from . /// public WebCmdletElementCollection InputFields { @@ -99,7 +105,7 @@ public WebCmdletElementCollection InputFields private WebCmdletElementCollection _links; /// - /// Gets the Links property. + /// Gets the HTML a link elements parsed from . /// public WebCmdletElementCollection Links { @@ -126,7 +132,7 @@ public WebCmdletElementCollection Links private WebCmdletElementCollection _images; /// - /// Gets the Images property. + /// Gets the HTML img elements parsed from . /// public WebCmdletElementCollection Images { 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 39ac6bdf20e..f7dcb764e48 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 @@ -18,13 +18,13 @@ public partial class WebResponseObject #region Properties /// - /// Gets or protected sets the Content property. + /// Gets or protected sets the response body content. /// [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public byte[] Content { get; protected set; } /// - /// Gets the StatusCode property. + /// Gets the response status code. /// public int StatusCode { @@ -32,7 +32,7 @@ public int StatusCode } /// - /// Gets the StatusDescription property. + /// Gets the response status description. /// public string StatusDescription { @@ -41,7 +41,7 @@ public string StatusDescription private MemoryStream _rawContentStream; /// - /// Gets the RawContentStream property. + /// Gets the response body content as a . /// public MemoryStream RawContentStream { @@ -49,7 +49,7 @@ public MemoryStream RawContentStream } /// - /// Gets the RawContentLength property. + /// Gets the length (in bytes) of . /// public long RawContentLength { @@ -57,8 +57,11 @@ public long RawContentLength } /// - /// Gets or protected sets the RawContent property. + /// Gets or protected sets the full response content. /// + /// + /// Full response content, including the HTTP status line, headers, and body. + /// public string RawContent { get; protected set; } #endregion Properties From 3c81de6d268e1056ae622b224fb927d89b990472 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 24 Mar 2020 10:49:54 -0700 Subject: [PATCH 088/275] Add PowerShell version 7.0 to compatible version list (#12184) --- src/System.Management.Automation/engine/PSVersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 7ac1c4b94ba..d557fccb09e 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -108,7 +108,7 @@ static PSVersionInfo() s_psVersionTable[PSVersionInfo.PSVersionName] = s_psSemVersion; s_psVersionTable[PSVersionInfo.PSEditionName] = PSEditionValue; s_psVersionTable[PSGitCommitIdName] = rawGitCommitId; - s_psVersionTable[PSCompatibleVersionsName] = new Version[] { s_psV1Version, s_psV2Version, s_psV3Version, s_psV4Version, s_psV5Version, s_psV51Version, s_psV6Version, s_psV61Version, s_psV62Version, s_psVersion }; + s_psVersionTable[PSCompatibleVersionsName] = new Version[] { s_psV1Version, s_psV2Version, s_psV3Version, s_psV4Version, s_psV5Version, s_psV51Version, s_psV6Version, s_psV61Version, s_psV62Version, s_psV7Version, s_psVersion }; s_psVersionTable[PSVersionInfo.SerializationVersionName] = new Version(InternalSerializer.DefaultVersion); s_psVersionTable[PSVersionInfo.PSRemotingProtocolVersionName] = RemotingConstants.ProtocolVersion; s_psVersionTable[PSVersionInfo.WSManStackVersionName] = GetWSManStackVersion(); From f8fb77052fd2a89b6ad018f50c5a89c4c3e33e62 Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Tue, 24 Mar 2020 13:51:55 -0400 Subject: [PATCH 089/275] Fix detection regex in web cmdlets (#12099) --- .../BasicHtmlWebResponseObject.Common.cs | 2 +- .../WebCmdlets.Tests.ps1 | 44 +++++++++++++++++++ .../WebListener/Controllers/DosController.cs | 17 ++++--- 3 files changed, 56 insertions(+), 7 deletions(-) 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 54950f84119..fd4c4b41219 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 @@ -232,7 +232,7 @@ private void EnsureHtmlParser() if (s_imageRegex == null) { - s_imageRegex = new Regex(@"]*>", + s_imageRegex = new Regex(@"]*?>", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled); } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index ba1c5e43e54..d588674d6a9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -1900,7 +1900,51 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { } } + Context "Regex Parsing" { + + It 'correctly parses an image with id, class, and src attributes' { + $dosUri = Get-WebListenerUrl -Test 'Dos' -query @{ + dosType = 'img-attribute' + } + + $response = Invoke-WebRequest -Uri $dosUri + $response.Images | Should -Not -BeNullOrEmpty + } + } + Context "Denial of service" -Tag 'DOS' { + It "Image Parsing" { + Set-ItResult -Pending -Because "The pathological regex runs fast due to https://github.com/dotnet/runtime/issues/33399. Fixed in .NET 5 preview.2" + $dosUri = Get-WebListenerUrl -Test 'Dos' -query @{ + dosType='img' + dosLength='5000' + } + $script:content = '' + [TimeSpan] $timeSpan = Measure-Command { + $response = Invoke-WebRequest -Uri $dosUri + $script:content = $response.content + $response.Images | out-null + } + + $script:content | Should -Not -BeNullOrEmpty + + # pathological regex + $regex = [RegEx]::new(']*>') + + [TimeSpan] $pathologicalTimeSpan = Measure-Command { + $regex.Match($content) + } + + $pathologicalRatio = $pathologicalTimeSpan.TotalMilliseconds/$timeSpan.TotalMilliseconds + Write-Verbose "Pathological ratio: $pathologicalRatio" -Verbose + + # dosLength 4,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 12 + # dosLength 5,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 21 + # dosLength 10,000 on my 3.5 GHz 6-Core Intel Xeon E5 macpro produced a ratio of 75 + # in some cases we will be running in a Docker container with modest resources + $pathologicalRatio | Should -BeGreaterThan 5 + } + It "Charset Parsing" { $dosUri = Get-WebListenerUrl -Test 'Dos' -query @{ dosType='charset' diff --git a/test/tools/WebListener/Controllers/DosController.cs b/test/tools/WebListener/Controllers/DosController.cs index 7966ab39bfa..864bb3aa8f2 100644 --- a/test/tools/WebListener/Controllers/DosController.cs +++ b/test/tools/WebListener/Controllers/DosController.cs @@ -29,33 +29,38 @@ public string Index() } StringValues dosLengths; - Int32 dosLength =1; + Int32 dosLength = 1; if (Request.Query.TryGetValue("dosLength", out dosLengths)) { Int32.TryParse(dosLengths.FirstOrDefault(), out dosLength); } string body = string.Empty; - switch(dosType) + switch (dosType) { case "img": contentType = "text/html; charset=utf8"; body = ""; + break; case "charset": contentType = "text/html; charset=melon"; body = " { - var httpContext = (HttpContext) state; - httpContext.Response.ContentType = contentType; - return Task.FromResult(0); + var httpContext = (HttpContext)state; + httpContext.Response.ContentType = contentType; + return Task.FromResult(0); }, HttpContext); Response.ContentLength = Encoding.UTF8.GetBytes(body).Length; From b7cb335f03fe2992d0cbd61699de9d9aafa1d7c1 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 24 Mar 2020 11:08:37 -0700 Subject: [PATCH 090/275] Update copyright notice to latest guidance (#12190) --- .devcontainer/Dockerfile | 2 +- .github/CONTRIBUTING.md | 6 +- LICENSE.txt | 2 +- build.psm1 | 2 +- demos/Apache/Apache/Apache.psm1 | 2 +- demos/Apache/apache-demo.ps1 | 2 +- demos/Azure/Azure-Demo.ps1 | 2 +- demos/DSC/dsc-demo.ps1 | 2 +- demos/Docker-PowerShell/Docker-PowerShell.ps1 | 2 +- demos/SystemD/SystemD/SystemD.psm1 | 2 +- demos/SystemD/journalctl-demo.ps1 | 2 +- demos/crontab/CronTab/CronTab.psd1 | 2 +- demos/crontab/CronTab/CronTab.psm1 | 2 +- demos/crontab/crontab.ps1 | 2 +- demos/dsc.ps1 | 2 +- demos/powershellget/PowerShellGet.ps1 | 2 +- demos/python/class1.ps1 | 2 +- demos/python/demo_script.ps1 | 2 +- demos/python/inline_python.ps1 | 2 +- demos/rest/rest.ps1 | 2 +- docker/tests/containerTestCommon.psm1 | 2 +- docs/host-powershell/sample/MyApp/Program.cs | 2 +- .../AssemblyInfo.cs | 2 +- .../CimAsyncOperation.cs | 2 +- .../CimBaseAction.cs | 2 +- .../CimCmdletModuleInitialize.cs | 2 +- .../CimCommandBase.cs | 2 +- .../CimGetAssociatedInstance.cs | 2 +- .../CimGetCimClass.cs | 2 +- .../CimGetInstance.cs | 2 +- .../CimIndicationWatcher.cs | 2 +- .../CimInvokeCimMethod.cs | 2 +- .../CimNewCimInstance.cs | 2 +- .../CimPromptUser.cs | 2 +- .../CimRegisterCimIndication.cs | 2 +- .../CimRemoveCimInstance.cs | 2 +- .../CimResultObserver.cs | 2 +- .../CimSessionOperations.cs | 2 +- .../CimSessionProxy.cs | 2 +- .../CimSetCimInstance.cs | 2 +- .../CimWriteError.cs | 2 +- .../CimWriteMessage.cs | 2 +- .../CimWriteProgress.cs | 2 +- .../CimWriteResultObject.cs | 2 +- .../CmdletOperation.cs | 2 +- .../GetCimAssociatedInstanceCommand.cs | 2 +- .../GetCimClassCommand.cs | 2 +- .../GetCimInstanceCommand.cs | 2 +- .../GetCimSessionCommand.cs | 2 +- .../InvokeCimMethodCommand.cs | 2 +- .../NewCimInstanceCommand.cs | 2 +- .../NewCimSessionCommand.cs | 2 +- .../NewCimSessionOptionCommand.cs | 2 +- .../RegisterCimIndicationCommand.cs | 2 +- .../RemoveCimInstanceCommand.cs | 2 +- .../RemoveCimSessionCommand.cs | 2 +- .../SetCimInstanceCommand.cs | 2 +- .../Utils.cs | 2 +- .../CommonHelper.cs | 2 +- .../HelpWindow/HelpParagraphBuilder.cs | 2 +- .../HelpWindow/HelpViewModel.cs | 2 +- .../HelpWindow/HelpWindow.xaml | 2 +- .../HelpWindow/HelpWindow.xaml.cs | 2 +- .../HelpWindow/HelpWindowSettings.Designer.cs | 2 +- .../HelpWindow/ParagraphBuilder.cs | 2 +- .../HelpWindow/ParagraphSearcher.cs | 2 +- .../HelpWindow/SettingsDialog.xaml | 2 +- .../HelpWindow/SettingsDialog.xaml.cs | 2 +- .../ManagementList/Common/AutomationButton.cs | 2 +- .../ManagementList/Common/AutomationImage.cs | 2 +- .../Common/AutomationTextBlock.cs | 2 +- .../AutomationTextBlockAutomationPeer.cs | 2 +- .../ManagementList/Common/BooleanBoxes.cs | 2 +- .../ManagementList/Common/CommandHelper.cs | 2 +- .../Common/CustomTypeComparer.cs | 2 +- .../Common/DataRoutedEventArgs.cs | 2 +- .../Common/DateTimeApproximationComparer.cs | 2 +- .../Common/DismissiblePopup.Generated.cs | 2 +- .../ManagementList/Common/DismissiblePopup.cs | 2 +- .../ExtendedFrameworkElementAutomationPeer.cs | 2 +- .../ManagementList/Common/IAsyncProgress.cs | 2 +- .../Common/IStateDescriptorFactory.cs | 2 +- .../Common/IntegralConverter.cs | 2 +- .../Common/InverseBooleanConverter.cs | 2 +- .../ManagementList/Common/IsEqualConverter.cs | 2 +- .../Common/IsNotNullConverter.cs | 2 +- .../ManagementList/Common/KeyboardHelp.cs | 2 +- .../Common/ListOrganizer.Generated.cs | 2 +- .../ManagementList/Common/ListOrganizer.cs | 2 +- .../Common/ListOrganizerItem.Generated.cs | 2 +- .../Common/ListOrganizerItem.cs | 2 +- .../Common/MessageTextBox.Generated.cs | 2 +- .../ManagementList/Common/MessageTextBox.cs | 2 +- .../Common/PickerBase.Generated.cs | 2 +- .../ManagementList/Common/PickerBase.cs | 2 +- .../Common/PopupControlButton.Generated.cs | 2 +- .../Common/PopupControlButton.cs | 2 +- .../Common/PropertyChangedEventArgs.cs | 2 +- .../ReadOnlyObservableAsyncCollection.cs | 2 +- .../Common/ScalableImage.Generated.cs | 2 +- .../ManagementList/Common/ScalableImage.cs | 2 +- .../Common/ScalableImageSource.Generated.cs | 2 +- .../Common/ScalableImageSource.cs | 2 +- .../ManagementList/Common/StateDescriptor.cs | 2 +- .../Common/StringFormatConverter.cs | 2 +- .../Common/TextBlockService.Generated.cs | 2 +- .../ManagementList/Common/TextBlockService.cs | 2 +- .../Common/TextTrimConverter.cs | 2 +- .../ManagementList/Common/Utilities.cs | 2 +- .../Common/VisualToAncestorDataConverter.cs | 2 +- .../Common/WeakEventListener.cs | 2 +- .../ManagementList/Common/WpfHelp.cs | 2 +- .../CommonControls/AutomationGroup.cs | 2 +- .../ExpanderButton.Generated.cs | 2 +- .../CommonControls/ExpanderButton.cs | 2 +- .../ExpanderButtonAutomationPeer.cs | 2 +- .../CommonControls/Resizer.Generated.cs | 2 +- .../ManagementList/CommonControls/Resizer.cs | 2 +- .../ResizerGripThicknessConverter.cs | 2 +- .../UIElementAdorner.Generated.cs | 2 +- .../CommonControls/UIElementAdorner.cs | 2 +- .../DefaultFilterRuleCustomizationFactory.cs | 2 +- .../FilterCore/FilterEvaluator.cs | 2 +- .../FilterCore/FilterExceptionEventArgs.cs | 2 +- .../FilterExpressionAndOperatorNode.cs | 2 +- .../FilterExpressionNode.cs | 2 +- .../FilterExpressionOperandNode.cs | 2 +- .../FilterExpressionOrOperatorNode.cs | 2 +- .../FilterRuleCustomizationFactory.cs | 2 +- .../FilterRules/ComparableValueFilterRule.cs | 2 +- .../FilterRules/DoesNotEqualFilterRule.cs | 2 +- .../FilterRules/EqualsFilterRule.cs | 2 +- .../FilterCore/FilterRules/FilterRule.cs | 2 +- .../FilterRules/FilterRuleExtensions.cs | 2 +- .../FilterRules/IsBetweenFilterRule.cs | 2 +- .../FilterRules/IsEmptyFilterRule.cs | 2 +- .../FilterRules/IsGreaterThanFilterRule.cs | 2 +- .../FilterRules/IsLessThanFilterRule.cs | 2 +- .../FilterRules/IsNotEmptyFilterRule.cs | 2 +- .../FilterRules/IsNotEmptyValidationRule.cs | 2 +- .../PropertiesTextContainsFilterRule.cs | 2 +- .../PropertyValueSelectorFilterRule.cs | 2 +- .../FilterRules/SelectorFilterRule.cs | 2 +- .../SingleValueComparableValueFilterRule.cs | 2 +- .../FilterRules/TextContainsFilterRule.cs | 2 +- .../TextDoesNotContainFilterRule.cs | 2 +- .../FilterRules/TextDoesNotEqualFilterRule.cs | 2 +- .../FilterRules/TextEndsWithFilterRule.cs | 2 +- .../FilterRules/TextEqualsFilterRule.cs | 2 +- .../FilterCore/FilterRules/TextFilterRule.cs | 2 +- .../FilterRules/TextStartsWithFilterRule.cs | 2 +- .../ManagementList/FilterCore/FilterStatus.cs | 2 +- .../FilterCore/FilterUtilities.cs | 2 +- .../ManagementList/FilterCore/IEvaluate.cs | 2 +- .../FilterCore/IFilterExpressionProvider.cs | 2 +- .../FilterCore/ItemsControlFilterEvaluator.cs | 2 +- .../FilterCore/ValidatingSelectorValue.cs | 2 +- .../FilterCore/ValidatingValue.cs | 2 +- .../FilterCore/ValidatingValueBase.cs | 2 +- .../DataErrorInfoValidationResult.cs | 2 +- .../DataErrorInfoValidationRule.cs | 2 +- .../AddFilterRulePicker.Generated.cs | 2 +- .../FilterProviders/AddFilterRulePicker.cs | 2 +- .../AddFilterRulePickerItem.cs | 2 +- .../FilterRulePanel.Generated.cs | 2 +- .../FilterProviders/FilterRulePanel.cs | 2 +- .../FilterRulePanelContentPresenter.cs | 2 +- .../FilterRulePanelController.cs | 2 +- .../FilterProviders/FilterRulePanelItem.cs | 2 +- .../FilterRulePanelItemType.cs | 2 +- .../FilterRuleTemplateSelector.cs | 2 +- .../FilterRuleToDisplayNameConverter.cs | 2 +- .../InputFieldBackgroundTextConverter.cs | 2 +- .../IsValidatingValueValidConverter.cs | 2 +- .../FilterProviders/SearchBox.Generated.cs | 2 +- .../FilterProviders/SearchBox.cs | 2 +- .../FilterProviders/SearchTextParseResult.cs | 2 +- .../FilterProviders/SearchTextParser.cs | 2 +- ...tingSelectorValueToDisplayNameConverter.cs | 2 +- ...ingValueToGenericParameterTypeConverter.cs | 2 +- .../ManagementList/ColumnPicker.xaml | 2 +- .../ManagementList/ColumnPicker.xaml.cs | 2 +- .../ManagementList/DefaultStringConverter.cs | 2 +- .../ManagementList/IPropertyValueGetter.cs | 2 +- .../ManagementList/InnerList.Generated.cs | 2 +- .../InnerListColumn.Generated.cs | 2 +- .../ManagementList/InnerListGridView.cs | 2 +- .../ManagementList/Innerlist.cs | 2 +- .../ManagementList.Generated.cs | 2 +- .../ManagementListStateDescriptor.cs | 2 +- .../ManagementListStateDescriptorFactory.cs | 2 +- .../ManagementListTitle.Generated.cs | 2 +- .../ManagementList/ManagementListTitle.cs | 2 +- .../ManagementList/PropertyValueComparer.cs | 2 +- .../ManagementList/PropertyValueGetter.cs | 2 +- .../UIPropertyGroupDescription.cs | 2 +- .../ViewGroupToStringConverter.cs | 2 +- .../ManagementList/ManagementList/WaitRing.cs | 2 +- .../ManagementList/innerlistcolumn.cs | 2 +- .../ManagementList/managementlist.cs | 2 +- .../Controls/AllModulesControl.xaml | 2 +- .../Controls/AllModulesControl.xaml.cs | 2 +- .../ShowCommand/Controls/CmdletControl.xaml | 2 +- .../Controls/CmdletControl.xaml.cs | 2 +- .../Controls/ImageButton/ImageButton.xaml | 2 +- .../Controls/ImageButton/ImageButton.xaml.cs | 2 +- .../Controls/ImageButton/ImageButtonBase.cs | 2 +- .../ImageButton/ImageButtonCommon.xaml | 2 +- .../ImageButtonToolTipConverter.cs | 2 +- .../ImageButton/ImageToggleButton.xaml | 2 +- .../ImageButton/ImageToggleButton.xaml.cs | 2 +- .../Controls/MultipleSelectionControl.xaml | 2 +- .../Controls/MultipleSelectionControl.xaml.cs | 2 +- .../Controls/NotImportedCmdletControl.xaml | 2 +- .../Controls/NotImportedCmdletControl.xaml.cs | 2 +- .../Controls/ParameterSetControl.xaml | 2 +- .../Controls/ParameterSetControl.xaml.cs | 2 +- .../Controls/ShowModuleControl.xaml | 2 +- .../Controls/ShowModuleControl.xaml.cs | 2 +- .../ShowCommandSettings.Designer.cs | 2 +- .../ViewModel/AllModulesViewModel.cs | 2 +- .../ShowCommand/ViewModel/CommandEventArgs.cs | 2 +- .../ShowCommand/ViewModel/CommandViewModel.cs | 2 +- .../ViewModel/HelpNeededEventArgs.cs | 2 +- .../ViewModel/ImportModuleEventArgs.cs | 2 +- .../ShowCommand/ViewModel/ModuleViewModel.cs | 2 +- .../ViewModel/ParameterSetViewModel.cs | 2 +- .../ViewModel/ParameterViewModel.cs | 2 +- .../Windows/MultipleSelectionDialog.xaml | 2 +- .../Windows/MultipleSelectionDialog.xaml.cs | 2 +- .../Windows/ShowAllModulesWindow.xaml | 2 +- .../Windows/ShowAllModulesWindow.xaml.cs | 2 +- .../Windows/ShowCommandWindow.xaml | 2 +- .../Windows/ShowCommandWindow.xaml.cs | 2 +- .../commandHelpers/HelpWindowHelper.cs | 2 +- .../commandHelpers/OutGridView.cs | 2 +- .../commandHelpers/ShowCommandHelper.cs | 2 +- .../themes/generic.xaml | 2 +- .../CommonUtils.cs | 2 +- .../CoreCLR/Stubs.cs | 2 +- .../CounterFileInfo.cs | 2 +- .../CounterSample.cs | 2 +- .../CounterSet.cs | 2 +- .../ExportCounterCommand.cs | 2 +- .../GetCounterCommand.cs | 2 +- .../GetEventCommand.cs | 2 +- .../GetEventSnapin.cs | 2 +- .../ImportCounterCommand.cs | 2 +- .../NewWinEventCommand.cs | 2 +- .../PdhHelper.cs | 2 +- .../PdhSafeHandle.cs | 2 +- .../resources/GetEventResources.txt | 2 +- .../cmdletization/SessionBasedWrapper.cs | 2 +- .../cmdletization/cim/CimJobException.cs | 2 +- .../cmdletization/cim/CreateInstanceJob.cs | 2 +- .../cmdletization/cim/DeleteInstanceJob.cs | 2 +- .../cim/EnumerateAssociatedInstancesJob.cs | 2 +- .../cim/ExtrinsicMethodInvocationJob.cs | 2 +- .../cim/InstanceMethodInvocationJob.cs | 2 +- .../cim/MethodInvocationJobBase.cs | 2 +- .../cmdletization/cim/ModifyInstanceJob.cs | 2 +- .../cmdletization/cim/PropertySettingJob.cs | 2 +- .../cimSupport/cmdletization/cim/QueryJob.cs | 2 +- .../cmdletization/cim/QueryJobBase.cs | 2 +- .../cim/StaticMethodInvocationJob.cs | 2 +- .../cim/TerminatingErrorTracker.cs | 2 +- .../cmdletization/cim/cimChildJobBase.cs | 2 +- .../cim/cimCmdletDefinitionContext.cs | 2 +- .../cim/cimCmdletInvocationContext.cs | 2 +- .../cmdletization/cim/cimConverter.cs | 2 +- .../cmdletization/cim/cimJobContext.cs | 2 +- .../cim/cimOperationOptionsHelper.cs | 2 +- .../cimSupport/cmdletization/cim/cimQuery.cs | 2 +- .../cmdletization/cim/cimWrapper.cs | 2 +- .../cmdletization/cim/clientSideQuery.cs | 2 +- .../commands/management/AddContentCommand.cs | 2 +- .../commands/management/CIMHelper.cs | 2 +- .../management/ClearContentCommand.cs | 2 +- .../management/ClearPropertyCommand.cs | 2 +- .../management/ClearRecycleBinCommand.cs | 2 +- .../commands/management/Clipboard.cs | 2 +- .../commands/management/CombinePathCommand.cs | 2 +- .../management/CommitTransactionCommand.cs | 2 +- .../commands/management/Computer.cs | 2 +- .../commands/management/ComputerUnix.cs | 2 +- .../commands/management/ContentCommandBase.cs | 2 +- .../management/ControlPanelItemCommand.cs | 2 +- .../commands/management/ConvertPathCommand.cs | 2 +- .../management/CopyPropertyCommand.cs | 2 +- .../commands/management/Eventlog.cs | 2 +- .../commands/management/GetChildrenCommand.cs | 2 +- .../management/GetClipboardCommand.cs | 2 +- .../management/GetComputerInfoCommand.cs | 2 +- .../commands/management/GetContentCommand.cs | 2 +- .../commands/management/GetPropertyCommand.cs | 2 +- .../management/GetTransactionCommand.cs | 2 +- .../management/GetWMIObjectCommand.cs | 2 +- .../commands/management/Hotfix.cs | 2 +- .../management/InvokeWMIMethodCommand.cs | 2 +- .../management/MovePropertyCommand.cs | 2 +- .../commands/management/Navigation.cs | 2 +- .../commands/management/NewPropertyCommand.cs | 2 +- .../commands/management/ParsePathCommand.cs | 2 +- .../PassThroughContentCommandBase.cs | 2 +- .../PassThroughPropertyCommandBase.cs | 2 +- .../commands/management/PingPathCommand.cs | 2 +- .../commands/management/Process.cs | 2 +- .../management/PropertyCommandBase.cs | 2 +- .../management/RegisterWMIEventCommand.cs | 2 +- .../management/RemovePropertyCommand.cs | 2 +- .../management/RemoveWMIObjectCommand.cs | 2 +- .../management/RenamePropertyCommand.cs | 2 +- .../commands/management/ResolvePathCommand.cs | 2 +- .../management/RollbackTransactionCommand.cs | 2 +- .../commands/management/Service.cs | 2 +- .../management/SetClipboardCommand.cs | 2 +- .../commands/management/SetContentCommand.cs | 2 +- .../commands/management/SetPropertyCommand.cs | 2 +- .../management/SetWMIInstanceCommand.cs | 2 +- .../management/StartTransactionCommand.cs | 2 +- .../management/TestConnectionCommand.cs | 2 +- .../commands/management/TimeZoneCommands.cs | 2 +- .../management/UseTransactionCommand.cs | 2 +- .../commands/management/WMIHelper.cs | 2 +- .../commands/management/WebServiceProxy.cs | 2 +- .../management/WriteContentCommandBase.cs | 2 +- .../installer/MshManagementMshSnapin.cs | 2 +- .../commands/utility/AddMember.cs | 2 +- .../commands/utility/AddType.cs | 2 +- .../commands/utility/Compare-Object.cs | 2 +- .../commands/utility/ConsoleColorCmdlet.cs | 2 +- .../utility/ConvertFrom-SddlString.cs | 2 +- .../utility/ConvertFrom-StringData.cs | 2 +- .../utility/ConvertFromMarkdownCommand.cs | 2 +- .../commands/utility/ConvertTo-Html.cs | 2 +- .../commands/utility/Csv.cs | 2 +- .../commands/utility/CsvCommands.cs | 2 +- .../commands/utility/CustomSerialization.cs | 2 +- .../utility/CustomSerializationStrings.cs | 2 +- .../commands/utility/DebugRunspaceCommand.cs | 2 +- .../commands/utility/Disable-PSBreakpoint.cs | 2 +- .../commands/utility/Enable-PSBreakpoint.cs | 2 +- .../EnableDisableRunspaceDebugCommand.cs | 2 +- .../commands/utility/ExportAliasCommand.cs | 2 +- .../FormatAndOutput/OutGridView/ColumnInfo.cs | 2 +- .../OutGridView/ExpressionColumnInfo.cs | 2 +- .../FormatAndOutput/OutGridView/HeaderInfo.cs | 2 +- .../OutGridView/OriginalColumnInfo.cs | 2 +- .../OutGridView/OutGridViewCommand.cs | 2 +- .../OutGridView/OutWindowProxy.cs | 2 +- .../OutGridView/ScalarTypeColumnInfo.cs | 2 +- .../FormatAndOutput/OutGridView/TableView.cs | 2 +- .../common/GetFormatDataCommand.cs | 2 +- .../common/WriteFormatDataCommand.cs | 2 +- .../FormatAndOutput/format-hex/Format-Hex.cs | 2 +- .../format-list/Format-List.cs | 2 +- .../format-object/Format-Object.cs | 2 +- .../format-table/Format-Table.cs | 2 +- .../format-wide/Format-Wide.cs | 2 +- .../FormatAndOutput/out-file/Out-File.cs | 2 +- .../out-printer/Out-Printer.cs | 2 +- .../out-printer/PrinterLineOutput.cs | 2 +- .../FormatAndOutput/out-string/Out-String.cs | 2 +- .../commands/utility/Get-Error.cs | 2 +- .../commands/utility/Get-PSBreakpoint.cs | 2 +- .../commands/utility/Get-PSCallStack.cs | 2 +- .../commands/utility/GetAliasCommand.cs | 2 +- .../commands/utility/GetCultureCommand.cs | 2 +- .../commands/utility/GetDateCommand.cs | 2 +- .../commands/utility/GetEventCommand.cs | 2 +- .../utility/GetEventSubscriberCommand.cs | 2 +- .../commands/utility/GetHash.cs | 2 +- .../commands/utility/GetHostCmdlet.cs | 2 +- .../commands/utility/GetMember.cs | 2 +- .../commands/utility/GetRandomCommand.cs | 2 +- .../commands/utility/GetRunspaceCommand.cs | 2 +- .../commands/utility/GetUICultureCommand.cs | 2 +- .../commands/utility/GetUnique.cs | 2 +- .../commands/utility/GetUptime.cs | 2 +- .../commands/utility/GetVerbCommand.cs | 2 +- .../commands/utility/Group-Object.cs | 2 +- .../utility/ImplicitRemotingCommands.cs | 2 +- .../commands/utility/Import-LocalizedData.cs | 2 +- .../commands/utility/ImportAliasCommand.cs | 2 +- .../utility/ImportPowerShellDataFile.cs | 2 +- .../utility/InvokeExpressionCommand.cs | 2 +- .../commands/utility/Join-String.cs | 2 +- .../utility/MarkdownOptionCommands.cs | 2 +- .../commands/utility/MatchString.cs | 2 +- .../commands/utility/Measure-Object.cs | 2 +- .../commands/utility/New-Object.cs | 2 +- .../commands/utility/NewAliasCommand.cs | 2 +- .../commands/utility/NewEventCommand.cs | 2 +- .../commands/utility/NewGuidCommand.cs | 2 +- .../utility/NewTemporaryFileCommand.cs | 2 +- .../commands/utility/NewTimeSpanCommand.cs | 2 +- .../commands/utility/ObjectCommandComparer.cs | 2 +- .../commands/utility/OrderObjectBase.cs | 2 +- .../utility/PSBreakpointCreationBase.cs | 2 +- .../commands/utility/ReadConsoleCmdlet.cs | 2 +- .../utility/RegisterObjectEventCommand.cs | 2 +- .../utility/RegisterPSEventCommand.cs | 2 +- .../commands/utility/Remove-PSBreakpoint.cs | 2 +- .../commands/utility/RemoveAliasCommand.cs | 2 +- .../commands/utility/RemoveEventCommand.cs | 2 +- .../commands/utility/Select-Object.cs | 2 +- .../commands/utility/Send-MailMessage.cs | 2 +- .../commands/utility/Set-PSBreakpoint.cs | 2 +- .../commands/utility/SetAliasCommand.cs | 2 +- .../commands/utility/SetDateCommand.cs | 2 +- .../utility/ShowCommand/ShowCommand.cs | 2 +- .../ShowCommand/ShowCommandCommandInfo.cs | 2 +- .../ShowCommand/ShowCommandModuleInfo.cs | 2 +- .../ShowCommand/ShowCommandParameterInfo.cs | 2 +- .../ShowCommandParameterSetInfo.cs | 2 +- .../ShowCommand/ShowCommandParameterType.cs | 2 +- .../utility/ShowCommand/ShowCommandProxy.cs | 2 +- .../commands/utility/ShowMarkdownCommand.cs | 2 +- .../commands/utility/Sort-Object.cs | 2 +- .../commands/utility/StartSleepCommand.cs | 2 +- .../commands/utility/Tee-Object.cs | 2 +- .../commands/utility/TestJsonCommand.cs | 2 +- .../commands/utility/TimeExpressionCommand.cs | 2 +- .../commands/utility/UnblockFile.cs | 2 +- .../utility/UnregisterEventCommand.cs | 2 +- .../commands/utility/Update-Data.cs | 2 +- .../commands/utility/Update-List.cs | 2 +- .../commands/utility/Update-TypeData.cs | 2 +- .../commands/utility/UtilityCommon.cs | 2 +- .../commands/utility/Var.cs | 2 +- .../commands/utility/WaitEventCommand.cs | 2 +- .../BasicHtmlWebResponseObject.Common.cs | 2 +- .../WebCmdlet/Common/ContentHelper.Common.cs | 2 +- .../Common/InvokeRestMethodCommand.Common.cs | 2 +- .../Common/WebRequestPSCmdlet.Common.cs | 2 +- .../Common/WebResponseObject.Common.cs | 2 +- .../WebCmdlet/ConvertFromJsonCommand.cs | 2 +- .../utility/WebCmdlet/ConvertToJsonCommand.cs | 2 +- .../WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs | 2 +- .../InvokeWebRequestCommand.CoreClr.cs | 2 +- .../utility/WebCmdlet/CoreCLR/WebProxy.cs | 2 +- .../CoreCLR/WebResponseHelper.CoreClr.cs | 2 +- .../WebResponseObjectFactory.CoreClr.cs | 2 +- .../commands/utility/WebCmdlet/FormObject.cs | 2 +- .../utility/WebCmdlet/FormObjectCollection.cs | 2 +- .../commands/utility/WebCmdlet/JsonObject.cs | 2 +- .../commands/utility/WebCmdlet/PSUserAgent.cs | 2 +- .../utility/WebCmdlet/StreamHelper.cs | 2 +- .../WebCmdlet/WebCmdletElementCollection.cs | 2 +- .../utility/WebCmdlet/WebRequestMethod.cs | 2 +- .../utility/WebCmdlet/WebRequestSession.cs | 2 +- .../commands/utility/Write-Object.cs | 2 +- .../commands/utility/Write.cs | 2 +- .../commands/utility/WriteAliasCommandBase.cs | 2 +- .../commands/utility/WriteConsoleCmdlet.cs | 2 +- .../commands/utility/WriteProgressCmdlet.cs | 2 +- .../commands/utility/XmlCommands.cs | 2 +- .../utility/trace/GetTracerCommand.cs | 2 +- .../utility/trace/MshHostTraceListener.cs | 2 +- .../utility/trace/SetTracerCommand.cs | 2 +- .../utility/trace/TraceCommandBase.cs | 2 +- .../utility/trace/TraceExpressionCommand.cs | 2 +- .../utility/trace/TraceListenerCommandBase.cs | 2 +- .../installer/MshUtilityMshSnapin.cs | 2 +- .../AssemblyInfo.cs | 2 +- .../WindowsTaskbarJumpList/ComInterfaces.cs | 2 +- .../WindowsTaskbarJumpList/HResult.cs | 2 +- .../WindowsTaskbarJumpList/PropVariant.cs | 2 +- .../WindowsTaskbarJumpList/PropertyKey.cs | 2 +- .../WindowsTaskbarJumpList/TaskbarJumpList.cs | 2 +- .../host/msh/CommandLineParameterParser.cs | 2 +- .../host/msh/ConsoleControl.cs | 2 +- .../host/msh/ConsoleHost.cs | 2 +- .../host/msh/ConsoleHostRawUserInterface.cs | 2 +- .../host/msh/ConsoleHostTranscript.cs | 2 +- .../host/msh/ConsoleHostUserInterface.cs | 2 +- .../msh/ConsoleHostUserInterfaceProgress.cs | 2 +- .../msh/ConsoleHostUserInterfacePrompt.cs | 2 +- ...ConsoleHostUserInterfacePromptForChoice.cs | 2 +- .../msh/ConsoleHostUserInterfaceSecurity.cs | 2 +- .../host/msh/ConsoleShell.cs | 2 +- .../host/msh/ConsoleTextWriter.cs | 2 +- .../host/msh/Executor.cs | 2 +- .../host/msh/ManagedEntrance.cs | 2 +- .../host/msh/PendingProgress.cs | 2 +- .../host/msh/ProgressNode.cs | 2 +- .../host/msh/ProgressPane.cs | 2 +- .../host/msh/Serialization.cs | 2 +- .../host/msh/StartTranscriptCmdlet.cs | 2 +- .../host/msh/StopTranscriptCmdlet.cs | 2 +- .../host/msh/UpdatesNotification.cs | 2 +- .../resources/ManagedEntranceStrings.resx | 2 +- .../singleshell/installer/EngineInstaller.cs | 2 +- .../singleshell/installer/MshHostMshSnapin.cs | 2 +- .../AssemblyInfo.cs | 2 +- .../DotNetCode/Eventing/EventDescriptor.cs | 2 +- .../DotNetCode/Eventing/EventProvider.cs | 2 +- .../Eventing/EventProviderTraceListener.cs | 2 +- .../Eventing/Reader/CoTaskMemSafeHandle.cs | 2 +- .../Reader/CoTaskMemUnicodeSafeHandle.cs | 2 +- .../Eventing/Reader/EventLogHandle.cs | 2 +- .../Eventing/Reader/NativeWrapper.cs | 2 +- .../Eventing/UnsafeNativeMethods.cs | 2 +- .../GlobalToolShim.cs | 2 +- .../Commands/AddLocalGroupMemberCommand.cs | 2 +- .../Commands/DisableLocalUserCommand.cs | 2 +- .../Commands/EnableLocalUserCommand.cs | 2 +- .../Commands/GetLocalGroupCommand.cs | 2 +- .../Commands/GetLocalGroupMemberCommand.cs | 2 +- .../Commands/GetLocalUserCommand.cs | 2 +- .../Commands/NewLocalGroupCommand.cs | 2 +- .../Commands/NewLocalUserCommand.cs | 2 +- .../Commands/RemoveLocalGroupCommand.cs | 2 +- .../Commands/RemoveLocalGroupMemberCommand.cs | 2 +- .../Commands/RemoveLocalUserCommand.cs | 2 +- .../Commands/RenameLocalGroupCommand.cs | 2 +- .../Commands/RenameLocalUserCommand.cs | 2 +- .../Commands/SetLocalGroupCommand.cs | 2 +- .../Commands/SetLocalUserCommand.cs | 2 +- .../LocalAccounts/Exceptions.cs | 2 +- .../LocalAccounts/Extensions.cs | 2 +- .../LocalAccounts/LocalGroup.cs | 2 +- .../LocalAccounts/LocalPrincipal.cs | 2 +- .../LocalAccounts/LocalUser.cs | 2 +- .../LocalAccounts/Native.cs | 2 +- .../LocalAccounts/NtStatus.cs | 2 +- .../LocalAccounts/PInvokeDllNames.cs | 2 +- .../LocalAccounts/Sam.cs | 2 +- .../LocalAccounts/SamApi.cs | 2 +- .../LocalAccounts/StringUtil.cs | 2 +- .../CodeInlineRenderer.cs | 2 +- .../EmphasisInlineRenderer.cs | 2 +- .../FencedCodeBlockRenderer.cs | 2 +- .../HeaderBlockRenderer.cs | 2 +- .../LeafInlineRenderer.cs | 2 +- .../LineBreakRenderer.cs | 2 +- .../LinkInlineRenderer.cs | 2 +- .../ListBlockRenderer.cs | 2 +- .../ListItemBlockRenderer.cs | 2 +- .../MarkdownConverter.cs | 2 +- .../ParagraphBlockRenderer.cs | 2 +- .../QuoteBlockRenderer.cs | 2 +- .../VT100EscapeSequences.cs | 2 +- .../VT100ObjectRenderer.cs | 2 +- .../VT100Renderer.cs | 2 +- .../AssemblyInfo.cs | 2 +- .../ScheduledJob.cs | 2 +- .../ScheduledJobDefinition.cs | 2 +- .../ScheduledJobOptions.cs | 2 +- .../ScheduledJobSourceAdapter.cs | 2 +- .../ScheduledJobStore.cs | 2 +- .../ScheduledJobTrigger.cs | 2 +- .../ScheduledJobWTS.cs | 2 +- .../commands/AddJobTrigger.cs | 2 +- .../commands/DisableJobDefinition.cs | 2 +- .../commands/DisableJobDefinitionBase.cs | 2 +- .../commands/DisableJobTrigger.cs | 2 +- .../commands/EnableDisableCmdletBase.cs | 2 +- .../commands/EnableJobDefinition.cs | 2 +- .../commands/EnableJobTrigger.cs | 2 +- .../commands/GetJobDefinition.cs | 2 +- .../commands/GetJobTrigger.cs | 2 +- .../commands/GetScheduledJobOption.cs | 2 +- .../commands/NewJobTrigger.cs | 2 +- .../commands/NewScheduledJobOption.cs | 2 +- .../commands/RegisterJobDefinition.cs | 2 +- .../commands/RemoveJobTrigger.cs | 2 +- .../commands/SchedJobCmdletBase.cs | 2 +- .../commands/ScheduledJobOptionCmdletBase.cs | 2 +- .../commands/SetJobDefinition.cs | 2 +- .../commands/SetJobTrigger.cs | 2 +- .../commands/SetScheduledJobOption.cs | 2 +- .../commands/UnregisterJobDefinition.cs | 2 +- .../security/AclCommands.cs | 2 +- .../security/CatalogCommands.cs | 2 +- .../security/CertificateCommands.cs | 2 +- .../security/CertificateProvider.cs | 2 +- .../security/CmsCommands.cs | 2 +- .../security/CredentialCommands.cs | 2 +- .../security/ExecutionPolicyCommands.cs | 2 +- .../security/SecureStringCommands.cs | 2 +- .../security/SignatureCommands.cs | 2 +- .../security/Utils.cs | 2 +- .../security/certificateproviderexceptions.cs | 2 +- .../installer/MshSecurityMshSnapin.cs | 2 +- .../ConfigProvider.cs | 2 +- src/Microsoft.WSMan.Management/CredSSP.cs | 2 +- .../CurrentConfigurations.cs | 2 +- src/Microsoft.WSMan.Management/Interop.cs | 2 +- .../InvokeWSManAction.cs | 2 +- .../NewWSManSession.cs | 2 +- src/Microsoft.WSMan.Management/PingWSMan.cs | 2 +- .../Set-QuickConfig.cs | 2 +- .../WSManConnections.cs | 2 +- .../WSManInstance.cs | 2 +- src/Microsoft.WSMan.Management/WsManHelper.cs | 2 +- src/Microsoft.WSMan.Management/WsManSnapin.cs | 2 +- .../resources/WsManResources.txt | 2 +- .../WSManSessionOption.cs | 2 +- .../Microsoft.PowerShell.Host.psd1 | 2 +- .../Microsoft.PowerShell.Management.psd1 | 2 +- .../Microsoft.PowerShell.Security.psd1 | 2 +- .../Microsoft.PowerShell.Utility.psd1 | 2 +- .../Windows/CimCmdlets/CimCmdlets.psd1 | 2 +- .../GetEvent.types.ps1xml | 2 +- .../Microsoft.PowerShell.Diagnostics.psd1 | 2 +- .../Microsoft.PowerShell.Management.psd1 | 2 +- .../Microsoft.PowerShell.Security.psd1 | 2 +- .../Microsoft.PowerShell.Utility.psd1 | 2 +- .../Microsoft.WSMan.Management.psd1 | 2 +- .../WSMan.format.ps1xml | 2 +- .../Windows/PSDiagnostics/PSDiagnostics.psd1 | 2 +- .../Windows/PSDiagnostics/PSDiagnostics.psm1 | 2 +- .../RegisterManifest.ps1 | 2 +- src/ResGen/Program.cs | 2 +- .../AssemblyInfo.cs | 2 +- .../CoreCLR/CorePsAssemblyLoadContext.cs | 2 +- .../CoreCLR/CorePsPlatform.cs | 2 +- .../CoreCLR/CorePsStub.cs | 2 +- .../CoreCLR/EventResource.cs | 2 +- .../DscSupport/CimDSCParser.cs | 2 +- .../Certificate_format_ps1xml.cs | 2 +- .../Diagnostics_Format_ps1xml.cs | 2 +- .../DotNetTypes_format_ps1xml.cs | 2 +- .../DefaultFormatters/Event_Format_ps1xml.cs | 2 +- .../FileSystem_format_ps1xml.cs | 2 +- .../DefaultFormatters/HelpV3_format_ps1xml.cs | 2 +- .../DefaultFormatters/Help_format_ps1xml.cs | 2 +- .../PowerShellCore_format_ps1xml.cs | 2 +- .../PowerShellTrace_format_ps1xml.cs | 2 +- .../Registry_format_ps1xml.cs | 2 +- .../DefaultFormatters/WSMan_Format_ps1xml.cs | 2 +- .../FormatAndOutput/common/BaseCommand.cs | 2 +- .../common/BaseFormattingCommand.cs | 2 +- .../common/BaseFormattingCommandParameters.cs | 2 +- .../common/BaseOutputtingCommand.cs | 2 +- .../common/ColumnWidthManager.cs | 2 +- .../FormatAndOutput/common/ComplexWriter.cs | 2 +- .../common/DisplayDatabase/FormatTable.cs | 2 +- .../common/DisplayDatabase/XmlLoaderBase.cs | 2 +- .../common/DisplayDatabase/commands.cs | 2 +- .../DisplayDatabase/displayDescriptionData.cs | 2 +- .../displayDescriptionDataMethods.cs | 2 +- .../displayDescriptionData_Complex.cs | 2 +- .../displayDescriptionData_List.cs | 2 +- .../displayDescriptionData_Misc.cs | 2 +- .../displayDescriptionData_Table.cs | 2 +- .../displayDescriptionData_Wide.cs | 2 +- .../displayResourceManagerCache.cs | 2 +- .../common/DisplayDatabase/typeDataManager.cs | 2 +- .../common/DisplayDatabase/typeDataQuery.cs | 2 +- .../DisplayDatabase/typeDataXmlLoader.cs | 2 +- .../typeDataXmlLoader_Complex.cs | 2 +- .../DisplayDatabase/typeDataXmlLoader_List.cs | 2 +- .../typeDataXmlLoader_Table.cs | 2 +- .../typeDataXmlLoader_Views.cs | 2 +- .../DisplayDatabase/typeDataXmlLoader_Wide.cs | 2 +- .../common/FormatGroupManager.cs | 2 +- .../common/FormatMsgCtxManager.cs | 2 +- .../common/FormatViewGenerator.cs | 2 +- .../common/FormatViewGenerator_Complex.cs | 2 +- .../common/FormatViewGenerator_List.cs | 2 +- .../common/FormatViewGenerator_Table.cs | 2 +- .../common/FormatViewGenerator_Wide.cs | 2 +- .../common/FormatViewManager.cs | 2 +- .../FormatAndOutput/common/FormatXMLWriter.cs | 2 +- .../common/FormattingObjects.cs | 2 +- .../common/FormattingObjectsDeserializer.cs | 2 +- .../FormatAndOutput/common/ILineOutput.cs | 2 +- .../FormatAndOutput/common/ListWriter.cs | 2 +- .../FormatAndOutput/common/OutputManager.cs | 2 +- .../FormatAndOutput/common/OutputQueue.cs | 2 +- .../FormatAndOutput/common/TableWriter.cs | 2 +- .../common/Utilities/MshObjectUtil.cs | 2 +- .../common/Utilities/MshParameter.cs | 2 +- .../Utilities/MshParameterAssociation.cs | 2 +- .../common/Utilities/Mshexpression.cs | 2 +- .../format-default/format-default.cs | 2 +- .../out-console/ConsoleLineOutput.cs | 2 +- .../FormatAndOutput/out-console/OutConsole.cs | 2 +- .../out-textInterface/OutTextInterface.cs | 2 +- .../cimSupport/cmdletization/EnumWriter.cs | 2 +- .../cmdletization/MethodInvocationInfo.cs | 2 +- .../cmdletization/MethodParameter.cs | 2 +- .../MethodParametersCollection.cs | 2 +- .../cmdletization/ObjectModelWrapper.cs | 2 +- .../cimSupport/cmdletization/QueryBuilder.cs | 2 +- .../cimSupport/cmdletization/ScriptWriter.cs | 2 +- .../cim/WildcardPatternToCimQueryParser.cs | 2 +- ...mdlets-over-objects.objectModel.autogen.cs | 2 +- ...lets-over-objects.xmlSerializer.autogen.cs | 2 +- ...mdlets-over-objects.objectModel.autogen.cs | 2 +- ...lets-over-objects.xmlSerializer.autogen.cs | 2 +- .../other/ciminstancetypeadapter.cs | 2 +- .../engine/AliasInfo.cs | 2 +- .../engine/ApplicationInfo.cs | 2 +- .../engine/ArgumentTypeConverterAttribute.cs | 2 +- .../engine/Attributes.cs | 2 +- .../engine/AutomationEngine.cs | 2 +- .../engine/AutomationNull.cs | 2 +- .../engine/COM/ComAdapter.cs | 2 +- .../engine/COM/ComDispatch.cs | 2 +- .../engine/COM/ComInvoker.cs | 2 +- .../engine/COM/ComMethod.cs | 2 +- .../engine/COM/ComProperty.cs | 2 +- .../engine/COM/ComTypeInfo.cs | 2 +- .../engine/COM/ComUtil.cs | 2 +- .../ChildrenCmdletProviderInterfaces.cs | 2 +- .../engine/CmdletFamilyProviderInterfaces.cs | 2 +- .../engine/CmdletInfo.cs | 2 +- .../engine/CmdletParameterBinderController.cs | 2 +- .../engine/CodeMethods.cs | 2 +- .../engine/ComInterop/ArgBuilder.cs | 2 +- .../engine/ComInterop/BoolArgBuilder.cs | 2 +- .../engine/ComInterop/BoundDispEvent.cs | 2 +- .../engine/ComInterop/CollectionExtensions.cs | 2 +- .../engine/ComInterop/ComBinder.cs | 2 +- .../engine/ComInterop/ComBinderHelpers.cs | 2 +- .../engine/ComInterop/ComClassMetaObject.cs | 2 +- .../engine/ComInterop/ComDispIds.cs | 2 +- .../engine/ComInterop/ComEventDesc.cs | 2 +- .../engine/ComInterop/ComEventSink.cs | 2 +- .../engine/ComInterop/ComEventSinkProxy.cs | 2 +- .../ComInterop/ComEventSinksContainer.cs | 2 +- .../ComInterop/ComFallbackMetaObject.cs | 2 +- .../engine/ComInterop/ComHresults.cs | 2 +- .../engine/ComInterop/ComInterop.cs | 2 +- .../engine/ComInterop/ComInvokeAction.cs | 2 +- .../engine/ComInterop/ComInvokeBinder.cs | 2 +- .../engine/ComInterop/ComMetaObject.cs | 2 +- .../engine/ComInterop/ComMethodDesc.cs | 2 +- .../engine/ComInterop/ComObject.cs | 2 +- .../engine/ComInterop/ComParamDesc.cs | 2 +- .../engine/ComInterop/ComRuntimeHelpers.cs | 2 +- .../engine/ComInterop/ComType.cs | 2 +- .../engine/ComInterop/ComTypeClassDesc.cs | 2 +- .../engine/ComInterop/ComTypeDesc.cs | 2 +- .../engine/ComInterop/ComTypeEnumDesc.cs | 2 +- .../engine/ComInterop/ComTypeLibDesc.cs | 2 +- .../engine/ComInterop/ComTypeLibInfo.cs | 2 +- .../engine/ComInterop/ComTypeLibMemberDesc.cs | 2 +- .../engine/ComInterop/ConversionArgBuilder.cs | 2 +- .../engine/ComInterop/ConvertArgBuilder.cs | 2 +- .../ComInterop/ConvertibleArgBuilder.cs | 2 +- .../engine/ComInterop/CurrencyArgBuilder.cs | 2 +- .../engine/ComInterop/DateTimeArgBuilder.cs | 2 +- .../engine/ComInterop/DispCallable.cs | 2 +- .../ComInterop/DispCallableMetaObject.cs | 2 +- .../engine/ComInterop/DispatchArgBuilder.cs | 2 +- .../engine/ComInterop/ErrorArgBuilder.cs | 2 +- .../engine/ComInterop/Errors.cs | 2 +- .../engine/ComInterop/ExcepInfo.cs | 2 +- .../engine/ComInterop/Helpers.cs | 2 +- .../engine/ComInterop/IDispatchComObject.cs | 2 +- .../engine/ComInterop/IDispatchMetaObject.cs | 2 +- .../engine/ComInterop/IPseudoComObject.cs | 2 +- .../engine/ComInterop/NullArgBuilder.cs | 2 +- .../engine/ComInterop/SimpleArgBuilder.cs | 2 +- .../engine/ComInterop/SplatCallSite.cs | 2 +- .../engine/ComInterop/StringArgBuilder.cs | 2 +- .../engine/ComInterop/TypeEnumMetaObject.cs | 2 +- .../ComInterop/TypeLibInfoMetaObject.cs | 2 +- .../engine/ComInterop/TypeLibMetaObject.cs | 2 +- .../engine/ComInterop/TypeUtils.cs | 2 +- .../engine/ComInterop/UnknownArgBuilder.cs | 2 +- .../engine/ComInterop/VarEnumSelector.cs | 2 +- .../engine/ComInterop/Variant.cs | 2 +- .../engine/ComInterop/VariantArgBuilder.cs | 2 +- .../engine/ComInterop/VariantArray.cs | 2 +- .../engine/ComInterop/VariantBuilder.cs | 2 +- .../engine/CommandBase.cs | 2 +- .../CommandCompletion/CommandCompletion.cs | 2 +- .../CommandCompletion/CompletionAnalysis.cs | 2 +- .../CommandCompletion/CompletionCompleters.cs | 2 +- .../CommandCompletion/CompletionResult.cs | 2 +- .../CommandCompletion/ExtensibleCompletion.cs | 2 +- .../PseudoParameterBinder.cs | 2 +- .../engine/CommandDiscovery.cs | 2 +- .../engine/CommandInfo.cs | 2 +- .../engine/CommandMetadata.cs | 2 +- .../engine/CommandParameter.cs | 2 +- .../engine/CommandPathSearch.cs | 2 +- .../engine/CommandProcessor.cs | 2 +- .../engine/CommandProcessorBase.cs | 2 +- .../engine/CommandSearcher.cs | 2 +- .../engine/CommonCommandParameters.cs | 2 +- .../engine/CompiledCommandParameter.cs | 2 +- .../engine/ConfigurationInfo.cs | 2 +- .../engine/ContentCmdletProviderInterfaces.cs | 2 +- .../engine/CoreAdapter.cs | 2 +- .../engine/Credential.cs | 2 +- .../engine/CultureVariable.cs | 2 +- .../engine/DataStoreAdapter.cs | 2 +- .../engine/DataStoreAdapterProvider.cs | 2 +- .../engine/DefaultCommandRuntime.cs | 2 +- .../engine/DriveInterfaces.cs | 2 +- .../engine/DriveNames.cs | 2 +- .../engine/DscResourceInfo.cs | 2 +- .../engine/DscResourceSearcher.cs | 2 +- .../engine/EngineIntrinsics.cs | 2 +- .../engine/EnumExpressionEvaluator.cs | 2 +- .../engine/EnumMinimumDisambiguation.cs | 2 +- .../engine/ErrorPackage.cs | 2 +- .../engine/EventManager.cs | 2 +- .../engine/ExecutionContext.cs | 2 +- ...EnableDisableExperimentalFeatureCommand.cs | 2 +- .../ExperimentalFeature.cs | 2 +- .../GetExperimentalFeatureCommand.cs | 2 +- .../engine/ExtendedTypeSystemException.cs | 2 +- .../engine/ExternalScriptInfo.cs | 2 +- .../engine/ExtraAdapter.cs | 2 +- .../engine/FilterInfo.cs | 2 +- .../engine/FunctionInfo.cs | 2 +- .../engine/GetCommandCommand.cs | 2 +- .../engine/ICommandRuntime.cs | 2 +- .../engine/InformationRecord.cs | 2 +- .../engine/InitialSessionState.cs | 2 +- .../engine/InternalCommands.cs | 2 +- .../engine/InvocationInfo.cs | 2 +- .../engine/ItemCmdletProviderInterfaces.cs | 2 +- .../engine/LanguagePrimitives.cs | 2 +- .../engine/ManagementObjectAdapter.cs | 2 +- .../engine/MergedCommandParameterMetadata.cs | 2 +- .../MinishellParameterBinderController.cs | 2 +- .../engine/Modules/AnalysisCache.cs | 2 +- .../Modules/ExportModuleMemberCommand.cs | 2 +- .../engine/Modules/GetModuleCommand.cs | 2 +- .../engine/Modules/ImportModuleCommand.cs | 2 +- .../engine/Modules/ModuleCmdletBase.cs | 2 +- .../engine/Modules/ModuleIntrinsics.cs | 2 +- .../engine/Modules/ModuleSpecification.cs | 2 +- .../engine/Modules/ModuleUtils.cs | 2 +- .../engine/Modules/NewModuleCommand.cs | 2 +- .../Modules/NewModuleManifestCommand.cs | 2 +- .../engine/Modules/PSModuleInfo.cs | 2 +- .../engine/Modules/RemoteDiscoveryHelper.cs | 2 +- .../engine/Modules/RemoveModuleCommand.cs | 2 +- .../engine/Modules/ScriptAnalysis.cs | 2 +- .../Modules/TestModuleManifestCommand.cs | 2 +- .../engine/MshCmdlet.cs | 2 +- .../engine/MshCommandRuntime.cs | 2 +- .../engine/MshMemberInfo.cs | 2 +- .../engine/MshObject.cs | 2 +- .../engine/MshObjectTypeDescriptor.cs | 2 +- .../engine/MshReference.cs | 2 +- .../engine/MshSecurityException.cs | 2 +- .../engine/MshSnapinQualifiedName.cs | 2 +- .../engine/NativeCommand.cs | 2 +- .../engine/NativeCommandParameterBinder.cs | 2 +- .../NativeCommandParameterBinderController.cs | 2 +- .../engine/NativeCommandProcessor.cs | 2 +- .../engine/NullString.cs | 2 +- .../engine/ObjectEventRegistrationBase.cs | 2 +- .../engine/PSClassInfo.cs | 2 +- .../engine/PSClassSearcher.cs | 2 +- .../engine/PSConfiguration.cs | 2 +- .../engine/PSVersionInfo.cs | 2 +- .../engine/ParameterBinderBase.cs | 2 +- .../engine/ParameterBinderController.cs | 2 +- .../engine/ParameterInfo.cs | 2 +- .../engine/ParameterSetInfo.cs | 2 +- .../engine/ParameterSetPromptingData.cs | 2 +- .../engine/ParameterSetSpecificMetadata.cs | 2 +- .../engine/PathInterfaces.cs | 2 +- .../engine/Pipe.cs | 2 +- .../engine/PositionalCommandParameter.cs | 2 +- .../engine/PowerShellStreamType.cs | 2 +- .../engine/ProcessCodeMethods.cs | 2 +- .../engine/ProgressRecord.cs | 2 +- .../PropertyCmdletProviderInterfaces.cs | 2 +- .../engine/ProviderInterfaces.cs | 2 +- .../engine/ProviderNames.cs | 2 +- .../engine/ProxyCommand.cs | 2 +- .../engine/PseudoParameterBinder.cs | 2 +- .../engine/PseudoParameters.cs | 2 +- .../engine/QuestionMarkVariable.cs | 2 +- .../engine/ReflectionParameterBinder.cs | 2 +- .../engine/ScopedItemSearcher.cs | 2 +- .../engine/ScriptCommand.cs | 2 +- .../engine/ScriptCommandProcessor.cs | 2 +- .../engine/ScriptInfo.cs | 2 +- ...urityDescriptorCmdletProviderInterfaces.cs | 2 +- .../engine/SecurityManagerBase.cs | 2 +- .../engine/SerializationStrings.cs | 2 +- .../engine/SessionState.cs | 2 +- .../engine/SessionStateAliasAPIs.cs | 2 +- .../engine/SessionStateCmdletAPIs.cs | 2 +- .../engine/SessionStateContainer.cs | 2 +- .../engine/SessionStateContent.cs | 2 +- .../engine/SessionStateDriveAPIs.cs | 2 +- .../engine/SessionStateDynamicProperty.cs | 2 +- .../engine/SessionStateFunctionAPIs.cs | 2 +- .../engine/SessionStateItem.cs | 2 +- .../engine/SessionStateLocationAPIs.cs | 2 +- .../engine/SessionStateNavigation.cs | 2 +- .../engine/SessionStateProperty.cs | 2 +- .../engine/SessionStateProviderAPIs.cs | 2 +- .../engine/SessionStatePublic.cs | 2 +- .../engine/SessionStateScope.cs | 2 +- .../engine/SessionStateScopeAPIs.cs | 2 +- .../engine/SessionStateScopeEnumerator.cs | 2 +- ...SessionStateSecurityDescriptorInterface.cs | 2 +- .../engine/SessionStateStrings.cs | 2 +- .../engine/SessionStateUtils.cs | 2 +- .../engine/SessionStateVariableAPIs.cs | 2 +- .../engine/ShellVariable.cs | 2 +- .../engine/SpecialVariables.cs | 2 +- .../engine/ThirdPartyAdapter.cs | 2 +- .../engine/TransactedString.cs | 2 +- .../engine/TransactionManager.cs | 2 +- .../engine/TypeMetadata.cs | 2 +- .../engine/TypeTable.cs | 2 +- .../engine/TypeTable_GetEvent_Types_Ps1Xml.cs | 2 +- .../engine/TypeTable_TypesV3_Ps1Xml.cs | 2 +- .../engine/TypeTable_Types_Ps1Xml.cs | 2 +- .../engine/UserFeedbackParameters.cs | 2 +- .../engine/Utils.cs | 2 +- .../engine/VariableAttributeCollection.cs | 2 +- .../engine/VariableInterfaces.cs | 2 +- .../engine/VariablePath.cs | 2 +- .../engine/WinRT/IInspectable.cs | 2 +- .../engine/cmdlet.cs | 2 +- .../engine/debugger/Breakpoint.cs | 2 +- .../engine/debugger/debugger.cs | 2 +- .../engine/hostifaces/AsyncResult.cs | 2 +- .../engine/hostifaces/ChoiceDescription.cs | 2 +- .../engine/hostifaces/Command.cs | 2 +- .../engine/hostifaces/Connection.cs | 2 +- .../engine/hostifaces/ConnectionBase.cs | 2 +- .../engine/hostifaces/ConnectionFactory.cs | 2 +- .../engine/hostifaces/DefaultHost.cs | 2 +- .../engine/hostifaces/FieldDescription.cs | 2 +- .../engine/hostifaces/History.cs | 2 +- .../engine/hostifaces/HostUtilities.cs | 2 +- .../engine/hostifaces/InformationalRecord.cs | 2 +- .../engine/hostifaces/InternalHost.cs | 2 +- .../InternalHostRawUserInterface.cs | 2 +- .../hostifaces/InternalHostUserInterface.cs | 2 +- .../engine/hostifaces/ListModifier.cs | 2 +- .../engine/hostifaces/LocalConnection.cs | 2 +- .../engine/hostifaces/LocalPipeline.cs | 2 +- .../engine/hostifaces/MshHost.cs | 2 +- .../hostifaces/MshHostRawUserInterface.cs | 2 +- .../engine/hostifaces/MshHostUserInterface.cs | 2 +- .../hostifaces/NativeCultureResolver.cs | 2 +- .../engine/hostifaces/PSCommand.cs | 2 +- .../engine/hostifaces/PSDataCollection.cs | 2 +- .../engine/hostifaces/PSTask.cs | 2 +- .../engine/hostifaces/Parameter.cs | 2 +- .../engine/hostifaces/Pipeline.cs | 2 +- .../engine/hostifaces/PowerShell.cs | 2 +- .../hostifaces/PowerShellProcessInstance.cs | 2 +- .../engine/hostifaces/RunspaceInit.cs | 2 +- .../engine/hostifaces/RunspaceInvoke.cs | 2 +- .../engine/hostifaces/RunspacePool.cs | 2 +- .../engine/hostifaces/RunspacePoolInternal.cs | 2 +- .../internalHostuserInterfacesecurity.cs | 2 +- .../engine/hostifaces/pipelinebase.cs | 2 +- .../engine/interpreter/Utilities.cs | 2 +- .../engine/lang/codegen.cs | 2 +- .../engine/lang/interface/PSParseError.cs | 2 +- .../engine/lang/interface/PSParser.cs | 2 +- .../engine/lang/interface/PSToken.cs | 2 +- .../engine/lang/parserutils.cs | 2 +- .../engine/lang/scriptblock.cs | 2 +- .../engine/parser/AstVisitor.cs | 2 +- .../engine/parser/CharTraits.cs | 2 +- .../engine/parser/Compiler.cs | 2 +- .../engine/parser/ConstantValues.cs | 2 +- .../engine/parser/FusionAssemblyIdentity.cs | 2 +- .../engine/parser/GlobalAssemblyCache.cs | 2 +- .../engine/parser/PSType.cs | 2 +- .../engine/parser/Parser.cs | 2 +- .../engine/parser/Position.cs | 2 +- .../engine/parser/PreOrderVisitor.cs | 2 +- .../engine/parser/SafeValues.cs | 2 +- .../engine/parser/SemanticChecks.cs | 2 +- .../engine/parser/SymbolResolver.cs | 2 +- .../engine/parser/TypeInferenceVisitor.cs | 2 +- .../engine/parser/TypeResolver.cs | 2 +- .../engine/parser/VariableAnalysis.cs | 2 +- .../engine/parser/ast.cs | 2 +- .../engine/parser/token.cs | 2 +- .../engine/parser/tokenizer.cs | 2 +- .../engine/pipeline.cs | 2 +- .../engine/regex.cs | 2 +- .../remoting/client/ClientMethodExecutor.cs | 2 +- .../remoting/client/ClientRemotePowerShell.cs | 2 +- .../engine/remoting/client/Job.cs | 2 +- .../engine/remoting/client/Job2.cs | 2 +- .../engine/remoting/client/JobManager.cs | 2 +- .../remoting/client/JobSourceAdapter.cs | 2 +- .../remoting/client/PowerShellStreams.cs | 2 +- .../client/RemoteRunspacePoolInternal.cs | 2 +- .../remoting/client/RemotingErrorRecord.cs | 2 +- .../remoting/client/RemotingProtocol2.cs | 2 +- .../engine/remoting/client/RunspaceRef.cs | 2 +- .../engine/remoting/client/ThrottlingJob.cs | 2 +- .../remoting/client/clientremotesession.cs | 2 +- ...clientremotesessionprotocolstatemachine.cs | 2 +- .../engine/remoting/client/remotepipeline.cs | 2 +- .../engine/remoting/client/remoterunspace.cs | 2 +- .../remoting/client/remoterunspaceinfo.cs | 2 +- .../remoting/client/remotingprotocol.cs | 2 +- .../client/remotingprotocolimplementation.cs | 2 +- .../remoting/commands/ConnectPSSession.cs | 2 +- .../remoting/commands/CustomShellCommands.cs | 2 +- .../engine/remoting/commands/DebugJob.cs | 2 +- .../remoting/commands/DisconnectPSSession.cs | 2 +- .../commands/EnterPSHostProcessCommand.cs | 2 +- .../engine/remoting/commands/GetJob.cs | 2 +- .../remoting/commands/InvokeCommandCommand.cs | 2 +- .../engine/remoting/commands/JobRepository.cs | 2 +- .../commands/NewPSSessionConfigurationFile.cs | 2 +- .../NewPSSessionConfigurationOptionCommand.cs | 2 +- .../commands/NewPSSessionOptionCommand.cs | 2 +- .../remoting/commands/PSRemotingCmdlet.cs | 2 +- .../remoting/commands/PopRunspaceCommand.cs | 2 +- .../remoting/commands/PushRunspaceCommand.cs | 2 +- .../engine/remoting/commands/ReceiveJob.cs | 2 +- .../remoting/commands/ReceivePSSession.cs | 2 +- .../engine/remoting/commands/RemoveJob.cs | 2 +- .../engine/remoting/commands/ResumeJob.cs | 2 +- .../engine/remoting/commands/StartJob.cs | 2 +- .../engine/remoting/commands/StopJob.cs | 2 +- .../engine/remoting/commands/SuspendJob.cs | 2 +- .../TestPSSessionConfigurationFile.cs | 2 +- .../engine/remoting/commands/WaitJob.cs | 2 +- .../remoting/commands/getrunspacecommand.cs | 2 +- .../remoting/commands/newrunspacecommand.cs | 2 +- .../remoting/commands/remotingcommandutil.cs | 2 +- .../commands/removerunspacecommand.cs | 2 +- .../remoting/commands/runspacerepository.cs | 2 +- .../engine/remoting/common/AsyncObject.cs | 2 +- .../engine/remoting/common/DispatchTable.cs | 2 +- .../engine/remoting/common/Indexer.cs | 2 +- .../engine/remoting/common/ObjectRef.cs | 2 +- .../engine/remoting/common/PSETWTracer.cs | 2 +- .../PSSessionConfigurationTypeOption.cs | 2 +- .../common/RemoteSessionHyperVSocket.cs | 2 +- .../remoting/common/RemoteSessionNamedPipe.cs | 2 +- .../remoting/common/RunspaceConnectionInfo.cs | 2 +- .../remoting/common/RunspaceInitInfo.cs | 2 +- .../remoting/common/RunspacePoolStateInfo.cs | 2 +- .../common/WireDataFormat/EncodeAndDecode.cs | 2 +- .../RemoteDebuggingCapability.cs | 2 +- .../common/WireDataFormat/RemoteHost.cs | 2 +- .../WireDataFormat/RemoteHostEncoder.cs | 2 +- .../WireDataFormat/RemoteSessionCapability.cs | 2 +- .../WireDataFormat/RemotingDataObject.cs | 2 +- .../engine/remoting/common/fragmentor.cs | 2 +- .../engine/remoting/common/misc.cs | 2 +- .../engine/remoting/common/psstreamobject.cs | 2 +- .../engine/remoting/common/remotesession.cs | 2 +- .../remoting/common/remotingexceptions.cs | 2 +- .../engine/remoting/common/throttlemanager.cs | 2 +- .../remoting/fanin/BaseTransportManager.cs | 2 +- .../fanin/InitialSessionStateProvider.cs | 2 +- .../fanin/OutOfProcTransportManager.cs | 2 +- .../engine/remoting/fanin/PSPrincipal.cs | 2 +- .../fanin/PSSessionConfigurationData.cs | 2 +- .../remoting/fanin/PriorityCollection.cs | 2 +- .../engine/remoting/fanin/WSManNativeAPI.cs | 2 +- .../engine/remoting/fanin/WSManPlugin.cs | 2 +- .../remoting/fanin/WSManPluginFacade.cs | 2 +- .../remoting/fanin/WSManPluginShellSession.cs | 2 +- .../fanin/WSManPluginTransportManager.cs | 2 +- .../remoting/fanin/WSManTransportManager.cs | 2 +- .../remoting/host/RemoteHostMethodInfo.cs | 2 +- .../server/OutOfProcServerMediator.cs | 2 +- .../remoting/server/ServerMethodExecutor.cs | 2 +- .../remoting/server/ServerPowerShellDriver.cs | 2 +- .../remoting/server/ServerRemoteHost.cs | 2 +- .../ServerRemoteHostRawUserInterface.cs | 2 +- .../server/ServerRemoteHostUserInterface.cs | 2 +- .../server/ServerRemotingProtocol2.cs | 2 +- .../server/ServerRunspacePoolDriver.cs | 2 +- .../server/ServerSteppablePipelineDriver.cs | 2 +- .../ServerSteppablePipelineSubscriber.cs | 2 +- .../remoting/server/WSManChannelEvents.cs | 2 +- .../remoting/server/serverremotesession.cs | 2 +- .../server/serverremotesessionstatemachine.cs | 2 +- .../remoting/server/serverremotingprotocol.cs | 2 +- .../serverremotingprotocolimplementation.cs | 2 +- .../engine/runtime/Binding/Binders.cs | 2 +- .../engine/runtime/CompiledScriptBlock.cs | 2 +- .../engine/runtime/Operations/ArrayOps.cs | 2 +- .../engine/runtime/Operations/ClassOps.cs | 2 +- .../engine/runtime/Operations/MiscOps.cs | 2 +- .../engine/runtime/Operations/NumericOps.cs | 2 +- .../engine/runtime/Operations/StringOps.cs | 2 +- .../engine/runtime/Operations/VariableOps.cs | 2 +- .../engine/runtime/ScriptBlockToPowerShell.cs | 2 +- .../engine/scriptparameterbinder.cs | 2 +- .../engine/scriptparameterbindercontroller.cs | 2 +- .../engine/serialization.cs | 2 +- .../help/AliasHelpInfo.cs | 2 +- .../help/AliasHelpProvider.cs | 2 +- .../help/BaseCommandHelpInfo.cs | 2 +- .../help/CabinetAPI.cs | 2 +- .../help/CabinetNativeApi.cs | 2 +- .../help/CommandHelpProvider.cs | 2 +- .../help/DefaultCommandHelpObjectBuilder.cs | 2 +- .../help/DefaultHelpProvider.cs | 2 +- .../help/DscResourceHelpProvider.cs | 2 +- .../help/HelpCategoryInvalidException.cs | 2 +- .../help/HelpCommands.cs | 2 +- .../help/HelpCommentsParser.cs | 2 +- .../help/HelpErrorTracer.cs | 2 +- .../help/HelpFileHelpInfo.cs | 2 +- .../help/HelpFileHelpProvider.cs | 2 +- .../help/HelpInfo.cs | 2 +- .../help/HelpNotFoundException.cs | 2 +- .../help/HelpProvider.cs | 2 +- .../help/HelpProviderWithCache.cs | 2 +- .../help/HelpProviderWithFullCache.cs | 2 +- .../help/HelpRequest.cs | 2 +- .../help/HelpSystem.cs | 2 +- .../help/HelpUtils.cs | 2 +- .../help/MUIFileSearcher.cs | 2 +- .../help/MamlClassHelpInfo.cs | 2 +- .../help/MamlCommandHelpInfo.cs | 2 +- .../help/MamlNode.cs | 2 +- .../help/MamlUtil.cs | 2 +- .../help/PSClassHelpProvider.cs | 2 +- .../help/ProviderCommandHelpInfo.cs | 2 +- .../help/ProviderContext.cs | 2 +- .../help/ProviderHelpInfo.cs | 2 +- .../help/ProviderHelpProvider.cs | 2 +- .../help/RemoteHelpInfo.cs | 2 +- .../help/SaveHelpCommand.cs | 2 +- .../help/ScriptCommandHelpProvider.cs | 2 +- .../help/SyntaxHelpInfo.cs | 2 +- .../help/UpdatableHelpCommandBase.cs | 2 +- .../help/UpdatableHelpInfo.cs | 2 +- .../help/UpdatableHelpModuleInfo.cs | 2 +- .../help/UpdatableHelpSystem.cs | 2 +- .../help/UpdatableHelpUri.cs | 2 +- .../help/UpdateHelpCommand.cs | 2 +- .../logging/LogContext.cs | 2 +- .../logging/LogProvider.cs | 2 +- .../logging/MshLog.cs | 2 +- .../logging/eventlog/EventLogLogProvider.cs | 2 +- .../namespaces/AliasProvider.cs | 2 +- .../namespaces/ContainerProviderBase.cs | 2 +- .../namespaces/CoreCommandContext.cs | 2 +- .../namespaces/DriveProviderBase.cs | 2 +- .../namespaces/EnvironmentProvider.cs | 2 +- .../namespaces/FileSystemContentStream.cs | 2 +- .../namespaces/FileSystemProvider.cs | 2 +- .../namespaces/FileSystemSecurity.cs | 2 +- .../namespaces/FunctionProvider.cs | 2 +- .../namespaces/IContentProvider.cs | 2 +- .../namespaces/IContentReader.cs | 2 +- .../namespaces/IContentWriter.cs | 2 +- .../namespaces/IDynamicPropertyProvider.cs | 2 +- .../namespaces/IPermissionProvider.cs | 2 +- .../namespaces/IPropertiesProvider.cs | 2 +- .../namespaces/ItemProviderBase.cs | 2 +- .../namespaces/LocationGlobber.cs | 2 +- .../namespaces/NavigationProviderBase.cs | 2 +- .../namespaces/PathInfo.cs | 2 +- .../namespaces/ProviderBase.cs | 2 +- .../namespaces/ProviderBaseSecurity.cs | 2 +- .../ProviderDeclarationAttribute.cs | 2 +- .../namespaces/RegistryProvider.cs | 2 +- .../namespaces/RegistrySecurity.cs | 2 +- .../namespaces/RegistryWrapper.cs | 2 +- .../namespaces/SafeRegistryHandle.cs | 2 +- .../namespaces/SafeTransactionHandle.cs | 2 +- .../namespaces/SessionStateProviderBase.cs | 2 +- .../namespaces/StackInfo.cs | 2 +- .../namespaces/TransactedRegistry.cs | 2 +- .../namespaces/TransactedRegistryKey.cs | 2 +- .../namespaces/TransactedRegistrySecurity.cs | 2 +- .../namespaces/VariableProvider.cs | 2 +- .../namespaces/Win32Native.cs | 2 +- .../security/Authenticode.cs | 2 +- .../security/CatalogHelper.cs | 2 +- .../security/CredentialParameter.cs | 2 +- .../security/MshSignature.cs | 2 +- .../security/SecureStringHelper.cs | 2 +- .../security/SecurityManager.cs | 2 +- .../security/SecuritySupport.cs | 2 +- .../security/nativeMethods.cs | 2 +- .../security/wldpNativeMethods.cs | 2 +- .../config/MshConsoleLoadException.cs | 2 +- .../singleshell/config/MshSnapinInfo.cs | 2 +- .../config/MshSnapinLoadException.cs | 2 +- .../utils/ArchitectureSensitiveAttribute.cs | 2 +- .../utils/BackgroundDispatcher.cs | 2 +- .../utils/ClrFacade.cs | 2 +- .../utils/CommandDiscoveryExceptions.cs | 2 +- .../utils/CommandProcessorExceptions.cs | 2 +- .../utils/CoreProviderCmdlets.cs | 2 +- .../utils/CryptoUtils.cs | 2 +- .../utils/EncodingUtils.cs | 2 +- .../utils/ExecutionExceptions.cs | 2 +- .../utils/ExtensionMethods.cs | 2 +- .../utils/FormatAndTypeDataHelper.cs | 2 +- .../utils/FuzzyMatch.cs | 2 +- .../utils/GraphicalHostReflectionWrapper.cs | 2 +- .../utils/HostInterfacesExceptions.cs | 2 +- .../utils/IObjectReader.cs | 2 +- .../utils/IObjectWriter.cs | 2 +- .../utils/MetadataExceptions.cs | 2 +- .../utils/MshArgumentException.cs | 2 +- .../utils/MshArgumentNullException.cs | 2 +- .../utils/MshArgumentOutOfRangeException.cs | 2 +- .../utils/MshInvalidOperationException.cs | 2 +- .../utils/MshNotImplementedException.cs | 2 +- .../utils/MshNotSupportedException.cs | 2 +- .../utils/MshObjectDisposedException.cs | 2 +- .../utils/MshTraceSource.cs | 2 +- .../utils/ObjectReader.cs | 2 +- .../utils/ObjectStream.cs | 2 +- .../utils/ObjectWriter.cs | 2 +- .../utils/PInvokeDllNames.cs | 2 +- .../utils/PSTelemetryMethods.cs | 2 +- .../utils/PSTelemetryWrapper.cs | 2 +- .../utils/ParameterBinderExceptions.cs | 2 +- .../utils/ParserException.cs | 2 +- .../utils/PathUtils.cs | 2 +- .../utils/PlatformInvokes.cs | 2 +- .../utils/PowerShellETWTracer.cs | 2 +- .../utils/PowerShellExecutionHelper.cs | 2 +- .../utils/PsUtils.cs | 2 +- .../utils/ResourceManagerCache.cs | 2 +- .../utils/RuntimeException.cs | 2 +- .../utils/SessionStateExceptions.cs | 2 +- .../utils/StringUtil.cs | 2 +- .../utils/StructuredTraceSource.cs | 2 +- .../utils/Telemetry.cs | 2 +- .../utils/VTUtils.cs | 2 +- .../utils/Verbs.cs | 2 +- .../utils/assert.cs | 2 +- .../perfCounters/CounterSetInstanceBase.cs | 2 +- .../perfCounters/CounterSetRegistrarBase.cs | 2 +- .../utils/perfCounters/PSPerfCountersMgr.cs | 2 +- .../utils/tracing/EtwActivity.cs | 2 +- .../utils/tracing/EtwActivityReverter.cs | 2 +- .../EtwActivityReverterMethodInvoker.cs | 2 +- .../utils/tracing/EtwEventCorrelator.cs | 2 +- .../utils/tracing/IMethodInvoker.cs | 2 +- .../utils/tracing/PSEtwLog.cs | 2 +- .../utils/tracing/PSEtwLogProvider.cs | 2 +- .../utils/tracing/PSSysLogProvider.cs | 2 +- .../utils/tracing/SysLogProvider.cs | 2 +- .../utils/tracing/Tracing.cs | 2 +- .../utils/tracing/TracingGen.cs | 2 +- src/TypeCatalogGen/TypeCatalogGen.cs | 2 +- .../Install-PowerShellRemoting.ps1 | 2 +- src/powershell/Program.cs | 2 +- stylecop.json | 2 +- test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 | 2 +- test/common/markdown/markdown-link.tests.ps1 | 2 +- .../networktest/DockerRemoting.Tests.ps1 | 2 +- .../networktest/New-DockerTestBuild.ps1 | 14 +-- test/hosting/test_HostingBasic.cs | 2 +- test/nanoserver/nanoserver.tests.ps1 | 2 +- test/packaging/windows/msi.tests.ps1 | 2 +- test/powershell/Host/Base-Directory.Tests.ps1 | 2 +- test/powershell/Host/ConsoleHost.Tests.ps1 | 2 +- test/powershell/Host/HostUtilities.Tests.ps1 | 2 +- test/powershell/Host/Logging.Tests.ps1 | 2 +- test/powershell/Host/PSVersionTable.Tests.ps1 | 2 +- test/powershell/Host/Read-Host.Tests.ps1 | 2 +- test/powershell/Host/ScreenReader.Tests.ps1 | 2 +- test/powershell/Host/Startup.Tests.ps1 | 2 +- .../Host/TabCompletion/BugFix.Tests.ps1 | 2 +- .../TabCompletion/TabCompletion.Tests.ps1 | 2 +- .../Installer/WindowsInstaller.Tests.ps1 | 2 +- .../Language/Classes/MSFT_778492.psm1 | 2 +- .../Classes/ProtectedAccess.Tests.ps1 | 2 +- .../Scripting.Classes.Attributes.Tests.ps1 | 2 +- .../Scripting.Classes.BasicParsing.Tests.ps1 | 2 +- .../Classes/Scripting.Classes.Break.Tests.ps1 | 2 +- .../Scripting.Classes.Exceptions.Tests.ps1 | 2 +- .../Scripting.Classes.MiscOps.Tests.ps1 | 6 +- .../Scripting.Classes.Modules.Tests.ps1 | 2 +- .../Scripting.Classes.RunPath.Tests.ps1 | 2 +- .../Scripting.Classes.StaticMethod.Tests.ps1 | 8 +- .../scripting.Classes.NestedModules.tests.ps1 | 2 +- .../scripting.Classes.inheritance.tests.ps1 | 2 +- .../Classes/scripting.Classes.using.tests.ps1 | 2 +- .../Classes/scripting.enums.tests.ps1 | 2 +- .../Language/CompletionTestSupport.psm1 | 2 +- .../Interop/DotNet/DotNetAPI.Tests.ps1 | 2 +- .../Interop/DotNet/DotNetInterop.Tests.ps1 | 2 +- .../Operators/ComparisonOperator.Tests.ps1 | 2 +- .../Operators/NullConditional.Tests.ps1 | 2 +- .../Operators/PipelineChainOperator.Tests.ps1 | 2 +- .../Operators/RangeOperator.Tests.ps1 | 2 +- .../Operators/ReplaceOperator.Tests.ps1 | 2 +- .../Operators/SplitOperator.Tests.ps1 | 2 +- .../Operators/TernaryOperator.Tests.ps1 | 2 +- test/powershell/Language/Parser/Ast.Tests.ps1 | 2 +- .../Parser/AutomaticVariables.Tests.ps1 | 2 +- .../Language/Parser/BNotOperator.Tests.ps1 | 2 +- .../Language/Parser/Conversions.Tests.ps1 | 2 +- .../Parser/ExtensibleCompletion.Tests.ps1 | 2 +- .../LanguageAndParser.TestFollowup.Tests.ps1 | 2 +- .../Language/Parser/LineContinuance.Tests.ps1 | 2 +- .../Parser/MethodInvocation.Tests.ps1 | 2 +- .../Parser/ParameterBinding.Tests.ps1 | 2 +- .../Language/Parser/Parser.Tests.ps1 | 2 +- .../Language/Parser/Parsing.Tests.ps1 | 2 +- .../Parser/RedirectionOperator.Tests.ps1 | 2 +- .../Language/Parser/TypeAccelerator.Tests.ps1 | 2 +- .../Language/Parser/UsingAssembly.Tests.ps1 | 2 +- .../Language/Parser/UsingNamespace.Tests.ps1 | 2 +- .../Scripting/ActionPreference.Tests.ps1 | 2 +- .../Language/Scripting/Array.Tests.ps1 | 2 +- .../CheckRestrictedlanguage.Tests.ps1 | 2 +- .../Scripting/CmdletDeclaration.Tests.ps1 | 2 +- .../Scripting/CommonParameters.Tests.ps1 | 2 +- .../ConstrainedLanguageMode.Tests.ps1 | 2 +- .../Debugging/DebuggerCommand.Tests.ps1 | 2 +- .../Debugging/DebuggerScriptTests.Tests.ps1 | 2 +- .../Scripting/Debugging/Debugging.Tests.ps1 | 2 +- .../Debugging/DebuggingInHost.Tests.ps1 | 2 +- .../Language/Scripting/Delegates.Tests.ps1 | 2 +- .../Scripting/DeserializedMethods.Tests.ps1 | 2 +- .../DeserializedTypeConversion.Tests.ps1 | 2 +- .../Language/Scripting/DollarHook.Tests.ps1 | 2 +- .../Scripting/Dynamicparameters.Tests.ps1 | 2 +- .../Scripting/ErrorPosition.Tests.ps1 | 2 +- .../Scripting/ForeachParallel.Tests.ps1 | 2 +- .../Language/Scripting/Generics.Tests.ps1 | 2 +- ...htableToPSCustomObjectConversion.Tests.ps1 | 2 +- .../Language/Scripting/I18n.Tests.ps1 | 2 +- .../Language/Scripting/Indexer.Tests.ps1 | 2 +- .../Language/Scripting/LineEndings.Tests.ps1 | 2 +- .../Language/Scripting/MyInvocation.Tests.ps1 | 2 +- .../NativeCommandArguments.Tests.ps1 | 2 +- .../NativeCommandProcessor.Tests.ps1 | 2 +- .../NativeLinuxCommands.Tests.ps1 | 2 +- .../NativeExecution/NativeStreams.Tests.ps1 | 2 +- .../NativeUnixGlobbing.Tests.ps1 | 2 +- .../OrderedAttributeForHashTables.Tests.ps1 | 2 +- .../Scripting/OutErrorVariable.Tests.ps1 | 2 +- .../Language/Scripting/PSSerializer.Tests.ps1 | 2 +- .../Scripting/ParameterBinding.Tests.ps1 | 2 +- .../Language/Scripting/Requires.Tests.ps1 | 2 +- .../Language/Scripting/ScriptHelp.Tests.ps1 | 2 +- .../Scripting/Scripting.Followup.Tests.ps1 | 2 +- .../SuppressAnsiEscapeSequence.Tests.ps1 | 2 +- .../Scripting/SwitchParallel.Tests.ps1 | 2 +- .../Language/Scripting/TestsOnWinFullOnly.ps1 | 2 +- .../Language/Scripting/Trap.Tests.ps1 | 2 +- .../Language/Scripting/TryCatch.Tests.ps1 | 2 +- .../Modules/CimCmdlets/CimInstance.Tests.ps1 | 2 +- .../Modules/CimCmdlets/CimSession.Tests.ps1 | 2 +- .../Modules/CimCmdlets/Get-CimClass.Tests.ps1 | 2 +- .../CompatiblePSEditions.Module.Tests.ps1 | 2 +- .../Enter-PSHostProcess.Tests.ps1 | 2 +- .../ForEach-Object.Tests.ps1 | 2 +- .../Get-Command.Tests.ps1 | 2 +- .../Get-Module.Tests.ps1 | 2 +- .../Get-PSHostProcessInfo.Tests.ps1 | 2 +- .../History.Tests.ps1 | 2 +- .../Import-Module.Tests.ps1 | 2 +- .../Microsoft.PowerShell.Core/Job.Tests.ps1 | 2 +- .../ModuleConstraint.Tests.ps1 | 2 +- .../ModuleManifest.Tests.ps1 | 2 +- .../Out-Default.Tests.ps1 | 2 +- .../Out-Host.Tests.ps1 | 2 +- .../PSSessionConfiguration.Tests.ps1 | 4 +- ...ster.Commands.Cmdlets.GetCommand.Tests.ps1 | 2 +- .../RemoteGetModule.Tests.ps1 | 2 +- .../RemoteImportModule.Tests.ps1 | 2 +- .../RemotingCmdlets.Tests.ps1 | 2 +- .../Remove-Module.Tests.ps1 | 2 +- .../Set-PSDebug.Tests.ps1 | 2 +- .../Where-Object.Tests.ps1 | 2 +- .../CounterTestHelperFunctions.ps1 | 2 +- .../Export-Counter.Tests.ps1 | 6 +- .../Get-Counter.Tests.ps1 | 2 +- .../Get-WinEvent.Tests.ps1 | 2 +- .../Import-Counter.Tests.ps1 | 6 +- .../New-WinEvent.Tests.ps1 | 12 +- ...Cmdlets.LocalAccounts.LocalGroup.Tests.ps1 | 2 +- ...s.LocalAccounts.LocalGroupMember.Tests.ps1 | 2 +- ....Cmdlets.LocalAccounts.LocalUser.Tests.ps1 | 2 +- .../Add-Content.Tests.ps1 | 2 +- .../Alias.Tests.ps1 | 2 +- .../Clear-Content.Tests.ps1 | 2 +- .../Clear-EventLog.Tests.ps1 | 2 +- .../Clear-Item.Tests.ps1 | 2 +- .../Clipboard.Tests.ps1 | 2 +- .../ControlService.Tests.ps1 | 2 +- .../Convert-Path.Tests.ps1 | 2 +- .../Copy.Item.Tests.ps1 | 2 +- .../FileSystem.Tests.ps1 | 2 +- .../FileSystemProviderExtended.Tests.ps1 | 2 +- .../FunctionProvider.Tests.ps1 | 2 +- .../Get-ChildItem.Tests.ps1 | 2 +- .../Get-ComputerInfo.Tests.ps1 | 2 +- .../Get-Content.Tests.ps1 | 10 +- .../Get-EventLog.Tests.ps1 | 2 +- .../Get-HotFix.Tests.ps1 | 2 +- .../Get-Item.Tests.ps1 | 2 +- .../Get-ItemProperty.Tests.ps1 | 2 +- .../Get-Location.Tests.ps1 | 2 +- .../Get-PSDrive.Tests.ps1 | 2 +- .../Get-PSProvider.Tests.ps1 | 2 +- .../Get-Process.Tests.ps1 | 2 +- .../Get-Service.Tests.ps1 | 2 +- .../Hierarchical-Path.Tests.ps1 | 2 +- .../ItemProperty.Tests.ps1 | 2 +- .../Join-Path.Tests.ps1 | 2 +- .../Move-Item.Tests.ps1 | 2 +- .../New-EventLog.Tests.ps1 | 2 +- .../New-Item.Tests.ps1 | 2 +- .../New-PSDrive.Tests.ps1 | 2 +- .../PSDrive.Tests.ps1 | 2 +- ...mands.Cmdlets.NoNewlineParameter.Tests.ps1 | 2 +- .../Pop-Location.Tests.ps1 | 2 +- .../Push-Location.Tests.ps1 | 2 +- .../Registry.Tests.ps1 | 2 +- .../Remove-EventLog.Tests.ps1 | 2 +- .../Remove-Item.Tests.ps1 | 2 +- .../Rename-Computer.Tests.ps1 | 2 +- .../Rename-Item.Tests.ps1 | 2 +- .../Resolve-Path.Tests.ps1 | 2 +- .../Restart-Computer.Tests.ps1 | 2 +- .../Set-Content.Tests.ps1 | 2 +- .../Set-Item.Tests.ps1 | 2 +- .../Set-Location.Tests.ps1 | 2 +- .../Set-Service.Tests.ps1 | 2 +- .../Split-Path.Tests.ps1 | 2 +- .../Start-Process.Tests.ps1 | 2 +- .../Stop-Computer.Tests.ps1 | 2 +- .../Test-Connection.Tests.ps1 | 2 +- .../Test-Path.Tests.ps1 | 2 +- .../TimeZone.Tests.ps1 | 2 +- .../Unimplemented-Cmdlet.Tests.ps1 | 2 +- .../UnixStat.Tests.ps1 | 2 +- .../Variable.Tests.ps1 | 2 +- .../AclCmdlets.Tests.ps1 | 2 +- .../AmsiInterface.Tests.ps1 | 2 +- .../CertificateProvider.Tests.ps1 | 2 +- .../CmsMessage.Tests.ps1 | 2 +- .../CmsMessage2.Tests.ps1 | 2 +- .../ConstrainedLanguageDebugger.Tests.ps1 | 4 +- .../ConstrainedLanguageModules.Tests.ps1 | 2 +- .../ConstrainedLanguageRestriction.Tests.ps1 | 2 +- .../ConstrainedLanguageValidation.Tests.ps1 | 2 +- .../ExecutionPolicy.Tests.ps1 | 2 +- .../FileCatalog.Tests.ps1 | 2 +- .../GetCredential.Tests.ps1 | 2 +- .../SecureString.Tests.ps1 | 2 +- .../UserConfigProviderModVersion1.psm1 | 2 +- .../UserConfigProviderModVersion2.psm1 | 2 +- .../UserConfigProviderModVersion3.psm1 | 2 +- .../DSCResources/scriptdsc/scriptdsc.psd1 | 2 +- .../scriptdsc/scriptdsc.schema.psm1 | 2 +- .../UserConfigProv/UserConfigProv.psd1 | 2 +- .../certificateCommon.psm1 | 2 +- .../Add-Member.Tests.ps1 | 2 +- .../Add-Type.Tests.ps1 | 2 +- .../Clear-Variable.Tests.ps1 | 2 +- .../Compare-Object.Tests.ps1 | 2 +- .../ConvertFrom-Csv.Tests.ps1 | 2 +- .../ConvertFrom-Json.Tests.ps1 | 2 +- .../ConvertFrom-SddlString.ps1 | 2 +- .../ConvertFrom-StringData.Tests.ps1 | 2 +- .../ConvertTo-Csv.Tests.ps1 | 2 +- .../ConvertTo-Html.Tests.ps1 | 2 +- .../ConvertTo-Json.Tests.ps1 | 2 +- .../ConvertTo-SecureString.Tests.ps1 | 2 +- .../ConvertTo-Xml.Tests.ps1 | 2 +- .../Debug-Runspace.Tests.ps1 | 2 +- .../Enable-RunspaceDebug.Tests.ps1 | 2 +- .../Environment-Variables.Tests.ps1 | 2 +- .../Eventing.Tests.ps1 | 2 +- .../Export-Alias.Tests.ps1 | 2 +- .../Export-Csv.Tests.ps1 | 2 +- .../Export-FormatData.Tests.ps1 | 2 +- .../Foreach-Object-Parallel.Tests.ps1 | 2 +- .../Format-Custom.Tests.ps1 | 2 +- .../Format-Hex.Tests.ps1 | 2 +- .../Format-List.Tests.ps1 | 2 +- .../Format-Table.Tests.ps1 | 2 +- .../Format-Wide.Tests.ps1 | 2 +- .../Get-Alias.Tests.ps1 | 2 +- .../Get-Command.Tests.ps1 | 2 +- .../Get-Culture.Tests.ps1 | 2 +- .../Get-Date.Tests.ps1 | 2 +- .../Get-Error.Tests.ps1 | 2 +- .../Get-Event.Tests.ps1 | 2 +- .../Get-EventSubscriber.Tests.ps1 | 2 +- .../Get-FileHash.Tests.ps1 | 2 +- .../Get-FormatData.Tests.ps1 | 2 +- .../Get-Host.Tests.ps1 | 2 +- .../Get-Member.Tests.ps1 | 2 +- .../Get-PSBreakpoint.Tests.ps1 | 2 +- .../Get-PSCallStack.Tests.ps1 | 2 +- .../Get-Random.Tests.ps1 | 2 +- .../Get-RunspaceDebug.Tests.ps1 | 2 +- .../Get-TraceSource.Tests.ps1 | 2 +- .../Get-UICulture.Tests.ps1 | 2 +- .../Get-Unique.Tests.ps1 | 2 +- .../Get-Uptime.Tests.ps1 | 2 +- .../Get-Variable.Tests.ps1 | 2 +- .../Get-Verb.Tests.ps1 | 2 +- .../Group-Object.Tests.ps1 | 2 +- .../Implicit.Remoting.Tests.ps1 | 2 +- .../Import-Alias.Tests.ps1 | 2 +- .../Import-Csv.Tests.ps1 | 2 +- .../Import-LocalizedData.Tests.ps1 | 2 +- .../ImportExportCSV.Delimiter.Tests.ps1 | 2 +- .../Invoke-Expression.Tests.ps1 | 2 +- .../Invoke-Item.Tests.ps1 | 2 +- .../Join-String.Tests.ps1 | 2 +- .../Json.Tests.ps1 | 2 +- .../JsonObject.Tests.ps1 | 2 +- .../MarkdownCmdlets.Tests.ps1 | 2 +- .../Measure-Command.Tests.ps1 | 2 +- .../Measure-Object.Tests.ps1 | 2 +- .../MiscCmdletUpdates.Tests.ps1 | 2 +- .../New-Alias.Tests.ps1 | 2 +- .../New-Event.Tests.ps1 | 2 +- .../New-Guid.Tests.ps1 | 2 +- .../New-Object.Tests.ps1 | 2 +- .../New-TemporaryFile.Tests.ps1 | 2 +- .../New-TimeSpan.Tests.ps1 | 2 +- .../New-Variable.Tests.ps1 | 2 +- .../Out-File.Tests.ps1 | 2 +- .../Out-String.Tests.ps1 | 2 +- .../PowerShellData.tests.ps1 | 2 +- .../Read-Host.Tests.ps1 | 2 +- .../Register-EngineEvent.Tests.ps1 | 2 +- .../Register-ObjectEvent.Tests.ps1 | 2 +- .../Remove-Alias.Tests.ps1 | 2 +- .../Remove-Event.Tests.ps1 | 2 +- .../Remove-PSBreakpoint.Tests.ps1 | 2 +- .../Remove-TypeData.Tests.ps1 | 2 +- .../Remove-Variable.Tests.ps1 | 2 +- .../RunspaceCmdlets.Tests.ps1 | 2 +- .../Select-Object.Tests.ps1 | 2 +- .../Select-String.Tests.ps1 | 2 +- .../Select-Xml.Tests.ps1 | 2 +- .../Send-MailMessage.Tests.ps1 | 2 +- .../Set-Alias.Tests.ps1 | 2 +- .../Set-Date.Tests.ps1 | 2 +- .../Set-PSBreakpoint.Tests.ps1 | 2 +- .../Set-Variable.Tests.ps1 | 2 +- .../Sort-Object.Tests.ps1 | 2 +- .../Start-Sleep.Tests.ps1 | 2 +- .../Tee-Object.Tests.ps1 | 2 +- .../Test-Json.Tests.ps1 | 2 +- .../Test-Mocks.ps1 | 2 +- .../Trace-Command.Tests.ps1 | 2 +- .../Unblock-File.Tests.ps1 | 2 +- .../Unimplemented-Cmdlet.Tests.ps1 | 2 +- .../Update-FormatData.Tests.ps1 | 2 +- .../Update-List.Tests.ps1 | 2 +- .../Update-TypeData.Tests.ps1 | 2 +- .../Wait-Debugger.Tests.ps1 | 2 +- .../Wait-Event.Tests.ps1 | 2 +- .../WebCmdlets.Tests.ps1 | 2 +- .../Write-Debug.Tests.ps1 | 2 +- .../Write-Error.Tests.ps1 | 2 +- .../Write-Host.Tests.ps1 | 2 +- .../Write-Output.Tests.ps1 | 2 +- .../Write-Progress.Tests.ps1 | 2 +- .../Write-Stream.Tests.ps1 | 2 +- .../Write-Verbose.Tests.ps1 | 2 +- .../XMLCommand.Tests.ps1 | 2 +- .../alias.tests.ps1 | 2 +- .../clixml.tests.ps1 | 2 +- .../command.tests.ps1 | 2 +- .../object.tests.ps1 | 2 +- .../string.tests.ps1 | 2 +- .../typedata.tests.ps1 | 2 +- .../Start-Transcript.Tests.ps1 | 2 +- .../ConfigProvider.Tests.ps1 | 2 +- .../CredSSP.Tests.ps1 | 2 +- .../TestWSMan.Tests.ps1 | 4 +- .../MOF-Compilation.Tests.ps1 | 2 +- .../PSDesiredStateConfiguration.Tests.ps1 | 2 +- .../configuration.Tests.ps1 | 2 +- .../PSDiagnostics/PSDiagnostics.Tests.ps1 | 2 +- .../Modules/PSReadLine/PSReadLine.Tests.ps1 | 2 +- .../PackageManagement.Tests.ps1 | 2 +- .../PowerShellGet/PowerShellGet.Tests.ps1 | 2 +- .../Modules/ThreadJob/ThreadJob.Tests.ps1 | 2 +- .../Provider/AutomountSubstDrive.ps1 | 2 +- .../Provider/AutomountSubstDriveCore.ps1 | 2 +- .../powershell/Provider/AutomountVHDDrive.ps1 | 2 +- .../Pester.AutomountedDrives.Tests.ps1 | 2 +- .../Provider/ProviderIntrinsics.Tests.ps1 | 2 +- test/powershell/SDK/Breakpoint.Tests.ps1 | 2 +- test/powershell/SDK/Json.Tests.ps1 | 2 +- test/powershell/SDK/PSDebugging.Tests.ps1 | 2 +- .../engine/Api/BasicEngine.Tests.ps1 | 2 +- .../engine/Api/GetNewClosure.Tests.ps1 | 4 +- .../engine/Api/InitialSessionState.Tests.ps1 | 2 +- .../engine/Api/LanguagePrimitive.Tests.ps1 | 2 +- .../engine/Api/ProxyCommand.Tests.ps1 | 2 +- .../engine/Api/Serialization.Tests.ps1 | 2 +- .../Api/TaskBasedAsyncPowerShellAPI.Tests.ps1 | 2 +- .../engine/Api/TypeInference.Tests.ps1 | 2 +- .../engine/Basic/Assembly.LoadFrom.Tests.ps1 | 2 +- .../Basic/Assembly.LoadNative.Tests.ps1 | 2 +- .../Assembly.LoadWithPartialName.Tests.ps1 | 2 +- .../Assembly.LoadedInSeparateALC.Tests.ps1 | 2 +- .../engine/Basic/Attributes.Tests.ps1 | 2 +- .../engine/Basic/CommandDiscovery.Tests.ps1 | 2 +- .../engine/Basic/Credential.Tests.ps1 | 2 +- .../engine/Basic/DefaultCommands.Tests.ps1 | 2 +- .../engine/Basic/Encoding.Tests.ps1 | 2 +- .../engine/Basic/PropertyAccessor.Tests.ps1 | 2 +- .../engine/Basic/ProxyCommand.tests.ps1 | 2 +- .../engine/Basic/SemanticVersion.Tests.ps1 | 2 +- .../Basic/StandardLibraryTypes.Tests.ps1 | 2 +- .../engine/Basic/Telemetry.Tests.ps1 | 2 +- .../engine/Basic/TypeResolution.Tests.ps1 | 2 +- .../engine/Basic/ValidateAttributes.Tests.ps1 | 116 +++++++++--------- .../powershell/engine/COM/COM.Basic.Tests.ps1 | 2 +- test/powershell/engine/Cdxml/Cdxml.Tests.ps1 | 2 +- .../Cdxml/assets/CimTest/CdxmlTest.psd1 | 2 +- test/powershell/engine/ETS/Adapter.Tests.ps1 | 2 +- .../engine/ETS/CimAdapter.Tests.ps1 | 2 +- .../powershell/engine/ETS/TypeTable.Tests.ps1 | 2 +- ...nableDisable-ExperimentalFeature.Tests.ps1 | 2 +- .../ExperimentalFeature.Basic.Tests.ps1 | 2 +- .../Get-ExperimentalFeature.Tests.ps1 | 2 +- .../assets/ExpTest/ExpTest.cs | 2 +- .../assets/ExpTest/ExpTest.psd1 | 2 +- .../assets/ExpTest/ExpTest.psm1 | 2 +- .../engine/Formatting/BugFix.Tests.ps1 | 2 +- .../engine/Formatting/ErrorView.Tests.ps1 | 2 +- .../Help/HelpSystem.OnlineHelp.Tests.ps1 | 2 +- .../engine/Help/HelpSystem.Tests.ps1 | 2 +- .../engine/Help/UpdatableHelpSystem.Tests.ps1 | 2 +- test/powershell/engine/Job/Jobs.Tests.ps1 | 2 +- .../engine/Module/ModulePath.Tests.ps1 | 2 +- .../Module/ModuleSpecification.Tests.ps1 | 2 +- .../engine/Module/NewModuleManifest.Tests.ps1 | 2 +- .../Module/SubmodulePathInManifest.Tests.ps1 | 10 +- .../Module/TestModuleManifest.Tests.ps1 | 2 +- .../Module/UpdateModuleManifest.Tests.ps1 | 2 +- .../2.5/NestedRequiredModule1.psd1 | 2 +- .../2.5/NestedRequiredModule1.psm1 | 2 +- .../BooleanParameterDCR.Tests.ps1 | 2 +- .../NullableBooleanDCR.Tests.ps1 | 2 +- .../ParameterBinding.Tests.ps1 | 2 +- .../StaticParameterBinder.Tests.ps1 | 2 +- .../ImplicitRemotingBatching.Tests.ps1 | 2 +- .../InvokeCommandRemoteDebug.Tests.ps1 | 2 +- .../engine/Remoting/PSSession.Tests.ps1 | 2 +- .../Remoting/RemoteSession.Basic.Tests.ps1 | 2 +- .../RemoteSession.Disconnect.Tests.ps1 | 2 +- .../Remoting/RoleCapabilityFiles.Tests.ps1 | 2 +- .../engine/Remoting/RunspacePool.Tests.ps1 | 2 +- .../engine/Remoting/SSHRemotingAPI.Tests.ps1 | 2 +- .../Remoting/SSHRemotingCmdlets.Tests.ps1 | 2 +- .../engine/Remoting/SessionOption.Tests.ps1 | 2 +- .../CimCmdletsResources.Tests.ps1 | 2 +- .../ConsoleHostResources.Tests.ps1 | 2 +- .../DotNetEventingResources.Tests.ps1 | 2 +- .../ManagementCommandsResources.Tests.ps1 | 2 +- .../ResourceValidation/SMAResources.Tests.ps1 | 2 +- .../SecurityResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/TestRunner.ps1 | 2 +- .../UtilityResources.Tests.ps1 | 2 +- .../WSManResources.Tests.ps1 | 2 +- .../Security/UntrustedDataMode.Tests.ps1 | 2 +- .../Start-CodeCoverageRun.ps1 | 2 +- .../Modules/HelpersCommon/HelpersCommon.psd1 | 2 +- .../Modules/HelpersCommon/HelpersCommon.psm1 | 2 +- .../HelpersDebugger/HelpersDebugger.psd1 | 4 +- .../HelpersDebugger/HelpersDebugger.psm1 | 2 +- .../Modules/HelpersHostCS/HelpersHostCS.psd1 | 2 +- .../Modules/HelpersHostCS/HelpersHostCS.psm1 | 2 +- .../HelpersLanguage/HelpersLanguage.psd1 | 2 +- .../HelpersLanguage/HelpersLanguage.psm1 | 4 +- .../HelpersRemoting/HelpersRemoting.psd1 | 2 +- .../HelpersRemoting/HelpersRemoting.psm1 | 2 +- .../HelpersSecurity/HelpersSecurity.psd1 | 2 +- .../HelpersSecurity/HelpersSecurity.psm1 | 2 +- .../Modules/HttpListener/HttpListener.psd1 | 2 +- .../Modules/HttpListener/HttpListener.psm1 | 2 +- .../Microsoft.PowerShell.RemotingTools.psd1 | 4 +- .../Microsoft.PowerShell.RemotingTools.psm1 | 16 +-- test/tools/Modules/PSSysLog/PSSysLog.psd1 | 2 +- test/tools/Modules/PSSysLog/PSSysLog.psm1 | 2 +- .../Modules/WebListener/WebListener.psm1 | 2 +- test/tools/OpenCover/OpenCover.psd1 | 2 +- test/tools/OpenCover/OpenCover.psm1 | 2 +- test/tools/TestExe/TestExe.cs | 2 +- test/tools/TestService/Program.cs | 2 +- test/tools/TestService/Service1.Designer.cs | 2 +- test/tools/TestService/Service1.cs | 2 +- test/tools/WebListener/Constants.cs | 2 +- .../WebListener/Controllers/AuthController.cs | 2 +- .../WebListener/Controllers/CertController.cs | 2 +- .../Controllers/CompressionController.cs | 2 +- .../Controllers/DelayController.cs | 2 +- .../WebListener/Controllers/DosController.cs | 2 +- .../Controllers/EncodingController.cs | 2 +- .../WebListener/Controllers/GetController.cs | 2 +- .../WebListener/Controllers/HomeController.cs | 2 +- .../WebListener/Controllers/LinkController.cs | 2 +- .../Controllers/MultipartController.cs | 2 +- .../Controllers/RedirectController.cs | 2 +- .../Controllers/ResponseController.cs | 2 +- .../Controllers/ResponseHeadersController.cs | 2 +- .../Controllers/ResumeController.cs | 2 +- .../Controllers/RetryController.cs | 2 +- test/tools/WebListener/DeflateFilter.cs | 2 +- test/tools/WebListener/GzipFilter.cs | 2 +- .../WebListener/Models/ErrorViewModel.cs | 2 +- test/tools/WebListener/Program.cs | 2 +- test/tools/WebListener/Startup.cs | 2 +- test/xUnit/Asserts/PriorityAttribute.cs | 2 +- test/xUnit/Asserts/PriorityOrderer.cs | 2 +- test/xUnit/csharp/test_Binders.cs | 2 +- test/xUnit/csharp/test_CorePsPlatform.cs | 2 +- test/xUnit/csharp/test_ExtensionMethods.cs | 2 +- test/xUnit/csharp/test_FileSystemProvider.cs | 2 +- test/xUnit/csharp/test_MshSnapinInfo.cs | 2 +- test/xUnit/csharp/test_NamedPipe.cs | 2 +- test/xUnit/csharp/test_PSConfiguration.cs | 2 +- test/xUnit/csharp/test_PSObject.cs | 2 +- test/xUnit/csharp/test_PSVersionInfo.cs | 2 +- test/xUnit/csharp/test_PowerShellAPI.cs | 2 +- test/xUnit/csharp/test_Runspace.cs | 2 +- test/xUnit/csharp/test_SecuritySupport.cs | 2 +- test/xUnit/csharp/test_SessionState.cs | 2 +- test/xUnit/csharp/test_Utils.cs | 2 +- test/xUnit/csharp/test_WildcardPattern.cs | 2 +- tools/ResxGen/ResxGen.ps1 | 2 +- tools/ResxGen/ResxGen.psm1 | 2 +- tools/Sign-Package.ps1 | 2 +- tools/WindowsCI.psm1 | 2 +- tools/Xml/Xml.psm1 | 2 +- tools/ci.psm1 | 2 +- tools/failingTests/fail.tests.ps1 | 2 +- tools/install-powershell.ps1 | 2 +- tools/install-powershell.sh | 2 +- tools/installpsh-amazonlinux.sh | 2 +- tools/packaging/packaging.psd1 | 2 +- tools/packaging/packaging.psm1 | 2 +- .../projects/nuget/powershell.nuspec | 2 +- tools/performance/PowerShell.Regions.xml | 2 +- .../GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- .../PowerShellPackage.ps1 | 2 +- .../dockerInstall.psm1 | 2 +- .../wix.psm1 | 2 +- .../SyncGalleryToAzArtifacts.psm1 | 2 +- tools/releaseBuild/createComplianceFolder.ps1 | 2 +- tools/releaseBuild/generatePackgeSigning.ps1 | 2 +- .../macOS/PowerShellPackageVsts.ps1 | 2 +- tools/releaseBuild/updateSigning.ps1 | 2 +- tools/releaseBuild/vstsbuild.ps1 | 2 +- tools/releaseTools.psm1 | 2 +- tools/windows/Reset-PWSHSystemPath.ps1 | 2 +- 1760 files changed, 1861 insertions(+), 1861 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 572c44334a3..c94b049a896 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 7b8a65c596d..8548101590f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -196,7 +196,7 @@ Additional references: * For `.h`, `.cpp`, and `.cs` files use the copyright header with empty line after it: ```c# - // Copyright (c) Microsoft Corporation. All rights reserved. + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. ``` @@ -204,7 +204,7 @@ Additional references: * For `.ps1` and `.psm1` files use the copyright header with empty line after it: ```powershell - # Copyright (c) Microsoft Corporation. All rights reserved. + # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ``` @@ -214,7 +214,7 @@ Additional references: ```powershell Author = "PowerShell" Company = "Microsoft Corporation" - Copyright = "Copyright (c) Microsoft Corporation. All rights reserved." + Copyright = "Copyright (c) Microsoft Corporation." ``` is at the top. diff --git a/LICENSE.txt b/LICENSE.txt index c0903c1e1d0..6eb8dc060c3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ PowerShell -Copyright (c) Microsoft Corporation. All rights reserved. +Copyright (c) Microsoft Corporation. MIT License diff --git a/build.psm1 b/build.psm1 index 081134e02ce..86c7acd50b2 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Set-StrictMode -Version 3.0 diff --git a/demos/Apache/Apache/Apache.psm1 b/demos/Apache/Apache/Apache.psm1 index 489502a6d39..5f980f26bae 100644 --- a/demos/Apache/Apache/Apache.psm1 +++ b/demos/Apache/Apache/Apache.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #Region utility functions diff --git a/demos/Apache/apache-demo.ps1 b/demos/Apache/apache-demo.ps1 index 1f5d60587d7..1168bc7a39d 100644 --- a/demos/Apache/apache-demo.ps1 +++ b/demos/Apache/apache-demo.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module $PSScriptRoot/Apache/Apache.psm1 diff --git a/demos/Azure/Azure-Demo.ps1 b/demos/Azure/Azure-Demo.ps1 index f75aa3e2d02..22b316686a7 100644 --- a/demos/Azure/Azure-Demo.ps1 +++ b/demos/Azure/Azure-Demo.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ### The techniques used in this demo are documented at diff --git a/demos/DSC/dsc-demo.ps1 b/demos/DSC/dsc-demo.ps1 index f393916408b..3abd642a3b4 100644 --- a/demos/DSC/dsc-demo.ps1 +++ b/demos/DSC/dsc-demo.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #Get Distro type and set distro-specific variables diff --git a/demos/Docker-PowerShell/Docker-PowerShell.ps1 b/demos/Docker-PowerShell/Docker-PowerShell.ps1 index 4639f7ee1d0..51b07f2d345 100644 --- a/demos/Docker-PowerShell/Docker-PowerShell.ps1 +++ b/demos/Docker-PowerShell/Docker-PowerShell.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 diff --git a/demos/SystemD/SystemD/SystemD.psm1 b/demos/SystemD/SystemD/SystemD.psm1 index b127a2e5169..770451bdd05 100644 --- a/demos/SystemD/SystemD/SystemD.psm1 +++ b/demos/SystemD/SystemD/SystemD.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Function Get-SystemDJournal { diff --git a/demos/SystemD/journalctl-demo.ps1 b/demos/SystemD/journalctl-demo.ps1 index c979a97467b..1fe7198e4b7 100644 --- a/demos/SystemD/journalctl-demo.ps1 +++ b/demos/SystemD/journalctl-demo.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module $PSScriptRoot/SystemD/SystemD.psm1 diff --git a/demos/crontab/CronTab/CronTab.psd1 b/demos/crontab/CronTab/CronTab.psd1 index df7d8149420..aabc48e572e 100755 --- a/demos/crontab/CronTab/CronTab.psd1 +++ b/demos/crontab/CronTab/CronTab.psd1 @@ -19,7 +19,7 @@ Author = 'PowerShell' CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' # Description of the functionality provided by this module Description = 'Sample module for managing CronTab' diff --git a/demos/crontab/CronTab/CronTab.psm1 b/demos/crontab/CronTab/CronTab.psm1 index 1b5bcfb2b79..d354419c9bf 100644 --- a/demos/crontab/CronTab/CronTab.psm1 +++ b/demos/crontab/CronTab/CronTab.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Collections.Generic diff --git a/demos/crontab/crontab.ps1 b/demos/crontab/crontab.ps1 index 72cc084d41e..3d0ee0741ea 100644 --- a/demos/crontab/crontab.ps1 +++ b/demos/crontab/crontab.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module $PSScriptRoot/CronTab/CronTab.psd1 diff --git a/demos/dsc.ps1 b/demos/dsc.ps1 index 8f93dd507c3..c59be643edc 100644 --- a/demos/dsc.ps1 +++ b/demos/dsc.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # DSC MOF Compilation diff --git a/demos/powershellget/PowerShellGet.ps1 b/demos/powershellget/PowerShellGet.ps1 index 0dc33f85c46..e93216851da 100644 --- a/demos/powershellget/PowerShellGet.ps1 +++ b/demos/powershellget/PowerShellGet.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #region find, install, update, uninstall the PowerShell scripts from an online repository. diff --git a/demos/python/class1.ps1 b/demos/python/class1.ps1 index 291677fd948..d79e6c7ff20 100644 --- a/demos/python/class1.ps1 +++ b/demos/python/class1.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # diff --git a/demos/python/demo_script.ps1 b/demos/python/demo_script.ps1 index 586e14a2085..dfa5bb5f6b4 100644 --- a/demos/python/demo_script.ps1 +++ b/demos/python/demo_script.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # diff --git a/demos/python/inline_python.ps1 b/demos/python/inline_python.ps1 index fdad32a8601..71b65215f74 100644 --- a/demos/python/inline_python.ps1 +++ b/demos/python/inline_python.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # diff --git a/demos/rest/rest.ps1 b/demos/rest/rest.ps1 index 3f2364f9507..f40b49b6538 100644 --- a/demos/rest/rest.ps1 +++ b/demos/rest/rest.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #----------------- diff --git a/docker/tests/containerTestCommon.psm1 b/docker/tests/containerTestCommon.psm1 index b34f097b95c..c6b540abd77 100644 --- a/docker/tests/containerTestCommon.psm1 +++ b/docker/tests/containerTestCommon.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $script:forcePull = $true diff --git a/docs/host-powershell/sample/MyApp/Program.cs b/docs/host-powershell/sample/MyApp/Program.cs index 1bd9f883ca3..fc54fa2d709 100644 --- a/docs/host-powershell/sample/MyApp/Program.cs +++ b/docs/host-powershell/sample/MyApp/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs index 09297dcdc20..2e914a2299a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.CompilerServices; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs index b7e418e05b6..1dcfaa482f2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 c76fb819697..302fd16d9f1 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 7f9a1da4057..2de029c25f8 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 9b8b69fe6e8..6420fe28909 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs index aee88fd57d6..b0b95d14c50 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ef334a93c95..a3826487e24 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 13fd5ffa66a..c462d5b9918 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 f77e8a04bba..fd44d922009 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 bec0749dbd7..74f4a571dd2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 da3808459af..40dff3422a2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 2ebebfec1c6..4d4ff5d6ec5 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs index 20da97bbcc0..5dee76e5f3c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3ed5511b802..3dbae04b726 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 74ea55fa3b0..55cf540c0e8 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 36c72ae697c..49b77c4830a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 7e9bdb3d90e..4f8b0e3a986 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 aa04d2d2aa7..d55532e805e 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs index 2c27fe777f5..fbd780450ab 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs index ec8b1c6f867..b351813c4d4 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 5bf1f535741..720f5537d2b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 57ce642c373..b1ef21600ed 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 bb58c6a0b84..648f6cfb327 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 753487de760..06754aae168 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index b3571dbccc6..0c2032720a0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 e9c29619488..ba5f6125a7f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs index c648807d833..459c777c817 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index 3585c464e8c..b4d58032739 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index 44daaabed95..444dcd1f32c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs index ee83d12ff26..f2d520eef2c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index f22cd2a8b53..d53403d5e81 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs index 17da1ae330a..e34ad952d50 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index 7c37b7c4610..c7f2ab4c6a3 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs index afbdf49343c..20fae29b593 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index abad4702e8b..714a192081a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs index 7dc5281bcc7..03bf6ce61d4 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // #define LOGENABLE // uncomment this line to enable the log, diff --git a/src/Microsoft.Management.UI.Internal/CommonHelper.cs b/src/Microsoft.Management.UI.Internal/CommonHelper.cs index b9e1249f283..c9492c701d6 100644 --- a/src/Microsoft.Management.UI.Internal/CommonHelper.cs +++ b/src/Microsoft.Management.UI.Internal/CommonHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpParagraphBuilder.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpParagraphBuilder.cs index ce1feafc422..8667afa3a62 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpParagraphBuilder.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpParagraphBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpViewModel.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpViewModel.cs index 4814f109890..1b8ee0e8400 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml index 15d3ed562c7..2b2a8fe60b1 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml.cs index 8fb5a65ebb6..a2a23e13900 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindow.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindowSettings.Designer.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindowSettings.Designer.cs index 03f214dd60d..937429ebf09 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindowSettings.Designer.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/HelpWindowSettings.Designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. //------------------------------------------------------------------------------ // diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs index 26005f6467f..822e4c05026 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs index 22094797073..e71a27bac8b 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml b/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml index 47877ddb78f..d99c86c2a6a 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml.cs b/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml.cs index 4687758b485..5d499d47f71 100644 --- a/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/HelpWindow/SettingsDialog.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationButton.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationButton.cs index dbfa42ed53c..40f3e9e15a9 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationButton.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationImage.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationImage.cs index d542ee0654f..1c0690a43c9 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationImage.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationImage.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlock.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlock.cs index 44fbd38dff4..50db1bb78c1 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlock.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlock.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlockAutomationPeer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlockAutomationPeer.cs index 79950b95b4e..6de73299abb 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlockAutomationPeer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/AutomationTextBlockAutomationPeer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/BooleanBoxes.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/BooleanBoxes.cs index f75bad7e982..92d50d5d007 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/BooleanBoxes.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/BooleanBoxes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/CommandHelper.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/CommandHelper.cs index 7316b3e50e9..c9c8606f899 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/CommandHelper.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/CommandHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/CustomTypeComparer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/CustomTypeComparer.cs index 49b1beb54fc..6b0db6d5f95 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/CustomTypeComparer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/CustomTypeComparer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DataRoutedEventArgs.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DataRoutedEventArgs.cs index aefcb941741..cf65462c3b4 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DataRoutedEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DataRoutedEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DateTimeApproximationComparer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DateTimeApproximationComparer.cs index 9090f5764af..c7b76d0e51d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DateTimeApproximationComparer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DateTimeApproximationComparer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.Generated.cs index 1eb1d456389..76e3206f1f5 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.cs index fa08b212e4a..582be1c7ecd 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/DismissiblePopup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ExtendedFrameworkElementAutomationPeer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ExtendedFrameworkElementAutomationPeer.cs index 1670e7bbc6e..0f269df5b75 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ExtendedFrameworkElementAutomationPeer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ExtendedFrameworkElementAutomationPeer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IAsyncProgress.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IAsyncProgress.cs index 4798e8e5c90..a87266dd696 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IAsyncProgress.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IAsyncProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IStateDescriptorFactory.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IStateDescriptorFactory.cs index cecccc6a7ee..e1539e76707 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IStateDescriptorFactory.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IStateDescriptorFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IntegralConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IntegralConverter.cs index caffb63b645..dff537f00bb 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IntegralConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IntegralConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/InverseBooleanConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/InverseBooleanConverter.cs index c8f5f8e29e7..55b57d76a3f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/InverseBooleanConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/InverseBooleanConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsEqualConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsEqualConverter.cs index d340839f5f9..83cd762198f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsEqualConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsEqualConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsNotNullConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsNotNullConverter.cs index 21371fee76f..265e0266c53 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsNotNullConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/IsNotNullConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/KeyboardHelp.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/KeyboardHelp.cs index 3de99caeb4f..90684f3f6cc 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/KeyboardHelp.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/KeyboardHelp.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.Generated.cs index fa30bc0c700..799cd260e12 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.cs index 67ad950fbc8..7f8a0f8bfc4 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.Generated.cs index 44d77369723..e51172095a1 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // // diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.cs index fad63be68e4..ddcb75df521 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ListOrganizerItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.Generated.cs index b764ed81355..e204886880a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.cs index 89a6288b03d..741d93a07d3 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/MessageTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.Generated.cs index 46065a9398f..f8b8bec0a5a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.cs index 5644faa91e0..271f5f3a279 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PickerBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.Generated.cs index 291a65373d1..c358ce69985 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.cs index 66cb1ef10e6..b02ea20e07a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PopupControlButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PropertyChangedEventArgs.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PropertyChangedEventArgs.cs index 010c69f6a4e..7d601bf8e26 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/PropertyChangedEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/PropertyChangedEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ReadOnlyObservableAsyncCollection.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ReadOnlyObservableAsyncCollection.cs index 8e59ff89368..cf183fa01f2 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ReadOnlyObservableAsyncCollection.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ReadOnlyObservableAsyncCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.Generated.cs index 319de2fed32..6d682160e49 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.cs index 2799ce6e1d0..b994bb1a29a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImage.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.Generated.cs index 5a4fb439c46..aaafd913976 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.cs index 1587c5feb5b..5f88400d63b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/ScalableImageSource.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/StateDescriptor.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/StateDescriptor.cs index fedb4f97138..be8cc841757 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/StateDescriptor.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/StateDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/StringFormatConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/StringFormatConverter.cs index ec7e43a9003..a2e2b144ad6 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/StringFormatConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/StringFormatConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.Generated.cs index 5a7523cf04e..9270c8f7914 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.cs index 79b36812065..bbd8e90b7cd 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextBlockService.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextTrimConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextTrimConverter.cs index cc81995074b..1ea4bf3b96f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextTrimConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/TextTrimConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/Utilities.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/Utilities.cs index 665c9b3c76c..f0308a8c2b7 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/Utilities.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/Utilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/VisualToAncestorDataConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/VisualToAncestorDataConverter.cs index 1d2776ce8e9..85a7d00a61f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/VisualToAncestorDataConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/VisualToAncestorDataConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/WeakEventListener.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/WeakEventListener.cs index 3f69908d5c9..cc18509092f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/WeakEventListener.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/WeakEventListener.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs b/src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs index 01f96bfa1f7..055e6453c22 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/Common/WpfHelp.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/AutomationGroup.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/AutomationGroup.cs index 90bcd753e9b..1341c12a25c 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/AutomationGroup.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/AutomationGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows.Automation.Peers; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.Generated.cs index 17988f4a8f5..2429db7b734 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.cs index e47ed8b4316..b641811444e 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButtonAutomationPeer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButtonAutomationPeer.cs index db7ef0ed4ab..3f6f2a3888b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButtonAutomationPeer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ExpanderButtonAutomationPeer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.Generated.cs index 6a99d0fd132..5e2c18129e6 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.cs index 6a7de4b6400..19c0671bf21 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/Resizer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ResizerGripThicknessConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ResizerGripThicknessConverter.cs index 7b496a2f9a2..4cdf51f63f6 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ResizerGripThicknessConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/ResizerGripThicknessConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.Generated.cs index 0d8b7ab8257..7e60d4c6ffc 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.cs b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.cs index 6ec505237bc..987a1170890 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/CommonControls/UIElementAdorner.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/DefaultFilterRuleCustomizationFactory.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/DefaultFilterRuleCustomizationFactory.cs index 7fc17d01ea2..54742e62235 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/DefaultFilterRuleCustomizationFactory.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/DefaultFilterRuleCustomizationFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterEvaluator.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterEvaluator.cs index 14246932829..3a2a3c71585 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterEvaluator.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterEvaluator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExceptionEventArgs.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExceptionEventArgs.cs index f2694bd152f..b7a26757b21 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExceptionEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExceptionEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionAndOperatorNode.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionAndOperatorNode.cs index 24262acc43d..f255973dce8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionAndOperatorNode.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionAndOperatorNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionNode.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionNode.cs index f4a30df084d..e9e41b93f20 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionNode.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOperandNode.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOperandNode.cs index fa021cb747d..f6bfd17377b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOperandNode.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOperandNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOrOperatorNode.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOrOperatorNode.cs index aa052436ff9..201316a433e 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOrOperatorNode.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterExpressionNodes/FilterExpressionOrOperatorNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRuleCustomizationFactory.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRuleCustomizationFactory.cs index 6019d06e528..75019cdbf5d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRuleCustomizationFactory.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRuleCustomizationFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs index 419c9c8987f..e75cd59f17a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/ComparableValueFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs index 3263dfc77bd..ea74ee062f9 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/DoesNotEqualFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs index d119e0d8bcb..5f21f57292b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/EqualsFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs index 2e21b412bf5..1c2fc523e86 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs index 19452a49656..cb0a79de775 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs index 6d73a582a3a..8765e033920 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsBetweenFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs index 311c8198bd8..8e8b91087ef 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsEmptyFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs index 0d4ae3f8a09..bd9af169e82 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsGreaterThanFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs index 936d9380ca4..db3bc01f810 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsLessThanFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs index 537713f420c..c9bfc7519a0 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs index 8a4137051c8..924ffc02af8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/IsNotEmptyValidationRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs index 1530991ca15..984d378dfdf 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertiesTextContainsFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs index 4d8b4c77405..e8927c74826 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/PropertyValueSelectorFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs index 6bb5c0a4634..be4c516eb0f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SelectorFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs index abfc83ba2bf..c5902a7901f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/SingleValueComparableValueFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs index 2de7780da52..9186827c5f5 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextContainsFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs index d2bc1973d5f..dcfeabff4c4 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotContainFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs index 57f8db3972f..3666b17c2de 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextDoesNotEqualFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs index 9bb052cc248..45a9dd85386 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEndsWithFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs index 5b6132b2ce2..6401506bf1d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextEqualsFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs index cf9d66a7293..3440935889f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs index 549c5cc637d..8cfdc7960d8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/TextStartsWithFilterRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterStatus.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterStatus.cs index 6fc01dfc03a..74cca6e890d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterStatus.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterUtilities.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterUtilities.cs index f1435ffd2f3..f4827d1b454 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterUtilities.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterUtilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IEvaluate.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IEvaluate.cs index 195e27b2598..f83f6b377aa 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IEvaluate.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IEvaluate.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IFilterExpressionProvider.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IFilterExpressionProvider.cs index 4063fd84a40..b72fcfe5aef 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IFilterExpressionProvider.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/IFilterExpressionProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ItemsControlFilterEvaluator.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ItemsControlFilterEvaluator.cs index ad8ec4d3d9e..d68ead8bc4b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ItemsControlFilterEvaluator.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ItemsControlFilterEvaluator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs index 7edb2e62a4c..89c1484cbc1 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs index c429cc44854..cf9c553f6b4 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValue.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs index f2ca5b67f2a..f3959685349 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingValueBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationResult.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationResult.cs index 8b1ab8f17a6..39ccd531c38 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationResult.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs index 42b7b14d9d3..9b4a2b23d0d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidationRules/DataErrorInfoValidationRule.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.Generated.cs index fea3c9e996d..e326f6542e0 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.cs index d6bab1e092d..d41b0a3e532 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePicker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePickerItem.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePickerItem.cs index 6f732a3358e..24c6eec1889 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePickerItem.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/AddFilterRulePickerItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.Generated.cs index dafb4b03a0f..5a87767b70a 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.cs index fb27cd19c8c..1d5e1324942 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelContentPresenter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelContentPresenter.cs index 1783b366d3b..7955a149435 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelContentPresenter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelContentPresenter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelController.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelController.cs index 157424b3221..63c611ce66f 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelController.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItem.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItem.cs index 8d45204a7a5..a1a873cdbc7 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItem.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItemType.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItemType.cs index 341005abaf8..490d1776ec0 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItemType.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRulePanelItemType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs index 0e9773664c2..e7e44ce8507 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs index 5434ffc9754..07a4ed58f8b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleToDisplayNameConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs index 20130a7823f..0017f2a4340 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/InputFieldBackgroundTextConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/IsValidatingValueValidConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/IsValidatingValueValidConverter.cs index 8495139b768..4c07ec10f6d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/IsValidatingValueValidConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/IsValidatingValueValidConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.Generated.cs index f864b222ab9..3a6c7fedae8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.cs index 2472dcb17dc..25830150939 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParseResult.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParseResult.cs index 1af2103eab7..5fa5e3e7703 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParseResult.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParseResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParser.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParser.cs index 5a34b0ca985..04ba32ece6d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParser.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/SearchTextParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingSelectorValueToDisplayNameConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingSelectorValueToDisplayNameConverter.cs index c62ef7f144a..e8708b92a15 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingSelectorValueToDisplayNameConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingSelectorValueToDisplayNameConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingValueToGenericParameterTypeConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingValueToGenericParameterTypeConverter.cs index 6d56afd4f22..ccd7447e1de 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingValueToGenericParameterTypeConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/ValidatingValueToGenericParameterTypeConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml index 4c2a6ee6acb..3c4f7e86157 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml.cs index a585aff27ae..470a7670860 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ColumnPicker.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs index e0ac198d500..cf85d79ae36 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/DefaultStringConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/IPropertyValueGetter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/IPropertyValueGetter.cs index 03051218587..bf435d20103 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/IPropertyValueGetter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/IPropertyValueGetter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerList.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerList.Generated.cs index 7db7d10791e..d53c8eb8daf 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerList.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerList.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListColumn.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListColumn.Generated.cs index 9e13b33f1ac..51311c6f875 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListColumn.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListColumn.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListGridView.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListGridView.cs index f949afe6430..e5c0dcaeff2 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListGridView.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/InnerListGridView.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/Innerlist.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/Innerlist.cs index 28f8be37a4f..9facdf94ca8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/Innerlist.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/Innerlist.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementList.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementList.Generated.cs index 2627fa20884..3ffb8993185 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementList.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementList.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs index 6b07e1adbf2..841175c97da 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptorFactory.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptorFactory.cs index 276cb798452..07c2cec62fa 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptorFactory.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListStateDescriptorFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.Management.UI.Internal diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.Generated.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.Generated.cs index 8becd00210b..6aa6d584e65 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.Generated.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.Generated.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region StyleCop Suppression - generated code diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.cs index a8e27916bf7..66be05cdf33 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ManagementListTitle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows.Controls; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueComparer.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueComparer.cs index f977ef72887..5c9f56daa81 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueComparer.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueComparer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs index 6f809560f28..6875198704d 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/UIPropertyGroupDescription.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/UIPropertyGroupDescription.cs index 4d6b3cb54a1..44d869c3272 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/UIPropertyGroupDescription.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/UIPropertyGroupDescription.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ViewGroupToStringConverter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ViewGroupToStringConverter.cs index 92c3a7a59db..c69cd8e0c08 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ViewGroupToStringConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/ViewGroupToStringConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/WaitRing.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/WaitRing.cs index a368cad00fc..c65da37d6f0 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/WaitRing.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/WaitRing.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/innerlistcolumn.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/innerlistcolumn.cs index 502a95b2ad2..9f91f2b74e8 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/innerlistcolumn.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/innerlistcolumn.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/managementlist.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/managementlist.cs index 8513a758fe4..9dcd8d9d18b 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/managementlist.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/managementlist.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml index d02f3cbd2a1..3729feb4a28 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml.cs index 35ff24db066..5d360017c16 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/AllModulesControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml index 63d24fc8516..f7e77ed944d 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml.cs index e5bf176b56a..3a5e95b344a 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/CmdletControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml index 5d4078676e6..024b287e80a 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml.cs index f788b06edab..b638b3f6a27 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButton.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonBase.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonBase.cs index f415294d46d..76ab5cf3c28 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonBase.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonCommon.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonCommon.xaml index 36a599399eb..f89e474a2de 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonCommon.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonCommon.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonToolTipConverter.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonToolTipConverter.cs index 2562db07d53..bec10afc6b7 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonToolTipConverter.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageButtonToolTipConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml index 6f8659bded0..c472721ac85 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml.cs index 97056f54916..d1e27f3de51 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ImageButton/ImageToggleButton.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml index 515bb076e5b..557741edf0d 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml.cs index 1008a691b94..54dcf1896ff 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/MultipleSelectionControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml index aed99f1bd90..cb0a9198b80 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml.cs index f3299dddca0..65774004236 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/NotImportedCmdletControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows.Controls; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml index b991ced09b6..c59f519d663 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml.cs index b9c681018ff..a98c7e6d95b 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ParameterSetControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml index 7a129e05ad8..e03c7859ed0 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml.cs index cff283bcf6a..c42bdb949bd 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Controls/ShowModuleControl.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ShowCommandSettings.Designer.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ShowCommandSettings.Designer.cs index 589fb63b52c..18194cec8fb 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ShowCommandSettings.Designer.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ShowCommandSettings.Designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. //------------------------------------------------------------------------------ // diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs index ee7ca11ccbd..9187673a71c 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandEventArgs.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandEventArgs.cs index 5ffdba45b06..857d466c80f 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs index d6bb68bbc20..75263082d29 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/CommandViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/HelpNeededEventArgs.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/HelpNeededEventArgs.cs index 039eee9e1e4..3d4c42a6cbe 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/HelpNeededEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/HelpNeededEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ImportModuleEventArgs.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ImportModuleEventArgs.cs index 5bdeeb87aff..3d7a7ccf3f0 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ImportModuleEventArgs.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ImportModuleEventArgs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs index dd37c7c09d9..749b3c56ac4 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ModuleViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterSetViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterSetViewModel.cs index 33364d42181..d6c8a365d83 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterSetViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterSetViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterViewModel.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterViewModel.cs index eea774177d2..2c6931eb08e 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterViewModel.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/ParameterViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml index 26991e87e25..185c5513ddb 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml.cs index 8de3b5e1cb3..8097952ffab 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/MultipleSelectionDialog.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml index edbac1f5605..7a88bb3699b 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml.cs index 2ad52f84b5a..12436d2f725 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowAllModulesWindow.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml index 96258220f04..6617070be4e 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml.cs b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml.cs index 6d1835c6d16..770bc8d8cae 100644 --- a/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml.cs +++ b/src/Microsoft.Management.UI.Internal/ShowCommand/Windows/ShowCommandWindow.xaml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Windows; diff --git a/src/Microsoft.Management.UI.Internal/commandHelpers/HelpWindowHelper.cs b/src/Microsoft.Management.UI.Internal/commandHelpers/HelpWindowHelper.cs index 04e6d74ae69..efed820e71c 100644 --- a/src/Microsoft.Management.UI.Internal/commandHelpers/HelpWindowHelper.cs +++ b/src/Microsoft.Management.UI.Internal/commandHelpers/HelpWindowHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/commandHelpers/OutGridView.cs b/src/Microsoft.Management.UI.Internal/commandHelpers/OutGridView.cs index ea36be8c73d..39405953f33 100644 --- a/src/Microsoft.Management.UI.Internal/commandHelpers/OutGridView.cs +++ b/src/Microsoft.Management.UI.Internal/commandHelpers/OutGridView.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs index 882f9e21c54..bc15f1e76bd 100644 --- a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs +++ b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.Management.UI.Internal/themes/generic.xaml b/src/Microsoft.Management.UI.Internal/themes/generic.xaml index 2a16a1d87cc..36d2354e1af 100644 --- a/src/Microsoft.Management.UI.Internal/themes/generic.xaml +++ b/src/Microsoft.Management.UI.Internal/themes/generic.xaml @@ -1,5 +1,5 @@ diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs index 8c516462f73..bd686e7f9c9 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs index 5ea3041de9e..00981ad8847 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CoreCLR/Stubs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if CORECLR diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs index 87c629b9396..cbebb9b4557 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterFileInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs index c2dbb2b2130..3a7af308f29 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs index acbfc7e9fb3..c1474ec4209 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs index fc0183466ad..9385e55909f 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index cb0eacff8e8..566ae6d1d22 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs index 3d7c3b37546..41829598482 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs index 5debeaef176..df3835d9e18 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs index fc08bcd96c4..d571df34084 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index 96682ccc1e0..1c0acb7f45a 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs index da136e9bf09..c6c1ddd8be8 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs index c77e9f10f5e..39aded7d646 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.txt b/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.txt index 4605fbe008c..3e0744889e7 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.txt +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft Corporation. All rights reserved. +#Copyright (c) Microsoft Corporation. Vendor=Microsoft Description=This PowerShell snap-in contains Windows Eventing and Performance Counter cmdlets. diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs index 470b7b42be4..0c03623110b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 12331bd9cd4..b9a1d210823 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 4690a729e1a..b55b105e20b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CreateInstanceJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 6caf4146d20..327fb83affa 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/DeleteInstanceJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 440594322f6..bd024b7d76a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/EnumerateAssociatedInstancesJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 13c75586f31..3a8b0e2200c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ExtrinsicMethodInvocationJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 b1c8873d29f..cd1eb78d81c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/InstanceMethodInvocationJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 edb6b2c991a..075e218ea60 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/MethodInvocationJobBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 13e0630bf27..f0d07fc201d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/ModifyInstanceJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f5cc8a862e7..f5bdc0745cd 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/PropertySettingJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.Management.Infrastructure; 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 d7648ce809a..2570f13cdf5 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 c05d9991fda..8ee336de383 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJobBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 a025ef77d6b..5a25206fe94 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 15c5d5099d1..730e54a6391 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/TerminatingErrorTracker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 84c00126238..c09ed5287ad 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 a7fb3465b69..082a7597425 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f5bb541c012..cfa26ca0e05 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletInvocationContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 8fdb0fda75f..58a9f02338b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 3603b339594..5dcca85a9b9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimJobContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f6eb6b99403..17801923bf0 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimOperationOptionsHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 4e10fc94517..ba727baaef4 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 ad37e321aa1..acd432037fb 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 e27387f9cbe..47c538ccb6a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs index a1e15c0248e..af8efbd6885 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/AddContentCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs index f642cfab6f7..edf1249638f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs index 3f1a3f237e2..61726686f28 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearContentCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs index d203a8facce..75ee9a639e3 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearPropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs index 8460392ff5e..f42e4dae173 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ClearRecycleBinCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs index 0f978e9eb2d..77701a1bb70 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs index 5ee3ba4ca34..bd97d485cd1 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CombinePathCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs index 32eeb443848..6f93119c999 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CommitTransactionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using 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 92302849359..578b4a7efde 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs index f0254091348..a5e1ed331cb 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if UNIX diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs index 5dbe8fcc918..34f7636174d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs index c2798b03f51..fffb36d2979 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ControlPanelItemCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs index 13687aad792..06add515e1c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ConvertPathCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs index b1271dd398d..699676acfd6 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CopyPropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs index b0366872ce2..45c484744fa 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Eventlog.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs index 9caa7cdee15..3dcd0d51c4a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetChildrenCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs index 7dda142c2eb..dc272f40281 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetClipboardCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs index 7cfee303084..14f8a207ae5 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs index f133d4e5db9..86f252fb8fc 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetContentCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs index 761f054be7d..7f6e4c5b1b4 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetPropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs index ed99d63861d..484ddb96680 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetTransactionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using 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 b078262505f..f460b2c4957 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/GetWMIObjectCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs index 6f6855c6068..f4c634adca2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Hotfix.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs index e6204c619d0..df0c5775ca1 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/InvokeWMIMethodCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs index 89094d7487d..0fcc8a3a244 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/MovePropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 1c2388782a3..564a8daf3ec 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs index b2e6673faf1..e3982d49034 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/NewPropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs index 77086c8b7e3..0cf95e8ac9d 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ParsePathCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs index 17c7082b1a9..83ce50d0049 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughContentCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using 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 27e33a01564..f2d18660ee5 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PassThroughPropertyCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using 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 46ce49079fa..29b905cb0ff 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PingPathCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 1ef115c7764..576e7cb38b9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs index ceda21a531f..5a73d16e40e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/PropertyCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs index f2f95e0ca43..0a4d9c6cb34 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs index 55893107000..1f02a4fc6d1 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemovePropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs index c9fb150b766..cce50ea1563 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RemoveWMIObjectCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs index 9ba19a521e9..3bed667fb0f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RenamePropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs index 9879716be4c..8fa26142c5b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ResolvePathCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs index 63c71991deb..297dd5269a9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/RollbackTransactionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using 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 31c025f843b..d2468387f17 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX // Not built on Unix diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs index 3aed047f443..bcb7330c674 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetClipboardCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs index e7e4eb1fa15..b73edc3f291 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs index eb07082d92d..9e2018342ba 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetPropertyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs index 68c8fdfd507..4b2deac8bef 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetWMIInstanceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs index 509c87915df..4f5c239cc64 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/StartTransactionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index cb2f37a0ef5..a4044e3d5c2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #nullable enable diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs index 250bccaddf6..106c9038981 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TimeZoneCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs index 6b734d0ec4f..056cf60265b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/UseTransactionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs index a90a8971e06..eed6efff76a 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs index 929dcf6f6e1..547b121c571 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WebServiceProxy.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs index 68560bef20f..7ccf63cdf8e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/WriteContentCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs b/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs index abd768a782b..0b0239053ea 100644 --- a/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Management/singleshell/installer/MshManagementMshSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs index eb6ea6fc99e..9bbde6cac81 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 714a852383a..833c373ca9c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 524af9fdb3f..5ee48da98de 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs index f0b24be51ed..250b00422d6 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConsoleColorCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-SddlString.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-SddlString.cs index 341b16289c9..1e64dfe7754 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-SddlString.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-SddlString.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX 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 12491fbd077..2daa22a4f69 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFrom-StringData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs index 5df1b594391..efd61a6922a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertTo-Html.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertTo-Html.cs index d8de66a7461..b0c3ff27f35 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertTo-Html.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertTo-Html.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs index aba6043d2bb..3bb626ca06e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Csv.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs index 2503d925934..cb6e4a9024d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs index 16f30042200..91985bd17c7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs index 59ec5432add..ff4b2580f83 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerializationStrings.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace System.Management.Automation diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs index 122fd33ad71..355d94912af 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/DebugRunspaceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9e17910a561..c54c9499761 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Disable-PSBreakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 c47f09b28e7..d06073c4214 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Enable-PSBreakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs index 433db02826b..6896917429f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs index 31d79d2d748..1ac3e781ab7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ExportAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9536f3d399a..0d2db93302a 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 113ba0ffabb..a9d60def958 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 32a61eb1f36..d7d863e29b8 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 5caeaf5758b..48a9004e604 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 37bca37c3a2..8ae81bedd24 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 cefb5540e87..49d41d8ce3e 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 75adcd3cf42..b72c9b7d439 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 7dfda541d77..dc967889e69 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 2324b8e5e05..ae9e83bce14 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 6d64902e6ff..919264ad180 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 09df27f2a92..3a4a43fa205 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 a6d68b89ca8..202250f33a1 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 a7cc58e38a8..813bfad23c0 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 dcd256d4962..6939c38643d 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 a0c12236e96..5927244d896 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 3efd88dbb31..642139c07d9 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 5bf7ad6489b..67c173b2077 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 312734c043e..5616a7fa436 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 541912598b7..5dcb3c4f588 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs index 428a2da36c2..e7fa686c389 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f04f66d4884..ba57278f6c8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9b451f4983f..4d2d0517569 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSCallStack.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3ce9fcb9d8c..49baa9bd296 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs index 81ba7c535d7..82a725ba212 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetCultureCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs index 59b57d6bec3..aefbed7dbe2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs index d6ae515ad56..faf16d384f7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs index c5f25e742d7..cde73b2914d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetEventSubscriberCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs index 7afca70e3fe..c851c2bc815 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs index b2ffebcd164..76718bfde3f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHostCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 4831200555f..daa870d9b1a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetMember.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index 6fa3993ea47..b4c015e6801 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs index 4d6cdeb3244..0aedd4c9d06 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRunspaceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs index 5b50efd978d..53e8c5d3adf 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUICultureCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs index b2a45626b27..9dc133caced 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUnique.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs index 0527ed8fce8..e8dcfbe254a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetUptime.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs index 4f00c11d6ee..766b38116c0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetVerbCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 bb3f9a0bf3e..9938dc15c7f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Group-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index 06a5459ad58..61b71fe8f45 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 1f64879df51..4749d28322c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Import-LocalizedData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs index f2db97cdd51..c4b4a9d3d4e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs index 1edac551584..694e82686be 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportPowerShellDataFile.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeExpressionCommand.cs index a4abba2dbd5..d51f20f8704 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/InvokeExpressionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs index c1971c3da11..abc8fddc6f9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs index 61953205445..d6cecf471bc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs index 43db8154484..3a5d4c77a5f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MatchString.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 c668e41b98d..2ef311e38f3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Measure-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9596df44e79..a571c72be11 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs index cbf09d0087e..3c95ebbc7de 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewEventCommand.cs index 198d2c31048..34c95a116f3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs index badbaa21b4d..537d86c24ec 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewGuidCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs index f7a5bd63afc..f8bb3d4e6ea 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTemporaryFileCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs index b75932b869d..0e633ca5b2e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/NewTimeSpanCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs index 24a7ce46ca2..fd69a2011fb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ObjectCommandComparer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs index 8254f98a7ea..c2ebc9261a1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/OrderObjectBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/PSBreakpointCreationBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/PSBreakpointCreationBase.cs index 43e3e93839d..cb0e9ea2435 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/PSBreakpointCreationBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/PSBreakpointCreationBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs index 205b61fcd8d..949d45ba1c4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs index 6229cd42e84..ce72dac51fe 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterObjectEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs index c634779cb78..f04124e9a4c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RegisterPSEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 c3ec16fa0b6..458b471b322 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Remove-PSBreakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 8a32bfa30c5..7b44a0c2664 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs index 0ec00f82236..14acbbdf6af 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/RemoveEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 47a6c2d51cd..e5405172bee 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 74861700732..b4582f788a8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9b18c6fd4c5..cb4b14a6619 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Set-PSBreakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs index eda5028b373..b2746625375 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetAliasCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs index 3382ec5cdb0..e00a3bda2d9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/SetDateCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 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 8b9213c6fd0..701508ed4ff 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 7b6bb0674c7..115920651a4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 9c3f97d5165..9111cd88216 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 a7fb2664a11..6e4732f7eac 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 e9d149bfca5..ff63ee13e76 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 3bde6cdf858..f53d72ea868 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 8b39c5f13fb..4a5700bdf7a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandProxy.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowMarkdownCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowMarkdownCommand.cs index 65fb48e4126..2203fbb20a7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowMarkdownCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowMarkdownCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f2847b3d50e..5f66b39753f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Sort-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs index 0e62652842a..4fe5c641ff9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/StartSleepCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 3866c1202ad..32048362b06 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tee-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Tee-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs index 23f0cc7c37f..e20a2abe70e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs index 3e45cf8d7f7..d7071a06605 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TimeExpressionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs index 8e4a92ea389..afd4a649c95 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #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 d6d9e4c222a..f89b3d6e4cc 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnregisterEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 a0b093cfb90..d19810522d0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-Data.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 ceac0ad541e..dbff09ef36a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-List.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 8131fbcded6..817c4306b44 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs index f3c9d86a8e9..5308f836d4a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs index 2ad4b0c04c6..6739dbb38e5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs index 5fbfb6f8763..7aeb864e2ba 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WaitEventCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 fd4c4b41219..1d33957d624 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 98d5a73d328..8e28c630e17 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 101cf78c55b..fc0921d3c63 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 ed73fabc8dc..ee56360e103 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 f7dcb764e48..40e1ddffab0 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 518613ea0e4..955786248f7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertFromJsonCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 8ebbabee593..6c191fcb6e9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 1de3a7c14e5..84e96e34675 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 5edec0bf558..27cca48377c 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 c338be5ac9f..c1df3aa0bf5 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 b61977d87e9..7b118840576 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 bc8502ccc16..c4371515fe7 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 aadaf616d38..d1a4cde2115 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 53c60384136..9072e431cae 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/FormObjectCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 2a03d53f4f2..736b2bcdc79 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/JsonObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 be3b79ecfc5..a730c043216 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/PSUserAgent.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 91662ed7878..58d63c36ca3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/StreamHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 340baf18550..fada385d4ac 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebCmdletElementCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 1ed35bd9545..aa7067f1c23 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestMethod.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 384c72a5219..a28f07c842c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/WebRequestSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 e24cc35702b..2d7fc9d233d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write-Object.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs index 727eaa9d779..6f374336da5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Write.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs index 130f88c2a8f..3dbb2e378ad 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteAliasCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs index 2b32e2acf02..a66e24f4b9e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs index d3abb9d2285..070c1275aa8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteProgressCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs index 0013b22963c..8736965fd61 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/XmlCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 cefb4dd9744..b37f06b2b2f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/GetTracerCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Linq; 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 c95c9793be0..fc91cec91c0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 032fa63006c..d05a535145d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/SetTracerCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; 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 c52862fc8c3..a2e04f79ae1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 a3000848988..c7668903ed4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 31a6845c0eb..3eecdd51cba 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceListenerCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs b/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs index c86dad7e054..1c29b44c603 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/singleshell/installer/MshUtilityMshSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs b/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs index 7a8ebd5fbd2..26b1dbe9a48 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.CompilerServices; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs index a62e51c29fb..82b3756d32b 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/HResult.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/HResult.cs index 13e6fb612d6..e23f0810ea1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/HResult.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/HResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace Microsoft.PowerShell diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs index 8beb35c637c..3b9d73c0f4f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropertyKey.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropertyKey.cs index 2040c905a52..be45b0d8d84 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropertyKey.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropertyKey.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs index 39014cbee82..5b7572c94b2 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/TaskbarJumpList.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 47129d45861..9907e43c4b0 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 45d95ff7920..8d3eb856bd0 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index e6e8759d3cd..eaa0d3d43d9 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index af9d754861c..c1487dead65 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs index fe3b37a77ba..fd1b91574b4 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostTranscript.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 7cf189fb984..354d6f19aa2 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs index afe2cbd8d63..f055001239f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index bcb729d87cb..cd455c0f989 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs index 44264828fc1..1988104dbdb 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs index f78e5b9304b..6926f685795 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceSecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs index f8467e634cb..cd8364fc7ce 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleShell.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs index 590ad7c1a21..c875bc0c506 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleTextWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs index e432b01f6da..bdba911e298 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Executor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs index 5c271197af2..cfe7f0c16e1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs index e0c2b011d4c..0d4638cdb6f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs index c3965908bfb..35066c0bf09 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs index e2f1bfeb850..c2a13132e41 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs index e24823da6cc..696e47313d5 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/Serialization.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs index 399ed27a94b..1587f91d3f9 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StartTranscriptCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs index 66f76157033..9fae35ac83e 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/StopTranscriptCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs index ff7b952ed39..5c202eb32b1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/UpdatesNotification.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx b/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx index 02eaca3954e..45f387df28b 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx +++ b/src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx @@ -119,7 +119,7 @@ PowerShell {0} -Copyright (c) Microsoft Corporation. All rights reserved. +Copyright (c) Microsoft Corporation. https://aka.ms/powershell Type 'help' to get help. diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs index 2cb5dd6d83a..1b3f939158f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/EngineInstaller.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs index f06bd4e0b64..c532aeb190d 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/singleshell/installer/MshHostMshSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs index e007c82fc81..4d72090e088 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Reflection; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs index 0dd474169d9..e01249c9bc5 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs index 9178a5d202b..05628d51f8d 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs index 45927d2c076..2c272226ae2 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; 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 71be5f4ca3e..d26c629d54e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemSafeHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /*============================================================ 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 6e7694949a6..8b9c9e44ebc 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/CoTaskMemUnicodeSafeHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 06222aa8081..b9956b30681 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/EventLogHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /*============================================================ 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 12bbaca9af2..8a7fda12c74 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/Reader/NativeWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 76674132b2d..a902f0def73 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs b/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs index c7d89aa65fa..47a66ea8767 100644 --- a/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs +++ b/src/Microsoft.PowerShell.GlobalTool.Shim/GlobalToolShim.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs index d799a70d9db..375a8101075 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/AddLocalGroupMemberCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs index 5125f28c88e..09e7bdf9452 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/DisableLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs index 60f7f21c3fd..e321a03e266 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/EnableLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs index 74836e1aa14..3965c362335 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs index e3853d73ccb..a10300e9065 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalGroupMemberCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs index f25791df48c..e469d043ffa 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/GetLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs index 2c2f28d6173..59e4f4ca13f 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalGroupCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs index a5d012e187f..b3916f46071 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/NewLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs index 2fc7c332111..0c0af710af1 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs index 0ed137b08f4..7e132405b2a 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalGroupMemberCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs index 4ef9da3b599..0c61da2e117 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RemoveLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs index 05fd348e95e..f32e3365086 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalGroupCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs index 42250fc6eff..e6b1297a7d5 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/RenameLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs index 8926848d7e3..b1943971e3d 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalGroupCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs index 63756347b66..8fafa52c9e4 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/SetLocalUserCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #region Using directives diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs index 18eb8e1f167..1c7a7630ea3 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Exceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs index d492336bd6d..007966cb0a8 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Extensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.InteropServices; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs index 25af6b87e90..b43904fb773 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs index fa7add127ae..dcfec24631b 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalPrincipal.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Security.Principal; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs index 35a0059057b..9cad9777cac 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/LocalUser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs index 2441c9a2ae7..c34dbcd64d8 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Native.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs index d1db20b4fe7..654d221a69b 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/NtStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs index 026a47ca6f6..68a7d31e833 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/PInvokeDllNames.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 cd5ee5fccab..e87147fd35d 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs index 9768eb32d92..c2d9bc7f95b 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/SamApi.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs index c80c14be7f6..3534b34cc49 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/StringUtil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/Microsoft.PowerShell.MarkdownRender/CodeInlineRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/CodeInlineRenderer.cs index 72fb6428821..681c38cc6d8 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/CodeInlineRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/CodeInlineRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/EmphasisInlineRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/EmphasisInlineRenderer.cs index e4ce8ab0e6f..8a4be614796 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/EmphasisInlineRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/EmphasisInlineRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/FencedCodeBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/FencedCodeBlockRenderer.cs index 36f04aca067..121c7ee01fa 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/FencedCodeBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/FencedCodeBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/HeaderBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/HeaderBlockRenderer.cs index 87dc5c0e5aa..eb975d6b6a3 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/HeaderBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/HeaderBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/LeafInlineRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/LeafInlineRenderer.cs index 7585759675a..55a8ff32a73 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/LeafInlineRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/LeafInlineRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/LineBreakRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/LineBreakRenderer.cs index ed008b8609e..1f4c8f4ceaf 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/LineBreakRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/LineBreakRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/LinkInlineRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/LinkInlineRenderer.cs index 677143bbff1..3999fd5f4e1 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/LinkInlineRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/LinkInlineRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/ListBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/ListBlockRenderer.cs index a4076ab04a6..b65d7c25475 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/ListBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/ListBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs index 417ad052bcb..c680d9c973b 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/MarkdownConverter.cs b/src/Microsoft.PowerShell.MarkdownRender/MarkdownConverter.cs index 9a39a6b26ba..c68d9af3d3b 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/MarkdownConverter.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/MarkdownConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/ParagraphBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/ParagraphBlockRenderer.cs index bdeb1d13c61..26986311614 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/ParagraphBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/ParagraphBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/QuoteBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/QuoteBlockRenderer.cs index 273f1c05a57..1f26adc5883 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/QuoteBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/QuoteBlockRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs index 4b2213ab702..83e99298979 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/VT100ObjectRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/VT100ObjectRenderer.cs index d42c85e1c45..566a086015d 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/VT100ObjectRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/VT100ObjectRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.MarkdownRender/VT100Renderer.cs b/src/Microsoft.PowerShell.MarkdownRender/VT100Renderer.cs index 65af4a83f80..c817cea7e87 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/VT100Renderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/VT100Renderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs b/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs index 08853e30b8b..3e2e4ff3268 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Reflection; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs index 9bdc6e42e65..48c9fd056d7 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs index 474265eac42..650c643ecf9 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs index b8582600204..2daedddc554 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs index 3c5e833706c..53434c729e7 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobSourceAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs index e2982d85b25..bd9d7439696 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs index 4fef0e1c45b..a507e3161af 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs index 1b89e955984..a8d76ef7da8 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobWTS.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs index 603bfabe31f..2936fcf78c6 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/AddJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs index bd1ed864a14..d76b1829d42 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs index d692b4aabb1..d06020ed3d6 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobDefinitionBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs index 9bb46d60ca4..02e37c0acfb 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/DisableJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs index e377287e775..c00626e6d64 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableDisableCmdletBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs index 67584690694..6f236ea57af 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs index 39063f9c1ef..955dde31dfe 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/EnableJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs index 00ab434769c..772027f4fa5 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs index dc1e08bc678..0218395f3a1 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs index 26458fda2df..4de3131b223 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/GetScheduledJobOption.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs index 9fcdf500838..99ce575bec3 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/NewJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs index 55fb9a4c0bd..09eab549426 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/NewScheduledJobOption.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs index 895c4e33528..e473f91dfd4 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/RegisterJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs index a281d830d78..81cdb8ecc35 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/RemoveJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs index f01d5b5ad30..e8112877019 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SchedJobCmdletBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs index 5d0bd636fa6..cd70dc0a8f1 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/ScheduledJobOptionCmdletBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs index 2a8da6f00ef..0d56f5640e4 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs index cac4dda1793..4eeab7fcc72 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetJobTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs index 8dbac01b438..bc1e07b1473 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/SetScheduledJobOption.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs index 7b25a749989..c6c3885fb90 100644 --- a/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs +++ b/src/Microsoft.PowerShell.ScheduledJob/commands/UnregisterJobDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 100b7dde2d1..9cdae9175ae 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs index f4b1602f2a1..5d094413904 100644 --- a/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs index 7366bccb4d6..28163845d22 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index fa23e31a473..7bdb8286598 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs index 6a7502f7a7d..4c90c02e941 100644 --- a/src/Microsoft.PowerShell.Security/security/CmsCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CmsCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs index 3fbe9bd237c..cb23979c77f 100644 --- a/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/CredentialCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs index 21da73e205c..7924fcd7652 100644 --- a/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/ExecutionPolicyCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 85ecca4d029..74dee890cdf 100644 --- a/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SecureStringCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index 789ae2fa014..ae9004f8dcf 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/Utils.cs b/src/Microsoft.PowerShell.Security/security/Utils.cs index 75481ff292f..f8eb7243285 100644 --- a/src/Microsoft.PowerShell.Security/security/Utils.cs +++ b/src/Microsoft.PowerShell.Security/security/Utils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs b/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs index 4eb3838f5ea..efd205e5769 100644 --- a/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs +++ b/src/Microsoft.PowerShell.Security/security/certificateproviderexceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs b/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs index 1460cb8a184..efc4ec63daa 100644 --- a/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs +++ b/src/Microsoft.PowerShell.Security/singleshell/installer/MshSecurityMshSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 5a6c4d75cb6..414b70c8403 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index 60cfe742767..259bf4910ff 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs index 41427678150..42709bc8337 100644 --- a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs +++ b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/Interop.cs b/src/Microsoft.WSMan.Management/Interop.cs index d9394f4a941..663e1e35ec7 100644 --- a/src/Microsoft.WSMan.Management/Interop.cs +++ b/src/Microsoft.WSMan.Management/Interop.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs index 88657b30a30..f237a0f740b 100644 --- a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs +++ b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/NewWSManSession.cs b/src/Microsoft.WSMan.Management/NewWSManSession.cs index 73ea9f68c53..b2d6719e7e9 100644 --- a/src/Microsoft.WSMan.Management/NewWSManSession.cs +++ b/src/Microsoft.WSMan.Management/NewWSManSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/PingWSMan.cs b/src/Microsoft.WSMan.Management/PingWSMan.cs index 5603f9882e3..9581eaabc33 100644 --- a/src/Microsoft.WSMan.Management/PingWSMan.cs +++ b/src/Microsoft.WSMan.Management/PingWSMan.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs index 484247a2e5a..e81ac154bde 100644 --- a/src/Microsoft.WSMan.Management/Set-QuickConfig.cs +++ b/src/Microsoft.WSMan.Management/Set-QuickConfig.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/WSManConnections.cs b/src/Microsoft.WSMan.Management/WSManConnections.cs index 57c504d61d8..103115fff98 100644 --- a/src/Microsoft.WSMan.Management/WSManConnections.cs +++ b/src/Microsoft.WSMan.Management/WSManConnections.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index 243095bc4fd..fabac20ec78 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 3fcd7c4d83d..32e1f88e57b 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/WsManSnapin.cs b/src/Microsoft.WSMan.Management/WsManSnapin.cs index 903d02c7784..4093caf12db 100644 --- a/src/Microsoft.WSMan.Management/WsManSnapin.cs +++ b/src/Microsoft.WSMan.Management/WsManSnapin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/Microsoft.WSMan.Management/resources/WsManResources.txt b/src/Microsoft.WSMan.Management/resources/WsManResources.txt index 61be75be118..50cf1bf1fe5 100644 --- a/src/Microsoft.WSMan.Management/resources/WsManResources.txt +++ b/src/Microsoft.WSMan.Management/resources/WsManResources.txt @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # {0} = Delegate diff --git a/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs b/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs index 42c684a9c8d..014cc03c8ec 100644 --- a/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs +++ b/src/Microsoft.WSMan.Runtime/WSManSessionOption.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 3dfba7c32e6..bb927249e7f 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 @@ -2,7 +2,7 @@ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" 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 e69dfe1a0d6..a2b0a1d9d0b 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -2,7 +2,7 @@ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.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 c287a6cef3c..11cd24e99a7 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -2,7 +2,7 @@ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.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 eb9299a4807..76f123f26c4 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -2,7 +2,7 @@ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" -Copyright = "Copyright (c) Microsoft Corporation. All rights reserved." +Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" diff --git a/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 b/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 index f7a0f18400e..36684dcaab9 100644 --- a/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 +++ b/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 @@ -2,7 +2,7 @@ GUID="{Fb6cc51d-c096-4b38-b78d-0fed6277096a}" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml index 95386960921..e63a9b56d94 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml +++ b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml @@ -5,7 +5,7 @@ PowerShell engine. Do not edit or change the contents of this file directly. Please see the PowerShell documentation or type Get-Help Update-TypeData for more information. -Copyright (c) Microsoft Corporation. All rights reserved. +Copyright (c) Microsoft Corporation. THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO diff --git a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 index 8907dd40417..f060e931c9f 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 @@ -2,7 +2,7 @@ GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index 34328bb14aa..d23cebc58f8 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -2,7 +2,7 @@ GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 index 2873dbc3ecc..bef21b6f8df 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -2,7 +2,7 @@ GUID="A94C8C7E-9810-47C0-B8AF-65089C13A35A" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index e3d4643c855..b8082249b81 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -2,7 +2,7 @@ GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59" Author = "PowerShell" CompanyName = "Microsoft Corporation" -Copyright = "Copyright (c) Microsoft Corporation. All rights reserved." +Copyright = "Copyright (c) Microsoft Corporation." ModuleVersion = "7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion = "3.0" diff --git a/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 b/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 index d3d84d7c409..7fb73b2db4f 100644 --- a/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 +++ b/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 @@ -2,7 +2,7 @@ GUID="766204A6-330E-4263-A7AB-46C87AFC366C" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/Microsoft.WSMan.Management/WSMan.format.ps1xml b/src/Modules/Windows/Microsoft.WSMan.Management/WSMan.format.ps1xml index 71a30b7dec5..bbee94971d5 100644 --- a/src/Modules/Windows/Microsoft.WSMan.Management/WSMan.format.ps1xml +++ b/src/Modules/Windows/Microsoft.WSMan.Management/WSMan.format.ps1xml @@ -5,7 +5,7 @@ PowerShell engine. Do not edit or change the contents of this file directly. Please see the PowerShell documentation or type Get-Help Update-FormatData for more information. -Copyright (c) Microsoft Corporation. All rights reserved. +Copyright (c) Microsoft Corporation. THIS SAMPLE CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO diff --git a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 index f5fc194f503..86578f88308 100644 --- a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 +++ b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 @@ -2,7 +2,7 @@ GUID="c61d6278-02a3-4618-ae37-a524d40a7f44 " Author="PowerShell" CompanyName="Microsoft Corporation" - Copyright="Copyright (c) Microsoft Corporation. All rights reserved." + Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" diff --git a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 index ecfdb1364d4..16bb19e76ea 100644 --- a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 +++ b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# diff --git a/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 b/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 index 6221691d85c..992c7b1c159 100644 --- a/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 +++ b/src/PowerShell.Core.Instrumentation/RegisterManifest.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# diff --git a/src/ResGen/Program.cs b/src/ResGen/Program.cs index f07b992484d..6e25d9239e7 100644 --- a/src/ResGen/Program.cs +++ b/src/ResGen/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/AssemblyInfo.cs b/src/System.Management.Automation/AssemblyInfo.cs index 731fb02e7e2..279feede65b 100644 --- a/src/System.Management.Automation/AssemblyInfo.cs +++ b/src/System.Management.Automation/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Reflection; diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index bfc683c0905..fafd27c2cc4 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 7fe897d8ea4..96ba4cd28fb 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/CoreCLR/CorePsStub.cs b/src/System.Management.Automation/CoreCLR/CorePsStub.cs index 783b36af188..2691e168364 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsStub.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsStub.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/CoreCLR/EventResource.cs b/src/System.Management.Automation/CoreCLR/EventResource.cs index 56a53066f90..178602e7da4 100755 --- a/src/System.Management.Automation/CoreCLR/EventResource.cs +++ b/src/System.Management.Automation/CoreCLR/EventResource.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if UNIX diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index dcf52a1ad02..db7f2c8eba1 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 66093a82912..22945778c12 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Certificate_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 6c6bc97793e..e08c7357e63 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Diagnostics_Format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 040de0994c8..6407a2d7012 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/DotNetTypes_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 a68c82024ba..8b92e3ac391 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Event_Format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 0346a094189..374cadf31d8 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/FileSystem_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 508afa56e1f..987ed33fb4a 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/HelpV3_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 35d8818ac25..d18de013397 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Help_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 7dd6914561a..90fa1490a39 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ef0a79e12a6..c958ac9f49d 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellTrace_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 caab800c85c..c1498af0bf1 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/Registry_format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 d11b1538edb..3ac1cdf35b1 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/WSMan_Format_ps1xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 b2e5a64caf0..6574914c396 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs index cd9b6afeff5..bb6e6cb50aa 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs index 8614896384f..26e62bc8a79 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index be70dc9714b..5025fc6c381 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs index 28357039d18..d2e44c4ad60 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ColumnWidthManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs index d43e42ebb2d..74031dc515c 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ComplexWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs index af8ef63e9fc..da440d8f628 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs index 0e77a143e02..02d60731e43 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs index 721db4264fa..1402fbbbc8a 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/commands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs index a3e8e7400ee..50f687c46d1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs index d4ed74e97cf..fd321e14b80 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionDataMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 76a6fe55a21..6e11d21647a 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database 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 fba42c25522..06a330c0264 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database 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 09a27be3473..cb1cc5cbf30 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Misc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database 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 6ca0967b10f..2afbab8a7e7 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database 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 63438583bee..2b4dd913f94 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // this file contains the data structures for the in memory database diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs index 73cb10b98af..1892a87668b 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs index 37cf6b9de93..d03d2eb1ad3 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs index 6edc79f2595..470832670a9 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataQuery.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs index 5c0d209a5ec..82277eeebd1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 38efdf7923e..3c9cecaed1b 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Complex.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 031672a9b27..323c94454b2 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_List.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 68ac9fb5e2e..acc60a3e3e5 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Table.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 ab1453f7d79..66d819a0f1e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 2a53a7d0d66..07ea8ae69e1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Wide.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs index 3710e82139f..92eb3708d16 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatGroupManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs index 374897f8a6c..0aaf16a9a28 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatMsgCtxManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs index 5596987d50b..cf6a4d2eb88 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs index d41a119dde6..eeacaad4520 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs index 95ce0d71fff..2ded68cd510 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_List.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs index ec261cc305d..ab4912c8838 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Table.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs index 213ccb4fedf..9d378eaf9cc 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Wide.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs index 49425d7854d..40ca2e18a80 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs index 11f214c9cdb..bb2c8ff93e7 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatXMLWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs index bc9cc0565a0..f4ac55d1feb 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjects.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // This file contains the definitions for the objects diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs index ce2c2ef7a81..dd0dbf4738e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs index 880a1c9f5cc..03cd5a1a2a2 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs index 03742dc79ff..91a7b8698a6 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ListWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs index a5bf1c9bf22..889ded7d226 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs index b4714d0e429..1545f456e12 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputQueue.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs index c9974a64834..7eaeef24c26 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs index a2de347af9a..c6ee8059a9c 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index 53f379a59ee..3de036f35da 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs index 9d0c5d18028..25e7fd61250 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs index 5125283df5b..dd9f18a2502 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 2cd756ad772..4a6540afb4d 100644 --- a/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs +++ b/src/System.Management.Automation/FormatAndOutput/format-default/format-default.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs index fb6402b1ec7..0b2dfe2f721 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // NOTE: define this if you want to test the output on US machine and ASCII diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs index 53f5c09e86b..e7afeda5e15 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/OutConsole.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs b/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs index 2956889bc29..5a6f2bd0683 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-textInterface/OutTextInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs index 87c7fc991ac..23c7a09c4f2 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/EnumWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs index f1643c7777d..44cda85e582 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs index 70a6a4a87a4..d9b08b27179 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 098303c2118..f52021fb2b0 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodParametersCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs index 90a4c3a0836..4851bf1f9da 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs b/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs index e6d7751a566..a1ce1d726ec 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/QueryBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs index e32cd1ee2a9..f14eae396f8 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs b/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs index e9de925e3da..4ce8a854487 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/cim/WildcardPatternToCimQueryParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation; 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 e6425a51056..8614c6a3994 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Xml.Serialization; 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 1c9a66549ad..9c53032284e 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,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if CORECLR 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 43f0817c92c..e2b87d4adf9 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,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // PLEASE DO NOT EDIT THIS FILE BY HAND!!! 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 3711ad54ced..f4892b51bc1 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,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // PLEASE DO NOT EDIT THIS FILE BY HAND!!! diff --git a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs index e7330a860c3..47fb00d2e32 100644 --- a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs +++ b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/AliasInfo.cs b/src/System.Management.Automation/engine/AliasInfo.cs index b6caa6b7598..bd209c6afe8 100644 --- a/src/System.Management.Automation/engine/AliasInfo.cs +++ b/src/System.Management.Automation/engine/AliasInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ApplicationInfo.cs b/src/System.Management.Automation/engine/ApplicationInfo.cs index 106696a28ef..308cea39b64 100644 --- a/src/System.Management.Automation/engine/ApplicationInfo.cs +++ b/src/System.Management.Automation/engine/ApplicationInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs b/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs index 746d2f82df3..e9b6be3caff 100644 --- a/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs +++ b/src/System.Management.Automation/engine/ArgumentTypeConverterAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Attributes.cs b/src/System.Management.Automation/engine/Attributes.cs index 8d3eaa08343..99433b32d0f 100644 --- a/src/System.Management.Automation/engine/Attributes.cs +++ b/src/System.Management.Automation/engine/Attributes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/AutomationEngine.cs b/src/System.Management.Automation/engine/AutomationEngine.cs index 0f04d99057f..1254e4027e1 100644 --- a/src/System.Management.Automation/engine/AutomationEngine.cs +++ b/src/System.Management.Automation/engine/AutomationEngine.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Linq; diff --git a/src/System.Management.Automation/engine/AutomationNull.cs b/src/System.Management.Automation/engine/AutomationNull.cs index e74258bf354..6dec6aeabb7 100644 --- a/src/System.Management.Automation/engine/AutomationNull.cs +++ b/src/System.Management.Automation/engine/AutomationNull.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 257638f7645..75e95b6082a 100644 --- a/src/System.Management.Automation/engine/COM/ComAdapter.cs +++ b/src/System.Management.Automation/engine/COM/ComAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/COM/ComDispatch.cs b/src/System.Management.Automation/engine/COM/ComDispatch.cs index 0daeea783aa..9199ef9f48f 100644 --- a/src/System.Management.Automation/engine/COM/ComDispatch.cs +++ b/src/System.Management.Automation/engine/COM/ComDispatch.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.InteropServices; diff --git a/src/System.Management.Automation/engine/COM/ComInvoker.cs b/src/System.Management.Automation/engine/COM/ComInvoker.cs index f315b36b7b8..4e0d083c118 100644 --- a/src/System.Management.Automation/engine/COM/ComInvoker.cs +++ b/src/System.Management.Automation/engine/COM/ComInvoker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Linq; diff --git a/src/System.Management.Automation/engine/COM/ComMethod.cs b/src/System.Management.Automation/engine/COM/ComMethod.cs index 9dd28fe3911..32552c6bd14 100644 --- a/src/System.Management.Automation/engine/COM/ComMethod.cs +++ b/src/System.Management.Automation/engine/COM/ComMethod.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/COM/ComProperty.cs b/src/System.Management.Automation/engine/COM/ComProperty.cs index c4b19e8a87e..2de108a872e 100644 --- a/src/System.Management.Automation/engine/COM/ComProperty.cs +++ b/src/System.Management.Automation/engine/COM/ComProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/COM/ComTypeInfo.cs b/src/System.Management.Automation/engine/COM/ComTypeInfo.cs index 64d07872c61..6a03f31c9ac 100644 --- a/src/System.Management.Automation/engine/COM/ComTypeInfo.cs +++ b/src/System.Management.Automation/engine/COM/ComTypeInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/COM/ComUtil.cs b/src/System.Management.Automation/engine/COM/ComUtil.cs index a1fa5a0125a..4d5a9964339 100644 --- a/src/System.Management.Automation/engine/COM/ComUtil.cs +++ b/src/System.Management.Automation/engine/COM/ComUtil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs index 46c8f40d06a..7fafdf84503 100644 --- a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs index 9d40f77b6b1..2ce58a04afb 100644 --- a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/CmdletInfo.cs b/src/System.Management.Automation/engine/CmdletInfo.cs index 8cfec82613d..896763d9d74 100644 --- a/src/System.Management.Automation/engine/CmdletInfo.cs +++ b/src/System.Management.Automation/engine/CmdletInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs index 5914c900e4c..72d6ba964d4 100644 --- a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs +++ b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CodeMethods.cs b/src/System.Management.Automation/engine/CodeMethods.cs index c50b906ff71..d764f5e37a9 100644 --- a/src/System.Management.Automation/engine/CodeMethods.cs +++ b/src/System.Management.Automation/engine/CodeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs index 092f19791a0..948ed8d1d7c 100644 --- a/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 cdc2a452876..4655373548b 100644 --- a/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/BoolArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs b/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs index 86fdfa82f4d..2fa337e165c 100644 --- a/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs +++ b/src/System.Management.Automation/engine/ComInterop/BoundDispEvent.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs b/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs index cc2fc8bff0a..fc64b27986d 100644 --- a/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs +++ b/src/System.Management.Automation/engine/ComInterop/CollectionExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ac24cbb422f..9ba83fc4de3 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs b/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs index c2139d60984..50fdbec6855 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComBinderHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs index b437fdf7eac..1c246d8f170 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComClassMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 5a2368bf321..95ce0b4ed6e 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComDispIds.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 2ee835aff9b..b601fb7bb39 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 9ac480aa676..c4146cf08b3 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSink.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 be368a74ef1..7fbb23f932d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSinkProxy.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 e7cd946d596..029068323f6 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventSinksContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 1968d042632..44765fd39e9 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComFallbackMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 632d2d06515..3fd90e9a733 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComHresults.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComHresults.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 f6b0ead393b..21a334a1991 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInterop.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInterop.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 b40e5fe43eb..9375a1f977e 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeAction.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 0d34c1a4d33..26186e16c46 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs index 8adc529cbbd..bf16a2f2c5d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs index 44bdaa91316..79ba5d8f2a4 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComMethodDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ae8eacd1ad9..65ac238a06c 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs index c0c6e0b113c..e98f23cdc93 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComParamDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 8f709624b73..c421fe09ac9 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComType.cs b/src/System.Management.Automation/engine/ComInterop/ComType.cs index 7adb8026dad..fe76e682495 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComType.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 6e375983270..fcd9fc51bcc 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeClassDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs index c10df104cd9..12375c978fb 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs index d3454fe2ab1..c873a1f8d5e 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeEnumDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 48a3276cb21..5bded65e70a 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs b/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs index e2ae7ab65e6..5863424275d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 5e8ce696cb1..494425213b0 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComTypeLibMemberDesc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 a9dc572b1bd..caff255c02a 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConversionArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs index 08f6be519a5..e177898e6d1 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConvertArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 66f60c94754..4c446b7ac95 100644 --- a/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ConvertibleArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 68c4ecfc260..3ad1264b2d0 100644 --- a/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/CurrencyArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs index 39e18316b3d..a69037ab3f7 100644 --- a/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/DateTimeArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/DispCallable.cs b/src/System.Management.Automation/engine/ComInterop/DispCallable.cs index c2da035a4be..aba2fc5f6f2 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispCallable.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispCallable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs index d83025aca0e..130eaa524c2 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispCallableMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ebfdb4868a6..1c0c0b23dc5 100644 --- a/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/DispatchArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs index 784401399f9..e0a95e37bce 100644 --- a/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ErrorArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 abe1775e6e8..0756a1f5312 100644 --- a/src/System.Management.Automation/engine/ComInterop/Errors.cs +++ b/src/System.Management.Automation/engine/ComInterop/Errors.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ff73c782036..c1a937fd318 100644 --- a/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs +++ b/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 908c5a18c2a..d29462d235c 100644 --- a/src/System.Management.Automation/engine/ComInterop/Helpers.cs +++ b/src/System.Management.Automation/engine/ComInterop/Helpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs index f2ee582089a..bb8a2eeb5a8 100644 --- a/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IDispatchComObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs index 2f7859a067c..9a4c9693c27 100644 --- a/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IDispatchMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs b/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs index 6ad943edcc7..9ab6c1aae65 100644 --- a/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/IPseudoComObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs index fda43e814be..d5747f6fc68 100644 --- a/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/NullArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs index 1050f0695f5..1df83daf12b 100644 --- a/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/SimpleArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs b/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs index a5b772373a2..07ad10f6bac 100644 --- a/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs +++ b/src/System.Management.Automation/engine/ComInterop/SplatCallSite.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs index 89291cd5cfa..437407baf7d 100644 --- a/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/StringArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs index e43956280d6..4a07e275836 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeEnumMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs index cd9d2501c5b..88035265236 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeLibInfoMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs b/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs index 72032d65b66..a4eab6f7ad5 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeLibMetaObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT diff --git a/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs b/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs index 0b406c56cd5..ab82f854f28 100644 --- a/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs +++ b/src/System.Management.Automation/engine/ComInterop/TypeUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !CLR2 diff --git a/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs index 2b10d677250..552e262c859 100644 --- a/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/UnknownArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs index fd8d156e8da..4a5bbe746a1 100644 --- a/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs +++ b/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/Variant.cs b/src/System.Management.Automation/engine/ComInterop/Variant.cs index 5e5e1d49c8b..0e1561fbe17 100644 --- a/src/System.Management.Automation/engine/ComInterop/Variant.cs +++ b/src/System.Management.Automation/engine/ComInterop/Variant.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs b/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs index 980f239f23f..b8a2b8c5e27 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantArgBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs index 77f4c6b377a..0277e03f191 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantArray.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantArray.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs b/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs index 216bc443a54..06d449ece27 100644 --- a/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs +++ b/src/System.Management.Automation/engine/ComInterop/VariantBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !SILVERLIGHT // ComObject diff --git a/src/System.Management.Automation/engine/CommandBase.cs b/src/System.Management.Automation/engine/CommandBase.cs index c192ac3ffbf..0e925f9648f 100644 --- a/src/System.Management.Automation/engine/CommandBase.cs +++ b/src/System.Management.Automation/engine/CommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs index 3297f8bf15c..d1f4aa48624 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs index e96914f96b3..1a5f0989b8f 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionAnalysis.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 86657f92f32..70027d06c43 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs index 50f3e946d3f..763f54b60fa 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs index 0689647185f..71c76b3ce67 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index 2b13ccf56a6..2b10b988ea6 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/CommandDiscovery.cs b/src/System.Management.Automation/engine/CommandDiscovery.cs index 3333a3f81f8..c194a2f40f6 100644 --- a/src/System.Management.Automation/engine/CommandDiscovery.cs +++ b/src/System.Management.Automation/engine/CommandDiscovery.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/CommandInfo.cs b/src/System.Management.Automation/engine/CommandInfo.cs index 4587707b150..e55240a4cfa 100644 --- a/src/System.Management.Automation/engine/CommandInfo.cs +++ b/src/System.Management.Automation/engine/CommandInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/CommandMetadata.cs b/src/System.Management.Automation/engine/CommandMetadata.cs index 2548d05bc57..02f4f23c3cc 100644 --- a/src/System.Management.Automation/engine/CommandMetadata.cs +++ b/src/System.Management.Automation/engine/CommandMetadata.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandParameter.cs b/src/System.Management.Automation/engine/CommandParameter.cs index 2a93440ff10..0ee5f7855f1 100644 --- a/src/System.Management.Automation/engine/CommandParameter.cs +++ b/src/System.Management.Automation/engine/CommandParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; diff --git a/src/System.Management.Automation/engine/CommandPathSearch.cs b/src/System.Management.Automation/engine/CommandPathSearch.cs index 2a43bb1a834..415736b8561 100644 --- a/src/System.Management.Automation/engine/CommandPathSearch.cs +++ b/src/System.Management.Automation/engine/CommandPathSearch.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandProcessor.cs b/src/System.Management.Automation/engine/CommandProcessor.cs index 40fb3eff83f..e7454b112a7 100644 --- a/src/System.Management.Automation/engine/CommandProcessor.cs +++ b/src/System.Management.Automation/engine/CommandProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index 042a69489ca..8a01dc34980 100644 --- a/src/System.Management.Automation/engine/CommandProcessorBase.cs +++ b/src/System.Management.Automation/engine/CommandProcessorBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index 4967024aef4..093a2fbe993 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CommonCommandParameters.cs b/src/System.Management.Automation/engine/CommonCommandParameters.cs index 4ae05ac878b..19c693551a2 100644 --- a/src/System.Management.Automation/engine/CommonCommandParameters.cs +++ b/src/System.Management.Automation/engine/CommonCommandParameters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/CompiledCommandParameter.cs b/src/System.Management.Automation/engine/CompiledCommandParameter.cs index a507fef10eb..48a7b2fd415 100644 --- a/src/System.Management.Automation/engine/CompiledCommandParameter.cs +++ b/src/System.Management.Automation/engine/CompiledCommandParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ConfigurationInfo.cs b/src/System.Management.Automation/engine/ConfigurationInfo.cs index 4fb39fb145d..28b6dbbc52f 100644 --- a/src/System.Management.Automation/engine/ConfigurationInfo.cs +++ b/src/System.Management.Automation/engine/ConfigurationInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 e2f94d077a6..a2997a77b72 100644 --- a/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 438af05dbac..6bf9d0c52aa 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/Credential.cs b/src/System.Management.Automation/engine/Credential.cs index f42b11b95ed..df17c38a884 100644 --- a/src/System.Management.Automation/engine/Credential.cs +++ b/src/System.Management.Automation/engine/Credential.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/CultureVariable.cs b/src/System.Management.Automation/engine/CultureVariable.cs index d365278a6eb..2de72aa96c1 100644 --- a/src/System.Management.Automation/engine/CultureVariable.cs +++ b/src/System.Management.Automation/engine/CultureVariable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ce6e1dfb5a0..3b01bae2934 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapter.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs index 453cba6a0e9..84d8a80fbcb 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs index ff398c9bdbb..4df5c39fe15 100644 --- a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs +++ b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/DriveInterfaces.cs b/src/System.Management.Automation/engine/DriveInterfaces.cs index 9d86fda58a2..8d605e7313a 100644 --- a/src/System.Management.Automation/engine/DriveInterfaces.cs +++ b/src/System.Management.Automation/engine/DriveInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/DriveNames.cs b/src/System.Management.Automation/engine/DriveNames.cs index bc5a89a01da..2f737bbc53d 100644 --- a/src/System.Management.Automation/engine/DriveNames.cs +++ b/src/System.Management.Automation/engine/DriveNames.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 a94cef1eb1b..93f7be37323 100644 --- a/src/System.Management.Automation/engine/DscResourceInfo.cs +++ b/src/System.Management.Automation/engine/DscResourceInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/DscResourceSearcher.cs b/src/System.Management.Automation/engine/DscResourceSearcher.cs index bf1bfe4be52..8bb4f5bd267 100644 --- a/src/System.Management.Automation/engine/DscResourceSearcher.cs +++ b/src/System.Management.Automation/engine/DscResourceSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/EngineIntrinsics.cs b/src/System.Management.Automation/engine/EngineIntrinsics.cs index a2405ab08d2..ca322dbff06 100644 --- a/src/System.Management.Automation/engine/EngineIntrinsics.cs +++ b/src/System.Management.Automation/engine/EngineIntrinsics.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs b/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs index 978eda0cef9..092500c0af7 100644 --- a/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs +++ b/src/System.Management.Automation/engine/EnumExpressionEvaluator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs b/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs index 710261bd29f..543d920418f 100644 --- a/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs +++ b/src/System.Management.Automation/engine/EnumMinimumDisambiguation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ErrorPackage.cs b/src/System.Management.Automation/engine/ErrorPackage.cs index ff1df35ad0b..cf02b7db8d1 100644 --- a/src/System.Management.Automation/engine/ErrorPackage.cs +++ b/src/System.Management.Automation/engine/ErrorPackage.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index 2071ee444db..86c639ab9af 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/ExecutionContext.cs b/src/System.Management.Automation/engine/ExecutionContext.cs index 118ff82a899..592b4554811 100644 --- a/src/System.Management.Automation/engine/ExecutionContext.cs +++ b/src/System.Management.Automation/engine/ExecutionContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/EnableDisableExperimentalFeatureCommand.cs b/src/System.Management.Automation/engine/ExperimentalFeature/EnableDisableExperimentalFeatureCommand.cs index 35a404b675e..c15d8628cb9 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/EnableDisableExperimentalFeatureCommand.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/EnableDisableExperimentalFeatureCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs index 452e7bcd7ff..32ffb718177 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/GetExperimentalFeatureCommand.cs b/src/System.Management.Automation/engine/ExperimentalFeature/GetExperimentalFeatureCommand.cs index 96681e6e6b9..ff1c964fc4c 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/GetExperimentalFeatureCommand.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/GetExperimentalFeatureCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs index 1a9e02872d8..4866316efdc 100644 --- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs +++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/ExternalScriptInfo.cs b/src/System.Management.Automation/engine/ExternalScriptInfo.cs index 18db1edd721..ef4bc477653 100644 --- a/src/System.Management.Automation/engine/ExternalScriptInfo.cs +++ b/src/System.Management.Automation/engine/ExternalScriptInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ExtraAdapter.cs b/src/System.Management.Automation/engine/ExtraAdapter.cs index e44df98a8f2..dd6ba0c0784 100644 --- a/src/System.Management.Automation/engine/ExtraAdapter.cs +++ b/src/System.Management.Automation/engine/ExtraAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/FilterInfo.cs b/src/System.Management.Automation/engine/FilterInfo.cs index 70ad62b4a5a..247aa0d5f6b 100644 --- a/src/System.Management.Automation/engine/FilterInfo.cs +++ b/src/System.Management.Automation/engine/FilterInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 0c11badf613..95bdf5b0025 100644 --- a/src/System.Management.Automation/engine/FunctionInfo.cs +++ b/src/System.Management.Automation/engine/FunctionInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 06bdf643a5b..0532c78d525 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/ICommandRuntime.cs b/src/System.Management.Automation/engine/ICommandRuntime.cs index da77f9cdb45..cf5de2b20ab 100644 --- a/src/System.Management.Automation/engine/ICommandRuntime.cs +++ b/src/System.Management.Automation/engine/ICommandRuntime.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/InformationRecord.cs b/src/System.Management.Automation/engine/InformationRecord.cs index c65123fcf95..81a9789bb81 100644 --- a/src/System.Management.Automation/engine/InformationRecord.cs +++ b/src/System.Management.Automation/engine/InformationRecord.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index f1994d5a797..80fbfcc4b5f 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/InternalCommands.cs b/src/System.Management.Automation/engine/InternalCommands.cs index 9f861b5b78d..348f4b33277 100644 --- a/src/System.Management.Automation/engine/InternalCommands.cs +++ b/src/System.Management.Automation/engine/InternalCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/InvocationInfo.cs b/src/System.Management.Automation/engine/InvocationInfo.cs index e636f472086..1871ae3c9cd 100644 --- a/src/System.Management.Automation/engine/InvocationInfo.cs +++ b/src/System.Management.Automation/engine/InvocationInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs index b0f83d39214..63f4bbaffcb 100644 --- a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index aa2240bc454..54a9d568455 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs index 44788eb1d4c..522a69f11ed 100644 --- a/src/System.Management.Automation/engine/ManagementObjectAdapter.cs +++ b/src/System.Management.Automation/engine/ManagementObjectAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs index a1d5530b658..8bb14cebccb 100644 --- a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs +++ b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs index 705319bf327..a85b462abb9 100644 --- a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs +++ b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs index 0179b45e237..324922e9daa 100644 --- a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs +++ b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs b/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs index e937f2c12be..7dc91d76776 100644 --- a/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ExportModuleMemberCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs index 08b936a785b..bfecce83e4e 100644 --- a/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/GetModuleCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index 21fd37e27ad..55db1b075db 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 7506262ac1a..4200ea32fb3 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index feb511d109e..94cc94fdbd1 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs index 488d893b313..5333e364502 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/ModuleUtils.cs b/src/System.Management.Automation/engine/Modules/ModuleUtils.cs index 41fb0c5c0e1..b825a54fbab 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleUtils.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs index 2673c08ea5d..f61d3bb39bb 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs index 9b4da782d53..6f9f5a2f39f 100644 --- a/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/NewModuleManifestCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index 11622e04680..29bc54a6798 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs index 42584078d2e..10f53ef0136 100644 --- a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs +++ b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs b/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs index 863c01922d0..64958c9fde6 100644 --- a/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/RemoveModuleCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs index 8893882c80d..870c564244b 100644 --- a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs +++ b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs b/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs index ca0350daa1d..2f6c0fdd5cf 100644 --- a/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs +++ b/src/System.Management.Automation/engine/Modules/TestModuleManifestCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/MshCmdlet.cs b/src/System.Management.Automation/engine/MshCmdlet.cs index c3d070f7030..839ea1c005f 100644 --- a/src/System.Management.Automation/engine/MshCmdlet.cs +++ b/src/System.Management.Automation/engine/MshCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 19c328785d8..a40ebced867 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index df4e78eff30..e341d6d8dda 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index 80d5b90e106..7697f2b413e 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs index f7e6e50be4b..0ee6945f3a8 100644 --- a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs +++ b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/System.Management.Automation/engine/MshReference.cs b/src/System.Management.Automation/engine/MshReference.cs index eeeca79e178..05077708608 100644 --- a/src/System.Management.Automation/engine/MshReference.cs +++ b/src/System.Management.Automation/engine/MshReference.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Dynamic; diff --git a/src/System.Management.Automation/engine/MshSecurityException.cs b/src/System.Management.Automation/engine/MshSecurityException.cs index b207df2cf52..878de10e2b4 100644 --- a/src/System.Management.Automation/engine/MshSecurityException.cs +++ b/src/System.Management.Automation/engine/MshSecurityException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 94231ed8654..42f73df2a46 100644 --- a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs +++ b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/NativeCommand.cs b/src/System.Management.Automation/engine/NativeCommand.cs index 7147ea86a8a..417e257f548 100644 --- a/src/System.Management.Automation/engine/NativeCommand.cs +++ b/src/System.Management.Automation/engine/NativeCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 580c1580b56..d2c5d1de2ab 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs index 9fddd2cc827..5acdf199637 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinderController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index c41cd9a055b..45fb9582599 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/NullString.cs b/src/System.Management.Automation/engine/NullString.cs index 31c6f803526..9ac2ebe7c7e 100644 --- a/src/System.Management.Automation/engine/NullString.cs +++ b/src/System.Management.Automation/engine/NullString.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3a81a9c3d2e..3c385a6f7bf 100644 --- a/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs +++ b/src/System.Management.Automation/engine/ObjectEventRegistrationBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/PSClassInfo.cs b/src/System.Management.Automation/engine/PSClassInfo.cs index 2b999c9a3fb..2a22f27b189 100644 --- a/src/System.Management.Automation/engine/PSClassInfo.cs +++ b/src/System.Management.Automation/engine/PSClassInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/PSClassSearcher.cs b/src/System.Management.Automation/engine/PSClassSearcher.cs index aa7ae80d604..613035820d0 100644 --- a/src/System.Management.Automation/engine/PSClassSearcher.cs +++ b/src/System.Management.Automation/engine/PSClassSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/PSConfiguration.cs b/src/System.Management.Automation/engine/PSConfiguration.cs index c25eb20e1b6..820448dde29 100644 --- a/src/System.Management.Automation/engine/PSConfiguration.cs +++ b/src/System.Management.Automation/engine/PSConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index d557fccb09e..78e907af5c0 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index 8edc637b3cf..c2f2a45d057 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ParameterBinderController.cs b/src/System.Management.Automation/engine/ParameterBinderController.cs index 8524462c81b..5105abbc298 100644 --- a/src/System.Management.Automation/engine/ParameterBinderController.cs +++ b/src/System.Management.Automation/engine/ParameterBinderController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ParameterInfo.cs b/src/System.Management.Automation/engine/ParameterInfo.cs index 84ac0165e04..5878fdc400a 100644 --- a/src/System.Management.Automation/engine/ParameterInfo.cs +++ b/src/System.Management.Automation/engine/ParameterInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ParameterSetInfo.cs b/src/System.Management.Automation/engine/ParameterSetInfo.cs index f31d2f72417..85a3cf042a6 100644 --- a/src/System.Management.Automation/engine/ParameterSetInfo.cs +++ b/src/System.Management.Automation/engine/ParameterSetInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ParameterSetPromptingData.cs b/src/System.Management.Automation/engine/ParameterSetPromptingData.cs index d34e3e332c1..0f7889f8d0b 100644 --- a/src/System.Management.Automation/engine/ParameterSetPromptingData.cs +++ b/src/System.Management.Automation/engine/ParameterSetPromptingData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs index 14c8e07b490..7ffba7fd0dd 100644 --- a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs +++ b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace System.Management.Automation diff --git a/src/System.Management.Automation/engine/PathInterfaces.cs b/src/System.Management.Automation/engine/PathInterfaces.cs index 612411fc70e..342aec3cba0 100644 --- a/src/System.Management.Automation/engine/PathInterfaces.cs +++ b/src/System.Management.Automation/engine/PathInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/Pipe.cs b/src/System.Management.Automation/engine/Pipe.cs index a2473d1e44b..ac9350487a0 100644 --- a/src/System.Management.Automation/engine/Pipe.cs +++ b/src/System.Management.Automation/engine/Pipe.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/PositionalCommandParameter.cs b/src/System.Management.Automation/engine/PositionalCommandParameter.cs index 879b96c4649..1370d8c9a2f 100644 --- a/src/System.Management.Automation/engine/PositionalCommandParameter.cs +++ b/src/System.Management.Automation/engine/PositionalCommandParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/PowerShellStreamType.cs b/src/System.Management.Automation/engine/PowerShellStreamType.cs index 6d8bfc21184..6afbb79be51 100644 --- a/src/System.Management.Automation/engine/PowerShellStreamType.cs +++ b/src/System.Management.Automation/engine/PowerShellStreamType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace System.Management.Automation diff --git a/src/System.Management.Automation/engine/ProcessCodeMethods.cs b/src/System.Management.Automation/engine/ProcessCodeMethods.cs index 298bd0d1f1e..04487f923f8 100644 --- a/src/System.Management.Automation/engine/ProcessCodeMethods.cs +++ b/src/System.Management.Automation/engine/ProcessCodeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/ProgressRecord.cs b/src/System.Management.Automation/engine/ProgressRecord.cs index 4483ed81f94..086815105ef 100644 --- a/src/System.Management.Automation/engine/ProgressRecord.cs +++ b/src/System.Management.Automation/engine/ProgressRecord.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs index 2e7a4cd4bc4..e249a2b7d0c 100644 --- a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/ProviderInterfaces.cs b/src/System.Management.Automation/engine/ProviderInterfaces.cs index da270626875..c74b1336184 100644 --- a/src/System.Management.Automation/engine/ProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ProviderNames.cs b/src/System.Management.Automation/engine/ProviderNames.cs index c4915dd7773..0ae3e63edec 100644 --- a/src/System.Management.Automation/engine/ProviderNames.cs +++ b/src/System.Management.Automation/engine/ProviderNames.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3ea9c5a58f2..a3dca0da40a 100644 --- a/src/System.Management.Automation/engine/ProxyCommand.cs +++ b/src/System.Management.Automation/engine/ProxyCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/PseudoParameterBinder.cs index 3fbe1c4f7a2..123c7291e10 100644 --- a/src/System.Management.Automation/engine/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/PseudoParameterBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 d0dd98a32ae..28be3daefc6 100644 --- a/src/System.Management.Automation/engine/PseudoParameters.cs +++ b/src/System.Management.Automation/engine/PseudoParameters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/QuestionMarkVariable.cs b/src/System.Management.Automation/engine/QuestionMarkVariable.cs index f530bf533cc..af2436c2f2a 100644 --- a/src/System.Management.Automation/engine/QuestionMarkVariable.cs +++ b/src/System.Management.Automation/engine/QuestionMarkVariable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 7a75ca44376..ed6421ea77d 100644 --- a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs +++ b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/ScopedItemSearcher.cs b/src/System.Management.Automation/engine/ScopedItemSearcher.cs index 58a5a9cd58f..27710417123 100644 --- a/src/System.Management.Automation/engine/ScopedItemSearcher.cs +++ b/src/System.Management.Automation/engine/ScopedItemSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ScriptCommand.cs b/src/System.Management.Automation/engine/ScriptCommand.cs index 50811477c5f..d64d6112171 100644 --- a/src/System.Management.Automation/engine/ScriptCommand.cs +++ b/src/System.Management.Automation/engine/ScriptCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 5a5b2df239c..cdba3bad0a2 100644 --- a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs +++ b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ScriptInfo.cs b/src/System.Management.Automation/engine/ScriptInfo.cs index d12230f1273..695e89f04fb 100644 --- a/src/System.Management.Automation/engine/ScriptInfo.cs +++ b/src/System.Management.Automation/engine/ScriptInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs index 591d306a638..404eb940b0b 100644 --- a/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/SecurityDescriptorCmdletProviderInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SecurityManagerBase.cs b/src/System.Management.Automation/engine/SecurityManagerBase.cs index c03797ba2e0..3cb4c9e7a70 100644 --- a/src/System.Management.Automation/engine/SecurityManagerBase.cs +++ b/src/System.Management.Automation/engine/SecurityManagerBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/SerializationStrings.cs b/src/System.Management.Automation/engine/SerializationStrings.cs index 0bc8e998e40..c3a1c8a46dc 100644 --- a/src/System.Management.Automation/engine/SerializationStrings.cs +++ b/src/System.Management.Automation/engine/SerializationStrings.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 fbf4a774204..3b3f606e79f 100644 --- a/src/System.Management.Automation/engine/SessionState.cs +++ b/src/System.Management.Automation/engine/SessionState.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs b/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs index 48cd7eca09f..d63bee08917 100644 --- a/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateAliasAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs b/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs index 0b1e922b818..03cd9943bd0 100644 --- a/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateCmdletAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateContainer.cs b/src/System.Management.Automation/engine/SessionStateContainer.cs index aa32e151226..d57da6776fd 100644 --- a/src/System.Management.Automation/engine/SessionStateContainer.cs +++ b/src/System.Management.Automation/engine/SessionStateContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/SessionStateContent.cs b/src/System.Management.Automation/engine/SessionStateContent.cs index 5c4ae6e1c98..3ace73430c9 100644 --- a/src/System.Management.Automation/engine/SessionStateContent.cs +++ b/src/System.Management.Automation/engine/SessionStateContent.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 51714134f5d..abc6b867ae5 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs index 66c965dc404..4b6bfef05d7 100644 --- a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs index 88ff5a5350f..b04e5e8d275 100644 --- a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/SessionStateItem.cs b/src/System.Management.Automation/engine/SessionStateItem.cs index 64b4d04b9b5..aa1d50aab27 100644 --- a/src/System.Management.Automation/engine/SessionStateItem.cs +++ b/src/System.Management.Automation/engine/SessionStateItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs index 138f671ad6b..591c20f184a 100644 --- a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/SessionStateNavigation.cs b/src/System.Management.Automation/engine/SessionStateNavigation.cs index 9ac1c715cf4..f42e79433ad 100644 --- a/src/System.Management.Automation/engine/SessionStateNavigation.cs +++ b/src/System.Management.Automation/engine/SessionStateNavigation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateProperty.cs b/src/System.Management.Automation/engine/SessionStateProperty.cs index 1456d427c65..003da25d93f 100644 --- a/src/System.Management.Automation/engine/SessionStateProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateProperty.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs index beebcc60c08..61d21413604 100644 --- a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStatePublic.cs b/src/System.Management.Automation/engine/SessionStatePublic.cs index 7c5b41b7e74..de23eff9479 100644 --- a/src/System.Management.Automation/engine/SessionStatePublic.cs +++ b/src/System.Management.Automation/engine/SessionStatePublic.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateScope.cs b/src/System.Management.Automation/engine/SessionStateScope.cs index a0298746412..aac49ab5a4c 100644 --- a/src/System.Management.Automation/engine/SessionStateScope.cs +++ b/src/System.Management.Automation/engine/SessionStateScope.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs b/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs index f80bb29e470..2ab84387726 100644 --- a/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateScopeAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs b/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs index 64ac5b119cc..c3b643e4f31 100644 --- a/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs +++ b/src/System.Management.Automation/engine/SessionStateScopeEnumerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs index fef7c7eba06..574e2266638 100644 --- a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs +++ b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/SessionStateStrings.cs b/src/System.Management.Automation/engine/SessionStateStrings.cs index 741ab5f47cb..ac5ced27170 100644 --- a/src/System.Management.Automation/engine/SessionStateStrings.cs +++ b/src/System.Management.Automation/engine/SessionStateStrings.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 e01ed19cf7f..4eaf5b23312 100644 --- a/src/System.Management.Automation/engine/SessionStateUtils.cs +++ b/src/System.Management.Automation/engine/SessionStateUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs index fc69216b677..92abd09af6f 100644 --- a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/ShellVariable.cs b/src/System.Management.Automation/engine/ShellVariable.cs index 5a92077e4f9..42cc174083b 100644 --- a/src/System.Management.Automation/engine/ShellVariable.cs +++ b/src/System.Management.Automation/engine/ShellVariable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/SpecialVariables.cs b/src/System.Management.Automation/engine/SpecialVariables.cs index b867dfedc6d..fb6a762dfe6 100644 --- a/src/System.Management.Automation/engine/SpecialVariables.cs +++ b/src/System.Management.Automation/engine/SpecialVariables.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs index 8c2d4855469..75e958693d9 100644 --- a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs +++ b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/TransactedString.cs b/src/System.Management.Automation/engine/TransactedString.cs index 517a03a3600..948cf1d9d81 100644 --- a/src/System.Management.Automation/engine/TransactedString.cs +++ b/src/System.Management.Automation/engine/TransactedString.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/TransactionManager.cs b/src/System.Management.Automation/engine/TransactionManager.cs index 84606789b87..bf86d90e812 100644 --- a/src/System.Management.Automation/engine/TransactionManager.cs +++ b/src/System.Management.Automation/engine/TransactionManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/TypeMetadata.cs b/src/System.Management.Automation/engine/TypeMetadata.cs index 6b1237ab67b..76f22734f8a 100644 --- a/src/System.Management.Automation/engine/TypeMetadata.cs +++ b/src/System.Management.Automation/engine/TypeMetadata.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/TypeTable.cs b/src/System.Management.Automation/engine/TypeTable.cs index a0f62885d50..c6d52a7ff1b 100644 --- a/src/System.Management.Automation/engine/TypeTable.cs +++ b/src/System.Management.Automation/engine/TypeTable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/TypeTable_GetEvent_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_GetEvent_Types_Ps1Xml.cs index 35e7e77c4fe..a306c9cd9c8 100644 --- a/src/System.Management.Automation/engine/TypeTable_GetEvent_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_GetEvent_Types_Ps1Xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/TypeTable_TypesV3_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_TypesV3_Ps1Xml.cs index f95d3e04035..63c2ea1918d 100644 --- a/src/System.Management.Automation/engine/TypeTable_TypesV3_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_TypesV3_Ps1Xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs index 15e940d4302..6dbf181051a 100644 --- a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/UserFeedbackParameters.cs b/src/System.Management.Automation/engine/UserFeedbackParameters.cs index 27c5a46a4f8..e74e309b3b1 100644 --- a/src/System.Management.Automation/engine/UserFeedbackParameters.cs +++ b/src/System.Management.Automation/engine/UserFeedbackParameters.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 41a3e4573e1..6c122551995 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/VariableAttributeCollection.cs b/src/System.Management.Automation/engine/VariableAttributeCollection.cs index 7e9a0a4a026..918b040a0f6 100644 --- a/src/System.Management.Automation/engine/VariableAttributeCollection.cs +++ b/src/System.Management.Automation/engine/VariableAttributeCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/VariableInterfaces.cs b/src/System.Management.Automation/engine/VariableInterfaces.cs index 428ba7522fe..60d23f9e12a 100644 --- a/src/System.Management.Automation/engine/VariableInterfaces.cs +++ b/src/System.Management.Automation/engine/VariableInterfaces.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 db1bb184fbf..17cf9b95fac 100644 --- a/src/System.Management.Automation/engine/VariablePath.cs +++ b/src/System.Management.Automation/engine/VariablePath.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; diff --git a/src/System.Management.Automation/engine/WinRT/IInspectable.cs b/src/System.Management.Automation/engine/WinRT/IInspectable.cs index d01cf5965cd..f6f4d9ee7d9 100644 --- a/src/System.Management.Automation/engine/WinRT/IInspectable.cs +++ b/src/System.Management.Automation/engine/WinRT/IInspectable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Reflection; diff --git a/src/System.Management.Automation/engine/cmdlet.cs b/src/System.Management.Automation/engine/cmdlet.cs index 7c6ebb99ee0..4a330b34ed0 100644 --- a/src/System.Management.Automation/engine/cmdlet.cs +++ b/src/System.Management.Automation/engine/cmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/engine/debugger/Breakpoint.cs b/src/System.Management.Automation/engine/debugger/Breakpoint.cs index ade266e6c53..f9f550da7fa 100644 --- a/src/System.Management.Automation/engine/debugger/Breakpoint.cs +++ b/src/System.Management.Automation/engine/debugger/Breakpoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index 3b183bb2125..ab715b053ff 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs index c84f39d3891..e55f7618df6 100644 --- a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs +++ b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Threading; diff --git a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs index 82c35951f4c..ba3a8c13b66 100644 --- a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/hostifaces/Command.cs b/src/System.Management.Automation/engine/hostifaces/Command.cs index ae091e2ed59..a31f0087b36 100644 --- a/src/System.Management.Automation/engine/hostifaces/Command.cs +++ b/src/System.Management.Automation/engine/hostifaces/Command.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index f0b4a640f22..89d04fa515b 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs index 43b27614a12..dd3544aa406 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs index fbb38b61127..b42d8d7198a 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs b/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs index ad61687a10c..1542ab865f7 100644 --- a/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/DefaultHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs index 20deca8818e..1556d10aa55 100644 --- a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/hostifaces/History.cs b/src/System.Management.Automation/engine/hostifaces/History.cs index d5e1ef12d86..b6138df546c 100644 --- a/src/System.Management.Automation/engine/hostifaces/History.cs +++ b/src/System.Management.Automation/engine/hostifaces/History.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index acc3a26bd53..66f0d841bfb 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs index 34aa7ca0e30..c8d997d0808 100644 --- a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs +++ b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs index f56d05341c4..e170a3792e4 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs index d310d2fd056..d182ef6302a 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostRawUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index c37b85260f5..f0185900bbb 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs index f72322e90d7..bc25d928ef3 100644 --- a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs +++ b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs index 796e6c4d18c..f924985fb5c 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index a0d50bd15d8..48ab16c579a 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/MshHost.cs b/src/System.Management.Automation/engine/hostifaces/MshHost.cs index fdd6dce1196..356e2adb03f 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs index 41d27605390..e107054326e 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 45c0b44df75..1f3b857af21 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs index 97afac1e285..1d21fa952a0 100644 --- a/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs +++ b/src/System.Management.Automation/engine/hostifaces/NativeCultureResolver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /********************************************************************++ diff --git a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs index b9615ab0783..9da8f7c9081 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs index 2f21bb990f4..5d6fc8578ca 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index 45b3e944917..fc868fbf957 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/hostifaces/Parameter.cs b/src/System.Management.Automation/engine/hostifaces/Parameter.cs index 54fdbb18de0..3ffb3d22f97 100644 --- a/src/System.Management.Automation/engine/hostifaces/Parameter.cs +++ b/src/System.Management.Automation/engine/hostifaces/Parameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs b/src/System.Management.Automation/engine/hostifaces/Pipeline.cs index b73d4ed7db2..7c20c17f194 100644 --- a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/Pipeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index d1b26a1e111..0bb95d30d55 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs index 736a229d09d..938ba6d2874 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs b/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs index d9616190772..04dc65baac2 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspaceInit.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Dbg = System.Management.Automation.Diagnostics; diff --git a/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs b/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs index acc0ddf426d..25c611eba0e 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspaceInvoke.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 541575099b2..58268db59e5 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs index 3215b8f2f6b..49950ac0fa1 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs b/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs index 9d408fc99d6..f5155fd7c13 100644 --- a/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs +++ b/src/System.Management.Automation/engine/hostifaces/internalHostuserInterfacesecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs index 305514f70d8..fbc2276f693 100644 --- a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs +++ b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace System.Management.Automation.Runspaces diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index 45874d6a6c8..85d7c09841c 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/lang/codegen.cs b/src/System.Management.Automation/engine/lang/codegen.cs index d94adf00cc8..16fdf3079ba 100644 --- a/src/System.Management.Automation/engine/lang/codegen.cs +++ b/src/System.Management.Automation/engine/lang/codegen.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Text; diff --git a/src/System.Management.Automation/engine/lang/interface/PSParseError.cs b/src/System.Management.Automation/engine/lang/interface/PSParseError.cs index e3be59b5bee..5fa12cc073c 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSParseError.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSParseError.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /********************************************************************++ diff --git a/src/System.Management.Automation/engine/lang/interface/PSParser.cs b/src/System.Management.Automation/engine/lang/interface/PSParser.cs index 21d8b5b1bf9..0a4f93e2d5a 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSParser.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /********************************************************************++ diff --git a/src/System.Management.Automation/engine/lang/interface/PSToken.cs b/src/System.Management.Automation/engine/lang/interface/PSToken.cs index 712dc35ec54..b0b34ec0544 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSToken.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSToken.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /********************************************************************++ diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 38045a18d9c..28dcda71479 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/lang/scriptblock.cs b/src/System.Management.Automation/engine/lang/scriptblock.cs index 8a16a5f8726..ccd9ac5d918 100644 --- a/src/System.Management.Automation/engine/lang/scriptblock.cs +++ b/src/System.Management.Automation/engine/lang/scriptblock.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/AstVisitor.cs b/src/System.Management.Automation/engine/parser/AstVisitor.cs index a0089fc5d35..28cc235140a 100644 --- a/src/System.Management.Automation/engine/parser/AstVisitor.cs +++ b/src/System.Management.Automation/engine/parser/AstVisitor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/CharTraits.cs b/src/System.Management.Automation/engine/parser/CharTraits.cs index 1130a3909bb..fc45f017afd 100644 --- a/src/System.Management.Automation/engine/parser/CharTraits.cs +++ b/src/System.Management.Automation/engine/parser/CharTraits.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 1a0c8e104d3..229aa3a5887 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/ConstantValues.cs b/src/System.Management.Automation/engine/parser/ConstantValues.cs index 16d4a8d271e..ab01c61a651 100644 --- a/src/System.Management.Automation/engine/parser/ConstantValues.cs +++ b/src/System.Management.Automation/engine/parser/ConstantValues.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs b/src/System.Management.Automation/engine/parser/FusionAssemblyIdentity.cs index 6970e17b7cd..93e11f598b1 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. 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 0fb4ab37b0a..467f3f2c5e7 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. 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 703fc00706f..1feb951d7b4 100644 --- a/src/System.Management.Automation/engine/parser/PSType.cs +++ b/src/System.Management.Automation/engine/parser/PSType.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index 94b4e842956..7ef9e2f8848 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/Position.cs b/src/System.Management.Automation/engine/parser/Position.cs index b7e63532cc7..e9f273fed14 100644 --- a/src/System.Management.Automation/engine/parser/Position.cs +++ b/src/System.Management.Automation/engine/parser/Position.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs b/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs index ad95def8db8..b865a76ee40 100644 --- a/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs +++ b/src/System.Management.Automation/engine/parser/PreOrderVisitor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 75328a91ddd..abe3b95b933 100644 --- a/src/System.Management.Automation/engine/parser/SafeValues.cs +++ b/src/System.Management.Automation/engine/parser/SafeValues.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/SemanticChecks.cs b/src/System.Management.Automation/engine/parser/SemanticChecks.cs index 5fcd1ab4a0a..9068a60722b 100644 --- a/src/System.Management.Automation/engine/parser/SemanticChecks.cs +++ b/src/System.Management.Automation/engine/parser/SemanticChecks.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/SymbolResolver.cs b/src/System.Management.Automation/engine/parser/SymbolResolver.cs index f9fcf48d906..a453f0095ac 100644 --- a/src/System.Management.Automation/engine/parser/SymbolResolver.cs +++ b/src/System.Management.Automation/engine/parser/SymbolResolver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs index 9380092a35a..e09ece216ae 100644 --- a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs +++ b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/TypeResolver.cs b/src/System.Management.Automation/engine/parser/TypeResolver.cs index 9fee8108b60..ad771750e60 100644 --- a/src/System.Management.Automation/engine/parser/TypeResolver.cs +++ b/src/System.Management.Automation/engine/parser/TypeResolver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs index 66d7f43804d..4cae1d361d2 100644 --- a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs +++ b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index b1dd14464f9..f135fadfd54 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/engine/parser/token.cs b/src/System.Management.Automation/engine/parser/token.cs index e9575ebe720..bfe7ddbd6a5 100644 --- a/src/System.Management.Automation/engine/parser/token.cs +++ b/src/System.Management.Automation/engine/parser/token.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index e11d7f8de7d..7ea0ececdb0 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index 4c509970309..d963afffad1 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index 2c4ade7cb5f..2a62a8a543e 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 7101e7ffb7a..ccee756d654 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs index 07bfd126b88..5ae081bc3a7 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 63847c3f69f..7cbf139d361 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/Job2.cs b/src/System.Management.Automation/engine/remoting/client/Job2.cs index d2c3813a4cf..b97243651fb 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job2.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job2.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/JobManager.cs b/src/System.Management.Automation/engine/remoting/client/JobManager.cs index a81c5efdeff..88952ef893b 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobManager.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs index b0538b33f37..8802c3a2f61 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs b/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs index 038a8fc1763..288bc1449e9 100644 --- a/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs +++ b/src/System.Management.Automation/engine/remoting/client/PowerShellStreams.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 b401f0f96b6..640bbb11f33 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs index d38b67af1a5..5665a0e3be0 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs index 6c4b054e9c3..852579e0c88 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs index ebf24e1e757..acf5d8cee8c 100644 --- a/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs +++ b/src/System.Management.Automation/engine/remoting/client/RunspaceRef.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs index ceeb8f745de..f63376179a8 100644 --- a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs +++ b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs index bbd47cf7925..fc7e4ffa8c9 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index f146beb3d4a..cba83da97ad 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs index a599df2d4e3..5b7ddd301ee 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs index 76e257373d4..0b8cd69e2de 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs index b598d3ecbc9..1a975f5a785 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspaceinfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs index 6a640886300..04ac1eaeaa0 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 a9f3a7b6eca..486b9c4cf13 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs index 77e1c8d0b8e..452a6b10b75 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ConnectPSSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs index cfe092c639b..3a7d1e5a9e4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs +++ b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs index 385182fc12f..5a73ec9e38d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs index e664ee55ce0..dd4f153ca1d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DisconnectPSSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index 21614338af9..f39e7eae9b1 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/GetJob.cs b/src/System.Management.Automation/engine/remoting/commands/GetJob.cs index 2b41e3f39cf..17ee25c52cf 100644 --- a/src/System.Management.Automation/engine/remoting/commands/GetJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/GetJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs index 0fa91661b02..6b2fa8c804e 100644 --- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs b/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs index f4b2aff0be9..d06eabf25a3 100644 --- a/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs +++ b/src/System.Management.Automation/engine/remoting/commands/JobRepository.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs index 4303a766d3c..8a7a9b88b88 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationFile.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs index 19731beb1d4..963259b91ff 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 f6a7f215829..5ad0df8910c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionOptionCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 3654a67c3fd..a000e2d0bbe 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs index d6da9d63f81..c5d9648cd0a 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs index 70601f5f321..9a063d935e1 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs index f375b356df4..d6deb965849 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs index 039427c7170..e36fb633783 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceivePSSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs index 4771a86c1af..c63e4548e6a 100644 --- a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs b/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs index 84bddf6439f..1b5fcd7bbe4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ResumeJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs index 89a96b938af..29e6640279f 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StartJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StartJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs index 54df5b8b748..cdb1da81ed9 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs b/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs index 06015f2b139..1c729d8df74 100644 --- a/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs b/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs index 3add796b3c8..3e013caa05b 100644 --- a/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs +++ b/src/System.Management.Automation/engine/remoting/commands/TestPSSessionConfigurationFile.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs index 45df8a25706..dd04519eb19 100644 --- a/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/WaitJob.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs index af1005faa6f..2a3c92dfcf3 100644 --- a/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/getrunspacecommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs index 1d1c6e5533b..c9df93cd05b 100644 --- a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs index 57f38139d24..1ccdd82c396 100644 --- a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs +++ b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs index f81570bd5d8..d4cf3877fd4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/removerunspacecommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs b/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs index f3961cb688d..3f1f20b4c6c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs +++ b/src/System.Management.Automation/engine/remoting/commands/runspacerepository.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs b/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs index 4e2ec57d264..a68a6f78869 100644 --- a/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs +++ b/src/System.Management.Automation/engine/remoting/common/AsyncObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Threading; diff --git a/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs b/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs index ef41f1985ee..035d39ac84e 100644 --- a/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs +++ b/src/System.Management.Automation/engine/remoting/common/DispatchTable.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/Indexer.cs b/src/System.Management.Automation/engine/remoting/common/Indexer.cs index 96c31e7b17f..0f6b70482c8 100644 --- a/src/System.Management.Automation/engine/remoting/common/Indexer.cs +++ b/src/System.Management.Automation/engine/remoting/common/Indexer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs b/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs index 6ad0dbd581e..25534b59a30 100644 --- a/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs +++ b/src/System.Management.Automation/engine/remoting/common/ObjectRef.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 d2e08ad68c7..5eb9c5fc338 100644 --- a/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs +++ b/src/System.Management.Automation/engine/remoting/common/PSETWTracer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 4c34f1d4d3b..616ca252d07 100644 --- a/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs +++ b/src/System.Management.Automation/engine/remoting/common/PSSessionConfigurationTypeOption.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs index e618532f125..dff56e407f9 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 eefe2f51f73..92d10c75000 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 1b28947623f..3e4af990bd0 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs index 629a046b492..ad193fc914b 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceInitInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 cac5184e075..e863a7c795e 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspacePoolStateInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 eb997d8a44e..bfc4bdaca6b 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteDebuggingCapability.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteDebuggingCapability.cs index b4d5072e046..8314337b77a 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteDebuggingCapability.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteDebuggingCapability.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; 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 562e58db8bc..414676dffed 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; 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 ef27c874c42..8a60ce277a8 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteHostEncoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; 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 bde35ad9de1..bc5d47c8a83 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; 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 f4e9a943837..664c2a91ae0 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemotingDataObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs index a2b34d5fb8c..72feecefdc9 100644 --- a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs +++ b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/common/misc.cs b/src/System.Management.Automation/engine/remoting/common/misc.cs index 9d515b2c7c9..ab344497f8b 100644 --- a/src/System.Management.Automation/engine/remoting/common/misc.cs +++ b/src/System.Management.Automation/engine/remoting/common/misc.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Remoting; diff --git a/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs b/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs index e08c768f95a..fa1bcb7da86 100644 --- a/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs +++ b/src/System.Management.Automation/engine/remoting/common/psstreamobject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Runspaces; diff --git a/src/System.Management.Automation/engine/remoting/common/remotesession.cs b/src/System.Management.Automation/engine/remoting/common/remotesession.cs index e0d6ff4687c..662a7344068 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotesession.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotesession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 60db14226b8..47fb742f448 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs b/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs index ed133110b7f..571ec3225d5 100644 --- a/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs +++ b/src/System.Management.Automation/engine/remoting/common/throttlemanager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs index 082a8852552..e8a780543bc 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /* diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index dfcd8b44960..6ed7eb06245 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index c4f9f9d0d7c..9bd00bed2c6 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /* diff --git a/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs b/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs index 32ce3834bce..1341c9e0a83 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PSPrincipal.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /* diff --git a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs index 0f4a29c4ac0..17aac7adfdf 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PSSessionConfigurationData.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs b/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs index 5c559536435..6c2b64479f4 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/PriorityCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs index f8f21fc03a0..fca6eb12a51 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs index 692288e74f6..860dcb3ae32 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ---------------------------------------------------------------------- // Contents: Entry points for managed PowerShell plugin worker used to diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs index c318cfb2b57..cd77ccedb82 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ---------------------------------------------------------------------- // Contents: Entry points for managed PowerShell plugin worker used to diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs index 3d18ff69dc3..c3cc20983ab 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ---------------------------------------------------------------------- // Contents: Entry points for managed PowerShell plugin worker used to diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs index c73cb1c4bfd..2c963a69d16 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginTransportManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ---------------------------------------------------------------------- // Contents: Entry points for managed PowerShell plugin worker used to diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index 46ac2063192..76319a5bc5a 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /* diff --git a/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs b/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs index 149cf133194..63185ebc13f 100644 --- a/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs +++ b/src/System.Management.Automation/engine/remoting/host/RemoteHostMethodInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs index 09c47a789a3..e88447a61d7 100644 --- a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs +++ b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 3228d1fad83..0c0fb0a0c42 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerMethodExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Remoting.Server; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs index ce5f69ee6a3..b71da3cb5e7 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerPowerShellDriver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs index 872588ef549..921f9f456f1 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHost.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs index be421ec7603..5fe393171d3 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs index 694876f8c32..89a5ef97569 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs index a1ae5bb67cb..15dc8654f88 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index b3335cb7d02..8aff9264d0b 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs index f94c5e3e39e..9b86ac8c5ca 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineDriver.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. 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 611a0719a5d..850993cf162 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerSteppablePipelineSubscriber.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 d0aedc2c9f4..3b1174f0fff 100644 --- a/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs +++ b/src/System.Management.Automation/engine/remoting/server/WSManChannelEvents.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 b951edf142a..3b77a0e656c 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs index 3aa174df7db..27bd41330f1 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs index 3120b3b17f4..cb8b8060a52 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 475b6399e93..653299e2cbb 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 cbccd082a77..5db2bfec218 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index c3416bb321a..2341dca4042 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs b/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs index 911c6b9a688..d340f8c2667 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/ArrayOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 be30fe10310..7b06697afa1 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/ClassOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index bfa573ee928..8ae6da58655 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs index e687e4c7f43..9fa515a9b81 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ReSharper disable UnusedMember.Global diff --git a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs index 2bf68796b4a..1f0c26ab01a 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs b/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs index f26fce16a00..d337c56ab2b 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/VariableOps.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Linq; diff --git a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs index 9a41f13d0fd..66b5f63da82 100644 --- a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs +++ b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/scriptparameterbinder.cs b/src/System.Management.Automation/engine/scriptparameterbinder.cs index 6e580507684..35480a96d3e 100644 --- a/src/System.Management.Automation/engine/scriptparameterbinder.cs +++ b/src/System.Management.Automation/engine/scriptparameterbinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs index 601fc78667c..9a63b1969a8 100644 --- a/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs +++ b/src/System.Management.Automation/engine/scriptparameterbindercontroller.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index f419968144f..ddc44bd8970 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/help/AliasHelpInfo.cs b/src/System.Management.Automation/help/AliasHelpInfo.cs index d0fd56d0f49..b51d1b192dc 100644 --- a/src/System.Management.Automation/help/AliasHelpInfo.cs +++ b/src/System.Management.Automation/help/AliasHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 17be8bb3f3f..db7e4056d1e 100644 --- a/src/System.Management.Automation/help/AliasHelpProvider.cs +++ b/src/System.Management.Automation/help/AliasHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/BaseCommandHelpInfo.cs b/src/System.Management.Automation/help/BaseCommandHelpInfo.cs index e1147c0780f..0c70b815928 100644 --- a/src/System.Management.Automation/help/BaseCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/BaseCommandHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/CabinetAPI.cs b/src/System.Management.Automation/help/CabinetAPI.cs index c308de10049..41a83010f58 100644 --- a/src/System.Management.Automation/help/CabinetAPI.cs +++ b/src/System.Management.Automation/help/CabinetAPI.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/help/CabinetNativeApi.cs b/src/System.Management.Automation/help/CabinetNativeApi.cs index 0ef22c88dc8..4b19861e473 100644 --- a/src/System.Management.Automation/help/CabinetNativeApi.cs +++ b/src/System.Management.Automation/help/CabinetNativeApi.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/help/CommandHelpProvider.cs b/src/System.Management.Automation/help/CommandHelpProvider.cs index 24acee030d7..e89bbcc40c4 100644 --- a/src/System.Management.Automation/help/CommandHelpProvider.cs +++ b/src/System.Management.Automation/help/CommandHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs index 2646276725b..76ac1e7d1b6 100644 --- a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs +++ b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/DefaultHelpProvider.cs b/src/System.Management.Automation/help/DefaultHelpProvider.cs index d1e63f6e9b8..9bbaea3f08d 100644 --- a/src/System.Management.Automation/help/DefaultHelpProvider.cs +++ b/src/System.Management.Automation/help/DefaultHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 c337705d46d..b0cdc239fb8 100644 --- a/src/System.Management.Automation/help/DscResourceHelpProvider.cs +++ b/src/System.Management.Automation/help/DscResourceHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs index fc1071ec4a0..194160ad5e2 100644 --- a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs +++ b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/help/HelpCommands.cs b/src/System.Management.Automation/help/HelpCommands.cs index 9b7ad5edd96..852db86c267 100644 --- a/src/System.Management.Automation/help/HelpCommands.cs +++ b/src/System.Management.Automation/help/HelpCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/help/HelpCommentsParser.cs b/src/System.Management.Automation/help/HelpCommentsParser.cs index 3bfa0181297..62cbfdd9557 100644 --- a/src/System.Management.Automation/help/HelpCommentsParser.cs +++ b/src/System.Management.Automation/help/HelpCommentsParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/HelpErrorTracer.cs b/src/System.Management.Automation/help/HelpErrorTracer.cs index 6a2ae124955..7437e5cc7dd 100644 --- a/src/System.Management.Automation/help/HelpErrorTracer.cs +++ b/src/System.Management.Automation/help/HelpErrorTracer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpFileHelpInfo.cs b/src/System.Management.Automation/help/HelpFileHelpInfo.cs index bbab589e776..1df1b70411b 100644 --- a/src/System.Management.Automation/help/HelpFileHelpInfo.cs +++ b/src/System.Management.Automation/help/HelpFileHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 e1e0a438526..2c527d2f95a 100644 --- a/src/System.Management.Automation/help/HelpFileHelpProvider.cs +++ b/src/System.Management.Automation/help/HelpFileHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/HelpInfo.cs b/src/System.Management.Automation/help/HelpInfo.cs index e8dbc08d9dc..bc0b855d807 100644 --- a/src/System.Management.Automation/help/HelpInfo.cs +++ b/src/System.Management.Automation/help/HelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3bb400119a3..e6dc7a21ee4 100644 --- a/src/System.Management.Automation/help/HelpNotFoundException.cs +++ b/src/System.Management.Automation/help/HelpNotFoundException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/help/HelpProvider.cs b/src/System.Management.Automation/help/HelpProvider.cs index 6da72b1f542..66a7ab1ab95 100644 --- a/src/System.Management.Automation/help/HelpProvider.cs +++ b/src/System.Management.Automation/help/HelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/HelpProviderWithCache.cs b/src/System.Management.Automation/help/HelpProviderWithCache.cs index 6c54eb577d9..99dc3fa7a19 100644 --- a/src/System.Management.Automation/help/HelpProviderWithCache.cs +++ b/src/System.Management.Automation/help/HelpProviderWithCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/HelpProviderWithFullCache.cs b/src/System.Management.Automation/help/HelpProviderWithFullCache.cs index 52a4d21e54c..379ee0ac1c6 100644 --- a/src/System.Management.Automation/help/HelpProviderWithFullCache.cs +++ b/src/System.Management.Automation/help/HelpProviderWithFullCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 83113a4ca9d..7e4de9f1569 100644 --- a/src/System.Management.Automation/help/HelpRequest.cs +++ b/src/System.Management.Automation/help/HelpRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 3e3c4080a85..fb92ed1c19c 100644 --- a/src/System.Management.Automation/help/HelpSystem.cs +++ b/src/System.Management.Automation/help/HelpSystem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/HelpUtils.cs b/src/System.Management.Automation/help/HelpUtils.cs index 7892ec26af8..0c0770173be 100644 --- a/src/System.Management.Automation/help/HelpUtils.cs +++ b/src/System.Management.Automation/help/HelpUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.IO; diff --git a/src/System.Management.Automation/help/MUIFileSearcher.cs b/src/System.Management.Automation/help/MUIFileSearcher.cs index 354cc9c4d10..2101e268dc1 100644 --- a/src/System.Management.Automation/help/MUIFileSearcher.cs +++ b/src/System.Management.Automation/help/MUIFileSearcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/MamlClassHelpInfo.cs b/src/System.Management.Automation/help/MamlClassHelpInfo.cs index 36d337474f3..002eecb3bfe 100644 --- a/src/System.Management.Automation/help/MamlClassHelpInfo.cs +++ b/src/System.Management.Automation/help/MamlClassHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 aea0ed47936..998e647cd05 100644 --- a/src/System.Management.Automation/help/MamlCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/MamlCommandHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Globalization; diff --git a/src/System.Management.Automation/help/MamlNode.cs b/src/System.Management.Automation/help/MamlNode.cs index 332a7953087..712dc2325ea 100644 --- a/src/System.Management.Automation/help/MamlNode.cs +++ b/src/System.Management.Automation/help/MamlNode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/MamlUtil.cs b/src/System.Management.Automation/help/MamlUtil.cs index 999cbe2e255..7e8bd8892cf 100644 --- a/src/System.Management.Automation/help/MamlUtil.cs +++ b/src/System.Management.Automation/help/MamlUtil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/PSClassHelpProvider.cs b/src/System.Management.Automation/help/PSClassHelpProvider.cs index 6ee8107afa7..b6ec7a0db69 100644 --- a/src/System.Management.Automation/help/PSClassHelpProvider.cs +++ b/src/System.Management.Automation/help/PSClassHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs b/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs index 1c9d43cf9a2..6d9bedf4fac 100644 --- a/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs +++ b/src/System.Management.Automation/help/ProviderCommandHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 cfe2aeafbcc..184ad5526fa 100644 --- a/src/System.Management.Automation/help/ProviderContext.cs +++ b/src/System.Management.Automation/help/ProviderContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/help/ProviderHelpInfo.cs b/src/System.Management.Automation/help/ProviderHelpInfo.cs index b1fb779a3da..39eebe0c23a 100644 --- a/src/System.Management.Automation/help/ProviderHelpInfo.cs +++ b/src/System.Management.Automation/help/ProviderHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/ProviderHelpProvider.cs b/src/System.Management.Automation/help/ProviderHelpProvider.cs index 71331657461..a21c3038b43 100644 --- a/src/System.Management.Automation/help/ProviderHelpProvider.cs +++ b/src/System.Management.Automation/help/ProviderHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/help/RemoteHelpInfo.cs b/src/System.Management.Automation/help/RemoteHelpInfo.cs index 3a69a84d8dc..a80ba7a7736 100644 --- a/src/System.Management.Automation/help/RemoteHelpInfo.cs +++ b/src/System.Management.Automation/help/RemoteHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/help/SaveHelpCommand.cs b/src/System.Management.Automation/help/SaveHelpCommand.cs index b87ff03a3dc..3c4d18af00a 100644 --- a/src/System.Management.Automation/help/SaveHelpCommand.cs +++ b/src/System.Management.Automation/help/SaveHelpCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs b/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs index 119c51d67dd..5071451962e 100644 --- a/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs +++ b/src/System.Management.Automation/help/ScriptCommandHelpProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 8b97b1a98a1..469ab94a913 100644 --- a/src/System.Management.Automation/help/SyntaxHelpInfo.cs +++ b/src/System.Management.Automation/help/SyntaxHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 6de08213888..16ac4f2a58e 100644 --- a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs +++ b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/help/UpdatableHelpInfo.cs b/src/System.Management.Automation/help/UpdatableHelpInfo.cs index e4eea1ef9cb..cb5b1b959f8 100644 --- a/src/System.Management.Automation/help/UpdatableHelpInfo.cs +++ b/src/System.Management.Automation/help/UpdatableHelpInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs b/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs index 893f46344e9..9f0c32d679a 100644 --- a/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs +++ b/src/System.Management.Automation/help/UpdatableHelpModuleInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; diff --git a/src/System.Management.Automation/help/UpdatableHelpSystem.cs b/src/System.Management.Automation/help/UpdatableHelpSystem.cs index eba8c8583d1..6bdac0afaf8 100644 --- a/src/System.Management.Automation/help/UpdatableHelpSystem.cs +++ b/src/System.Management.Automation/help/UpdatableHelpSystem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/help/UpdatableHelpUri.cs b/src/System.Management.Automation/help/UpdatableHelpUri.cs index eea27f0534c..28683a3e2a8 100644 --- a/src/System.Management.Automation/help/UpdatableHelpUri.cs +++ b/src/System.Management.Automation/help/UpdatableHelpUri.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics; diff --git a/src/System.Management.Automation/help/UpdateHelpCommand.cs b/src/System.Management.Automation/help/UpdateHelpCommand.cs index 88efa16f0da..bccd7418476 100644 --- a/src/System.Management.Automation/help/UpdateHelpCommand.cs +++ b/src/System.Management.Automation/help/UpdateHelpCommand.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/logging/LogContext.cs b/src/System.Management.Automation/logging/LogContext.cs index aa07e805e3d..84df2e34be4 100644 --- a/src/System.Management.Automation/logging/LogContext.cs +++ b/src/System.Management.Automation/logging/LogContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 46f4bcb19cd..19eed89d968 100644 --- a/src/System.Management.Automation/logging/LogProvider.cs +++ b/src/System.Management.Automation/logging/LogProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/logging/MshLog.cs b/src/System.Management.Automation/logging/MshLog.cs index e48b3fb28c4..9ebdb699e40 100644 --- a/src/System.Management.Automation/logging/MshLog.cs +++ b/src/System.Management.Automation/logging/MshLog.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs b/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs index 52711fee895..e6f301a04ac 100644 --- a/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs +++ b/src/System.Management.Automation/logging/eventlog/EventLogLogProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/namespaces/AliasProvider.cs b/src/System.Management.Automation/namespaces/AliasProvider.cs index 376cf0f8eda..700d2a7ce84 100644 --- a/src/System.Management.Automation/namespaces/AliasProvider.cs +++ b/src/System.Management.Automation/namespaces/AliasProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/ContainerProviderBase.cs b/src/System.Management.Automation/namespaces/ContainerProviderBase.cs index 0ff37f207ad..c70fe238b44 100644 --- a/src/System.Management.Automation/namespaces/ContainerProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ContainerProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/namespaces/CoreCommandContext.cs b/src/System.Management.Automation/namespaces/CoreCommandContext.cs index 51691548d32..4c571a6fb73 100644 --- a/src/System.Management.Automation/namespaces/CoreCommandContext.cs +++ b/src/System.Management.Automation/namespaces/CoreCommandContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/namespaces/DriveProviderBase.cs b/src/System.Management.Automation/namespaces/DriveProviderBase.cs index 2a6e6ff03f7..d69f17e94ee 100644 --- a/src/System.Management.Automation/namespaces/DriveProviderBase.cs +++ b/src/System.Management.Automation/namespaces/DriveProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/namespaces/EnvironmentProvider.cs b/src/System.Management.Automation/namespaces/EnvironmentProvider.cs index a5c21017569..4f1fd8eb0b0 100644 --- a/src/System.Management.Automation/namespaces/EnvironmentProvider.cs +++ b/src/System.Management.Automation/namespaces/EnvironmentProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index 0cb668b7248..da2d708aa99 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index bda80eecb24..23706ab1e05 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs index c3b1cc1f5a6..25143673900 100644 --- a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs +++ b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/FunctionProvider.cs b/src/System.Management.Automation/namespaces/FunctionProvider.cs index c5d603f4158..d12808cf7c0 100644 --- a/src/System.Management.Automation/namespaces/FunctionProvider.cs +++ b/src/System.Management.Automation/namespaces/FunctionProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/IContentProvider.cs b/src/System.Management.Automation/namespaces/IContentProvider.cs index 92c88d7a937..7c91019124d 100644 --- a/src/System.Management.Automation/namespaces/IContentProvider.cs +++ b/src/System.Management.Automation/namespaces/IContentProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 4ca0064f888..8835d948ddd 100644 --- a/src/System.Management.Automation/namespaces/IContentReader.cs +++ b/src/System.Management.Automation/namespaces/IContentReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/namespaces/IContentWriter.cs b/src/System.Management.Automation/namespaces/IContentWriter.cs index 437a08cfe19..e01ed0c9cb4 100644 --- a/src/System.Management.Automation/namespaces/IContentWriter.cs +++ b/src/System.Management.Automation/namespaces/IContentWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs b/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs index d4ccdaa3b59..d7265e7380f 100644 --- a/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs +++ b/src/System.Management.Automation/namespaces/IDynamicPropertyProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 b5adea6644c..13b41261a19 100644 --- a/src/System.Management.Automation/namespaces/IPermissionProvider.cs +++ b/src/System.Management.Automation/namespaces/IPermissionProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 f5e331846d9..2a347fafbce 100644 --- a/src/System.Management.Automation/namespaces/IPropertiesProvider.cs +++ b/src/System.Management.Automation/namespaces/IPropertiesProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/namespaces/ItemProviderBase.cs b/src/System.Management.Automation/namespaces/ItemProviderBase.cs index 7562c1c58fe..c563f48aaec 100644 --- a/src/System.Management.Automation/namespaces/ItemProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ItemProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/namespaces/LocationGlobber.cs b/src/System.Management.Automation/namespaces/LocationGlobber.cs index f03ff7038dd..0a4e1785e4c 100644 --- a/src/System.Management.Automation/namespaces/LocationGlobber.cs +++ b/src/System.Management.Automation/namespaces/LocationGlobber.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs index 654574c8dec..bacaa547a60 100644 --- a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs +++ b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/namespaces/PathInfo.cs b/src/System.Management.Automation/namespaces/PathInfo.cs index 9440eb56e51..cd91845f84c 100644 --- a/src/System.Management.Automation/namespaces/PathInfo.cs +++ b/src/System.Management.Automation/namespaces/PathInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Dbg = System.Management.Automation; diff --git a/src/System.Management.Automation/namespaces/ProviderBase.cs b/src/System.Management.Automation/namespaces/ProviderBase.cs index 4b9e46ab596..9441cf90e75 100644 --- a/src/System.Management.Automation/namespaces/ProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs b/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs index 16fd633c9e1..c232b769fb3 100644 --- a/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs +++ b/src/System.Management.Automation/namespaces/ProviderBaseSecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Security.AccessControl; diff --git a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs index e490db90a18..4107dc662c6 100644 --- a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs +++ b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 7aa18ebee6c..5436dfb0bbb 100644 --- a/src/System.Management.Automation/namespaces/RegistryProvider.cs +++ b/src/System.Management.Automation/namespaces/RegistryProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/namespaces/RegistrySecurity.cs b/src/System.Management.Automation/namespaces/RegistrySecurity.cs index c528c3b5131..cd05967b7eb 100644 --- a/src/System.Management.Automation/namespaces/RegistrySecurity.cs +++ b/src/System.Management.Automation/namespaces/RegistrySecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/namespaces/RegistryWrapper.cs b/src/System.Management.Automation/namespaces/RegistryWrapper.cs index 049c65fbd34..13f451a539c 100644 --- a/src/System.Management.Automation/namespaces/RegistryWrapper.cs +++ b/src/System.Management.Automation/namespaces/RegistryWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. /* diff --git a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs index 2bfa089d455..3d9e299d028 100644 --- a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs +++ b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs b/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs index d26d3ce3642..01cef7dce46 100644 --- a/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs +++ b/src/System.Management.Automation/namespaces/SafeTransactionHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs index d96010ed163..f3720bb130d 100644 --- a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs +++ b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/namespaces/StackInfo.cs b/src/System.Management.Automation/namespaces/StackInfo.cs index c8f068f4bd2..4715c28172a 100644 --- a/src/System.Management.Automation/namespaces/StackInfo.cs +++ b/src/System.Management.Automation/namespaces/StackInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 ea293cc857d..56062e6de6c 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistry.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistry.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs index 67fec931cce..dac6f6c0897 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistryKey.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs index a6f69c981d9..e0cd273fe2b 100644 --- a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs +++ b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/namespaces/VariableProvider.cs b/src/System.Management.Automation/namespaces/VariableProvider.cs index 994476117e7..5da5351ebad 100644 --- a/src/System.Management.Automation/namespaces/VariableProvider.cs +++ b/src/System.Management.Automation/namespaces/VariableProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/namespaces/Win32Native.cs b/src/System.Management.Automation/namespaces/Win32Native.cs index 5ce1810440a..41638e9b969 100644 --- a/src/System.Management.Automation/namespaces/Win32Native.cs +++ b/src/System.Management.Automation/namespaces/Win32Native.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // NOTE: A vast majority of this code was copied from BCL in diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index 1b809231cae..49d0f79783e 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/security/CatalogHelper.cs b/src/System.Management.Automation/security/CatalogHelper.cs index 018720f3910..74a239a2ccd 100644 --- a/src/System.Management.Automation/security/CatalogHelper.cs +++ b/src/System.Management.Automation/security/CatalogHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/security/CredentialParameter.cs b/src/System.Management.Automation/security/CredentialParameter.cs index 5497c4b7eca..1472f331e49 100644 --- a/src/System.Management.Automation/security/CredentialParameter.cs +++ b/src/System.Management.Automation/security/CredentialParameter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/security/MshSignature.cs b/src/System.Management.Automation/security/MshSignature.cs index 6402c56a858..df20f7d0e63 100644 --- a/src/System.Management.Automation/security/MshSignature.cs +++ b/src/System.Management.Automation/security/MshSignature.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ComponentModel; diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index 6f7bb1180b3..bc2c3c6374c 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/security/SecurityManager.cs b/src/System.Management.Automation/security/SecurityManager.cs index 940241b260f..7d6478601d7 100644 --- a/src/System.Management.Automation/security/SecurityManager.cs +++ b/src/System.Management.Automation/security/SecurityManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index b7b08491e5f..d9c1f0d3994 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index ab5c9cf1375..e109e000719 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/security/wldpNativeMethods.cs b/src/System.Management.Automation/security/wldpNativeMethods.cs index 901135907d3..6f814ed8ca2 100644 --- a/src/System.Management.Automation/security/wldpNativeMethods.cs +++ b/src/System.Management.Automation/security/wldpNativeMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // diff --git a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs index 27656b111c2..cbd4d8836cf 100644 --- a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index f6f8f0b6df2..b1f13ab0cf0 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs index b75c50bcbb9..130ebbe8241 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Reflection; diff --git a/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs b/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs index 1e10b2e4eb7..eecde27926c 100644 --- a/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs +++ b/src/System.Management.Automation/utils/ArchitectureSensitiveAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 6b28170ffad..583eecfa836 100644 --- a/src/System.Management.Automation/utils/BackgroundDispatcher.cs +++ b/src/System.Management.Automation/utils/BackgroundDispatcher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 dd1b806fdc9..148d5696d7a 100644 --- a/src/System.Management.Automation/utils/ClrFacade.cs +++ b/src/System.Management.Automation/utils/ClrFacade.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs index 39e22c79ab1..ea6ecd3b0ba 100644 --- a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs +++ b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/utils/CommandProcessorExceptions.cs b/src/System.Management.Automation/utils/CommandProcessorExceptions.cs index d0ee48167f6..4aebe05af59 100644 --- a/src/System.Management.Automation/utils/CommandProcessorExceptions.cs +++ b/src/System.Management.Automation/utils/CommandProcessorExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 9a544dc5871..c91c3ce69fb 100644 --- a/src/System.Management.Automation/utils/CoreProviderCmdlets.cs +++ b/src/System.Management.Automation/utils/CoreProviderCmdlets.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 67ef04258ef..2b644f8aebb 100644 --- a/src/System.Management.Automation/utils/CryptoUtils.cs +++ b/src/System.Management.Automation/utils/CryptoUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 26a1b6a60ac..a843bc381da 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/ExecutionExceptions.cs b/src/System.Management.Automation/utils/ExecutionExceptions.cs index 297105a1c17..ab60cc636ba 100644 --- a/src/System.Management.Automation/utils/ExecutionExceptions.cs +++ b/src/System.Management.Automation/utils/ExecutionExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma warning disable 1634, 1691 diff --git a/src/System.Management.Automation/utils/ExtensionMethods.cs b/src/System.Management.Automation/utils/ExtensionMethods.cs index a7abaf71055..93951bb1ac1 100644 --- a/src/System.Management.Automation/utils/ExtensionMethods.cs +++ b/src/System.Management.Automation/utils/ExtensionMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs b/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs index a46fdb056ec..db68073deb4 100644 --- a/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs +++ b/src/System.Management.Automation/utils/FormatAndTypeDataHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/utils/FuzzyMatch.cs b/src/System.Management.Automation/utils/FuzzyMatch.cs index a99f9a5bf5c..828d5cdb148 100644 --- a/src/System.Management.Automation/utils/FuzzyMatch.cs +++ b/src/System.Management.Automation/utils/FuzzyMatch.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs b/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs index 3a1ffb11ba5..7579245980b 100644 --- a/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs +++ b/src/System.Management.Automation/utils/GraphicalHostReflectionWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 f0b80dcf057..c67fcd7e1b7 100644 --- a/src/System.Management.Automation/utils/HostInterfacesExceptions.cs +++ b/src/System.Management.Automation/utils/HostInterfacesExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/utils/IObjectReader.cs b/src/System.Management.Automation/utils/IObjectReader.cs index 5d865f197b8..a4fb4a53f37 100644 --- a/src/System.Management.Automation/utils/IObjectReader.cs +++ b/src/System.Management.Automation/utils/IObjectReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/IObjectWriter.cs b/src/System.Management.Automation/utils/IObjectWriter.cs index c3367ee77f3..eb011e4f3b8 100644 --- a/src/System.Management.Automation/utils/IObjectWriter.cs +++ b/src/System.Management.Automation/utils/IObjectWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/utils/MetadataExceptions.cs b/src/System.Management.Automation/utils/MetadataExceptions.cs index c7a9e061b10..21f9a9b842c 100644 --- a/src/System.Management.Automation/utils/MetadataExceptions.cs +++ b/src/System.Management.Automation/utils/MetadataExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/MshArgumentException.cs b/src/System.Management.Automation/utils/MshArgumentException.cs index f7adfb599f5..e937a275b4d 100644 --- a/src/System.Management.Automation/utils/MshArgumentException.cs +++ b/src/System.Management.Automation/utils/MshArgumentException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshArgumentNullException.cs b/src/System.Management.Automation/utils/MshArgumentNullException.cs index 9789acb2dd9..a7b870bcab0 100644 --- a/src/System.Management.Automation/utils/MshArgumentNullException.cs +++ b/src/System.Management.Automation/utils/MshArgumentNullException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs index 6806b836248..e54320235a2 100644 --- a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs +++ b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshInvalidOperationException.cs b/src/System.Management.Automation/utils/MshInvalidOperationException.cs index 18a100c686b..e4c0b7b111e 100644 --- a/src/System.Management.Automation/utils/MshInvalidOperationException.cs +++ b/src/System.Management.Automation/utils/MshInvalidOperationException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshNotImplementedException.cs b/src/System.Management.Automation/utils/MshNotImplementedException.cs index bc63b870ddc..c84f66e1ac4 100644 --- a/src/System.Management.Automation/utils/MshNotImplementedException.cs +++ b/src/System.Management.Automation/utils/MshNotImplementedException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshNotSupportedException.cs b/src/System.Management.Automation/utils/MshNotSupportedException.cs index c35af88a065..fc4ce6871f3 100644 --- a/src/System.Management.Automation/utils/MshNotSupportedException.cs +++ b/src/System.Management.Automation/utils/MshNotSupportedException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshObjectDisposedException.cs b/src/System.Management.Automation/utils/MshObjectDisposedException.cs index d1eacfc9068..0de12d3b0d3 100644 --- a/src/System.Management.Automation/utils/MshObjectDisposedException.cs +++ b/src/System.Management.Automation/utils/MshObjectDisposedException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.Serialization; diff --git a/src/System.Management.Automation/utils/MshTraceSource.cs b/src/System.Management.Automation/utils/MshTraceSource.cs index b632b206dc1..9a4d28b8b5b 100644 --- a/src/System.Management.Automation/utils/MshTraceSource.cs +++ b/src/System.Management.Automation/utils/MshTraceSource.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #define TRACE diff --git a/src/System.Management.Automation/utils/ObjectReader.cs b/src/System.Management.Automation/utils/ObjectReader.cs index cb41bd79067..99cf452fb38 100644 --- a/src/System.Management.Automation/utils/ObjectReader.cs +++ b/src/System.Management.Automation/utils/ObjectReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/utils/ObjectStream.cs b/src/System.Management.Automation/utils/ObjectStream.cs index 989bd54a8da..607d6acc94a 100644 --- a/src/System.Management.Automation/utils/ObjectStream.cs +++ b/src/System.Management.Automation/utils/ObjectStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 73aa30cfefa..9da4a2307a3 100644 --- a/src/System.Management.Automation/utils/ObjectWriter.cs +++ b/src/System.Management.Automation/utils/ObjectWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 d0ce5ea844a..7dd28be8cdd 100644 --- a/src/System.Management.Automation/utils/PInvokeDllNames.cs +++ b/src/System.Management.Automation/utils/PInvokeDllNames.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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 a131a7bfef4..b440b649c79 100644 --- a/src/System.Management.Automation/utils/PSTelemetryMethods.cs +++ b/src/System.Management.Automation/utils/PSTelemetryMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if LEGACYTELEMETRY diff --git a/src/System.Management.Automation/utils/PSTelemetryWrapper.cs b/src/System.Management.Automation/utils/PSTelemetryWrapper.cs index 5a15dbb9435..8e9da553f24 100644 --- a/src/System.Management.Automation/utils/PSTelemetryWrapper.cs +++ b/src/System.Management.Automation/utils/PSTelemetryWrapper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if LEGACYTELEMETRY diff --git a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs index 78b92409f37..4daa7dc5962 100644 --- a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs +++ b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Internal; diff --git a/src/System.Management.Automation/utils/ParserException.cs b/src/System.Management.Automation/utils/ParserException.cs index 4feb9822d8c..ac10c577481 100644 --- a/src/System.Management.Automation/utils/ParserException.cs +++ b/src/System.Management.Automation/utils/ParserException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/PathUtils.cs b/src/System.Management.Automation/utils/PathUtils.cs index da3d094bd01..ad92bc37fff 100644 --- a/src/System.Management.Automation/utils/PathUtils.cs +++ b/src/System.Management.Automation/utils/PathUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs index a25aca6c73c..de45d6303da 100644 --- a/src/System.Management.Automation/utils/PlatformInvokes.cs +++ b/src/System.Management.Automation/utils/PlatformInvokes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/PowerShellETWTracer.cs b/src/System.Management.Automation/utils/PowerShellETWTracer.cs index d9945d4cc0f..0dc4b2f08f8 100644 --- a/src/System.Management.Automation/utils/PowerShellETWTracer.cs +++ b/src/System.Management.Automation/utils/PowerShellETWTracer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs index 35e6af08a51..0f35f718faa 100644 --- a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs +++ b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/utils/PsUtils.cs b/src/System.Management.Automation/utils/PsUtils.cs index 447564d013e..0d8c3473ba0 100644 --- a/src/System.Management.Automation/utils/PsUtils.cs +++ b/src/System.Management.Automation/utils/PsUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections; diff --git a/src/System.Management.Automation/utils/ResourceManagerCache.cs b/src/System.Management.Automation/utils/ResourceManagerCache.cs index e4f5c3dc594..7c7036e5f09 100644 --- a/src/System.Management.Automation/utils/ResourceManagerCache.cs +++ b/src/System.Management.Automation/utils/ResourceManagerCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/RuntimeException.cs b/src/System.Management.Automation/utils/RuntimeException.cs index d3fc5e95201..17ceb5d0068 100644 --- a/src/System.Management.Automation/utils/RuntimeException.cs +++ b/src/System.Management.Automation/utils/RuntimeException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Language; diff --git a/src/System.Management.Automation/utils/SessionStateExceptions.cs b/src/System.Management.Automation/utils/SessionStateExceptions.cs index 7f516c413a9..bb2532347f7 100644 --- a/src/System.Management.Automation/utils/SessionStateExceptions.cs +++ b/src/System.Management.Automation/utils/SessionStateExceptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.ObjectModel; diff --git a/src/System.Management.Automation/utils/StringUtil.cs b/src/System.Management.Automation/utils/StringUtil.cs index 99eb63d90e4..5b87d106f5c 100644 --- a/src/System.Management.Automation/utils/StringUtil.cs +++ b/src/System.Management.Automation/utils/StringUtil.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Management.Automation.Host; diff --git a/src/System.Management.Automation/utils/StructuredTraceSource.cs b/src/System.Management.Automation/utils/StructuredTraceSource.cs index c3d7b566205..1aebf9534e4 100644 --- a/src/System.Management.Automation/utils/StructuredTraceSource.cs +++ b/src/System.Management.Automation/utils/StructuredTraceSource.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #define TRACE diff --git a/src/System.Management.Automation/utils/Telemetry.cs b/src/System.Management.Automation/utils/Telemetry.cs index 14431a0c149..6041c35ca06 100644 --- a/src/System.Management.Automation/utils/Telemetry.cs +++ b/src/System.Management.Automation/utils/Telemetry.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/src/System.Management.Automation/utils/VTUtils.cs b/src/System.Management.Automation/utils/VTUtils.cs index 379d5984c07..c91ce24e19d 100644 --- a/src/System.Management.Automation/utils/VTUtils.cs +++ b/src/System.Management.Automation/utils/VTUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/Verbs.cs b/src/System.Management.Automation/utils/Verbs.cs index 1bd2efba32b..aeb6a3ee530 100644 --- a/src/System.Management.Automation/utils/Verbs.cs +++ b/src/System.Management.Automation/utils/Verbs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/assert.cs b/src/System.Management.Automation/utils/assert.cs index 2909c858178..8fe3bc786b2 100644 --- a/src/System.Management.Automation/utils/assert.cs +++ b/src/System.Management.Automation/utils/assert.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // The define below is only valid for this file. It allows the methods diff --git a/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs b/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs index 68d770d8a90..89b2a69e7b4 100644 --- a/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs +++ b/src/System.Management.Automation/utils/perfCounters/CounterSetInstanceBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs b/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs index 58fc193bd9c..155a3db99c9 100644 --- a/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs +++ b/src/System.Management.Automation/utils/perfCounters/CounterSetRegistrarBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Diagnostics.CodeAnalysis; diff --git a/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs b/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs index 8ecaf3600a5..22df79a0589 100644 --- a/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs +++ b/src/System.Management.Automation/utils/perfCounters/PSPerfCountersMgr.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Concurrent; diff --git a/src/System.Management.Automation/utils/tracing/EtwActivity.cs b/src/System.Management.Automation/utils/tracing/EtwActivity.cs index 6f076f148ac..7dfac67ddb2 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivity.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivity.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs index 22badeaa20b..fdff216e1c8 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs index 3a753e59182..50bb00dd488 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs index d22830c5e6c..32b0bb5a222 100644 --- a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs +++ b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs index 20f60433cc1..78561134fb9 100644 --- a/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/IMethodInvoker.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs index 5cf505bdbea..ec772fe549c 100644 --- a/src/System.Management.Automation/utils/tracing/PSEtwLog.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLog.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; diff --git a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs index d3158afa763..173c5b8379a 100755 --- a/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs index 27799bdc16b..d80705b38e4 100755 --- a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if UNIX diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index 59b2c0055cf..379f9f69b42 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if UNIX diff --git a/src/System.Management.Automation/utils/tracing/Tracing.cs b/src/System.Management.Automation/utils/tracing/Tracing.cs index ab6c0f6831d..70338b28c7a 100644 --- a/src/System.Management.Automation/utils/tracing/Tracing.cs +++ b/src/System.Management.Automation/utils/tracing/Tracing.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/System.Management.Automation/utils/tracing/TracingGen.cs b/src/System.Management.Automation/utils/tracing/TracingGen.cs index 30fd715cb66..09b712714ae 100644 --- a/src/System.Management.Automation/utils/tracing/TracingGen.cs +++ b/src/System.Management.Automation/utils/tracing/TracingGen.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #if !UNIX diff --git a/src/TypeCatalogGen/TypeCatalogGen.cs b/src/TypeCatalogGen/TypeCatalogGen.cs index 668556cafb7..8bac4cdbc21 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.cs +++ b/src/TypeCatalogGen/TypeCatalogGen.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // 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. diff --git a/src/powershell-native/Install-PowerShellRemoting.ps1 b/src/powershell-native/Install-PowerShellRemoting.ps1 index 5162d1dccb2..b08194fc201 100644 --- a/src/powershell-native/Install-PowerShellRemoting.ps1 +++ b/src/powershell-native/Install-PowerShellRemoting.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ##################################################################################################### diff --git a/src/powershell/Program.cs b/src/powershell/Program.cs index 99834e6a95f..e4d3b51c5d6 100644 --- a/src/powershell/Program.cs +++ b/src/powershell/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/stylecop.json b/stylecop.json index de9133da257..77517f2095b 100644 --- a/stylecop.json +++ b/stylecop.json @@ -38,7 +38,7 @@ "allowConsecutiveUsings" : false }, "documentationRules" : { - "copyrightText" : "Copyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the MIT License.", + "copyrightText" : "Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.", "xmlHeader" : false, "documentInterfaces" : true, "documentExposedElements" : true, diff --git a/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 index 9e8bd379eb0..2a574af68f4 100644 --- a/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 +++ b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "SSHRemoting Basic Tests" -tags CI { diff --git a/test/common/markdown/markdown-link.tests.ps1 b/test/common/markdown/markdown-link.tests.ps1 index 79f72906f12..197250d3663 100644 --- a/test/common/markdown/markdown-link.tests.ps1 +++ b/test/common/markdown/markdown-link.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Verify Markdown Links" { diff --git a/test/docker/networktest/DockerRemoting.Tests.ps1 b/test/docker/networktest/DockerRemoting.Tests.ps1 index ae9db267d6d..df6ed5833fb 100644 --- a/test/docker/networktest/DockerRemoting.Tests.ps1 +++ b/test/docker/networktest/DockerRemoting.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $imageName = "remotetestimage" Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ diff --git a/test/docker/networktest/New-DockerTestBuild.ps1 b/test/docker/networktest/New-DockerTestBuild.ps1 index fbb0c4e0be8..8f548e7bc41 100644 --- a/test/docker/networktest/New-DockerTestBuild.ps1 +++ b/test/docker/networktest/New-DockerTestBuild.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param ( [switch]$Force, [switch]$UseExistingMsi ) @@ -23,9 +23,9 @@ if ( $dockerExe.name -ne "docker.exe" ) { # Check to see if we already have an image, and if so # delete it if -Force was used, otherwise throw and exit $TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) +if ( $TestImage -eq $Constants.TestImageName) { - if ( $Force ) + if ( $Force ) { docker rmi $Constants.TestImageName } @@ -36,7 +36,7 @@ if ( $TestImage -eq $Constants.TestImageName) } # check again - there could be some permission problems $TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) +if ( $TestImage -eq $Constants.TestImageName) { throw ("'{0}' still exists, giving up" -f $Constants.TestImageName) } @@ -45,13 +45,13 @@ if ( $TestImage -eq $Constants.TestImageName) # check to see if the MSI is present $MsiExists = test-path $Constants.MsiName $msg = "{0} exists, use -Force to remove or -UseExistingMsi to use" -f $Constants.MsiName -if ( $MsiExists -and ! ($force -or $useExistingMsi)) +if ( $MsiExists -and ! ($force -or $useExistingMsi)) { throw $msg } # remove the msi -if ( $MsiExists -and $Force -and ! $UseExistingMsi ) +if ( $MsiExists -and $Force -and ! $UseExistingMsi ) { Remove-Item -force $Constants.MsiName $MsiExists = $false @@ -64,7 +64,7 @@ if ( ! $MsiExists -and $UseExistingMsi ) { throw ("{0} does not exist" -f $Constants.MsiName) } -elseif ( $MsiExists -and ! $UseExistingMsi ) +elseif ( $MsiExists -and ! $UseExistingMsi ) { throw $msg } diff --git a/test/hosting/test_HostingBasic.cs b/test/hosting/test_HostingBasic.cs index d2948d5887f..efd3043d514 100644 --- a/test/hosting/test_HostingBasic.cs +++ b/test/hosting/test_HostingBasic.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/nanoserver/nanoserver.tests.ps1 b/test/nanoserver/nanoserver.tests.ps1 index e9a776385a4..1b1ec6b0576 100644 --- a/test/nanoserver/nanoserver.tests.ps1 +++ b/test/nanoserver/nanoserver.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Verify PowerShell Runs" { diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 20b6c4f2200..17ffebd3e66 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Test-Elevated { diff --git a/test/powershell/Host/Base-Directory.Tests.ps1 b/test/powershell/Host/Base-Directory.Tests.ps1 index 71f6e682edb..246db8fb839 100644 --- a/test/powershell/Host/Base-Directory.Tests.ps1 +++ b/test/powershell/Host/Base-Directory.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Configuration file locations" -tags "CI","Slow" { diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 7f8d92a4bf8..ba1a4910938 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Diagnostics diff --git a/test/powershell/Host/HostUtilities.Tests.ps1 b/test/powershell/Host/HostUtilities.Tests.ps1 index 278c5e1110f..6c791b5c446 100644 --- a/test/powershell/Host/HostUtilities.Tests.ps1 +++ b/test/powershell/Host/HostUtilities.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "InvokeOnRunspace method argument error handling" -tags "Feature" { diff --git a/test/powershell/Host/Logging.Tests.ps1 b/test/powershell/Host/Logging.Tests.ps1 index 56a60f47986..30895cd2c5e 100644 --- a/test/powershell/Host/Logging.Tests.ps1 +++ b/test/powershell/Host/Logging.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Text diff --git a/test/powershell/Host/PSVersionTable.Tests.ps1 b/test/powershell/Host/PSVersionTable.Tests.ps1 index 858d5e3b6cb..5bba07d981a 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "PSVersionTable" -Tags "CI" { diff --git a/test/powershell/Host/Read-Host.Tests.ps1 b/test/powershell/Host/Read-Host.Tests.ps1 index 09809659701..dc225362ed0 100644 --- a/test/powershell/Host/Read-Host.Tests.ps1 +++ b/test/powershell/Host/Read-Host.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Read-Host" -Tags "Slow","Feature" { Context "[Console]::ReadKey() implementation on non-Windows" { diff --git a/test/powershell/Host/ScreenReader.Tests.ps1 b/test/powershell/Host/ScreenReader.Tests.ps1 index 7a2b3464680..35f86459861 100644 --- a/test/powershell/Host/ScreenReader.Tests.ps1 +++ b/test/powershell/Host/ScreenReader.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Validate start of console host" -Tag CI { diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 7f0cc7e6b3d..8f419fbc37f 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Validate start of console host" -Tag CI { diff --git a/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 b/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 index 89b91b6cfba..78be093a5bb 100644 --- a/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/BugFix.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tab completion bug fix" -Tags "CI" { diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index d75510eb1ef..cebb2a2f82d 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "TabCompletion" -Tags CI { BeforeAll { diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index fbf7fffc0a8..0fc2c020a0c 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Windows Installer" -Tags "Scenario" { diff --git a/test/powershell/Language/Classes/MSFT_778492.psm1 b/test/powershell/Language/Classes/MSFT_778492.psm1 index 52a0efb47a5..e17710f0e8e 100644 --- a/test/powershell/Language/Classes/MSFT_778492.psm1 +++ b/test/powershell/Language/Classes/MSFT_778492.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 4b37e6a1a4a..d9dc808b0d7 100644 --- a/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 +++ b/test/powershell/Language/Classes/ProtectedAccess.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Add-Type -WarningAction Ignore @' diff --git a/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 index e0ba18ae26d..3df42931855 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Attributes.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Attributes Test' -Tags "CI" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index 3641323018d..8ba3edc8099 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Positive Parse Properties Tests' -Tags "CI" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 index ead2ed5ee20..20aab127abc 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Break.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Break statements with classes' -Tags "CI" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 index 3c10419afa4..d4b6e77a290 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Exceptions.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Exceptions flow for classes' -Tags "CI" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 index 0b7be62ebeb..11880bf7dce 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.MiscOps.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Misc Test' -Tags "CI" { @@ -63,10 +63,10 @@ Describe 'Misc Test' -Tags "CI" { $NewRunspaceFunctionDefinitions = @" ## Define 'Get-TestText' in the new Runspace function Get-TestText { return '$ExpectedTextFromUnboundInstance' } - + ## Define the function to create an instance of the given type using the default constructor function New-UnboundInstance([Type]`$type) { `$type::new() } - + ## Define the function to call 'Foo()' on the given C1 instance, and return the result function Run-Foo(`$C1Instance) { `$C1Instance.Foo() } "@ diff --git a/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 index 0bd882013b8..c2e376f10cf 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.Modules.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'PSModuleInfo.GetExportedTypeDefinitions()' -Tags "CI" { It "doesn't throw for any module" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 index 85c78a74948..e6545d0ed28 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.RunPath.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Script with a class definition run path" -Tags "CI" { diff --git a/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 index 687877c06a2..e99a96a504a 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.StaticMethod.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Additional static method tests" -Tags "CI" { @@ -32,7 +32,7 @@ class Foo { static [string] $Name static Foo() { [Foo]::Name = Get-Name } - + static [string] GetName() { return (Get-AnotherName) @@ -80,7 +80,7 @@ class Foo } It "Static constructor should run in the triggering Runspace if the class has been defined in that Runspace" { - + ## The static constructor is triggered by accessing '[Foo]::Name' which happens in the current Runspace. ## The class 'Foo' has been defined in the current Runspace, so it uses the current Runspace to run the ## static constructor. @@ -107,7 +107,7 @@ class Foo ## Define the functions that [Foo] depends on in PS2 Runspace. RunScriptInPS -PowerShell $ps2 -Script "function Get-Name { 'PS2 Runspace - Name' }" -IgnoreResult RunScriptInPS -PowerShell $ps2 -Script "function Get-AnotherName { 'PS2 Runspace - AnotherName' }" -IgnoreResult - + ## Define the function to call the static method 'GetName' on the passed-in type RunScriptInPS -PowerShell $ps2 -Script 'function Call-GetName([type] $type) { $type::GetName() }' -IgnoreResult diff --git a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 index 70089cb5f8e..e94d57e115b 100644 --- a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'NestedModules' -Tags "CI" { diff --git a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 index 073ab06a67c..f19507d59e5 100644 --- a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Classes inheritance syntax' -Tags "CI" { diff --git a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 index 88b32b8c8e0..18c3661d5af 100644 --- a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'using module' -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Classes/scripting.enums.tests.ps1 b/test/powershell/Language/Classes/scripting.enums.tests.ps1 index a3a86863a0a..f11f294a0a5 100644 --- a/test/powershell/Language/Classes/scripting.enums.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.enums.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'enums' -Tags "CI" { diff --git a/test/powershell/Language/CompletionTestSupport.psm1 b/test/powershell/Language/CompletionTestSupport.psm1 index 3490830c481..a5942d4a259 100644 --- a/test/powershell/Language/CompletionTestSupport.psm1 +++ b/test/powershell/Language/CompletionTestSupport.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 07d1c9995fe..65b9e61a6a7 100644 --- a/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 +++ b/test/powershell/Language/Interop/DotNet/DotNetAPI.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "DotNetAPI" -Tags "CI" { diff --git a/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 b/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 index c7d63a13522..02d49c4435c 100644 --- a/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 +++ b/test/powershell/Language/Interop/DotNet/DotNetInterop.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Handle ByRef-like types gracefully" -Tags "CI" { diff --git a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 index 2c0847dee63..a94c1835e59 100644 --- a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ComparisonOperator" -tag "CI" { diff --git a/test/powershell/Language/Operators/NullConditional.Tests.ps1 b/test/powershell/Language/Operators/NullConditional.Tests.ps1 index c82b88144e5..b24bb87d352 100644 --- a/test/powershell/Language/Operators/NullConditional.Tests.ps1 +++ b/test/powershell/Language/Operators/NullConditional.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'NullCoalesceOperations' -Tags 'CI' { diff --git a/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 b/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 index dfac35d1bb9..e3581666552 100644 --- a/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Experimental Feature: && and || operators - Feature-Enabled" -Tag CI { diff --git a/test/powershell/Language/Operators/RangeOperator.Tests.ps1 b/test/powershell/Language/Operators/RangeOperator.Tests.ps1 index 12e98ac4f4c..56941827fcc 100644 --- a/test/powershell/Language/Operators/RangeOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/RangeOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Range Operator" -Tags CI { Context "Range integer operations" { diff --git a/test/powershell/Language/Operators/ReplaceOperator.Tests.ps1 b/test/powershell/Language/Operators/ReplaceOperator.Tests.ps1 index a818725a871..59d7039898a 100644 --- a/test/powershell/Language/Operators/ReplaceOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/ReplaceOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Replace Operator" -Tags CI { diff --git a/test/powershell/Language/Operators/SplitOperator.Tests.ps1 b/test/powershell/Language/Operators/SplitOperator.Tests.ps1 index 68550ea3c48..1ebbbff4fa2 100644 --- a/test/powershell/Language/Operators/SplitOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/SplitOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Split Operator" -Tags CI { Context "Binary split operator" { diff --git a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 index 71ce7c1ac25..12b5bccbe2d 100644 --- a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Using of ternary operator" -Tags CI { diff --git a/test/powershell/Language/Parser/Ast.Tests.ps1 b/test/powershell/Language/Parser/Ast.Tests.ps1 index 53e0320f59b..2f87e5c5120 100644 --- a/test/powershell/Language/Parser/Ast.Tests.ps1 +++ b/test/powershell/Language/Parser/Ast.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using Namespace System.Management.Automation.Language Describe "The SafeGetValue method on AST returns safe values" -Tags "CI" { diff --git a/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 b/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 index 8265178de59..cef1861f807 100644 --- a/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 +++ b/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Automatic variable $input' -Tags "CI" { diff --git a/test/powershell/Language/Parser/BNotOperator.Tests.ps1 b/test/powershell/Language/Parser/BNotOperator.Tests.ps1 index 0b5e4c1bbdc..eb6dd934e30 100644 --- a/test/powershell/Language/Parser/BNotOperator.Tests.ps1 +++ b/test/powershell/Language/Parser/BNotOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $baseTypes = @{ diff --git a/test/powershell/Language/Parser/Conversions.Tests.ps1 b/test/powershell/Language/Parser/Conversions.Tests.ps1 index b5265c5e347..f9a981060cd 100644 --- a/test/powershell/Language/Parser/Conversions.Tests.ps1 +++ b/test/powershell/Language/Parser/Conversions.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'conversion syntax' -Tags "CI" { diff --git a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 index 42785fc555c..8229634e45b 100644 --- a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 +++ b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 949cc6a15a0..07843346f06 100644 --- a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 +++ b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $powershellexe = (get-process -id $PID).mainmodule.filename diff --git a/test/powershell/Language/Parser/LineContinuance.Tests.ps1 b/test/powershell/Language/Parser/LineContinuance.Tests.ps1 index 2bb5395119e..1bdf18525a3 100644 --- a/test/powershell/Language/Parser/LineContinuance.Tests.ps1 +++ b/test/powershell/Language/Parser/LineContinuance.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Line Continuance' -Tags 'CI' { diff --git a/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 b/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 index 69a6cdca9c3..f28b6801389 100644 --- a/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 +++ b/test/powershell/Language/Parser/MethodInvocation.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 ca6a9b2082e..e0f2aa909b1 100644 --- a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Argument transformation attribute on optional argument with explicit $null' -Tags "CI" { diff --git a/test/powershell/Language/Parser/Parser.Tests.ps1 b/test/powershell/Language/Parser/Parser.Tests.ps1 index 5105f9e9e03..05e49fc4ce1 100644 --- a/test/powershell/Language/Parser/Parser.Tests.ps1 +++ b/test/powershell/Language/Parser/Parser.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" { diff --git a/test/powershell/Language/Parser/Parsing.Tests.ps1 b/test/powershell/Language/Parser/Parsing.Tests.ps1 index 8b79d994744..67a740a0ede 100644 --- a/test/powershell/Language/Parser/Parsing.Tests.ps1 +++ b/test/powershell/Language/Parser/Parsing.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. set-strictmode -v 2 diff --git a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 index 2702aaeb990..ed4e320d7c2 100644 --- a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 +++ b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Redirection operator now supports encoding changes" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 b/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 index e90e404602e..ee32d4f74ad 100644 --- a/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 +++ b/test/powershell/Language/Parser/TypeAccelerator.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Type accelerators" -Tags "CI" { diff --git a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 index aa7dff93974..ea3a8cfee0a 100644 --- a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Using assembly" -Tags "CI" { diff --git a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 index 1e8d1decc3b..359e1245ea1 100644 --- a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # There is an automatic 'using namespace system' which is diff --git a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 index c93e63bec4b..e5f1410d8bc 100644 --- a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 +++ b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/Array.Tests.ps1 b/test/powershell/Language/Scripting/Array.Tests.ps1 index 35d099c8dce..3eef84e2bd3 100644 --- a/test/powershell/Language/Scripting/Array.Tests.ps1 +++ b/test/powershell/Language/Scripting/Array.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ArrayExpression Tests" -Tags "CI" { It "@([object[]](1,2,3)) should return a 3-element array of object[]" { diff --git a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 index 44741fee91f..ab2dc8ecdcc 100644 --- a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 +++ b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Test restricted language check method on scriptblocks" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 b/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 index 1ede3b76d81..9e2e1ed6860 100644 --- a/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 +++ b/test/powershell/Language/Scripting/CmdletDeclaration.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Cmdlet declaration statement" -Tags "CI" { $testData = @( diff --git a/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 b/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 index 414de3637d4..6f9d80e1677 100644 --- a/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 +++ b/test/powershell/Language/Scripting/CommonParameters.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Common parameters support for script cmdlets" -Tags "CI" { BeforeEach { diff --git a/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 b/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 index 994e7c9cd1a..2c53cc922df 100644 --- a/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 +++ b/test/powershell/Language/Scripting/ConstrainedLanguageMode.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Test constrained language mode" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 index 852e9efbac0..9bf520cd2a9 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Basic debugger command tests' -tag 'CI' { diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 index d4edf44bbaf..6889fd04421 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Breakpoints set on custom FileSystem provider files should work" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 index 2259a587e82..15cfc38736b 100644 --- a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Basic debugger tests' -tag 'CI' { diff --git a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 index 2252d2b8dfc..c523f549247 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 6f3919dde90..cf0919cf12f 100644 --- a/test/powershell/Language/Scripting/Delegates.Tests.ps1 +++ b/test/powershell/Language/Scripting/Delegates.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Test for conversion b/w script block and delegate' -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 b/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 index 2bb454d131f..8599bb5511d 100644 --- a/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 +++ b/test/powershell/Language/Scripting/DeserializedMethods.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "DeserializedMethods" -Tags "CI" { It "Deserialized objects shouldn't ever have any methods (unless they are primitive known types)" { diff --git a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 index 59eb5362642..6122906c352 100644 --- a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests conversion of deserialized types to original type using object properties." -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/DollarHook.Tests.ps1 b/test/powershell/Language/Scripting/DollarHook.Tests.ps1 index d492cf16d84..86fb70306d2 100644 --- a/test/powershell/Language/Scripting/DollarHook.Tests.ps1 +++ b/test/powershell/Language/Scripting/DollarHook.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Tests for setting $? for execution success' -Tag 'CI' { diff --git a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 index 1c17a467ade..99aa4ff3274 100644 --- a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 +++ b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Dynamic parameter support in script cmdlets." -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/ErrorPosition.Tests.ps1 b/test/powershell/Language/Scripting/ErrorPosition.Tests.ps1 index 1853e9cba46..483528b10e8 100644 --- a/test/powershell/Language/Scripting/ErrorPosition.Tests.ps1 +++ b/test/powershell/Language/Scripting/ErrorPosition.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Error position Tests" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 b/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 index c820e947fe0..ba0759570bd 100644 --- a/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 +++ b/test/powershell/Language/Scripting/ForeachParallel.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Parallel foreach syntax' -Tags 'CI' { diff --git a/test/powershell/Language/Scripting/Generics.Tests.ps1 b/test/powershell/Language/Scripting/Generics.Tests.ps1 index e3843256953..96484f7a31c 100644 --- a/test/powershell/Language/Scripting/Generics.Tests.ps1 +++ b/test/powershell/Language/Scripting/Generics.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace system.collections.generic using namespace System.Management.Automation diff --git a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 index 6b1afd439c4..e9936f9bf9e 100644 --- a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 index a47fbefba70..078aeb54c0e 100644 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ b/test/powershell/Language/Scripting/I18n.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Testing of script internationalization' -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/Indexer.Tests.ps1 b/test/powershell/Language/Scripting/Indexer.Tests.ps1 index 5467c53de88..cb92894bf28 100644 --- a/test/powershell/Language/Scripting/Indexer.Tests.ps1 +++ b/test/powershell/Language/Scripting/Indexer.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 993d3c63b4c..e7b89e1f5b4 100644 --- a/test/powershell/Language/Scripting/LineEndings.Tests.ps1 +++ b/test/powershell/Language/Scripting/LineEndings.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Line endings' -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 b/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 index 24f7a4ba48a..d88ea288dbc 100644 --- a/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 +++ b/test/powershell/Language/Scripting/MyInvocation.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Testing of MyInvocation' -Tags "CI" { It 'MyInvocation works in Function' { diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 index 602b13976a2..693697d84de 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Native Command Arguments" -tags "CI" { # When passing arguments to native commands, quoted segments that contain diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 index d47c64f2e3f..12b1349f716 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Native pipeline should have proper encoding' -tags 'CI' { It '$OutputEncoding should be set to UTF8 without BOM' { diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 index b068b9fe332..a75b80747ac 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "NativeLinuxCommands" -tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 index 9b81f398ec7..2970f7ae7a9 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeStreams.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Native streams behavior with PowerShell" -Tags 'CI' { BeforeAll { diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 index 0d728b717d1..ae12076fed3 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeUnixGlobbing.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 2115cede0de..379a41e4301 100644 --- a/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 +++ b/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" { It 'New-Object - Property Parameter Must take IDictionary' { diff --git a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 index c344e3d78dd..c69d5969849 100644 --- a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 +++ b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests OutVariable only" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Language/Scripting/PSSerializer.Tests.ps1 b/test/powershell/Language/Scripting/PSSerializer.Tests.ps1 index a699648a225..6771642c14b 100644 --- a/test/powershell/Language/Scripting/PSSerializer.Tests.ps1 +++ b/test/powershell/Language/Scripting/PSSerializer.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Tests for lossless rehydration of serialized types.' -Tags 'CI' { diff --git a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 index 940bd347575..2a51f444816 100644 --- a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for parameter binding" -Tags "CI" { Context 'Test of Mandatory parameters' { diff --git a/test/powershell/Language/Scripting/Requires.Tests.ps1 b/test/powershell/Language/Scripting/Requires.Tests.ps1 index 03d44accb94..4930a2dfa77 100644 --- a/test/powershell/Language/Scripting/Requires.Tests.ps1 +++ b/test/powershell/Language/Scripting/Requires.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 49935865923..5e585bc001d 100644 --- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 +++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $ProgressPreference = "SilentlyContinue" diff --git a/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 b/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 index d80b0591840..31bc8bc9fc3 100644 --- a/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 +++ b/test/powershell/Language/Scripting/Scripting.Followup.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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" { diff --git a/test/powershell/Language/Scripting/SuppressAnsiEscapeSequence.Tests.ps1 b/test/powershell/Language/Scripting/SuppressAnsiEscapeSequence.Tests.ps1 index a8d070c9e6c..568e56be904 100644 --- a/test/powershell/Language/Scripting/SuppressAnsiEscapeSequence.Tests.ps1 +++ b/test/powershell/Language/Scripting/SuppressAnsiEscapeSequence.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe '$env:__SuppressAnsiEscapeSequences tests' -Tag CI { diff --git a/test/powershell/Language/Scripting/SwitchParallel.Tests.ps1 b/test/powershell/Language/Scripting/SwitchParallel.Tests.ps1 index 9af1cf5b8ed..74ca4edeb86 100644 --- a/test/powershell/Language/Scripting/SwitchParallel.Tests.ps1 +++ b/test/powershell/Language/Scripting/SwitchParallel.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Parallel switch syntax' -Tags 'CI' { diff --git a/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 b/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 index 9c7954a9cc5..b0b75bd1e7f 100644 --- a/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 +++ b/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Run-TestOnWinFull { diff --git a/test/powershell/Language/Scripting/Trap.Tests.ps1 b/test/powershell/Language/Scripting/Trap.Tests.ps1 index 6bf76e553bc..9a1dc18b791 100644 --- a/test/powershell/Language/Scripting/Trap.Tests.ps1 +++ b/test/powershell/Language/Scripting/Trap.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Test trap" -Tags "CI" { diff --git a/test/powershell/Language/Scripting/TryCatch.Tests.ps1 b/test/powershell/Language/Scripting/TryCatch.Tests.ps1 index 63df99d1db6..ea825cbd6e3 100644 --- a/test/powershell/Language/Scripting/TryCatch.Tests.ps1 +++ b/test/powershell/Language/Scripting/TryCatch.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ############################################################# diff --git a/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 b/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 index d95b150b23d..02717c19359 100644 --- a/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/CimInstance.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "CimInstance cmdlet tests" -Tag @("CI") { diff --git a/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 b/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 index 3561478ab32..33c1ef66407 100644 --- a/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/CimSession.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-CimSession" -Tag @("CI","RequireAdminOnWindows") { diff --git a/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 b/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 index 33407436d5d..248022bf032 100644 --- a/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 +++ b/test/powershell/Modules/CimCmdlets/Get-CimClass.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Get-CimClass' -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index c9929eed965..582dfa0bf36 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $script:oldModulePath = $env:PSModulePath diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 index 77344475bb4..de59f609687 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/ForEach-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/ForEach-Object.Tests.ps1 index d3d5ea97ca5..aac5e90462e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/ForEach-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/ForEach-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ForEach-Object" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 index e4fff519b05..e7bfc6be41f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Command Tests" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Module.Tests.ps1 index 5d901b7f8d5..fddd7a12ea6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Module.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Module -ListAvailable" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 index e53e4942ece..d61d34a80a9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-PSHostProcessInfo tests" -Tag CI { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 index 8ba26879139..335512b83d4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "History cmdlet test cases" -Tags "CI" { Context "Simple History Tests" { 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 7ade6b171c6..2d243f708fb 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Import-Module" -Tags "CI" { $moduleName = "Microsoft.PowerShell.Security" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 index 32308839de2..640dbff7beb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Job Cmdlet Tests" -Tag "CI" { Context "Simple Jobs" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleConstraint.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleConstraint.Tests.ps1 index 6a16731796f..34ddfd6fc53 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleConstraint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleConstraint.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function New-ModuleSpecification diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleManifest.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleManifest.Tests.ps1 index 504984dfe32..e2062adb22e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleManifest.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/ModuleManifest.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Recursively creates a module structure given a hashtable to describe it: 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 b7252815c1a..b4145180663 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Out-Default Tests" -tag CI { BeforeAll { 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 4ad3bb04ad2..cdd3fd28da4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Out-Host Tests" -tag CI { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 index e715026a5f6..d910f2c265c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon @@ -657,7 +657,7 @@ namespace PowershellTestConfigNamespace SessionType = 'Default' Author = 'User' CompanyName = 'Microsoft Corporation' - Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' + Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'This is a sample session configuration file.' GUID = '73cba863-aa49-4cbf-9917-269ddcf2b1e3' SchemaVersion = '1.0.0.0' 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 d17df2af3df..6b048587223 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,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 index 5f12a5f8f6d..2ad47aa2414 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteGetModule.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remote module tests" -Tags 'Feature','RequireAdminOnWindows' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 index 716820e3cb5..06203b517d2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remote import-module tests" -Tags 'Feature','RequireAdminOnWindows' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 index 7ec319edfd3..848e60ba40d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemotingCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "SSH Remoting Cmdlet Tests" -Tags "Feature" { 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 314a72cdd11..665281dd197 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" { 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 e6c5743f4ae..1bf610dd1f1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Set-PSDebug.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Set-PSDebug" -Tags "CI" { Context "Tracing can be used" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 index a8a4c88575e..83a7cb18693 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Add-TestDynamicType diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 index eb3791b0526..8cb6db661b0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/CounterTestHelperFunctions.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <############################################################################################ # File: CounterTestHelperFunctions.ps1 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 b648d36e15b..f925e28d28f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Export-Counter.Tests.ps1 @@ -1,14 +1,14 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <############################################################################################ # File: Export-Counter.Tests.ps1 # Provides Pester tests for the Export-Counter cmdlet. ############################################################################################> - + # Counter CmdLets are removed see issue #4272 # Tests are disabled return - + $cmdletName = "Export-Counter" . "$PSScriptRoot/CounterTestHelperFunctions.ps1" 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 9d378908e05..675cb11488f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-Counter.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $cmdletName = "Get-Counter" 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 2005365a1c8..62e9bf2a74d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Get-WinEvent' -Tags "CI" { BeforeAll { 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 ac46b88b972..33ec1c26228 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Import-Counter.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <############################################################################################ # File: Import-Counter.Tests.ps1 @@ -8,7 +8,7 @@ # Counter CmdLets are removed see issue #4272 # Tests are disabled return - + $cmdletName = "Import-Counter" . "$PSScriptRoot/CounterTestHelperFunctions.ps1" @@ -31,7 +31,7 @@ if ( ! $SkipTests ) Processor = (TranslateCounterName "processor") } } -else +else { $counterPaths = @() $setNames = @{} 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 96ec01605be..1ea8871d2a4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 @@ -1,9 +1,9 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'New-WinEvent' -Tags "CI" { Context "New-WinEvent tests" { - + BeforeAll { $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() if ( ! $IsWindows ) { @@ -14,7 +14,7 @@ Describe 'New-WinEvent' -Tags "CI" { $SimpleEventId = 40962 $ComplexEventId = 32868 } - + AfterAll { $global:PSDefaultParameterValues = $originalDefaultParameterValues } @@ -24,11 +24,11 @@ Describe 'New-WinEvent' -Tags "CI" { $filter = @{ ProviderName = $ProviderName; Id = $SimpleEventId} (Get-WinEvent -filterHashtable $filter).Count | Should -BeGreaterThan 0 } - + It 'No provider found error' { { New-WinEvent -ProviderName NonExistingProvider -Id 0 } | Should -Throw -ErrorId 'System.ArgumentException,Microsoft.PowerShell.Commands.NewWinEventCommand' } - + It 'EmptyProviderName error' { { New-WinEvent -ProviderName $null -Id 0 } | Should -Throw -ErrorId 'ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.NewWinEventCommand' } @@ -40,7 +40,7 @@ Describe 'New-WinEvent' -Tags "CI" { It 'IncorrectEventVersion error' { { New-WinEvent -ProviderName $ProviderName -Id $SimpleEventId -Version 99 } | Should -Throw -ErrorId 'Microsoft.PowerShell.Commands.EventWriteException,Microsoft.PowerShell.Commands.NewWinEventCommand' } - + It 'PayloadMismatch error' { $logPath = join-path $TestDrive 'testlog1.txt' # this will print the warning with expected event template to the file 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 a1d08776788..320a34e7b81 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,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Module removed due to #4272 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 f7f45712a8d..d6b3052bc1c 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,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Module removed due to #4272 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 05b14b00a10..2658d282f86 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,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Module removed due to #4272 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 0157e47faff..d4bd23a6fee 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Add-Content.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Add-Content cmdlet tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 index 4e0f54f0701..f16521d1c1d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Basic Alias Provider Tests" -Tags "CI" { BeforeAll { 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 93767086f6c..0ed9b0d906d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # get a random string of characters a-z and A-Z 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 170e0032068..533d1f0c84e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Clear-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { 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 f97c0911f2b..a6fb5634b24 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Clear-Item tests" -Tag "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 index c6d878fd4be..52f9e3317c6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Clipboard cmdlet tests' -Tag CI { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 index 8bbe60a6474..d7ac5aa1e21 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Control Service cmdlet tests" -Tags "Feature","RequireAdminOnWindows" { BeforeAll { 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 6205d70229a..1cc88b36bb7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Convert-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Convert-Path tests" -Tag CI { It "Convert-Path should handle provider qualified paths" { 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 f8d77028fc8..6d3009cb060 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Validate Copy-Item locally" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index 62bb57fe074..4d47ead944e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Basic FileSystem Provider Tests" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 index 4bd34631c4e..cdab0264fe7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FunctionProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FunctionProvider.Tests.ps1 index f8796f33085..0fd810c7292 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FunctionProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FunctionProvider.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Basic Function Provider Tests" -Tags "CI" { 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 c2a96664f43..79e8cc42b47 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-ChildItem" -Tags "CI" { 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 eb268d25a56..dc43edc85fc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # # TEST SPECIFIC HELPER METHODS FOR TESTING Get-ComputerInfo cmdlet 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 2e8a0de3e48..1d5ec99a952 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Content" -Tags "CI" { $testString = "This is a test content for a file" @@ -107,7 +107,7 @@ Describe "Get-Content" -Tags "CI" { ){ param($EncodingName) - $contentSets = + $contentSets = @(@('a1','aa2','aaa3','aaaa4','aaaaa5'), # utf-8 @('€1','€€2','€€€3','€€€€4','€€€€€5'), # utf-16 @('𐍈1','𐍈𐍈2','𐍈𐍈𐍈3','𐍈𐍈𐍈𐍈4','𐍈𐍈𐍈𐍈𐍈5')) # utf-32 @@ -116,20 +116,20 @@ Describe "Get-Content" -Tags "CI" { $tailCount = 3 $testPath = Join-Path -Path $TestDrive -ChildPath 'TailWithEncoding.txt' $content | Set-Content -Path $testPath -Encoding $EncodingName - + # read and verify using explicit encoding $expected = (Get-Content -Path $testPath -Encoding $EncodingName)[-$tailCount] $actual = Get-Content -Path $testPath -Tail $tailCount -Encoding $EncodingName $actual | Should -BeOfType string $actual.Length | Should -Be $tailCount $actual[0] | Should -BeExactly $expected - + # read and verify using implicit encoding $expected = (Get-Content -Path $testPath)[-$tailCount] $actual = Get-Content -Path $testPath -Tail $tailCount $actual | Should -BeOfType string $actual.Length | Should -Be $tailCount - $actual[0] | Should -BeExactly $expected + $actual[0] | Should -BeExactly $expected } } 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 ebf9ecc4724..f1e93020077 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 index 6afb9371e99..bdf5cf84fa9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-HotFix Tests" -Tag CI { 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 0cbdfe6261a..c6031b966d9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Item" -Tags "CI" { BeforeAll { 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 40fb81d0f6c..45930a6c36e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ItemProperty.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-ItemProperty" -Tags "CI" { $currentDirectory = Split-Path $PSScriptRoot -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 5c89609e4b9..395da72fd8e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Location" -Tags "CI" { $currentDirectory=[System.IO.Directory]::GetCurrentDirectory() 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 37784cf4217..1e9f8217cc8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSDrive.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-PSDrive" -Tags "CI" { 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 10019e709ca..c1796b52bb2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-PSProvider.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-PSProvider" -Tags "CI" { It "Should be able to call with no parameters without error" { 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 0af2258c25e..2fa7ef45387 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Process for admin" -Tags @('CI', 'RequireAdminOnWindows') { It "Should support -IncludeUserName" { 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 8b9a55308eb..42959ceff08 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Service cmdlet tests" -Tags "CI" { # Service cmdlet is currently working on windows only 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 e08bc31060d..694e16825b1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Hierarchical-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Hierarchical paths" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 index 04d80caf177..cbc6abeb084 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Simple ItemProperty Tests" -Tag "CI" { It "Can retrieve the PropertyValue with Get-ItemPropertyValue" { 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 3c607d6253a..50aba67bbe7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Join-Path cmdlet tests" -Tags "CI" { $SepChar=[io.path]::DirectorySeparatorChar 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 95d6538fb62..cd6db3c689e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Move-Item tests" -Tag "CI" { BeforeAll { 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 e6fafa510ac..84226229de4 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { 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 49a22f792c6..d6c98fc0695 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 index 16cddb30496..2e96797ecce 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for New-PSDrive cmdlet." -Tag "CI","RequireAdminOnWindows" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 index fb17c3c4082..30d31f6b825 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/PSDrive.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Basic Alias Provider Tests" -Tags "CI" { 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 cee3e2b30ef..e3d22de258a 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Tests related to TFS item 1370133 [PSUpgrade] Need -NoNewline parameter on Out-File, Add-Content and Set-Content 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 99cc2f1fd83..6df077b6c89 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Pop-Location.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 5509a46e82e..ca39688717f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Push-Location.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 fdbdadd986d..f0baa46e8b0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. try { #skip all tests on non-windows platform 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 095c9831c00..7ad443c9d1a 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { 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 bcbbaf17a97..88ec3b89fc8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-Item" -Tags "CI" { $testpath = $TestDrive 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 a2ed536220b..82f944612f9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Computer.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $RenameTesthook = "TestRenameComputer" $RenameResultName = "TestRenameComputerResults" 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 7abedaa31c1..6eb63ed7583 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Rename-Item tests" -Tag "CI" { BeforeAll { 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 9494c1ed9f9..87195c26352 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Resolve-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Resolve-Path returns proper path" -Tag "CI" { BeforeAll { 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 8da605bd8c3..42e2b3a2902 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # the testhook for restart-computer is the same as for stop-computer 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 6a81042cf0e..f0fe03a26d5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Set-Content cmdlet tests" -Tags "CI" { BeforeAll { 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 4e6e947ece9..d64b4fbae31 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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} }, 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 2c009b3f270..2fb8177ec1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Set-Location" -Tags "CI" { 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 90657419103..2c5f0fed3ee 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module (Join-Path -Path $PSScriptRoot '..\Microsoft.PowerShell.Security\certificateCommon.psm1') 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 5ad3915e9d9..ed524c5aa9d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Split-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Split-Path" -Tags "CI" { 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 2c649827318..0669e78426a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { 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 ff611a0b44d..c2a89117167 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Stop-Computer.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # note these will manipulate private data in the PowerShell engine which will diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index 20634b1dd67..5e78380b49a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon 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 48a80d8e0b8..8a21ceb8199 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Test-Path" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 index 0167137effb..e3f4c78ddf4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 4bb1d58c7ee..a10b6f6e298 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 index c6df456615e..423c0bfc4e8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "UnixFileSystem additions" -Tag "CI" { # if PSUnixFileStat is converted from an experimental feature, these tests will need to be changed diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 index 391f88ef14f..d159bcf8270 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Validate basic Variable provider cmdlets" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 index df150e39b2b..f95198928e4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Acl cmdlets are available and operate properly" -Tag CI { It "Get-Acl returns an ACL object" -pending:(!$IsWindows) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/AmsiInterface.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/AmsiInterface.Tests.ps1 index 6c2bd3bbc1e..c67dafd68ef 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/AmsiInterface.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/AmsiInterface.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. try diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 index 15bf3895002..61d30f584a6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # The import and table creation work on non-windows, but are currently not needed diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 index 0ab474b484f..67159e5c9e2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module (Join-Path -Path $PSScriptRoot 'certificateCommon.psm1') -Force diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 index f58e8759351..821ed628ec9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Security.Cryptography.X509Certificates diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageDebugger.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageDebugger.Tests.ps1 index 29a67919c19..3a1131e2628 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageDebugger.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageDebugger.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## @@ -101,7 +101,7 @@ try param ($scriptText) - try + try { Invoke-LanguageModeTestingSupportCmdlet -SetLockdownMode diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 index f71ca5e1020..926be123d41 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageModules.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 index 9c369798a53..047fcf9582a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageValidation.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageValidation.Tests.ps1 index 68b55bc0ea1..691a0ac5db8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageValidation.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ConstrainedLanguageValidation.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 index d73a9c12b06..f30ef57ce5e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index 6911532ac9e..96672d72a55 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite to validate the New-FileCatalog & Test-FileCatalog cmdlets on PowerShell. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 index f6eba5be84e..2af8021d922 100755 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Credential Test" -tag "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 index 838719ad1af..92041033a8b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "SecureString conversion tests" -Tags "CI" { BeforeAll { 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 6d9231d4445..7ef77dafe46 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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. 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 c4ba990084c..e4a5654204f 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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. 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 efa75bd89bf..74b7509d905 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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. 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 fdc5507ece8..7e1eb965728 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 @@ -24,7 +24,7 @@ Author = 'PowerShell' CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' # 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 c58e5cf4ebf..d5fd2f213e7 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 9fe5fc0d02c..c437a6ff374 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 @@ -2,7 +2,7 @@ ModuleVersion = '3.0.0.1' Author = 'PowerShell' CompanyName = 'Microsoft Corporation' - Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' + Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Hello World!' PowerShellVersion = '3.0' CLRVersion = '4.0' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 index 03dd6bb99c4..91c87df36d2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 a8e6d381a8f..67c7b55327d 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Add-Member DRT Unit Tests" -Tags "CI" { 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 c886a1ef4a4..ab2b94a6b58 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Type.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Add-Type" -Tags "CI" { 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 52353ab4121..4b8a2cce699 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Clear-Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Clear-Variable DRT Unit Tests" -Tags "CI" { It "Clear-Variable normal variable Name should works"{ 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 8f773de56db..55819fba180 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Compare-Object" -Tags "CI" { BeforeAll { 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 83640bcb367..827238eb9ef 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $here = Split-Path -Parent $MyInvocation.MyCommand.Path 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 d400dbc6b9f..029e7a70039 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Json.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function New-NestedJson { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.ps1 index c7e302ad29f..e50f23edd96 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertFrom-SddlString Tests" -Tags "CI", "RequireAdminOnWindows" { 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 7bafba9d250..0804d3dd740 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-StringData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" { It "Should able to throw error when convert invalid line" { 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 9c8a3f6f543..7d91b0b4bfd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" { $inputObject = [pscustomobject]@{ First = 1; Second = 2 } 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 7cfaed62aa5..5eea8505295 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertTo-Html Tests" -Tags "CI" { 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 1f09ea4a0ef..b2c55aceeca 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'ConvertTo-Json' -tags "CI" { BeforeAll { 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 ba3689ee759..e37c5c2ab31 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertTo--SecureString" -Tags "CI" { 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 03e5b3a0839..9e72b70f3e2 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" { 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 681cafd18bd..e75b09747a1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Debug-Runspace" -tag "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.Tests.ps1 index 176d980f551..79a1cbdd510 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $FeatureEnabled = $EnabledExperimentalFeatures.Contains('Microsoft.PowerShell.Utility.PSDebugRunspaceWithBreakpoints') 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 3760489ebef..4c2b839259b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Environment-Variables.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Environment-Variables" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 index eeffcf70ed3..18e84f096e2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Event Subscriber Tests" -Tags "Feature" { 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 147dbb3098b..5d01ca1652a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon 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 e54544baac1..962576f824e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon 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 7fc6722d0f1..12af02aa27b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Export-FormatData" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 index 2e6c5404fde..b587577b31a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'ForEach-Object -Parallel Basic Tests' -Tags 'CI' { 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 a296b5b4590..75aece4546c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Format-Custom" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 index aa9fb789a69..6bc7e06a591 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module. 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 dff2eeb9638..a562ac40d19 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-List.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Format-List" -Tags "CI" { $nl = [Environment]::NewLine 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 809182caa8e..345bd7adfc7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Format-Table" -Tags "CI" { It "Should call format table on piped input without error" { 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 f10f9f38649..f1bf37acc2d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Format-Wide" -Tags "CI" { BeforeAll { 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 69bc401e915..e7e62f428b9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Alias DRT Unit Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 index 74c6b4175f5..09fd6d077ac 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Command Feature tests" -Tag Feature { 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 c437f2804ff..42aa39bfb50 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Culture.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. 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 fbf71dead4f..cdbb7508989 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Date DRT Unit Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 index 988a20f6fe5..00a2744b8c3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Get-Error tests' -Tag CI { 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 7f2fbfeb309..f59b33d1db3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Event" -Tags "CI" { 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 1ffeefe8659..6ea5eb658b5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-EventSubscriber" -Tags "CI" { 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 3807d2d2ea0..eac9bd9c908 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-FileHash" -Tags "CI" { 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 bec83bcb99b..baf349e107e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-FormatData" -Tags "CI" { 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 5a3928aae37..5104ae6c904 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Host.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Host DRT Unit Tests" -Tags "CI" { It "Should works proper with 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 166190e4d8a..03ccf110754 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Member" -Tags "CI" { It "Should be able to be called on string objects, ints, arrays, etc" { 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 68b2c55e618..734fa4a8687 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-PSBreakpoint" -Tags "CI" { 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 97df34580bc..5a7cf94d673 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" { BeforeAll { 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 abe029d6c71..c0c87036671 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Random DRT Unit Tests" -Tags "CI" { $testData = @( 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 bf88b22a2ca..30423b861f5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-RunspaceDebug.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-RunspaceDebug" -Tags "CI" { 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 e558ba5d1fb..9837360afe8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-TraceSource" -Tags "Feature" { It "Should output data sorted by 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 dc1b13e7d92..5ce878b3712 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-UICulture.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-UICulture" -Tags "CI" { It "Should have $ PsUICulture variable be equivalent to Get-UICulture object" { 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 699f7eda74a..fa859c9b91b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Unique.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Unique DRT Unit Tests" -Tags "CI" { It "Command get-unique works with AsString switch" { 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 d8b4d67f94a..aff5e4d50af 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Uptime.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Uptime" -Tags "CI" { BeforeAll { 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 13c574de3ca..dc240e7b0df 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Variable DRT Unit Tests" -Tags "CI" { 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 4236c420116..c45bde77f10 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Verb" -Tags "CI" { 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 be2cba67800..d330757da52 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Group-Object DRT Unit Tests" -Tags "CI" { It "Test for CaseSensitive switch" { 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 064783bdeb6..6d1bf17ecc0 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Skip all tests on non-windows and non-PowerShellCore and non-elevated platforms. 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 e13442278ac..a5d73601b64 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Import-Alias DRT Unit Tests" -Tags "CI" { $testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory 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 45ccec63a76..debd3f3001b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Csv.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Import-Csv DRT Unit Tests" -Tags "CI" { BeforeAll { 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 2807c0eba36..59b4944a6ad 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-LocalizedData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets 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 3d840120e2a..bc9a5eee646 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tags "Feature" { BeforeAll { 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 6f34e441f3b..57812ca566c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Invoke-Expression" -Tags "CI" { 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 61b1175f586..c3e51bd5c7a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Diagnostics diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 index 4f4bdedf9e6..79fc6f2585e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Join-String" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 index e3decfee6e1..13eb43608ab 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite which validate the Json cmdlets. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 index 2c61abd2915..de04e9bcd07 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/JsonObject.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Unit tests for JsonObject' -tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/MarkdownCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/MarkdownCmdlets.Tests.ps1 index 96ad7cbd1f0..1faf4b89280 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/MarkdownCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/MarkdownCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'ConvertFrom-Markdown tests' -Tags 'CI' { 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 73aaf47fdd9..ea2550b8473 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Command.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Measure-Command" -Tags "CI" { 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 762c19e6c3b..afc35f0fdbb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Measure-Object" -Tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 index d04d4098498..82e00bd81af 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/MiscCmdletUpdates.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "GetDateFormatUpdates" -Tags "Feature" { 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 0c203697e05..715327c5501 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-Alias DRT Unit Tests" -Tags "CI" { It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{ 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 851bfdf49ae..ed3c69b9cb8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-Event" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Guid.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Guid.Tests.ps1 index ec5760cc269..e1d0431df41 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Guid.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Guid.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-Guid" -Tags "CI" { 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 625ff491fb3..c163e49189c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-Object" -Tags "CI" { It "Support 'ComObject' parameter on platforms" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TemporaryFile.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TemporaryFile.Tests.ps1 index 04f0554f49f..c78b795cc6b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TemporaryFile.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TemporaryFile.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite to validate the New-TemporaryFile cmdlet in the Microsoft.PowerShell.Utility module. 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 5db42d6b786..ad8cb8a6121 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-TimeSpan.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-TimeSpan DRT Unit Tests" -Tags "CI" { 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 342d8934901..77a6fc8910a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-Variable DRT Unit Tests" -Tags "CI" { 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 807a32a970b..219c729e25a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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" { 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 6174333a2fc..fbe4e9b3814 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Out-String DRT Unit Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 index 7b6530f6b9f..d4ece313b58 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for the Import-PowerShellDataFile cmdlet" -Tags "CI" { 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 6e5695e90e5..f12fa8f2d78 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Read-Host Test" -tag "CI" { BeforeAll { 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 f586a5f891f..054b5a8961b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Register-EngineEvent" -Tags "CI" { 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 79e77222294..bbae5e9a067 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-ObjectEvent.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Register-ObjectEvent" -Tags "CI" { 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 91614ec0449..7e98eb78917 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-Alias" -Tags "CI" { 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 4300514b6dc..11d402806b8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-Event" -Tags "CI" { 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 96386ab485c..549bb97851d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-PSBreakpoint" -Tags "CI" { # Set up test script 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 2f82d2823b6..ba009de4b1b 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Remove-TypeData DRT Unit Tests" -Tags "CI" { BeforeAll { 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 f631450de1b..a8499473cfc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ensure the machine is in a clean state from the outset. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 index 27a60351dd8..1b6e1ea05f5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Get-Runspace cmdlet tests" -Tag "CI" { BeforeAll { 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 2071e0a53ce..0c623f7d443 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . (Join-Path -Path $PSScriptRoot -ChildPath Test-Mocks.ps1) 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 7007fe36aa2..56f5e76cf76 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Select-String" -Tags "CI" { 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 4905e05789c..814b57a9720 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Xml.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Xml.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 cb05eabb8ba..9bc5a4e3024 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Send-MailMessage.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. if(-not ("netDumbster.smtp.SimpleSmtpServer" -as [type])) 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 55bd23aab02..c7b385d8677 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Set-Alias DRT Unit Tests" -Tags "CI" { 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 79faacc1028..f8b974c457f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Date.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon 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 96023d40470..84a16556e7b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $ps = Join-Path -Path $PSHOME -ChildPath "pwsh" 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 afde2431893..ab207f9ff85 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Set-Variable DRT Unit Tests" -Tags "CI" { 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 6c6423e6830..a58356f58ef 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Sort-Object" -Tags "CI" { 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 19a27e7c58c..59ac3e9903d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Start-Sleep.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Start-Sleep DRT Unit Tests" -Tags "CI" { 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 daa72e8e634..51b1354b934 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tee-Object" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 index cf5a9438406..8eadcaa78fd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Test-Json" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 index 7032e0acba2..6405bbac3b2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Mocks.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Function GetFileMock () { $objs = @( [pscustomobject]@{ Size=4533816; Mode="-a---l"; LastWriteTime="9/1/2015 11:15 PM"; Name="explorer.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 204bed93761..aca9a3a9eb9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This came from monad/tests/ci/PowerShell/tests/Commands/Cmdlets/pester.utility.command.tests.ps1 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 3d58556e580..e328111f0ab 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Unblock-File" -Tags "CI" { 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 feaf1b0548f..9c3ed3363b2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Unimplemented Utility Cmdlet Tests" -Tags "CI" { 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 29ec9cd5ea2..8436c9b9814 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Update-FormatData" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-List.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-List.Tests.ps1 index e79dcc7878c..e29c6183705 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-List.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-List.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Update-List Tests" -Tag CI { 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 ecb89ff62fe..38f1516dae2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Update-TypeData basic functionality" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 index 180c066016f..bcb3fc73781 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Tests for Wait-Debugger' -Tags "CI" { 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 72b6952ab19..0e9e806002e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Event.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Wait-Event" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index d588674d6a9..ce3720e49c5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a Pester test suite which validate the Web cmdlets. 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 7b7dd68b8e9..5dfc696b150 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Debug.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Debug tests" -Tags "CI" { It "Should not have added line breaks" { 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 4d4ba9f8cd4..4b15ed67c95 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Error Tests" -Tags "CI" { It "Should be works with command: write-error myerrortext" { 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 97d9b3ae36a..a75c17bcbaa 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Host with default Console Host" -Tags "Slow","Feature" { 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 08cc880a00d..c9e75c500d3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Output.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Output DRT Unit Tests" -Tags "CI" { It "Simple Write Object Test" { 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 e4a236e2458..baa7e1c1c52 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,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Progress DRT Unit Tests" -Tags "CI" { It "Should be able to throw exception when missing mandatory parameters" { 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 3fa2381472b..205d0050203 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Stream.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 77bbbaf3321..3630ef0cf3e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Verbose.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Write-Verbose" -Tags "CI" { It "Should be able to call cmdlet without error" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 index 2e2d3a75b7c..e640b93c324 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 index d23a9e8c339..27d33bc2416 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/alias.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Alias tests" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 index f7926aaa2b8..2d7439a1796 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "CliXml test" -Tags "CI" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 index 989ced59cd4..1ada3a7c020 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Trace-Command" -tags "Feature" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 index 4d009914304..4df2ebf3e9b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Object cmdlets" -Tags "CI" { Context "Group-Object" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 index 6f520e71cb6..2e27f285dd5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "String cmdlets" -Tags "CI" { Context "Select-String" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 index e396d57219a..bd0d0961886 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "TestData cmdlets" -Tags "CI" { Context "Get-TypeData" { 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 5a9f2bf869f..0bd17c50611 100644 --- a/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 index d2d84265492..49d60cd1283 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/ConfigProvider.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "WSMan Config Provider" -Tag Feature,RequireAdminOnWindows { diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 index 8b18dea309d..e440c8093f8 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/CredSSP.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "CredSSP cmdlet tests" -Tags 'Feature','RequireAdminOnWindows' { diff --git a/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 b/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 index ec824ec0b0b..2d85778a437 100644 --- a/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.WSMan.Management/TestWSMan.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "TestWSMan tests" -Tags 'Feature','RequireAdminOnWindows' { @@ -11,7 +11,7 @@ Describe "TestWSMan tests" -Tags 'Feature','RequireAdminOnWindows' { $testWsman = [Microsoft.WSMan.Management.TestWSManCommand]::new() } } - + AfterAll { $global:PSDefaultParameterValues = $originalDefaultParameterValues } diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 index 771f9f86e42..596154cba5a 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "DSC MOF Compilation" -tags "CI" { diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 index fd51ff77012..5ed18f048b6 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Function Install-ModuleIfMissing { param( diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 index c423e8d3392..c0133a013a1 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "DSC MOF Compilation" -tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 b/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 index d58b6b3cdfc..dc8e491d506 100644 --- a/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 +++ b/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index bbe0aa2c248..63dbb9a03b9 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "PSReadLine" -tags "CI" { BeforeAll { diff --git a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 index a7a6875023c..fb5f6941c81 100644 --- a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 +++ b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 @@ -1,5 +1,5 @@ # -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index db8bb59edb4..e178d0a77e3 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # no progress output during these tests diff --git a/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 b/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 index fa582ca877e..08fbb3f2d72 100644 --- a/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 +++ b/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Helper function to wait for job to reach a running or completed state diff --git a/test/powershell/Provider/AutomountSubstDrive.ps1 b/test/powershell/Provider/AutomountSubstDrive.ps1 index 0cbc8c5756e..0deafdd8ee0 100644 --- a/test/powershell/Provider/AutomountSubstDrive.ps1 +++ b/test/powershell/Provider/AutomountSubstDrive.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Precondition: start from fresh PS session, do not have the media mounted diff --git a/test/powershell/Provider/AutomountSubstDriveCore.ps1 b/test/powershell/Provider/AutomountSubstDriveCore.ps1 index 09ae998846d..3eaf51f0244 100644 --- a/test/powershell/Provider/AutomountSubstDriveCore.ps1 +++ b/test/powershell/Provider/AutomountSubstDriveCore.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param ([String]$Path) diff --git a/test/powershell/Provider/AutomountVHDDrive.ps1 b/test/powershell/Provider/AutomountVHDDrive.ps1 index 9cbbc95efa7..66d73a86305 100644 --- a/test/powershell/Provider/AutomountVHDDrive.ps1 +++ b/test/powershell/Provider/AutomountVHDDrive.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Precondition: start from fresh PS session, do not have the media mounted diff --git a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 index 1b60d6d430e..b2ac82fc2c1 100644 --- a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 +++ b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <############################################################################################ # File: Pester.AutomountedDrives.Tests.ps1 diff --git a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 index 0880b1b6f7d..4fd5cf73f2a 100644 --- a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 +++ b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ProviderIntrinsics Tests" -tags "CI" { BeforeAll { diff --git a/test/powershell/SDK/Breakpoint.Tests.ps1 b/test/powershell/SDK/Breakpoint.Tests.ps1 index 7b6769a4e05..4ac31c2fdaf 100644 --- a/test/powershell/SDK/Breakpoint.Tests.ps1 +++ b/test/powershell/SDK/Breakpoint.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Breakpoint SDK Unit Tests' -Tags 'CI' { diff --git a/test/powershell/SDK/Json.Tests.ps1 b/test/powershell/SDK/Json.Tests.ps1 index 78b9e0410db..2403c968a57 100644 --- a/test/powershell/SDK/Json.Tests.ps1 +++ b/test/powershell/SDK/Json.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # https://www.newtonsoft.com/json/help/html/ParsingLINQtoJSON.htm diff --git a/test/powershell/SDK/PSDebugging.Tests.ps1 b/test/powershell/SDK/PSDebugging.Tests.ps1 index 02090da3da8..e3b600adae4 100644 --- a/test/powershell/SDK/PSDebugging.Tests.ps1 +++ b/test/powershell/SDK/PSDebugging.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Diagnostics using namespace System.Management.Automation.Internal diff --git a/test/powershell/engine/Api/BasicEngine.Tests.ps1 b/test/powershell/engine/Api/BasicEngine.Tests.ps1 index d90aa4969e6..553fb1108af 100644 --- a/test/powershell/engine/Api/BasicEngine.Tests.ps1 +++ b/test/powershell/engine/Api/BasicEngine.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Basic engine APIs' -Tags "CI" { Context 'powershell::Create' { diff --git a/test/powershell/engine/Api/GetNewClosure.Tests.ps1 b/test/powershell/engine/Api/GetNewClosure.Tests.ps1 index 44c6d452fdf..662cb1c39dc 100644 --- a/test/powershell/engine/Api/GetNewClosure.Tests.ps1 +++ b/test/powershell/engine/Api/GetNewClosure.Tests.ps1 @@ -1,7 +1,7 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "ScriptBlock.GetNewClosure()" -tags "CI" { - + BeforeAll { ## No error should occur when calling GetNewClosure because: diff --git a/test/powershell/engine/Api/InitialSessionState.Tests.ps1 b/test/powershell/engine/Api/InitialSessionState.Tests.ps1 index 886af18654f..d7ca5dc4562 100644 --- a/test/powershell/engine/Api/InitialSessionState.Tests.ps1 +++ b/test/powershell/engine/Api/InitialSessionState.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "InitialSessionState capacity" -Tags CI { BeforeAll { diff --git a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 index f4c3a5975cc..155da067e81 100644 --- a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 +++ b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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" { diff --git a/test/powershell/engine/Api/ProxyCommand.Tests.ps1 b/test/powershell/engine/Api/ProxyCommand.Tests.ps1 index 1028a8fee75..0b765108d13 100644 --- a/test/powershell/engine/Api/ProxyCommand.Tests.ps1 +++ b/test/powershell/engine/Api/ProxyCommand.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 0a5784bd7e9..ac2761bbc06 100644 --- a/test/powershell/engine/Api/Serialization.Tests.ps1 +++ b/test/powershell/engine/Api/Serialization.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Serialization Tests" -tags "CI" { BeforeAll { diff --git a/test/powershell/engine/Api/TaskBasedAsyncPowerShellAPI.Tests.ps1 b/test/powershell/engine/Api/TaskBasedAsyncPowerShellAPI.Tests.ps1 index d9dba6141c2..e2b1d3d87d5 100644 --- a/test/powershell/engine/Api/TaskBasedAsyncPowerShellAPI.Tests.ps1 +++ b/test/powershell/engine/Api/TaskBasedAsyncPowerShellAPI.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Task-based PowerShell async APIs' -Tags 'Feature' { diff --git a/test/powershell/engine/Api/TypeInference.Tests.ps1 b/test/powershell/engine/Api/TypeInference.Tests.ps1 index dab2d220441..47e6dae5fbe 100644 --- a/test/powershell/engine/Api/TypeInference.Tests.ps1 +++ b/test/powershell/engine/Api/TypeInference.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Management.Automation using namespace System.Collections.Generic diff --git a/test/powershell/engine/Basic/Assembly.LoadFrom.Tests.ps1 b/test/powershell/engine/Basic/Assembly.LoadFrom.Tests.ps1 index 4b4555a2715..67ee0677c51 100644 --- a/test/powershell/engine/Basic/Assembly.LoadFrom.Tests.ps1 +++ b/test/powershell/engine/Basic/Assembly.LoadFrom.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Assembly.LoadFrom Validation Test" -Tags "CI" { diff --git a/test/powershell/engine/Basic/Assembly.LoadNative.Tests.ps1 b/test/powershell/engine/Basic/Assembly.LoadNative.Tests.ps1 index 689de7d73ee..bb383573672 100644 --- a/test/powershell/engine/Basic/Assembly.LoadNative.Tests.ps1 +++ b/test/powershell/engine/Basic/Assembly.LoadNative.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Can load a native assembly" -Tags "CI" { diff --git a/test/powershell/engine/Basic/Assembly.LoadWithPartialName.Tests.ps1 b/test/powershell/engine/Basic/Assembly.LoadWithPartialName.Tests.ps1 index 8d618d21c6f..bd490f92cfd 100644 --- a/test/powershell/engine/Basic/Assembly.LoadWithPartialName.Tests.ps1 +++ b/test/powershell/engine/Basic/Assembly.LoadWithPartialName.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Assembly::LoadWithPartialName Validation Test" -Tags "CI" { diff --git a/test/powershell/engine/Basic/Assembly.LoadedInSeparateALC.Tests.ps1 b/test/powershell/engine/Basic/Assembly.LoadedInSeparateALC.Tests.ps1 index c04acd91e95..13fa5c8b4e5 100644 --- a/test/powershell/engine/Basic/Assembly.LoadedInSeparateALC.Tests.ps1 +++ b/test/powershell/engine/Basic/Assembly.LoadedInSeparateALC.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Assembly loaded in a separate AssemblyLoadContext should not be seen by PowerShell type resolution" -Tags "CI" { diff --git a/test/powershell/engine/Basic/Attributes.Tests.ps1 b/test/powershell/engine/Basic/Attributes.Tests.ps1 index 074c492b5fc..f7eeacd3b60 100644 --- a/test/powershell/engine/Basic/Attributes.Tests.ps1 +++ b/test/powershell/engine/Basic/Attributes.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Attribute tests" -Tags "CI" { BeforeEach { diff --git a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 index 980ecaf6fdc..58fd53ad8b8 100644 --- a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 +++ b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Command Discovery tests" -Tags "CI" { diff --git a/test/powershell/engine/Basic/Credential.Tests.ps1 b/test/powershell/engine/Basic/Credential.Tests.ps1 index 237e924f9a0..eeccb18879f 100644 --- a/test/powershell/engine/Basic/Credential.Tests.ps1 +++ b/test/powershell/engine/Basic/Credential.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Credential tests" -Tags "CI" { It "Explicit cast for an empty credential returns null" { diff --git a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 index e93a7a0c51a..fefb4b15aca 100644 --- a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 +++ b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Verify approved aliases list" -Tags "CI" { BeforeAll { diff --git a/test/powershell/engine/Basic/Encoding.Tests.ps1 b/test/powershell/engine/Basic/Encoding.Tests.ps1 index 24f8e8af777..583deb89799 100644 --- a/test/powershell/engine/Basic/Encoding.Tests.ps1 +++ b/test/powershell/engine/Basic/Encoding.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "File encoding tests" -Tag CI { diff --git a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 index 8242b0c191e..3955d47ef9a 100644 --- a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 +++ b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # # Functional tests to verify basic conditions for IO to the powershell.config.json files diff --git a/test/powershell/engine/Basic/ProxyCommand.tests.ps1 b/test/powershell/engine/Basic/ProxyCommand.tests.ps1 index 947c4634249..abb2cef459e 100644 --- a/test/powershell/engine/Basic/ProxyCommand.tests.ps1 +++ b/test/powershell/engine/Basic/ProxyCommand.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'ProxyCommand Tests' -Tag 'CI' { diff --git a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 index 65b6136b257..3d4227c75f8 100644 --- a/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 +++ b/test/powershell/engine/Basic/SemanticVersion.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Management.Automation using namespace System.Management.Automation.Language diff --git a/test/powershell/engine/Basic/StandardLibraryTypes.Tests.ps1 b/test/powershell/engine/Basic/StandardLibraryTypes.Tests.ps1 index 7643d39df10..18dc449039d 100644 --- a/test/powershell/engine/Basic/StandardLibraryTypes.Tests.ps1 +++ b/test/powershell/engine/Basic/StandardLibraryTypes.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # This is a simple type check to validate that types in PowerShellStandard are present in System.Management.Automation.dll diff --git a/test/powershell/engine/Basic/Telemetry.Tests.ps1 b/test/powershell/engine/Basic/Telemetry.Tests.ps1 index b07ba07c304..0ea3594b869 100644 --- a/test/powershell/engine/Basic/Telemetry.Tests.ps1 +++ b/test/powershell/engine/Basic/Telemetry.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # unit tests for telemetry diff --git a/test/powershell/engine/Basic/TypeResolution.Tests.ps1 b/test/powershell/engine/Basic/TypeResolution.Tests.ps1 index 6169612ee5b..ffe4adb9f09 100644 --- a/test/powershell/engine/Basic/TypeResolution.Tests.ps1 +++ b/test/powershell/engine/Basic/TypeResolution.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Resolve types in additional referenced assemblies" -Tag CI { diff --git a/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 b/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 index 87b9fdf5c1f..7ca68b62db4 100644 --- a/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 +++ b/test/powershell/engine/Basic/ValidateAttributes.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Validate Attributes Tests' -Tags 'CI' { @@ -8,29 +8,29 @@ Describe 'Validate Attributes Tests' -Tags 'CI' { @{ ScriptBlock = { function foo { param([ValidateCount(-1,2)] [string[]] $bar) }; foo } FullyQualifiedErrorId = "ExceptionConstructingAttribute" - InnerErrorId = "" + InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateCount(1,-1)] [string[]] $bar) }; foo } - FullyQualifiedErrorId = "ExceptionConstructingAttribute" - InnerErrorId = "" + FullyQualifiedErrorId = "ExceptionConstructingAttribute" + InnerErrorId = "" } - @{ + @{ ScriptBlock = { function foo { param([ValidateCount(2, 1)] [string[]] $bar) }; foo } FullyQualifiedErrorId = "ValidateRangeMaxLengthSmallerThanMinLength" - InnerErrorId = "" + InnerErrorId = "" } - @{ - ScriptBlock = { function foo { param([ValidateCount(2, 2)] [string[]] $bar) }; foo 1 } + @{ + ScriptBlock = { function foo { param([ValidateCount(2, 2)] [string[]] $bar) }; foo 1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateCountExactFailure" + InnerErrorId = "ValidateCountExactFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateCount(2, 3)] [string[]] $bar) }; foo 1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateCountMinMaxFailure" + InnerErrorId = "ValidateCountMinMaxFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateCount(2, 3)] [string[]] $bar) }; foo 1,2,3,4 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" InnerErrorId = "ValidateCountMinMaxFailure" @@ -55,25 +55,25 @@ Describe 'Validate Attributes Tests' -Tags 'CI' { Context "ValidateRange - ParameterConstuctors" { BeforeAll { $testCases = @( - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('xPositive')] $bar) }; foo } FullyQualifiedErrorId = "ExceptionConstructingAttribute" - InnerErrorId = "SubstringDisambiguationEnumParseThrewAnException" + InnerErrorId = "SubstringDisambiguationEnumParseThrewAnException" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(2,1)] [int] $bar) }; foo } FullyQualifiedErrorId = "MaxRangeSmallerThanMinRange" - InnerErrorId = "" + InnerErrorId = "" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange("one",10)] $bar) }; foo } FullyQualifiedErrorId = "MinRangeNotTheSameTypeOfMaxRange" - InnerErrorId = "" + InnerErrorId = "" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(1,"two")] $bar) }; foo } FullyQualifiedErrorId = "MinRangeNotTheSameTypeOfMaxRange" - InnerErrorId = "" + InnerErrorId = "" } ) } @@ -90,25 +90,25 @@ Describe 'Validate Attributes Tests' -Tags 'CI' { Context "ValidateRange - User Defined Range"{ BeforeAll { $testCases = @( - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo -1 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeTooSmall" + InnerErrorId = "ValidateRangeTooSmall" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo 11 } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeTooBig" + InnerErrorId = "ValidateRangeTooBig" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] $bar) }; foo "one" } FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidationRangeElementType" + InnerErrorId = "ValidationRangeElementType" } ) $validTestCases = @( - @{ + @{ ScriptBlock = { function foo { param([ValidateRange(1,10)] [int] $bar) }; foo 5 } } ) @@ -132,115 +132,115 @@ Describe 'Validate Attributes Tests' -Tags 'CI' { Context "ValidateRange - Predefined Range" { BeforeAll { $testCases = @( - @{ + @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo -1 } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangePositiveFailure" + InnerErrorId = "ValidateRangePositiveFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo 0 } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangePositiveFailure" + InnerErrorId = "ValidateRangePositiveFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] $bar) }; foo "one" } RangeType = "Positive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "" + InnerErrorId = "" } @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo -1 } RangeType = "NonNegative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeNonNegativeFailure" + InnerErrorId = "ValidateRangeNonNegativeFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] $bar) }; foo "one" } RangeType = "NonNegative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "" + InnerErrorId = "" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo 1 } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeNegativeFailure" + InnerErrorId = "ValidateRangeNegativeFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo 0 } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeNegativeFailure" + InnerErrorId = "ValidateRangeNegativeFailure" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] $bar) }; foo "one" } RangeType = "Negative" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "" + InnerErrorId = "" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] $bar) }; foo 1 } RangeType = "NonPositive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "ValidateRangeNonPositiveFailure" + InnerErrorId = "ValidateRangeNonPositiveFailure" } @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] $bar) }; foo "one" } RangeType = "NonPositive" FullyQualifiedErrorId = "ParameterArgumentValidationError,foo" - InnerErrorId = "" + InnerErrorId = "" } ) $validTestCases = @( - @{ + @{ ScriptBlock = { function foo { param([ValidateRange("Positive")] [int] $bar) }; foo 15 } RangeType = "Positive" TestValue = 15 } - @{ - ScriptBlock = { function foo { param([ValidateRange("Positive")] [double]$bar) }; foo ([double]::MaxValue) }; + @{ + ScriptBlock = { function foo { param([ValidateRange("Positive")] [double]$bar) }; foo ([double]::MaxValue) }; RangeType = "Positive" TestValue = [double]::MaxValue } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo 0 } RangeType = "NonNegative" TestValue = 0 } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [int] $bar) }; foo 15 } RangeType = "NonNegative" TestValue = 15 } - @{ - ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [double]$bar) }; foo ([double]::MaxValue) }; + @{ + ScriptBlock = { function foo { param([ValidateRange('NonNegative')] [double]$bar) }; foo ([double]::MaxValue) }; RangeType = "NonNegative" TestValue = [double]::MaxValue } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('Negative')] [int] $bar) }; foo -15 } RangeType = "Negative" TestValue = -15 } - @{ - ScriptBlock = { function foo { param([ValidateRange('Negative')] [double]$bar) }; foo ([double]::MinValue) }; + @{ + ScriptBlock = { function foo { param([ValidateRange('Negative')] [double]$bar) }; foo ([double]::MinValue) }; TestValue = [double]::MinValue RangeType = "Negative" } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [int] $bar) }; foo 0 } RangeType = "NonPositive" TestValue = 0 } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [int] $bar) }; foo -15 } RangeType = "NonPositive" TestValue = -15 } - @{ + @{ ScriptBlock = { function foo { param([ValidateRange('NonPositive')] [double]$bar) }; foo ([double]::MinValue) } RangeType = "NonPositive" TestValue = [double]::MinValue diff --git a/test/powershell/engine/COM/COM.Basic.Tests.ps1 b/test/powershell/engine/COM/COM.Basic.Tests.ps1 index b69e2674fb8..496c5dbcc21 100644 --- a/test/powershell/engine/COM/COM.Basic.Tests.ps1 +++ b/test/powershell/engine/COM/COM.Basic.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. try { diff --git a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 index 6f5f82b0b9c..50e947e3f14 100644 --- a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 +++ b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $script:CimClassName = "PSCore_CimTest1" $script:CimNamespace = "root/default" diff --git a/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 b/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 index 83f2af544c5..55da2a467b5 100644 --- a/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 +++ b/test/powershell/engine/Cdxml/assets/CimTest/CdxmlTest.psd1 @@ -2,7 +2,7 @@ GUID = '41486F7D-842F-40F1-ACE4-8405F9C2ED9B' Author="PowerShell" CompanyName="Microsoft Corporation" - Copyright="Copyright (c) Microsoft Corporation. All rights reserved." + Copyright="Copyright (c) Microsoft Corporation." ModuleVersion = '2.0.0.0' PowerShellVersion = '3.0' FormatsToProcess = @() diff --git a/test/powershell/engine/ETS/Adapter.Tests.ps1 b/test/powershell/engine/ETS/Adapter.Tests.ps1 index f7fe53763e1..e543b430796 100644 --- a/test/powershell/engine/ETS/Adapter.Tests.ps1 +++ b/test/powershell/engine/ETS/Adapter.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Adapter Tests" -tags "CI" { Context "Property Adapter Tests" { diff --git a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 index aadc08e8606..d6eb95d4354 100644 --- a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 +++ b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function getIndex { diff --git a/test/powershell/engine/ETS/TypeTable.Tests.ps1 b/test/powershell/engine/ETS/TypeTable.Tests.ps1 index 0cf1aa18170..19c1b1eb9b7 100644 --- a/test/powershell/engine/ETS/TypeTable.Tests.ps1 +++ b/test/powershell/engine/ETS/TypeTable.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Built-in type information tests" -Tag "CI" { diff --git a/test/powershell/engine/ExperimentalFeature/EnableDisable-ExperimentalFeature.Tests.ps1 b/test/powershell/engine/ExperimentalFeature/EnableDisable-ExperimentalFeature.Tests.ps1 index 37bb52f79ea..a0db58da8e7 100644 --- a/test/powershell/engine/ExperimentalFeature/EnableDisable-ExperimentalFeature.Tests.ps1 +++ b/test/powershell/engine/ExperimentalFeature/EnableDisable-ExperimentalFeature.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/ExperimentalFeature/ExperimentalFeature.Basic.Tests.ps1 b/test/powershell/engine/ExperimentalFeature/ExperimentalFeature.Basic.Tests.ps1 index 4a7aad492ab..2e86672b3ac 100644 --- a/test/powershell/engine/ExperimentalFeature/ExperimentalFeature.Basic.Tests.ps1 +++ b/test/powershell/engine/ExperimentalFeature/ExperimentalFeature.Basic.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Experimental Feature Basic Tests - Feature-Disabled" -tags "CI" { diff --git a/test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 b/test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 index d9511a53d96..bcc358bcccd 100644 --- a/test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 +++ b/test/powershell/engine/ExperimentalFeature/Get-ExperimentalFeature.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs index 3d38dd57145..2b4b0980404 100644 --- a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs +++ b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psd1 b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psd1 index ad613c7126e..766518729bb 100644 --- a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psd1 +++ b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psd1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Module manifest for module 'ExpTest' diff --git a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psm1 b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psm1 index 27c9864d824..7117cba95b7 100644 --- a/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psm1 +++ b/test/powershell/engine/ExperimentalFeature/assets/ExpTest/ExpTest.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Management.Automation diff --git a/test/powershell/engine/Formatting/BugFix.Tests.ps1 b/test/powershell/engine/Formatting/BugFix.Tests.ps1 index 65b71113389..20f9d538aec 100644 --- a/test/powershell/engine/Formatting/BugFix.Tests.ps1 +++ b/test/powershell/engine/Formatting/BugFix.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Hidden properties should not be returned by the 'FirstOrDefault' primitive" -Tag CI { diff --git a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 index 29b7ee98d5e..dfb5ec41adb 100644 --- a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 +++ b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Tests for $ErrorView' -Tag CI { diff --git a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 index 1ab2e2166e8..f4ad51af3c1 100644 --- a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Online help tests for PowerShell Cmdlets' -Tags "Feature" { diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index 03ed622ddba..7f1f2927ba5 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # # Validates Get-Help for cmdlets in Microsoft.PowerShell.Core. diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index a2c2b2265af..61086667bcb 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/Job/Jobs.Tests.ps1 b/test/powershell/engine/Job/Jobs.Tests.ps1 index 52e1f545386..13276e092c0 100644 --- a/test/powershell/engine/Job/Jobs.Tests.ps1 +++ b/test/powershell/engine/Job/Jobs.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe 'Basic Job Tests' -Tags 'Feature' { diff --git a/test/powershell/engine/Module/ModulePath.Tests.ps1 b/test/powershell/engine/Module/ModulePath.Tests.ps1 index 952908edb4f..b4dd5add437 100644 --- a/test/powershell/engine/Module/ModulePath.Tests.ps1 +++ b/test/powershell/engine/Module/ModulePath.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "SxS Module Path Basic Tests" -tags "CI" { diff --git a/test/powershell/engine/Module/ModuleSpecification.Tests.ps1 b/test/powershell/engine/Module/ModuleSpecification.Tests.ps1 index b9f81a47463..6516ad05120 100644 --- a/test/powershell/engine/Module/ModuleSpecification.Tests.ps1 +++ b/test/powershell/engine/Module/ModuleSpecification.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace Microsoft.PowerShell.Commands diff --git a/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 b/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 index c287065a712..8c23bbfa1db 100644 --- a/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/NewModuleManifest.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "New-ModuleManifest basic tests" -tags "CI" { diff --git a/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 b/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 index 9b86849d004..8565f9fc381 100644 --- a/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 +++ b/test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Tests for paths of submodules in module manifest" -tags "CI" { @@ -12,10 +12,10 @@ Describe "Tests for paths of submodules in module manifest" -tags "CI" { $nestedModuleFilePath = Join-Path $nestedModulePath $submoduleFileName BeforeEach { - + Remove-Module $moduleName -Force -ErrorAction SilentlyContinue Remove-Item $moduleRootPath -Recurse -Force -ErrorAction SilentlyContinue - + New-Item -ItemType Directory -Force -Path $nestedModulePath "function TestModuleFunction{'Hello from TestModuleFunction'}" | Out-File $nestedModuleFilePath } @@ -40,7 +40,7 @@ Describe "Tests for paths of submodules in module manifest" -tags "CI" { It "Test if NestedModule path is " -TestCases $testCases { param($SubModulePath) - + New-ModuleManifest $moduleFilePath -NestedModules @($SubModulePath) Import-Module $moduleFilePath (Get-Module $moduleName).ExportedCommands.Keys.Contains('TestModuleFunction') | Should -BeTrue @@ -48,7 +48,7 @@ Describe "Tests for paths of submodules in module manifest" -tags "CI" { It "Test if RootModule path is " -TestCases $testCases { param($SubModulePath) - + New-ModuleManifest $moduleFilePath -RootModule $SubModulePath Import-Module $moduleFilePath (Get-Module $moduleName).ExportedCommands.Keys.Contains('TestModuleFunction') | Should -BeTrue diff --git a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 index c481ae28d7e..1e406e620bd 100644 --- a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/Module/UpdateModuleManifest.Tests.ps1 b/test/powershell/engine/Module/UpdateModuleManifest.Tests.ps1 index 0ac58a92c3c..a63efc02004 100644 --- a/test/powershell/engine/Module/UpdateModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/UpdateModuleManifest.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Update-ModuleManifest tests" -tags "CI" { 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 149a2f7a297..e43c261b35a 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 @@ -14,7 +14,7 @@ Author = 'PowerShell' CompanyName = 'Microsoft Corporation' # Copyright statement for this module -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' # 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 863908fa935..13890571b08 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,3 +1,3 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 595cff8ba9f..1dd49f56eca 100644 --- a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "BooleanParameterDCR Tests" -tags "CI" { BeforeAll { diff --git a/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 b/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 index f55fb514aac..b76a2f76e21 100644 --- a/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/NullableBooleanDCR.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Nullable Boolean DCR Tests" -Tags "CI" { BeforeAll { diff --git a/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 b/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 index ad1f2ff25a5..07d132012a0 100644 --- a/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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" { diff --git a/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 b/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 index 4ff3796b9c9..fe87aef5564 100644 --- a/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/StaticParameterBinder.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Management.Automation.Language diff --git a/test/powershell/engine/Remoting/ImplicitRemotingBatching.Tests.ps1 b/test/powershell/engine/Remoting/ImplicitRemotingBatching.Tests.ps1 index 8e1d39fb4a8..62c72790622 100644 --- a/test/powershell/engine/Remoting/ImplicitRemotingBatching.Tests.ps1 +++ b/test/powershell/engine/Remoting/ImplicitRemotingBatching.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "TestImplicitRemotingBatching hook should correctly batch simple remote command pipelines" -Tag 'Feature','RequireAdminOnWindows' { diff --git a/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 b/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 index 8053cf6838a..7829aa38770 100644 --- a/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 +++ b/test/powershell/engine/Remoting/InvokeCommandRemoteDebug.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## ## PowerShell Invoke-Command -RemoteDebug Tests diff --git a/test/powershell/engine/Remoting/PSSession.Tests.ps1 b/test/powershell/engine/Remoting/PSSession.Tests.ps1 index 7d17a7f444d..547c54f40f2 100644 --- a/test/powershell/engine/Remoting/PSSession.Tests.ps1 +++ b/test/powershell/engine/Remoting/PSSession.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index 7b0ce019699..46fc2045d19 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/Remoting/RemoteSession.Disconnect.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Disconnect.Tests.ps1 index cc004a8ce0d..a26769ad2ba 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Disconnect.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Disconnect.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersCommon diff --git a/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 b/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 index 67ca0d1e2b1..5ce9b0c4b0b 100644 --- a/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 +++ b/test/powershell/engine/Remoting/RoleCapabilityFiles.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## ## PowerShell Remoting Endpoint Role Capability Files Tests diff --git a/test/powershell/engine/Remoting/RunspacePool.Tests.ps1 b/test/powershell/engine/Remoting/RunspacePool.Tests.ps1 index 23dcbe65bb5..1266a6956e9 100644 --- a/test/powershell/engine/Remoting/RunspacePool.Tests.ps1 +++ b/test/powershell/engine/Remoting/RunspacePool.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module HelpersRemoting diff --git a/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 b/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 index c2d0245e316..5b3e6885190 100644 --- a/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 +++ b/test/powershell/engine/Remoting/SSHRemotingAPI.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "SSH Remoting API Tests" -Tags "Feature" { diff --git a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 index c79eb01a61b..a0caab97309 100644 --- a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 +++ b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 4a80f7bca5f..1ff51e2a707 100644 --- a/test/powershell/engine/Remoting/SessionOption.Tests.ps1 +++ b/test/powershell/engine/Remoting/SessionOption.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. try { if ( ! $IsWindows ) { diff --git a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 index c60985d511e..2093a1dd65c 100644 --- a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . "$PSScriptRoot/TestRunner.ps1" diff --git a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 index 3c8eecdd346..8459b0631fa 100644 --- a/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ConsoleHostResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . "$PSScriptRoot/TestRunner.ps1" diff --git a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 index d53858ba3ea..e36b2307979 100644 --- a/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/DotNetEventingResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . "$PSScriptRoot/TestRunner.ps1" diff --git a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 index ea6b1576fda..e3d4f7dc215 100644 --- a/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/ManagementCommandsResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 e8d7cf8bcf0..177f3e36932 100644 --- a/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SMAResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 227d17bd4f9..529dde227fa 100644 --- a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . "$PSScriptRoot/TestRunner.ps1" diff --git a/test/powershell/engine/ResourceValidation/TestRunner.ps1 b/test/powershell/engine/ResourceValidation/TestRunner.ps1 index e3c6cb5264b..881cb43f804 100644 --- a/test/powershell/engine/ResourceValidation/TestRunner.ps1 +++ b/test/powershell/engine/ResourceValidation/TestRunner.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Test-ResourceStrings { diff --git a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 index 5633584bcbb..e1ac58f1842 100644 --- a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 c4741f1e123..a0b2a9d31b4 100644 --- a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. . "$PSScriptRoot/TestRunner.ps1" diff --git a/test/powershell/engine/Security/UntrustedDataMode.Tests.ps1 b/test/powershell/engine/Security/UntrustedDataMode.Tests.ps1 index 8ae3e1012ee..8042be3463a 100644 --- a/test/powershell/engine/Security/UntrustedDataMode.Tests.ps1 +++ b/test/powershell/engine/Security/UntrustedDataMode.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "UntrustedDataMode tests for variable assignments" -Tags 'CI' { diff --git a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 index 21168fdd876..ec3792908c8 100644 --- a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 +++ b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [Parameter(Mandatory = $true, Position = 0)] $coverallsToken, diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 index 4e97a5f3734..3d501983806 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psd1 @@ -12,7 +12,7 @@ GUID = 'cc1c8e94-51d1-4bc1-b508-62bc09f02f54' CompanyName = 'Microsoft Corporation' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Temporary module contains functions for using in tests' diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index c9de2db3f51..fd7c9d16d48 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Wait-UntilTrue { diff --git a/test/tools/Modules/HelpersDebugger/HelpersDebugger.psd1 b/test/tools/Modules/HelpersDebugger/HelpersDebugger.psd1 index cc5d11ab936..7708d0b4fd9 100644 --- a/test/tools/Modules/HelpersDebugger/HelpersDebugger.psd1 +++ b/test/tools/Modules/HelpersDebugger/HelpersDebugger.psd1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @{ @@ -10,7 +10,7 @@ CompanyName = 'Microsoft Corporation' - Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' + Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Helper module for Pester tests that automate the debugger' diff --git a/test/tools/Modules/HelpersDebugger/HelpersDebugger.psm1 b/test/tools/Modules/HelpersDebugger/HelpersDebugger.psm1 index 2a0f8508bcf..74091d14e0d 100644 --- a/test/tools/Modules/HelpersDebugger/HelpersDebugger.psm1 +++ b/test/tools/Modules/HelpersDebugger/HelpersDebugger.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Ensure that terminating errors terminate when importing the module. diff --git a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psd1 b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psd1 index 361ce8d3a84..f0adc4639c4 100644 --- a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psd1 +++ b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psd1 @@ -12,7 +12,7 @@ GUID = '40a19c05-d765-41a1-995e-98ca5f247ee1' CompanyName = 'Microsoft Corporation' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Simple console host for console IO tests.' diff --git a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 index 45e4db5b844..dd52fdb59e2 100755 --- a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 +++ b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $definition = @' using System; diff --git a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psd1 b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psd1 index 3d5c9df5391..42bc7b4db03 100644 --- a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psd1 +++ b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psd1 @@ -12,7 +12,7 @@ GUID = 'a575af5e-2bd1-427f-b966-48640788896b' CompanyName = 'Microsoft Corporation' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Temporary module for language tests' diff --git a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 index d579ac88825..6f9f7038bef 100644 --- a/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 +++ b/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # # Run the new parser, return either errors or the ast @@ -27,7 +27,7 @@ function Get-RuntimeError param( [Parameter(ValueFromPipeline=$true,Mandatory=$true)][string]$src ) - + $errors = $null try { diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 index 8697076839b..de3bf5fd4dd 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psd1 @@ -12,7 +12,7 @@ GUID = '7acf3c68-64f4-4550-bf14-b9361bfbfea3' CompanyName = 'Microsoft Corporation' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Temporary module for remoting tests' diff --git a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 index 11f4af410d0..96461bd5fb0 100644 --- a/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 +++ b/test/tools/Modules/HelpersRemoting/HelpersRemoting.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## diff --git a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psd1 b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psd1 index 34a93d7dd99..20f3e6756e1 100644 --- a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psd1 +++ b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psd1 @@ -7,7 +7,7 @@ ModuleVersion = '1.0' GUID = '544d00d4-e3b7-46e2-a6a1-8bbf53980e5d' CompanyName = 'Microsoft Corporation' - Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' + Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Security tests helper functions' FunctionsToExport = @() AliasesToExport = @() diff --git a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 index 0f48322ef66..05692b09250 100644 --- a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 +++ b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. if ($IsWindows) diff --git a/test/tools/Modules/HttpListener/HttpListener.psd1 b/test/tools/Modules/HttpListener/HttpListener.psd1 index d4b46d3e7a4..866c9f8253d 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psd1 +++ b/test/tools/Modules/HttpListener/HttpListener.psd1 @@ -3,7 +3,7 @@ ModuleVersion = '1.0.0' GUID = 'e148b26c-0594-4963-99e5-419d4ff302e2' Author = 'PowerShell' CompanyName = 'Microsoft' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Creates a new HTTP Listener for testing purposes' RootModule = 'HttpListener.psm1' FunctionsToExport = @('Start-HttpListener','Stop-HttpListener') diff --git a/test/tools/Modules/HttpListener/HttpListener.psm1 b/test/tools/Modules/HttpListener/HttpListener.psm1 index a3e83ce45d0..adadc7425f3 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psm1 +++ b/test/tools/Modules/HttpListener/HttpListener.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Function Stop-HTTPListener { <# diff --git a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 index 5a6ee4dba02..770b3135db4 100644 --- a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 +++ b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. @{ @@ -18,7 +18,7 @@ This module contains remoting tool cmdlets. Enable-SSHRemoting cmdlet: -------------------------- -PowerShell SSH remoting was implemented in PowerShell 6.0 but requries SSH (client) and SSHD (service) components +PowerShell SSH remoting was implemented in PowerShell 6.0 but requries SSH (client) and SSHD (service) components to be installed. In addition the sshd_config configuration file must be updated to define a PowerShell endpoint as a subsystem. Once this is done PowerShell remoting cmdlets can be used to establish a PowerShell remoting session over SSH that works across platforms. diff --git a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 index 5d42ff861cb..737d0e29302 100644 --- a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 +++ b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. ## @@ -32,7 +32,7 @@ function DetectPlatform [PlatformInfo] $PlatformInfo ) - try + try { $Runtime = [System.Runtime.InteropServices.RuntimeInformation] $OSPlatform = [System.Runtime.InteropServices.OSPlatform] @@ -41,8 +41,8 @@ function DetectPlatform $platformInfo.isLinux = $Runtime::IsOSPlatform($OSPlatform::Linux) $platformInfo.isOSX = $Runtime::IsOSPlatform($OSPlatform::OSX) $platformInfo.isWindows = $Runtime::IsOSPlatform($OSPlatform::Windows) - } - catch + } + catch { $platformInfo.isCoreCLR = $false $platformInfo.isLinux = $false @@ -286,7 +286,7 @@ $typeDef = @' path: longPath, shortPath: shortPath, shortPathLength: shortPathLength); - + return shortPath.ToString(); } } @@ -298,7 +298,7 @@ $typeDef = @' Enables PowerShell SSH remoting endpoint on local system .Description This cmdlet will set up an SSH based remoting endpoint on the local system, based on - the PowerShell executable file path passed in. Or if no PowerShell file path is provided then + the PowerShell executable file path passed in. Or if no PowerShell file path is provided then the currently running PowerShell file path is used. The end point is enabled by adding a 'powershell' subsystem entry to the SSHD configuration, using the provided or current PowerShell file path. @@ -359,7 +359,7 @@ function Enable-SSHRemoting $parameters += "'$value' " } } - + & sudo "$PSHOME/pwsh" -NoExit -c "Import-Module -Name $modFilePath; Enable-SSHRemoting $parameters" exit } @@ -457,7 +457,7 @@ function Enable-SSHRemoting throw "Converting long Windows file path resulted in an invalid path: ${PowerShellToUse}." } } - else + else { throw "The PowerShell executable (pwsh) selected for hosting the remoting endpoint has a file path containing space characters, which cannot be used with SSHD configuration." } diff --git a/test/tools/Modules/PSSysLog/PSSysLog.psd1 b/test/tools/Modules/PSSysLog/PSSysLog.psd1 index d61d532740d..5691ce4518d 100644 --- a/test/tools/Modules/PSSysLog/PSSysLog.psd1 +++ b/test/tools/Modules/PSSysLog/PSSysLog.psd1 @@ -3,7 +3,7 @@ GUID = '56b63338-045c-4697-a24b-5a756268c8b2' Author = 'PowerShell' CompanyName = 'Microsoft Corporation' - Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' + Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Provides a reader for powershell syslog and os_log entries' RootModule = 'PSSysLog.psm1' FunctionsToExport = @( diff --git a/test/tools/Modules/PSSysLog/PSSysLog.psm1 b/test/tools/Modules/PSSysLog/PSSysLog.psm1 index 92f93ea27ec..dbd0bac5568 100644 --- a/test/tools/Modules/PSSysLog/PSSysLog.psm1 +++ b/test/tools/Modules/PSSysLog/PSSysLog.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Set-StrictMode -Version 3.0 diff --git a/test/tools/Modules/WebListener/WebListener.psm1 b/test/tools/Modules/WebListener/WebListener.psm1 index 7e0c5807d48..5d95707b50d 100644 --- a/test/tools/Modules/WebListener/WebListener.psm1 +++ b/test/tools/Modules/WebListener/WebListener.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Class WebListener diff --git a/test/tools/OpenCover/OpenCover.psd1 b/test/tools/OpenCover/OpenCover.psd1 index 89fd1db07db..024a745299f 100644 --- a/test/tools/OpenCover/OpenCover.psd1 +++ b/test/tools/OpenCover/OpenCover.psd1 @@ -4,7 +4,7 @@ ModuleVersion = '1.1.0.0' GUID = '4eedcffd-26e8-4172-8aad-9b882c13d370' Author = 'PowerShell' CompanyName = 'Microsoft Corporation' -Copyright = 'Copyright (c) Microsoft Corporation. All rights reserved.' +Copyright = 'Copyright (c) Microsoft Corporation.' Description = 'Module to install OpenCover and run Powershell tests to collect code coverage' DotNetFrameworkVersion = 4.5 TypesToProcess = @('OpenCover.Types.ps1xml') diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 84ded9e0357..7138e78853c 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #region privateFunctions diff --git a/test/tools/TestExe/TestExe.cs b/test/tools/TestExe/TestExe.cs index 46bae59fb52..09606f43e9d 100644 --- a/test/tools/TestExe/TestExe.cs +++ b/test/tools/TestExe/TestExe.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Threading; diff --git a/test/tools/TestService/Program.cs b/test/tools/TestService/Program.cs index 6be04aac653..a1d9049b31d 100644 --- a/test/tools/TestService/Program.cs +++ b/test/tools/TestService/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ServiceProcess; diff --git a/test/tools/TestService/Service1.Designer.cs b/test/tools/TestService/Service1.Designer.cs index 8ec66d05df5..861c596757c 100644 --- a/test/tools/TestService/Service1.Designer.cs +++ b/test/tools/TestService/Service1.Designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace TestService { diff --git a/test/tools/TestService/Service1.cs b/test/tools/TestService/Service1.cs index 2a5e5c18f6b..b21a8576dac 100644 --- a/test/tools/TestService/Service1.cs +++ b/test/tools/TestService/Service1.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.ServiceProcess; diff --git a/test/tools/WebListener/Constants.cs b/test/tools/WebListener/Constants.cs index 4d43888c425..7adb43a1d8d 100644 --- a/test/tools/WebListener/Constants.cs +++ b/test/tools/WebListener/Constants.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/tools/WebListener/Controllers/AuthController.cs b/test/tools/WebListener/Controllers/AuthController.cs index a7172d1aaca..77170723042 100644 --- a/test/tools/WebListener/Controllers/AuthController.cs +++ b/test/tools/WebListener/Controllers/AuthController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/CertController.cs b/test/tools/WebListener/Controllers/CertController.cs index e2bca31cd32..bdfe805765f 100644 --- a/test/tools/WebListener/Controllers/CertController.cs +++ b/test/tools/WebListener/Controllers/CertController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/CompressionController.cs b/test/tools/WebListener/Controllers/CompressionController.cs index 22cab21c796..ded0bc501d9 100644 --- a/test/tools/WebListener/Controllers/CompressionController.cs +++ b/test/tools/WebListener/Controllers/CompressionController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/test/tools/WebListener/Controllers/DelayController.cs b/test/tools/WebListener/Controllers/DelayController.cs index c64fb2490b9..c52f3c5c774 100644 --- a/test/tools/WebListener/Controllers/DelayController.cs +++ b/test/tools/WebListener/Controllers/DelayController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/DosController.cs b/test/tools/WebListener/Controllers/DosController.cs index 864bb3aa8f2..60029e4dbbd 100644 --- a/test/tools/WebListener/Controllers/DosController.cs +++ b/test/tools/WebListener/Controllers/DosController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Diagnostics; diff --git a/test/tools/WebListener/Controllers/EncodingController.cs b/test/tools/WebListener/Controllers/EncodingController.cs index 1b8c33576f3..a59c441b3fe 100644 --- a/test/tools/WebListener/Controllers/EncodingController.cs +++ b/test/tools/WebListener/Controllers/EncodingController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/GetController.cs b/test/tools/WebListener/Controllers/GetController.cs index 13a7094170b..0a4cd328a02 100644 --- a/test/tools/WebListener/Controllers/GetController.cs +++ b/test/tools/WebListener/Controllers/GetController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/HomeController.cs b/test/tools/WebListener/Controllers/HomeController.cs index 3341ff11f6a..8a9eb1ec1c7 100644 --- a/test/tools/WebListener/Controllers/HomeController.cs +++ b/test/tools/WebListener/Controllers/HomeController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/test/tools/WebListener/Controllers/LinkController.cs b/test/tools/WebListener/Controllers/LinkController.cs index 471cf7cbaa6..2a80ee3c53b 100644 --- a/test/tools/WebListener/Controllers/LinkController.cs +++ b/test/tools/WebListener/Controllers/LinkController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/MultipartController.cs b/test/tools/WebListener/Controllers/MultipartController.cs index 435347470ad..dc34714f8fc 100644 --- a/test/tools/WebListener/Controllers/MultipartController.cs +++ b/test/tools/WebListener/Controllers/MultipartController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/RedirectController.cs b/test/tools/WebListener/Controllers/RedirectController.cs index 9af1af6c390..414c11f0ec7 100644 --- a/test/tools/WebListener/Controllers/RedirectController.cs +++ b/test/tools/WebListener/Controllers/RedirectController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/ResponseController.cs b/test/tools/WebListener/Controllers/ResponseController.cs index 770739633a4..c77c53ac2bf 100644 --- a/test/tools/WebListener/Controllers/ResponseController.cs +++ b/test/tools/WebListener/Controllers/ResponseController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/ResponseHeadersController.cs b/test/tools/WebListener/Controllers/ResponseHeadersController.cs index 90a2fad900e..6532a030f05 100644 --- a/test/tools/WebListener/Controllers/ResponseHeadersController.cs +++ b/test/tools/WebListener/Controllers/ResponseHeadersController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/Controllers/ResumeController.cs b/test/tools/WebListener/Controllers/ResumeController.cs index f406be130c6..ebcfad40d78 100644 --- a/test/tools/WebListener/Controllers/ResumeController.cs +++ b/test/tools/WebListener/Controllers/ResumeController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/tools/WebListener/Controllers/RetryController.cs b/test/tools/WebListener/Controllers/RetryController.cs index bb11448d728..1dfcf6cd68f 100644 --- a/test/tools/WebListener/Controllers/RetryController.cs +++ b/test/tools/WebListener/Controllers/RetryController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections; diff --git a/test/tools/WebListener/DeflateFilter.cs b/test/tools/WebListener/DeflateFilter.cs index 89e9e353fb2..b7af0befd48 100644 --- a/test/tools/WebListener/DeflateFilter.cs +++ b/test/tools/WebListener/DeflateFilter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.IO; diff --git a/test/tools/WebListener/GzipFilter.cs b/test/tools/WebListener/GzipFilter.cs index 4fd39034e3a..58bca478b05 100644 --- a/test/tools/WebListener/GzipFilter.cs +++ b/test/tools/WebListener/GzipFilter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.IO; diff --git a/test/tools/WebListener/Models/ErrorViewModel.cs b/test/tools/WebListener/Models/ErrorViewModel.cs index 3a501f23674..269434d4477 100644 --- a/test/tools/WebListener/Models/ErrorViewModel.cs +++ b/test/tools/WebListener/Models/ErrorViewModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/tools/WebListener/Program.cs b/test/tools/WebListener/Program.cs index 54af72860fe..691ef60b7c2 100644 --- a/test/tools/WebListener/Program.cs +++ b/test/tools/WebListener/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/test/tools/WebListener/Startup.cs b/test/tools/WebListener/Startup.cs index 6a801b88708..4091a38b4dc 100644 --- a/test/tools/WebListener/Startup.cs +++ b/test/tools/WebListener/Startup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; diff --git a/test/xUnit/Asserts/PriorityAttribute.cs b/test/xUnit/Asserts/PriorityAttribute.cs index 626ac5ac233..0f26216253b 100644 --- a/test/xUnit/Asserts/PriorityAttribute.cs +++ b/test/xUnit/Asserts/PriorityAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/Asserts/PriorityOrderer.cs b/test/xUnit/Asserts/PriorityOrderer.cs index 1b9ea179372..f8801f314c7 100644 --- a/test/xUnit/Asserts/PriorityOrderer.cs +++ b/test/xUnit/Asserts/PriorityOrderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_Binders.cs b/test/xUnit/csharp/test_Binders.cs index 7918c65bafa..dd762b5538c 100644 --- a/test/xUnit/csharp/test_Binders.cs +++ b/test/xUnit/csharp/test_Binders.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_CorePsPlatform.cs b/test/xUnit/csharp/test_CorePsPlatform.cs index 58d5261e49e..780ce8d7e28 100644 --- a/test/xUnit/csharp/test_CorePsPlatform.cs +++ b/test/xUnit/csharp/test_CorePsPlatform.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_ExtensionMethods.cs b/test/xUnit/csharp/test_ExtensionMethods.cs index 1e29687759d..38726e1a45e 100644 --- a/test/xUnit/csharp/test_ExtensionMethods.cs +++ b/test/xUnit/csharp/test_ExtensionMethods.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_FileSystemProvider.cs b/test/xUnit/csharp/test_FileSystemProvider.cs index f3f690ebeca..268dbddef42 100644 --- a/test/xUnit/csharp/test_FileSystemProvider.cs +++ b/test/xUnit/csharp/test_FileSystemProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_MshSnapinInfo.cs b/test/xUnit/csharp/test_MshSnapinInfo.cs index 4fe65776d5b..2742ba71c09 100644 --- a/test/xUnit/csharp/test_MshSnapinInfo.cs +++ b/test/xUnit/csharp/test_MshSnapinInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_NamedPipe.cs b/test/xUnit/csharp/test_NamedPipe.cs index eac61c4d1bf..1ee50036fc0 100644 --- a/test/xUnit/csharp/test_NamedPipe.cs +++ b/test/xUnit/csharp/test_NamedPipe.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_PSConfiguration.cs b/test/xUnit/csharp/test_PSConfiguration.cs index 2bb33ea5db3..4bc38bdcfb4 100644 --- a/test/xUnit/csharp/test_PSConfiguration.cs +++ b/test/xUnit/csharp/test_PSConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_PSObject.cs b/test/xUnit/csharp/test_PSObject.cs index 5f4c6d41869..1888d45045d 100644 --- a/test/xUnit/csharp/test_PSObject.cs +++ b/test/xUnit/csharp/test_PSObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_PSVersionInfo.cs b/test/xUnit/csharp/test_PSVersionInfo.cs index c5151e1a8e1..a43e72f37f4 100644 --- a/test/xUnit/csharp/test_PSVersionInfo.cs +++ b/test/xUnit/csharp/test_PSVersionInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_PowerShellAPI.cs b/test/xUnit/csharp/test_PowerShellAPI.cs index 79aba1689f7..f237fa057b7 100644 --- a/test/xUnit/csharp/test_PowerShellAPI.cs +++ b/test/xUnit/csharp/test_PowerShellAPI.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_Runspace.cs b/test/xUnit/csharp/test_Runspace.cs index 9657ee37262..3a7a6278bf6 100644 --- a/test/xUnit/csharp/test_Runspace.cs +++ b/test/xUnit/csharp/test_Runspace.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_SecuritySupport.cs b/test/xUnit/csharp/test_SecuritySupport.cs index 0d7cbbc8f0d..51729d25e4f 100644 --- a/test/xUnit/csharp/test_SecuritySupport.cs +++ b/test/xUnit/csharp/test_SecuritySupport.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_SessionState.cs b/test/xUnit/csharp/test_SessionState.cs index 6032bcb15a1..ff2f1d82dc2 100644 --- a/test/xUnit/csharp/test_SessionState.cs +++ b/test/xUnit/csharp/test_SessionState.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_Utils.cs b/test/xUnit/csharp/test_Utils.cs index 2abe69d37d2..8519babf069 100644 --- a/test/xUnit/csharp/test_Utils.cs +++ b/test/xUnit/csharp/test_Utils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/test/xUnit/csharp/test_WildcardPattern.cs b/test/xUnit/csharp/test_WildcardPattern.cs index 50fb30620a2..07f4045ef11 100644 --- a/test/xUnit/csharp/test_WildcardPattern.cs +++ b/test/xUnit/csharp/test_WildcardPattern.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; diff --git a/tools/ResxGen/ResxGen.ps1 b/tools/ResxGen/ResxGen.ps1 index af43c496e79..23386517b21 100755 --- a/tools/ResxGen/ResxGen.ps1 +++ b/tools/ResxGen/ResxGen.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# diff --git a/tools/ResxGen/ResxGen.psm1 b/tools/ResxGen/ResxGen.psm1 index a2a30b41233..adb06982239 100644 --- a/tools/ResxGen/ResxGen.psm1 +++ b/tools/ResxGen/ResxGen.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# Enumerate all events in the manifest and create a hash table of event id to message id. diff --git a/tools/Sign-Package.ps1 b/tools/Sign-Package.ps1 index 9393f358863..fa9ef63d003 100644 --- a/tools/Sign-Package.ps1 +++ b/tools/Sign-Package.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Utility to generate a self-signed certificate and sign a given package such as PowerShell.zip/appx/msi diff --git a/tools/WindowsCI.psm1 b/tools/WindowsCI.psm1 index 8450f3e74e7..fd96d1eb0bb 100644 --- a/tools/WindowsCI.psm1 +++ b/tools/WindowsCI.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. if($PSVersionTable.PSEdition -ne 'Desktop') diff --git a/tools/Xml/Xml.psm1 b/tools/Xml/Xml.psm1 index 8b26d3d91d0..329bb3b2130 100644 --- a/tools/Xml/Xml.psm1 +++ b/tools/Xml/Xml.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # Adds an attribute to a XmlElement diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 7d39bd47300..854da9da3fb 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Set-StrictMode -Version 3.0 diff --git a/tools/failingTests/fail.tests.ps1 b/tools/failingTests/fail.tests.ps1 index 87aebc169ef..3526d0640b0 100644 --- a/tools/failingTests/fail.tests.ps1 +++ b/tools/failingTests/fail.tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Failing test used to test CI Scripts" -Tags 'CI' { It "Should fail" { diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index 80c9d86dd8f..a560e83eb41 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis diff --git a/tools/install-powershell.sh b/tools/install-powershell.sh index 794aaecdbe1..c6a2fa41f76 100755 --- a/tools/install-powershell.sh +++ b/tools/install-powershell.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. install(){ diff --git a/tools/installpsh-amazonlinux.sh b/tools/installpsh-amazonlinux.sh index 61bbe3e9c7f..48768549fc5 100755 --- a/tools/installpsh-amazonlinux.sh +++ b/tools/installpsh-amazonlinux.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. #Companion code for the blog https://cloudywindows.com diff --git a/tools/packaging/packaging.psd1 b/tools/packaging/packaging.psd1 index de5672690e2..0caae3ec701 100644 --- a/tools/packaging/packaging.psd1 +++ b/tools/packaging/packaging.psd1 @@ -2,7 +2,7 @@ GUID="41857994-4283-4757-a932-0b0edb104913" Author="PowerShell" CompanyName="Microsoft Corporation" -Copyright="Copyright (c) Microsoft Corporation. All rights reserved." +Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="1.0.0" PowerShellVersion="5.0" CmdletsToExport=@() diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 03b38be32c0..e6650eb810c 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. $Environment = Get-EnvironmentInformation diff --git a/tools/packaging/projects/nuget/powershell.nuspec b/tools/packaging/projects/nuget/powershell.nuspec index db3be245daa..5c191e911e5 100644 --- a/tools/packaging/projects/nuget/powershell.nuspec +++ b/tools/packaging/projects/nuget/powershell.nuspec @@ -11,7 +11,7 @@ https://github.com/powershell/powershell https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_64.png This package contains PowerShell for $runtime$. - Copyright (c) Microsoft Corporation. All rights reserved. + Copyright (c) Microsoft Corporation. PowerShell diff --git a/tools/performance/PowerShell.Regions.xml b/tools/performance/PowerShell.Regions.xml index 180374ecf5c..f97d627f74b 100644 --- a/tools/performance/PowerShell.Regions.xml +++ b/tools/performance/PowerShell.Regions.xml @@ -1,5 +1,5 @@ - + diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index 23e4225acdf..c8bff8d6684 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # PowerShell Script to build and package PowerShell from specified form and branch diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 0e606083446..3c6672f5241 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. [cmdletbinding(DefaultParameterSetName='default')] # PowerShell Script to clone, build and package PowerShell from specified fork and branch diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 index 25079028edf..73c428dce2d 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. function Install-ChocolateyPackage { diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 index db55a2d99a5..e2b446cb7b7 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/wix.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Import-Module "$PSScriptRoot\dockerInstall.psm1" diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index 60518484c84..54acd4a427f 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# diff --git a/tools/releaseBuild/createComplianceFolder.ps1 b/tools/releaseBuild/createComplianceFolder.ps1 index d036f65dcec..c462a09ebdb 100644 --- a/tools/releaseBuild/createComplianceFolder.ps1 +++ b/tools/releaseBuild/createComplianceFolder.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [Parameter(HelpMessage="Artifact folder to find compliance files in.")] diff --git a/tools/releaseBuild/generatePackgeSigning.ps1 b/tools/releaseBuild/generatePackgeSigning.ps1 index 4f7dd01b897..be3512d28d4 100644 --- a/tools/releaseBuild/generatePackgeSigning.ps1 +++ b/tools/releaseBuild/generatePackgeSigning.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. param( [Parameter(Mandatory)] diff --git a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 index be9ade24519..50fd12b7a8e 100644 --- a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # PowerShell Script to build and package PowerShell from specified form and branch diff --git a/tools/releaseBuild/updateSigning.ps1 b/tools/releaseBuild/updateSigning.ps1 index 3ebb474ca8c..bace3aec2b7 100644 --- a/tools/releaseBuild/updateSigning.ps1 +++ b/tools/releaseBuild/updateSigning.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # 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 63af03f6301..bef8a491104 100644 --- a/tools/releaseBuild/vstsbuild.ps1 +++ b/tools/releaseBuild/vstsbuild.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. [cmdletbinding(DefaultParameterSetName='Build')] param( diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index 0366c71227d..b87394fa561 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -1,5 +1,5 @@ #requires -Version 6.0 -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. class CommitNode { diff --git a/tools/windows/Reset-PWSHSystemPath.ps1 b/tools/windows/Reset-PWSHSystemPath.ps1 index 619c01b9b16..5a8a7d764e0 100644 --- a/tools/windows/Reset-PWSHSystemPath.ps1 +++ b/tools/windows/Reset-PWSHSystemPath.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# From f23be437afebe299796abac297b7f724953c35f8 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 24 Mar 2020 11:38:45 -0700 Subject: [PATCH 091/275] Fix terms checker issues (#12189) --- .../host/msh/ConsoleHostUserInterface.cs | 4 ++-- .../FormatAndOutput/common/OutputManager.cs | 6 ++--- .../engine/Modules/ImportModuleCommand.cs | 8 +++---- .../engine/SessionStateVariableAPIs.cs | 22 +++++++++---------- .../engine/parser/Parser.cs | 2 +- ...clientremotesessionprotocolstatemachine.cs | 2 +- .../remoting/fanin/WSManPluginShellSession.cs | 2 +- .../remoting/server/serverremotesession.cs | 4 ++-- .../engine/runtime/Binding/Binders.cs | 2 +- .../Language/Parser/Parser.Tests.ps1 | 4 ++-- .../Get-ChildItem.Tests.ps1 | 10 ++++----- .../Export-Alias.Tests.ps1 | 2 +- .../Format-Table.Tests.ps1 | 4 ++-- .../Get-Command.Tests.ps1 | 8 +++---- .../PSDesiredStateConfiguration.Tests.ps1 | 2 +- .../engine/Help/HelpSystem.Tests.ps1 | 2 +- 16 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 354d6f19aa2..48953bf2308 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -603,7 +603,7 @@ private void WriteToConsole(ReadOnlySpan value, bool transcribeResult, boo private void WriteToConsole(ConsoleColor foregroundColor, ConsoleColor backgroundColor, string text, bool newLine = false) { - // Sync access so that we don't race on color settings if called from multiple threads. + // Sync access so that we don't conflict on color settings if called from multiple threads. lock (_instanceLock) { ConsoleColor fg = RawUI.ForegroundColor; @@ -779,7 +779,7 @@ public override void WriteLine(ConsoleColor foregroundColor, ConsoleColor backgr private void Write(ConsoleColor foregroundColor, ConsoleColor backgroundColor, string value, bool newLine) { - // Sync access so that we don't race on color settings if called from multiple threads. + // Sync access so that we don't conflict on color settings if called from multiple threads. lock (_instanceLock) { ConsoleColor fg = RawUI.ForegroundColor; diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs index 889ded7d226..861a3ab6405 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs @@ -213,10 +213,10 @@ private void InitializeCommandsHardWired(ExecutionContext context) additional types. Adding a handler here would cause a new sub-pipeline to be created. - For example, the following line would add a new handler named "out-foobar" - to be invoked when the incoming object type is "MyNamespace.Whatever.FooBar" + For example, the following line would add a new handler named "out-example" + to be invoked when the incoming object type is "MyNamespace.Whatever.Example" - RegisterCommandForTypes (context, "out-foobar", new string[] { "MyNamespace.Whatever.FooBar" }); + RegisterCommandForTypes (context, "out-example", new string[] { "MyNamespace.Whatever.Example" }); And the method can be like this: private void RegisterCommandForTypes (ExecutionContext context, string commandName, Type commandType, string[] types) diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index 55db1b075db..c7366460928 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -1751,10 +1751,10 @@ protected override void BeginProcessing() /// c:\temp\mdir\mdir # resolve by using extensions. mdir is a directory, mdir.xxx is a file. /// c:\temp\mdir # load default module if mdir is directory /// module # $PSScriptRoot/module/module.psd1 (ps1,psm1,dll) - /// module/foobar.psm1 # $PSScriptRoot/module/module.psm1 - /// module/foobar # $PSScriptRoot/module/foobar.XXX if foobar is not a directory... - /// module/foobar # $PSScriptRoot/module/foobar is a directory and $PSScriptRoot/module/foobar/foobar.XXX exists - /// module/foobar/foobar.XXX + /// module/examplemodule.psm1 # $PSScriptRoot/module/module.psm1 + /// module/examplemodule # $PSScriptRoot/module/examplemodule.XXX if examplemodule is not a directory... + /// module/examplemodule # $PSScriptRoot/module/examplemodule is a directory and $PSScriptRoot/module/examplemodule/examplemodule.XXX exists + /// module/examplemodule/examplemodule.XXX /// protected override void ProcessRecord() { diff --git a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs index 92abd09af6f..9ad3b6eddcd 100644 --- a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs @@ -36,7 +36,7 @@ internal void AddSessionStateEntry(SessionStateVariableEntry entry) /// /// Get a variable out of session state. This interface supports - /// the scope specifiers like "global:foobar" + /// the scope specifiers like "global:example" /// /// /// name of variable to look up @@ -67,7 +67,7 @@ internal PSVariable GetVariable(string name, CommandOrigin origin) /// /// Get a variable out of session state. This interface supports - /// the scope specifiers like "global:foobar" + /// the scope specifiers like "global:example" /// /// /// name of variable to look up @@ -86,7 +86,7 @@ internal PSVariable GetVariable(string name) /// /// Get a variable out of session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to look up @@ -129,7 +129,7 @@ internal object GetVariableValue(string name) /// /// Get a variable out of session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to look up @@ -595,7 +595,7 @@ internal PSVariable GetVariableItem( /// /// Get a variable out of session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to look up @@ -646,7 +646,7 @@ internal PSVariable GetVariableAtScope(string name, string scopeID) /// /// Get a variable out of session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to look up @@ -922,7 +922,7 @@ internal object GetAutomaticVariableValue(AutomaticVariable variable) /// /// Set a variable in session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "$env:PATH = 'c:\windows'" or "$global:foobar = 13" + /// "$env:PATH = 'c:\windows'" or "$global:example = 13" /// /// /// The name of the item to set. @@ -967,7 +967,7 @@ internal void SetVariableValue(string name, object newValue, CommandOrigin origi /// /// Set a variable in session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "$env:PATH = 'c:\windows'" or "$global:foobar = 13" + /// "$env:PATH = 'c:\windows'" or "$global:example = 13" /// /// BUGBUG: this overload exists because a lot of tests in the /// testsuite use it. Those tests should eventually be fixed and this overload @@ -1005,7 +1005,7 @@ internal void SetVariableValue(string name, object newValue) /// /// Set a variable in session state. This interface supports - /// the scope specifiers like "$global:foobar = 13" + /// the scope specifiers like "$global:example = 13" /// /// /// The variable to be set. @@ -1639,7 +1639,7 @@ internal void RemoveVariable(PSVariable variable, bool force) /// /// Remove a variable from session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to remove @@ -1669,7 +1669,7 @@ internal void RemoveVariableAtScope(string name, string scopeID) /// /// Remove a variable from session state. This interface supports /// the "namespace:name" syntax so you can do things like - /// "env:PATH" or "global:foobar" + /// "env:PATH" or "global:example" /// /// /// name of variable to remove diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index 7ef9e2f8848..845b7f89e47 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -4887,7 +4887,7 @@ private StatementAst UsingStatementRule(Token usingToken) { case TokenKind.EndOfInput: case TokenKind.NewLine: - // Example: 'using module ,FooBar' + // Example: 'using module ,exampleModuleName' // GetCommandArgument will successfully return an argument for a unary array argument // but we don't want to allow that syntax with a using statement. case TokenKind.Comma: diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index cba83da97ad..63713c2c200 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs @@ -490,7 +490,7 @@ internal bool CanByPassRaiseEvent(RemoteSessionStateMachineEventArgs arg) _state == RemoteSessionState.EstablishedAndKeyReceived || // TODO - Client session would never get into this state... to be removed _state == RemoteSessionState.EstablishedAndKeySent || _state == RemoteSessionState.Disconnecting || // There can be input data until disconnect has been completed - _state == RemoteSessionState.Disconnected) // Data can arrive while state machine is transitioning to disconnected, in a race. + _state == RemoteSessionState.Disconnected) // Data can arrive while state machine is transitioning to disconnected { return true; } diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs index c3cc20983ab..9574301f415 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs @@ -254,7 +254,7 @@ internal void ReportContext() PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, creationRequestDetails.ToString(), creationRequestDetails.ToString()); - // RACE TO BE FIXED - As soon as this API is called, WinRM service will send CommandResponse back and Signal is expected anytime + // TO BE FIXED - As soon as this API is called, WinRM service will send CommandResponse back and Signal is expected anytime // If Signal comes and executes before registering the notification handle, cleanup will be messed result = WSManNativeApi.WSManPluginReportContext(creationRequestDetails.unmanagedHandle, 0, creationRequestDetails.unmanagedHandle); if (Platform.IsWindows && (WSManPluginConstants.ExitCodeSuccess == result)) diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs index 3b77a0e656c..e6520a9d389 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -676,9 +676,9 @@ internal void ExecuteConnect(byte[] connectData, out byte[] connectResponseData) } // we currently dont support adjusting runspace count on a connect operation. - // there is a potential race here where in the runspace pool driver is still yet to process a queued + // there is a potential conflict here where in the runspace pool driver is still yet to process a queued // setMax or setMinrunspaces request. - // TODO: resolve this race.. probably by letting the runspace pool consume all messages before we execute this. + // TODO: resolve this.. probably by letting the runspace pool consume all messages before we execute this. if (clientRequestedRunspaceCount && (_runspacePoolDriver.RunspacePool.GetMaxRunspaces() != clientRequestedMaxRunspaces) && (_runspacePoolDriver.RunspacePool.GetMinRunspaces() != clientRequestedMinRunspaces)) diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index 5db2bfec218..fddf9235bd6 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -5246,7 +5246,7 @@ public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, Dy if (adapterData.member.DeclaringType.IsGenericTypeDefinition || adapterData.propertyType.IsByRefLike) { - // This is kinda lame - we really should throw an error, but accessing property getter + // We really should throw an error, but accessing property getter // doesn't throw error in PowerShell since V2, even in strict mode. expr = ExpressionCache.NullConstant; } diff --git a/test/powershell/Language/Parser/Parser.Tests.ps1 b/test/powershell/Language/Parser/Parser.Tests.ps1 index 05e49fc4ce1..fd4d4a814e0 100644 --- a/test/powershell/Language/Parser/Parser.Tests.ps1 +++ b/test/powershell/Language/Parser/Parser.Tests.ps1 @@ -293,8 +293,8 @@ foo``u{2195}abc } It "Test that escaping any character with no special meaning just returns that char. (line 602)" { - $result = ExecuteCommand '"fo`obar"' - $result | Should -BeExactly "foobar" + $result = ExecuteCommand '"fo`odbar"' + $result | Should -BeExactly "foodbar" } Context "Test that we support all of the C# escape sequences. We use the ` instead of \. (line 613)" { 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 79e8cc42b47..7490f13c9a9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -214,16 +214,16 @@ Describe "Get-ChildItem" -Tags "CI" { It 'can handle mixed case in Env variables' { try { - $env:__FOOBAR = 'foo' - $env:__foobar = 'bar' + $env:__FOODBAR = 'food' + $env:__foodbar = 'bar' - $foobar = Get-Childitem env: | Where-Object {$_.Name -eq '__foobar'} + $foodbar = Get-Childitem env: | Where-Object {$_.Name -eq '__foodbar'} $count = if ($IsWindows) { 1 } else { 2 } - ($foobar | Measure-Object).Count | Should -Be $count + ($foodbar | Measure-Object).Count | Should -Be $count } catch { - Get-ChildItem env: | Where-Object {$_.Name -eq '__foobar'} | Remove-Item -ErrorAction SilentlyContinue + Get-ChildItem env: | Where-Object {$_.Name -eq '__foodbar'} | Remove-Item -ErrorAction SilentlyContinue } } } 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 5d01ca1652a..d28be6a3377 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { } It "Export-Alias with Invalid Scope will throw PSArgumentException" { - { Export-Alias $fulltestpath -scope foobar } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ExportAliasCommand" + { Export-Alias $fulltestpath -scope foodbar } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ExportAliasCommand" } It "Export-Alias for Default"{ 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 345bd7adfc7..32a5acbe17a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 @@ -134,8 +134,8 @@ Describe "Format-Table" -Tags "CI" { @{ testName = "array" ; testString = "line1","line2" } ) { param ($testString) - $result = $testString | Format-Table -Property "foo","bar" -Force | Out-String - $result.Replace(" ","").Replace([Environment]::NewLine,"") | Should -BeExactly "foobar------" + $result = $testString | Format-Table -Property "fox","bar" -Force | Out-String + $result.Replace(" ","").Replace([Environment]::NewLine,"") | Should -BeExactly "foxbar------" } It "Format-Table with complex object for End-To-End should work" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 index 09fd6d077ac..5725aede1d9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 @@ -75,9 +75,9 @@ Describe "Get-Command Feature tests" -Tag Feature { $manifestPath = Join-Path $testdrive "test.psd1" $modulePath = Join-Path $testdrive "test.psm1" - New-ModuleManifest -Path $manifestPath -FunctionsToExport "Get-FooBar","Get-FB" -RootModule test.psm1 + New-ModuleManifest -Path $manifestPath -FunctionsToExport "Get-FoodBar","Get-FB" -RootModule test.psm1 @" - function Get-FooBar { "foobar" } + function Get-FoodBar { "foodbar" } function Get-FB { "fb" } "@ > $modulePath @@ -85,8 +85,8 @@ Describe "Get-Command Feature tests" -Tag Feature { Import-Module $manifestPath $results = Get-Command g-fb -UseAbbreviationExpansion $results | Should -HaveCount 2 - $results[0].Name | Should -BeIn "Get-FB","Get-FooBar" - $results[1].Name | Should -BeIn "Get-FB","Get-FooBar" + $results[0].Name | Should -BeIn "Get-FB","Get-FoodBar" + $results[1].Name | Should -BeIn "Get-FB","Get-FoodBar" $results[0].Name | Should -Not -Be $results[1].Name } finally { diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 index 5ed18f048b6..11f2413da05 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 @@ -486,7 +486,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } try { - Invoke-DscResource -Name xWebSite -ModuleName 'xWebAdministration' -Method Test -Property @{TestScript = 'foobar' } -ErrorAction Stop -WarningVariable warnings + Invoke-DscResource -Name xWebSite -ModuleName 'xWebAdministration' -Method Test -Property @{TestScript = 'foodbar' } -ErrorAction Stop -WarningVariable warnings } catch{ #this will fail too, but that is nat what we are testing... diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index 7f1f2927ba5..0875bdcc407 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -574,7 +574,7 @@ Describe "Help failure cases" -Tags Feature { ) { param($command) - { & $command foobar -ErrorAction Stop } | Should -Throw -ErrorId "HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand" + { & $command DoesNotExist -ErrorAction Stop } | Should -Throw -ErrorId "HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand" } } From 7193800bc2394297fb701ef743b324691237f5d4 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 25 Mar 2020 12:11:06 -0700 Subject: [PATCH 092/275] Allow case insensitive paths for determining `PSModulePath` (#12192) * Allow case insensitive comparison of paths for determining PSModulePath * Address codefactor issue --- .../engine/Modules/ModuleIntrinsics.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index 94cc94fdbd1..3d03276613a 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -1250,7 +1250,7 @@ internal static string GetWindowsPowerShellModulePath() } // PowerShell specific paths including if set in powershell.config.json file we want to exclude - var excludeModulePaths = new HashSet { + var excludeModulePaths = new HashSet(StringComparer.OrdinalIgnoreCase) { GetPersonalModulePath(), GetSharedModulePath(), GetPSHomeModulePath(), From 238cb5c8dcc01565d0b93ade2faabfd8e6563329 Mon Sep 17 00:00:00 2001 From: Shayde Nofziger Date: Thu, 26 Mar 2020 04:18:33 -0400 Subject: [PATCH 093/275] Fix erroneous comment in tokenizer.cs (#12206) The BigInteger NumberSuffixFlags enum is 'N', not 'I'. Fix the comment to indicate it as such. --- src/System.Management.Automation/engine/parser/tokenizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 7ea0ececdb0..e5e6467c388 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -543,7 +543,7 @@ internal enum NumberSuffixFlags Decimal = 0x10, /// - /// Indicates 'I' suffix for BigInteger (arbitrarily large integer) numerals. + /// Indicates 'N' suffix for BigInteger (arbitrarily large integer) numerals. /// BigInteger = 0x20 } From 668d72c4af4eaf4ff676e020bb7d7e424e282c7c Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Thu, 26 Mar 2020 09:47:33 -0700 Subject: [PATCH 094/275] Clean up the IPC named pipe on PowerShell exit (#12187) --- .../commands/EnterPSHostProcessCommand.cs | 51 ++++++++++++++++--- .../remoting/common/RemoteSessionNamedPipe.cs | 43 ++++++++-------- .../Get-PSHostProcessInfo.Tests.ps1 | 45 ++++++++++++++++ 3 files changed, 110 insertions(+), 29 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs index f39e7eae9b1..3cf54997e5d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/EnterPSHostProcessCommand.cs @@ -707,7 +707,7 @@ internal static IReadOnlyCollection GetAppDomainNamesFromProc else if (process.ProcessName.Equals(pName, StringComparison.Ordinal)) { // only add if the process name matches - procAppDomainInfo.Add(new PSHostProcessInfo(pName, id, appDomainName)); + procAppDomainInfo.Add(new PSHostProcessInfo(pName, id, appDomainName, namedPipe)); } } } @@ -736,6 +736,12 @@ internal static IReadOnlyCollection GetAppDomainNamesFromProc /// public sealed class PSHostProcessInfo { + #region Members + + private readonly string _pipeNameFilePath; + + #endregion + #region Properties /// @@ -781,16 +787,27 @@ public string MainWindowTitle private PSHostProcessInfo() { } /// - /// Constructor. + /// Initializes a new instance of the PSHostProcessInfo type. /// /// Name of process. /// Id of process. /// Name of process AppDomain. - internal PSHostProcessInfo(string processName, int processId, string appDomainName) + /// File path of pipe name. + internal PSHostProcessInfo( + string processName, + int processId, + string appDomainName, + string pipeNameFilePath) { - if (string.IsNullOrEmpty(processName)) { throw new PSArgumentNullException("processName"); } + if (string.IsNullOrEmpty(processName)) + { + throw new PSArgumentNullException(nameof(processName)); + } - if (string.IsNullOrEmpty(appDomainName)) { throw new PSArgumentNullException("appDomainName"); } + if (string.IsNullOrEmpty(appDomainName)) + { + throw new PSArgumentNullException(nameof(appDomainName)); + } MainWindowTitle = string.Empty; try @@ -798,12 +815,32 @@ internal PSHostProcessInfo(string processName, int processId, string appDomainNa var proc = Process.GetProcessById(processId); MainWindowTitle = proc.MainWindowTitle ?? string.Empty; } - catch (ArgumentException) { } - catch (InvalidOperationException) { } + catch (ArgumentException) + { + // Window title is optional. + } + catch (InvalidOperationException) + { + // Window title is optional. + } this.ProcessName = processName; this.ProcessId = processId; this.AppDomainName = appDomainName; + _pipeNameFilePath = pipeNameFilePath; + } + + #endregion + + #region Methods + + /// + /// Retrieves the pipe name file path. + /// + /// Pipe name file path. + public string GetPipeNameFilePath() + { + return _pipeNameFilePath; } #endregion diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs index 92d10c75000..6c0e0625bdd 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs @@ -560,9 +560,7 @@ static RemoteSessionNamedPipeServer() CreateIPCNamedPipeServerSingleton(); -#if !CORECLR // There is only one AppDomain per application in CoreCLR, which would be the default - CreateAppDomainUnloadHandler(); -#endif + CreateProcessExitHandler(); } #endregion @@ -961,30 +959,31 @@ internal static void CreateIPCNamedPipeServerSingleton() } } -#if !CORECLR // There is only one AppDomain per application in CoreCLR, which would be the default - private static void CreateAppDomainUnloadHandler() + private static void CreateProcessExitHandler() { - // Subscribe to the app domain unload event. - AppDomain.CurrentDomain.DomainUnload += (sender, args) => + AppDomain.CurrentDomain.ProcessExit += (sender, args) => + { + IPCNamedPipeServerEnabled = false; + RemoteSessionNamedPipeServer namedPipeServer = IPCNamedPipeServer; + if (namedPipeServer != null) { - IPCNamedPipeServerEnabled = false; - RemoteSessionNamedPipeServer namedPipeServer = IPCNamedPipeServer; - if (namedPipeServer != null) + try { - try - { - // Terminate the IPC thread. - namedPipeServer.Dispose(); - } - catch (ObjectDisposedException) { } - catch (Exception) - { - // Don't throw an exception on the app domain unload event thread. - } + // Terminate the IPC thread. + namedPipeServer.Dispose(); } - }; + catch (ObjectDisposedException) + { + // Ignore if object already disposed. + } + catch (Exception) + { + // Don't throw an exception on the app domain unload event thread. + } + } + }; } -#endif + private static void OnIPCNamedPipeServerEnded(object sender, ListenerEndedEventArgs args) { if (args.RestartListener) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 index d61d34a80a9..1bedd52beb7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 @@ -53,4 +53,49 @@ Describe "Get-PSHostProcessInfo tests" -Tag CI { $psProcess.Count | Should -BeGreaterOrEqual 1 $psProcess.ProcessId | Should -Contain $powershell.id } + + It "Verifies named pipe filepath get method" { + $pipeFilePath = (Get-PSHostProcessInfo -Id $pid).GetPipeNameFilePath() + $pipeFilePath | Should -Exist + } + + It "Verifies named pipe filepath is removed on process exit" { + $aliveFile = Join-Path -Path $TestDrive -ChildPath 'AliveFileXXZZ.txt' + "" | Out-File -FilePath $aliveFile + $testfilePath = Join-Path -Path $TestDrive -ChildPath 'TestScriptXXZZ.ps1' + @' + param ( + [string] $LiveFilePath + ) + + $count = 0 + while ((Test-Path -Path $LiveFilePath) -and ($count++ -lt 60)) + { + Start-Sleep -Milliseconds 500 + } + + exit +'@ | Out-File -FilePath $testfilePath + + # Create PowerShell process to monitor. + $psFileName = $IsWindows ? 'pwsh.exe' : 'pwsh' + $psPath = Join-Path -Path $PSHOME -ChildPath $psFileName + $psProc = Start-Process -FilePath $psPath -ArgumentList "-File $testfilePath -LiveFilePath $aliveFile" -PassThru + Wait-UntilTrue -sb { + (Get-PSHostProcessInfo -Id $psProc.Id) -ne $null + } -TimeoutInMilliseconds 5000 -IntervalInMilliseconds 250 + + # Verify named pipe file path. + $psNamedPipePath = (Get-PSHostProcessInfo -Id $psProc.Id).GetPipeNameFilePath() + $psNamedPipePath | Should -Exist + + # Signal PowerShell test process to exit normally. + Remove-Item -Path $aliveFile -Force -ErrorAction Ignore + Wait-UntilTrue -sb { + (Test-Path -Path $psNamedPipePath) -eq $false + } -TimeoutInMilliseconds 5000 -IntervalInMilliseconds 250 + + # Verify named pipe file path is removed. + $psNamedPipePath | Should -Not -Exist + } } From 2367ea19f00e878c4055454aed6b551a862a9d5f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 26 Mar 2020 16:56:23 +0000 Subject: [PATCH 095/275] Merged PR 11200: Update change log for 7.1.0-preview.1 release Update change log for 7.1.0-preview.1 release --- .spelling | 46 +++++++++++++ CHANGELOG/preview.md | 160 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+) diff --git a/.spelling b/.spelling index a75617ab6f0..7e4944447eb 100644 --- a/.spelling +++ b/.spelling @@ -908,7 +908,53 @@ Greg-Smulko danstur vdamewood MJECloud +DamirAinullin +NoMoreFood +silijon +NextTurn +mikeTWC1984 +Marusyk +M1kep +doctordns +alvarodelvalle +devlead +RandomNoun7 +edyoung +stevend811 +LabhanshAgrawal +ShaydeNofziger +alepauly +bpayette +joeltankam +OneScripter +Francisco-Gamino +adamdriscoll analytics +deserialized +string.Split +Dictionary.TryAdd +Environment.NewLine +ParseError.ToString +EditorConfig +GetExceptionForHR +ThrowExceptionForHR +Get-ExperimentalFeature +PSWindowsPowerShellCompatibility +currentculture +NJsonSchema +Microsoft.CodeAnalysis.CSharp +NJsonSchema +StrictMode +devcontainer +AzFileCopy +metadata.json +ADOPTERS.md +powershell.exe +SetVersionVariables +yml +DateTime +DeploymentScripts +Markdig.Signed - docs/debugging/README.md corehost - docs/learning-powershell/README.md diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index 035db721385..ded6245de3f 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1 +1,161 @@ # Current preview release + +## 7.1.0-preview.1 - 2020-03-26 + +### Breaking Changes + +- Use invariant culture string conversion for `-replace` operator (#10954) (Thanks @iSazonov!) + +### Engine Updates and Fixes + +- Revert the PRs that made `DBNull.Value` and `NullString.Value` treated as `$null` (#11648) + +### Experimental Features + +- Use invariant culture string conversion for `-replace` operator (#10954) (Thanks @iSazonov!) + +### General Cmdlet Updates and Fixes + +- Fix an operator preference order issue in binder code (#12075) (Thanks @DamirAinullin!) +- Fix `NullReferenceException` when binding common parameters of type `ActionPreference` (#12124) +- Fix default formatting for deserialized `MatchInfo` (#11728) (Thanks @iSazonov!) +- Use asynchronous streams in `Invoke-RestMethod` (#11095) (Thanks @iSazonov!) +- Address UTF-8 Detection In `Get-Content -Tail` (#11899) (Thanks @NoMoreFood!) +- Handle the `IOException` in `Get-FileHash` (#11944) (Thanks @iSazonov!) +- Change 'PowerShell Core' to 'PowerShell' in a resource string (#11928) (Thanks @alexandair!) +- Bring back `MainWindowTitle` in `PSHostProcessInfo` (#11885) (Thanks @iSazonov!) +- Miscellaneous minor updates to Windows Compatibility (#11980) +- Fix `ConciseView` to split `PositionMessage` using `[Environment]::NewLine` (#12010) +- Remove network hop restriction for interactive sessions (#11920) +- Fix `NullReferenceException` in `SuspendStoppingPipeline()` and `RestoreStoppingPipeline()` (#11870) (Thanks @iSazonov!) +- Generate GUID for `FormatViewDefinition` `InstanceId` if not provided (#11896) +- Fix `ConciseView` where error message is wider than window width and doesn't have whitespace (#11880) +- Allow cross-platform `CAPI-compatible` remote key exchange (#11185) (Thanks @silijon!) +- Fix error message (#11862) (Thanks @NextTurn!) +- Fix `ConciseView` to handle case where there isn't a console to obtain the width (#11784) +- Update `CmsCommands` to use Store vs certificate provider (#11643) (Thanks @mikeTWC1984!) +- Enable `pwsh` to work on Windows systems where `mpr.dll` and STA is not available (#11748) +- Refactor and implement `Restart-Computer` for `Un*x` and macOS (#11319) +- Add an implementation of `Stop-Computer` for Linux and macOS (#11151) +- Fix `help` function to check if `less` is available before using (#11737) +- Update `PSPath` in `certificate_format_ps1.xml` (#11603) (Thanks @xtqqczze!) +- Change regular expression to match relation-types without quotes in Link header (#11711) (Thanks @Marusyk!) +- Fix error message during symbolic link deletion (#11331) +- Add custom 'Selected.*' type to `PSCustomObject` in `Select-Object` only once (#11548) (Thanks @iSazonov!) +- Add `-AsUTC` to the `Get-Date` cmdlet (#11611) +- Fix grouping behavior with Boolean values in `Format-Hex` (#11587) (Thanks @vexx32!) +- Make `Test-Connection` always use the default synchronization context for sending ping requests (#11517) +- Correct startup error messages (#11473) (Thanks @iSazonov!) +- Ignore headers with null values in web cmdlets (#11424) (Thanks @iSazonov!) +- Re-add check for `Invoke-Command` job dispose. (#11388) +- Revert "Update formatter to not write newlines if content is empty (#11193)" (#11342) (Thanks @iSazonov!) +- Allow `CompleteInput` to return results from `ArgumentCompleter` when `AST` or Script has matching function definition (#10574) (Thanks @M1kep!) +- Update formatter to not write new lines if content is empty (#11193) + +### Code Cleanup + +
+ +
    +
  • Use span-based overloads (#11884) (Thanks @iSazonov!)
  • +
  • Use new string.Split() overloads (#11867) (Thanks @iSazonov!)
  • +
  • Remove unreachable DSC code (#12076) (Thanks @DamirAinullin!)
  • +
  • Remove old dead code from FullCLR (#11886) (Thanks @iSazonov!)
  • +
  • Use Dictionary.TryAdd() where possible (#11767) (Thanks @iSazonov!)
  • +
  • Use Environment.NewLine instead of hard-coded linefeed in ParseError.ToString (#11746)
  • +
  • Fix FileSystem provider error message (#11741) (Thanks @iSazonov!)
  • +
  • Reformat code according to EditorConfig rules (#11681) (Thanks @xtqqczze!)
  • +
  • Replace use of throw GetExceptionForHR with ThrowExceptionForHR (#11640) (Thanks @xtqqczze!)
  • +
  • Refactor delegate types to lambda expressions (#11690) (Thanks @xtqqczze!)
  • +
  • Remove Unicode BOM from text files (#11546) (Thanks @xtqqczze!)
  • +
  • Fix Typo in Get-ComputerInfo cmdlet description (#11321) (Thanks @doctordns!)
  • +
  • Fix typo in description for Get-ExperimentalFeature PSWindowsPowerShellCompatibility (#11282) (Thanks @alvarodelvalle!)
  • +
  • Cleanups in command discovery (#10815) (Thanks @iSazonov!)
  • +
  • Review currentculture (#11044) (Thanks @iSazonov!)
  • +
+ +
+ +### Tools + +- Change recommended VS Code extension name from `ms-vscode.csharp` to `ms-dotnettools.csharp` (#12083) (Thanks @devlead!) +- Specify `csharp_preferred_modifier_order` in `EditorConfig` (#11775) (Thanks @xtqqczze!) +- Update `.editorconfig` (#11675) (Thanks @xtqqczze!) +- Enable `EditorConfig` support in `OmniSharp` (#11627) (Thanks @xtqqczze!) +- Specify charset in `.editorconfig` as `utf-8` (no BOM) (#11654) (Thanks @xtqqczze!) +- Configure the issue label bot (#11527) +- Avoid variable names that conflict with automatic variables (#11392) (Thanks @xtqqczze!) + +### Tests + +- Add empty `preview.md` file to fix broken link (#12041) +- Add helper functions for SSH remoting tests (#11955) +- Add new tests for `Get-ChildItem` for `FileSystemProvider` (#11602) (Thanks @iSazonov!) +- Ensure that types referenced by `PowerShellStandard` are present (#10634) +- Check state and report reason if it's not "opened" (#11574) +- Fixes for running tests on Raspbian (#11661) +- Unify pester test syntax for the arguments of `-BeOfType` (#11558) (Thanks @xtqqczze!) +- Correct casing for automatic variables (#11568) (Thanks @iSazonov!) +- Avoid variable names that conflict with automatic variables part 2 (#11559) (Thanks @xtqqczze!) +- Update pester syntax to v4 (#11544) (Thanks @xtqqczze!) +- Allow error 504 (Gateway Timeout) in `markdown-link` tests (#11439) (Thanks @xtqqczze!) +- Re-balance CI tests (#11420) (Thanks @iSazonov!) +- Include URL in the markdown-links test error message (#11438) (Thanks @xtqqczze!) +- Use CIM cmdlets instead of WMI cmdlets in tests (#11423) (Thanks @xtqqczze!) + +### Build and Packaging Improvements + +
+ +
    +
  • Put symbols in separate package (#12169)
  • +
  • Disable x86 PDB generation (#12167)
  • +
  • Bump NJsonSchema from 10.1.5 to 10.1.11 (#12050) (#12088) (#12166)
  • +
  • Create crossgen symbols for Windows x64 and x86 (#12157)
  • +
  • Move to .NET 5 preview.1 (#12140)
  • +
  • Bump Microsoft.CodeAnalysis.CSharp from 3.4.0 to 3.5.0 (#12136)
  • +
  • Move to standard internal pool for building (#12119)
  • +
  • Fix package syncing to private Module Feed (#11841)
  • +
  • Add Ubuntu SSH remoting tests CI (#12033)
  • +
  • Bump Markdig.Signed from 0.18.1 to 0.18.3 (#12078)
  • +
  • Fix MSIX packaging to determine if a Preview release by inspecting the semantic version string (#11991)
  • +
  • Ignore last exit code in the build step as dotnet may return error when SDK is not installed (#11972)
  • +
  • Fix daily package build (#11882)
  • +
  • Fix package sorting for syncing to private Module Feed (#11838)
  • +
  • Set StrictMode version 3.0 (#11563) (Thanks @xtqqczze!)
  • +
  • Bump .devcontainer version to dotnet 3.1.101 (#11707) (Thanks @Jawz84!)
  • +
  • Move to version 3 of AzFileCopy (#11697)
  • +
  • Update README.md and metadata.json for next release (#11664)
  • +
  • Code Cleanup for environment data gathering in build.psm1 (#11572) (Thanks @xtqqczze!)
  • +
  • Update Debian Install Script To Support Debian 10 (#11540) (Thanks @RandomNoun7!)
  • +
  • Update ADOPTERS.md (#11261) (Thanks @edyoung!)
  • +
  • Change back to use powershell.exe in 'SetVersionVariables.yml' to unblock daily build (#11207)
  • +
  • Change to use pwsh to have consistent JSON conversion for DateTime (#11126)
  • +
+ +
+ +### Documentation and Help Content + +- Replace `VSCode` link in `CONTRIBUTING.md` (#11475) (Thanks @stevend811!) +- Remove the version number of PowerShell from LICENSE (#12019) +- Add the 7.0 change log link to `CHANGELOG/README.md` (#12062) (Thanks @LabhanshAgrawal!) +- Improvements to the contribution guide (#12086) (Thanks @ShaydeNofziger!) +- Update the doc about debugging dotnet core in VSCode (#11969) +- Update `README.md` and `metadata.json` for the next release (#11918) (#11992) +- Update `Adopters.md` to include info on Azure Pipelines and GitHub Actions (#11888) (Thanks @alepauly!) +- Add information about how Amazon AWS uses PowerShell. (#11365) (Thanks @bpayette!) +- Add link to .NET CLI version in build documentation (#11725) (Thanks @joeltankam!) +- Added info about DeploymentScripts in ADOPTERS.md (#11703) +- Update `CHANGELOG.md` for `6.2.4` release (#11699) +- Update `README.md` and `metadata.json` for next release (#11597) +- Update the breaking change definition (#11516) +- Adding System Frontier to the PowerShell Core adopters list `ADOPTERS.md` (#11480) (Thanks @OneScripter!) +- Update `ChangeLog`, `README.md` and `metadata.json` for `7.0.0-rc.1` release (#11363) +- Add `AzFunctions` to `ADOPTERS.md` (#11311) (Thanks @Francisco-Gamino!) +- Add `Universal Dashboard` to `ADOPTERS.md` (#11283) (Thanks @adamdriscoll!) +- Add `config.yml` for `ISSUE_TEMPLATE` so that Doc, Security, Support, and Windows PowerShell issues go to URLs (#11153) +- Add `Adopters.md` file (#11256) +- Update `Readme.md` for `preview.6` release (#11108) +- Update `SUPPORT.md` (#11101) (Thanks @mklement0!) +- Update `README.md` (#11100) (Thanks @mklement0!) From 175efca71f5d87d6e85cefd6ebdf37f10500144f Mon Sep 17 00:00:00 2001 From: Next Turn <45985406+NextTurn@users.noreply.github.com> Date: Fri, 27 Mar 2020 02:17:58 +0800 Subject: [PATCH 096/275] Fix `Service.cs` to not modify collection while enumerating it (#11851) --- .../commands/management/Service.cs | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index d2468387f17..8081e98c261 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -1087,17 +1087,9 @@ internal List DoStopService(ServiceController serviceControll /// True if all dependent services are stopped /// False if not all dependent services are stopped /// - private bool HaveAllDependentServicesStopped(ICollection dependentServices) + private bool HaveAllDependentServicesStopped(ServiceController[] dependentServices) { - foreach (ServiceController service in dependentServices) - { - if (service.Status != ServiceControllerStatus.Stopped) - { - return false; - } - } - - return true; + return Array.TrueForAll(dependentServices, service => service.Status == ServiceControllerStatus.Stopped); } /// @@ -1106,14 +1098,10 @@ private bool HaveAllDependentServicesStopped(ICollection depe /// A list of services. internal void RemoveNotStoppedServices(List services) { - foreach (ServiceController service in services) - { - if (service.Status != ServiceControllerStatus.Stopped && - service.Status != ServiceControllerStatus.StopPending) - { - services.Remove(service); - } - } + // You shall not modify a collection during enumeration. + services.RemoveAll(service => + service.Status != ServiceControllerStatus.Stopped && + service.Status != ServiceControllerStatus.StopPending); } /// From 5b390f15071305508b55180e4bff3a21f269c79d Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 26 Mar 2020 12:30:05 -0700 Subject: [PATCH 097/275] Update `README.md` and `metadata.json` for `7.1.0-preview.1` (#12211) * Update `README.md` and `metadata.json` for `7.1.0-preview.1` release * Add missing version updates * fix test failure * fix test failure Co-authored-by: Travis Plunk --- README.md | 34 +++++++++---------- test/powershell/Host/PSVersionTable.Tests.ps1 | 2 +- .../Language/Scripting/Requires.Tests.ps1 | 2 +- tools/metadata.json | 4 +-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index b2dd36cebcf..97a5c8b44c8 100644 --- a/README.md +++ b/README.md @@ -87,23 +87,23 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x86.msi -[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.ubuntu.18.04_amd64.deb -[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.ubuntu.16.04_amd64.deb -[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.debian.9_amd64.deb -[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview_7.0.0-rc.3-1.debian.10_amd64.deb -[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview-7.0.0_rc.3-1.rhel.7.x86_64.rpm -[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-preview-7.0.0_rc.3-1.centos.8.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-osx-x64.pkg -[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-arm32.zip -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/PowerShell-7.0.0-rc.3-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-osx-x64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.3/powershell-7.0.0-rc.3-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x86.msi +[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.ubuntu.18.04_amd64.deb +[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.ubuntu.16.04_amd64.deb +[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.debian.9_amd64.deb +[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.debian.10_amd64.deb +[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview-7.1.0_preview.1-1.rhel.7.x86_64.rpm +[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview-7.1.0_preview.1-1.centos.8.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-osx-x64.pkg +[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-arm32.zip +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-osx-x64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7 diff --git a/test/powershell/Host/PSVersionTable.Tests.ps1 b/test/powershell/Host/PSVersionTable.Tests.ps1 index 5bba07d981a..2ef9fb30a23 100644 --- a/test/powershell/Host/PSVersionTable.Tests.ps1 +++ b/test/powershell/Host/PSVersionTable.Tests.ps1 @@ -23,7 +23,7 @@ Describe "PSVersionTable" -Tags "CI" { $unexpectectGitCommitIdPattern = $fullVersionPattern } - $powerShellVersions = "1.0", "2.0", "3.0", "4.0", "5.0", "5.1", "6.0", "6.1", "6.2", "7.0" + $powerShellVersions = "1.0", "2.0", "3.0", "4.0", "5.0", "5.1", "6.0", "6.1", "6.2", "7.0", "7.1" $powerShellCompatibleVersions = $PSVersionTable.PSCompatibleVersions | ForEach-Object {$_.ToString(2).SubString(0,3)} } diff --git a/test/powershell/Language/Scripting/Requires.Tests.ps1 b/test/powershell/Language/Scripting/Requires.Tests.ps1 index 4930a2dfa77..ed3180ffbc1 100644 --- a/test/powershell/Language/Scripting/Requires.Tests.ps1 +++ b/test/powershell/Language/Scripting/Requires.Tests.ps1 @@ -41,7 +41,7 @@ Describe "Requires tests" -Tags "CI" { BeforeAll { $currentVersion = $PSVersionTable.PSVersion - $powerShellVersions = "1.0", "2.0", "3.0", "4.0", "5.0", "5.1", "6.0", "6.1", "6.2", "7.0" + $powerShellVersions = "1.0", "2.0", "3.0", "4.0", "5.0", "5.1", "6.0", "6.1", "6.2", "7.0", "7.1" $latestVersion = [version]($powerShellVersions | Sort-Object -Descending -Top 1) $nonExistingMinor = "$($latestVersion.Major).$($latestVersion.Minor + 1)" $nonExistingMajor = "$($latestVersion.Major + 1).0" diff --git a/tools/metadata.json b/tools/metadata.json index 4ecb01aca98..11756d05e2b 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { "StableReleaseTag": "v7.0.0", - "PreviewReleaseTag": "v7.0.0-rc.3", + "PreviewReleaseTag": "v7.1.0-preview.1", "ServicingReleaseTag": "v6.2.4", "ReleaseTag": "v7.0.0", "LTSReleaseTag" : ["v7.0.0"], - "NextReleaseTag": "v7.0.0-preview.7", + "NextReleaseTag": "v7.1.0-preview.2", "LTSRelease": false } From 515511094d75d2bd022fdccf5ff89d6ba861e122 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 27 Mar 2020 17:40:12 -0700 Subject: [PATCH 098/275] Update change log generation script to support collapsible sections (#12214) --- tools/releaseTools.psm1 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index b87394fa561..9d0f4876769 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -341,21 +341,31 @@ function Get-ChangeLog PrintChangeLog -clSection $clBreakingChange -sectionTitle 'Breaking Changes' PrintChangeLog -clSection $clEngine -sectionTitle 'Engine Updates and Fixes' PrintChangeLog -clSection $clExperimental -sectionTitle 'Experimental Features' - PrintChangeLog -clSection $clGeneral -sectionTitle 'General Cmdlet Updates and Fixes' - PrintChangeLog -clSection $clCodeCleanup -sectionTitle 'Code Cleanup' PrintChangeLog -clSection $clPerformance -sectionTitle 'Performance' + PrintChangeLog -clSection $clGeneral -sectionTitle 'General Cmdlet Updates and Fixes' + PrintChangeLog -clSection $clCodeCleanup -sectionTitle 'Code Cleanup' -Compress PrintChangeLog -clSection $clTools -sectionTitle 'Tools' PrintChangeLog -clSection $clTest -sectionTitle 'Tests' - PrintChangeLog -clSection $clBuildPackage -sectionTitle 'Build and Packaging Improvements' + PrintChangeLog -clSection $clBuildPackage -sectionTitle 'Build and Packaging Improvements' -Compress PrintChangeLog -clSection $clDocs -sectionTitle 'Documentation and Help Content' Write-Output "[${version}]: https://github.com/PowerShell/PowerShell/compare/${$LastReleaseTag}...${ThisReleaseTag}`n" } -function PrintChangeLog($clSection, $sectionTitle) { +function PrintChangeLog($clSection, $sectionTitle, [switch] $Compress) { if ($clSection.Count -gt 0) { "### $sectionTitle`n" - $clSection | ForEach-Object -MemberName ChangeLogMessage + + if ($Compress) { + $items = $clSection.ChangeLogMessage -join "`n" + + "
`n" + $items | ConvertFrom-Markdown | Select-Object -ExpandProperty Html + "
" + } + else { + $clSection | ForEach-Object -MemberName ChangeLogMessage + } "" } } From 1ec7c826f03ed4549fc91a494cc0ff16e5adac2f Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Sat, 28 Mar 2020 03:44:23 -0700 Subject: [PATCH 099/275] Use dedicated threads to read the redirected output and error streams from the child process for out-of-proc jobs (#11713) --- .../fanin/OutOfProcTransportManager.cs | 120 ++++++++++++------ test/powershell/engine/Job/Jobs.Tests.ps1 | 54 ++++++++ 2 files changed, 135 insertions(+), 39 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index 9bd00bed2c6..fd55cd51bd3 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -1098,7 +1098,6 @@ internal override void CreateAsync() { _processCreated = false; } - // _processInstance.Start(); } PSEtwLog.LogAnalyticInformational(PSEventId.WSManCreateShell, PSOpcode.Connect, @@ -1123,28 +1122,10 @@ internal override void CreateAsync() _processInstance.RunspacePool.Dispose(); } - stdInWriter = _processInstance.StdInWriter; - // if (stdInWriter == null) - { - _serverProcess.OutputDataReceived += new DataReceivedEventHandler(OnOutputDataReceived); - _serverProcess.ErrorDataReceived += new DataReceivedEventHandler(OnErrorDataReceived); - } - _serverProcess.Exited += new EventHandler(OnExited); - - // serverProcess.Start(); _processInstance.Start(); - if (stdInWriter != null) - { - _serverProcess.CancelErrorRead(); - _serverProcess.CancelOutputRead(); - } - - // Start asynchronous reading of output/errors - _serverProcess.BeginOutputReadLine(); - _serverProcess.BeginErrorReadLine(); - + StartRedirectionReaderThreads(_serverProcess); stdInWriter = new OutOfProcessTextWriter(_serverProcess.StandardInput); _processInstance.StdInWriter = stdInWriter; } @@ -1172,6 +1153,86 @@ internal override void CreateAsync() SendOneItem(); } + private void StartRedirectionReaderThreads(Process serverProcess) + { + Thread outputThread = new Thread(ProcessOutputData); + outputThread.IsBackground = true; + outputThread.Name = "Out-of-Proc Job Output Thread"; + + Thread errorThread = new Thread(ProcessErrorData); + errorThread.IsBackground = true; + errorThread.Name = "Out-of-Proc Job Error Thread"; + + outputThread.Start(serverProcess.StandardOutput); + errorThread.Start(serverProcess.StandardError); + } + + private void ProcessOutputData(object arg) + { + if (arg is StreamReader reader) + { + try + { + string data = reader.ReadLine(); + while (data != null) + { + HandleOutputDataReceived(data); + data = reader.ReadLine(); + } + } + catch (IOException) + { + // Treat this as EOF, the same as what 'Process.BeginOutputReadLine()' does. + } + catch (Exception e) + { + _tracer.WriteMessage( + "OutOfProcessClientSessionTransportManager", + "ProcessOutputThread", + Guid.Empty, + "Transport manager output reader thread ended with error: {0}", + e.Message ?? string.Empty); + } + } + else + { + Dbg.Assert(false, "Invalid argument. Expecting a StreamReader object."); + } + } + + private void ProcessErrorData(object arg) + { + if (arg is StreamReader reader) + { + try + { + string data = reader.ReadLine(); + while (data != null) + { + HandleErrorDataReceived(data); + data = reader.ReadLine(); + } + } + catch (IOException) + { + // Treat this as EOF, the same as what 'Process.BeginErrorReadLine()' does. + } + catch (Exception e) + { + _tracer.WriteMessage( + "OutOfProcessClientSessionTransportManager", + "ProcessErrorThread", + Guid.Empty, + "Transport manager error reader thread ended with error: {0}", + e.Message ?? string.Empty); + } + } + else + { + Dbg.Assert(false, "Invalid argument. Expecting a StreamReader object."); + } + } + /// /// Kills the server process and disposes other resources. /// @@ -1198,20 +1259,6 @@ protected override void CleanupConnection() #endregion - #region Event Handlers - - private void OnOutputDataReceived(object sender, DataReceivedEventArgs e) - { - HandleOutputDataReceived(e.Data); - } - - private void OnErrorDataReceived(object sender, DataReceivedEventArgs e) - { - HandleErrorDataReceived(e.Data); - } - - #endregion - #region Helper Methods private void KillServerProcess() @@ -1230,13 +1277,8 @@ private void KillServerProcess() if (_processCreated) { - _serverProcess.CancelOutputRead(); - _serverProcess.CancelErrorRead(); _serverProcess.Kill(); } - - _serverProcess.OutputDataReceived -= new DataReceivedEventHandler(OnOutputDataReceived); - _serverProcess.ErrorDataReceived -= new DataReceivedEventHandler(OnErrorDataReceived); } } catch (System.ComponentModel.Win32Exception) diff --git a/test/powershell/engine/Job/Jobs.Tests.ps1 b/test/powershell/engine/Job/Jobs.Tests.ps1 index 13276e092c0..7200c6ad45b 100644 --- a/test/powershell/engine/Job/Jobs.Tests.ps1 +++ b/test/powershell/engine/Job/Jobs.Tests.ps1 @@ -338,4 +338,58 @@ Describe 'Basic Job Tests' -Tags 'Feature' { ValidateJobInfo -job $jobToStop -state 'Stopped' -hasMoreData $false } } + + Context 'Background pwsh process should terminate after job is done' { + It "Can clean up background pwsh process after job is done" { + $job = Start-Job { $pid } + $processId = Receive-Job $job -Wait + + try { + $process = Get-Process -Id $processId -ErrorAction Stop + Wait-UntilTrue { $process.HasExited } -IntervalInMilliseconds 300 | Should -BeTrue + } catch { + $_.FullyQualifiedErrorId | Should -BeExactly 'NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand' + } + + Remove-Job $job -Force + } + + It "Can clean up background pwsh process when job is stopped" { + $job = Start-Job { $pid; Start-Sleep -Second 10 } + + # Wait for the pid to be received. + Wait-UntilTrue { [bool](Receive-Job $job -Keep) } | Should -BeTrue + $processId = Receive-Job $job + + # Stop the job and wait for the cleanup to finish. + Stop-Job $job + + try { + $process = Get-Process -Id $processId -ErrorAction Stop + Wait-UntilTrue { $process.HasExited } -IntervalInMilliseconds 300 | Should -BeTrue + } catch { + $_.FullyQualifiedErrorId | Should -BeExactly 'NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand' + } + + Remove-Job $job -Force + } + + It "Can clean up background pwsh process when job is removed" { + $job = Start-Job { $pid; Start-Sleep -Second 10 } + + # Wait for the pid to be received. + Wait-UntilTrue { [bool](Receive-Job $job -Keep) } | Should -BeTrue + $processId = Receive-Job $job + + # Remove the job and wait for the cleanup to finish. + Remove-Job $job -Force + + try { + $process = Get-Process -Id $processId -ErrorAction Stop + Wait-UntilTrue { $process.HasExited } -IntervalInMilliseconds 300 | Should -BeTrue + } catch { + $_.FullyQualifiedErrorId | Should -BeExactly 'NoProcessFoundForGivenId,Microsoft.PowerShell.Commands.GetProcessCommand' + } + } + } } From dfe995534652e23b3c14bd5dfd28445233d9fc6b Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Sat, 28 Mar 2020 06:50:32 -0400 Subject: [PATCH 100/275] Don't write DNS resolution errors on Test-Connection -Quiet (#12204) --- .../management/TestConnectionCommand.cs | 73 +++++++++++++++---- .../Test-Connection.Tests.ps1 | 13 ++-- 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs index a4044e3d5c2..a6ff78d8c08 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/TestConnectionCommand.cs @@ -58,6 +58,8 @@ public class TestConnectionCommand : PSCmdlet, IDisposable private static byte[]? s_DefaultSendBuffer; + private readonly CancellationTokenSource _dnsLookupCancel = new CancellationTokenSource(); + private bool _disposed; private Ping? _sender; @@ -275,6 +277,7 @@ protected override void ProcessRecord() protected override void StopProcessing() { _sender?.SendAsyncCancel(); + _dnsLookupCancel.Cancel(); } #region ConnectionTest @@ -283,6 +286,11 @@ private void ProcessConnectionByTCPPort(string targetNameOrAddress) { if (!TryResolveNameOrAddress(targetNameOrAddress, out _, out IPAddress? targetAddress)) { + if (Quiet.IsPresent) + { + WriteObject(false); + } + return; } @@ -334,6 +342,11 @@ private void ProcessTraceroute(string targetNameOrAddress) if (!TryResolveNameOrAddress(targetNameOrAddress, out string resolvedTargetName, out IPAddress? targetAddress)) { + if (!Quiet.IsPresent) + { + WriteObject(false); + } + return; } @@ -471,6 +484,11 @@ private void ProcessMTUSize(string targetNameOrAddress) PingReply? reply, replyResult = null; if (!TryResolveNameOrAddress(targetNameOrAddress, out string resolvedTargetName, out IPAddress? targetAddress)) { + if (Quiet.IsPresent) + { + WriteObject(-1); + } + return; } @@ -574,6 +592,11 @@ private void ProcessPing(string targetNameOrAddress) { if (!TryResolveNameOrAddress(targetNameOrAddress, out string resolvedTargetName, out IPAddress? targetAddress)) { + if (Quiet.IsPresent) + { + WriteObject(false); + } + return; } @@ -667,7 +690,7 @@ private bool TryResolveNameOrAddress( if (ResolveDestination) { - hostEntry = Dns.GetHostEntry(targetNameOrAddress); + hostEntry = GetCancellableHostEntry(targetNameOrAddress); resolvedTargetName = hostEntry.HostName; } else @@ -679,27 +702,35 @@ private bool TryResolveNameOrAddress( { try { - hostEntry = Dns.GetHostEntry(targetNameOrAddress); + hostEntry = GetCancellableHostEntry(targetNameOrAddress); if (ResolveDestination) { resolvedTargetName = hostEntry.HostName; - hostEntry = Dns.GetHostEntry(hostEntry.HostName); + hostEntry = GetCancellableHostEntry(hostEntry.HostName); } } + catch (PipelineStoppedException) + { + throw; + } catch (Exception ex) { - string message = StringUtil.Format( - TestConnectionResources.NoPingResult, - resolvedTargetName, - TestConnectionResources.CannotResolveTargetName); - Exception pingException = new PingException(message, ex); - ErrorRecord errorRecord = new ErrorRecord( - pingException, - TestConnectionExceptionId, - ErrorCategory.ResourceUnavailable, - resolvedTargetName); - WriteError(errorRecord); + if (!Quiet.IsPresent) + { + string message = StringUtil.Format( + TestConnectionResources.NoPingResult, + resolvedTargetName, + TestConnectionResources.CannotResolveTargetName); + Exception pingException = new PingException(message, ex); + ErrorRecord errorRecord = new ErrorRecord( + pingException, + TestConnectionExceptionId, + ErrorCategory.ResourceUnavailable, + resolvedTargetName); + WriteError(errorRecord); + } + return false; } @@ -732,6 +763,20 @@ private bool TryResolveNameOrAddress( return true; } + private IPHostEntry GetCancellableHostEntry(string targetNameOrAddress) + { + var task = Dns.GetHostEntryAsync(targetNameOrAddress); + var waitHandles = new[] { ((IAsyncResult)task).AsyncWaitHandle, _dnsLookupCancel.Token.WaitHandle }; + + // WaitAny() returns the index of the first signal it gets; 1 is our cancellation token. + if (WaitHandle.WaitAny(waitHandles) == 1) + { + throw new PipelineStoppedException(); + } + + return task.GetAwaiter().GetResult(); + } + private IPAddress? GetHostAddress(IPHostEntry hostEntry) { AddressFamily addressFamily = IPv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork; diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index 5e78380b49a..31e14a0ce7e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -59,18 +59,19 @@ Describe "Test-Connection" -tags "CI" { $result2 | Should -BeFalse } - It "Ping fake host" { + It 'returns false without errors for an unresolvable address when using -Quiet' { + Test-Connection -Quiet -ErrorAction Stop -Count 1 -TargetName "fakeHost" | Should -BeFalse + } - { $result = Test-Connection "fakeHost" -Count 1 -Quiet -ErrorAction Stop } | + It "Ping fake host" { + { Test-Connection "fakeHost" -Count 1 -ErrorAction Stop } | Should -Throw -ErrorId "TestConnectionException,Microsoft.PowerShell.Commands.TestConnectionCommand" # Error code = 11001 - Host not found. if ((Get-PlatformInfo).Platform -match "raspbian") { $code = 11 - } - elseif (!$IsWindows) { + } elseif (!$IsWindows) { $code = -131073 - } - else { + } else { $code = 11001 } $error[0].Exception.InnerException.ErrorCode | Should -Be $code From e741dc58dd8739b711ce5166edd6f3e8d894b728 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Sat, 28 Mar 2020 08:25:59 -0700 Subject: [PATCH 101/275] Discover assemblies loaded by 'Assembly.Load(byte[])' and 'Assembly.LoadFile' (#12203) * Fix regression: pwsh should discover assemblies loaded by 'Assembly.Load(byte[])' and 'Assembly.LoadFile' --- .gitignore | 1 + .../utils/ClrFacade.cs | 33 +++++++++++-- .../Assembly.LoadBytesAndLoadFile.Tests.ps1 | 47 +++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 test/powershell/engine/Basic/Assembly.LoadBytesAndLoadFile.Tests.ps1 diff --git a/.gitignore b/.gitignore index 4c6f04a3afc..fb19bcffa77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ obj/ +.ionide/ project.lock.json *-tests.xml /debug/ diff --git a/src/System.Management.Automation/utils/ClrFacade.cs b/src/System.Management.Automation/utils/ClrFacade.cs index 148d5696d7a..587ce283578 100644 --- a/src/System.Management.Automation/utils/ClrFacade.cs +++ b/src/System.Management.Automation/utils/ClrFacade.cs @@ -58,9 +58,36 @@ internal static IEnumerable GetAssemblies(TypeResolutionState typeReso /// internal static IEnumerable GetAssemblies(string namespaceQualifiedTypeName = null) { - return PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ?? - AssemblyLoadContext.Default.Assemblies.Where(a => - !a.FullName.StartsWith(TypeDefiner.DynamicClassAssemblyFullNamePrefix, StringComparison.Ordinal)); + return PSAssemblyLoadContext.GetAssembly(namespaceQualifiedTypeName) ?? GetPSVisibleAssemblies(); + } + + /// + /// Return assemblies from the default load context and the 'individual' load contexts. + /// The 'individual' load contexts are the ones holding assemblies loaded via 'Assembly.Load(byte[])' and 'Assembly.LoadFile'. + /// Assemblies loaded in any custom load contexts are not consider visible to PowerShell to avoid type identity issues. + /// + private static IEnumerable GetPSVisibleAssemblies() + { + const string IndividualAssemblyLoadContext = "System.Runtime.Loader.IndividualAssemblyLoadContext"; + + foreach (Assembly assembly in AssemblyLoadContext.Default.Assemblies) + { + if (!assembly.FullName.StartsWith(TypeDefiner.DynamicClassAssemblyFullNamePrefix, StringComparison.Ordinal)) + { + yield return assembly; + } + } + + foreach (AssemblyLoadContext context in AssemblyLoadContext.All) + { + if (IndividualAssemblyLoadContext.Equals(context.GetType().FullName, StringComparison.Ordinal)) + { + foreach (Assembly assembly in context.Assemblies) + { + yield return assembly; + } + } + } } /// diff --git a/test/powershell/engine/Basic/Assembly.LoadBytesAndLoadFile.Tests.ps1 b/test/powershell/engine/Basic/Assembly.LoadBytesAndLoadFile.Tests.ps1 new file mode 100644 index 00000000000..981a00627e4 --- /dev/null +++ b/test/powershell/engine/Basic/Assembly.LoadBytesAndLoadFile.Tests.ps1 @@ -0,0 +1,47 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +Describe "Assembly loaded in IndividualAssemblyLoadContext should be visible to PowerShell" -Tags "CI" { + BeforeAll { + $code1 = @' + namespace LoadBytes { + public class MyLoadBytesTest { + public static string GetName() { return "MyLoadBytesTest"; } + } + } +'@ + $code2 = @' + namespace LoadFile { + public class MyLoadFileTest { + public static string GetName() { return "MyLoadFileTest"; } + } + } +'@ + + $tempFolderPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "IndividualALCTest") + New-Item $tempFolderPath -ItemType Directory -Force > $null + $loadBytesFile = [System.IO.Path]::Combine($tempFolderPath, "MyLoadBytesTest.dll") + $loadFileFile = [System.IO.Path]::Combine($tempFolderPath, "MyLoadFileTest.dll") + + if (-not (Test-Path $loadBytesFile)) { + Add-Type -TypeDefinition $code1 -OutputAssembly $loadBytesFile + } + + if (-not (Test-Path $loadFileFile)) { + Add-Type -TypeDefinition $code2 -OutputAssembly $loadFileFile + } + } + + It "Assembly loaded via 'Assembly.Load(byte[])' should be discoverable" { + $bytes = [System.IO.File]::ReadAllBytes($loadBytesFile) + [System.Reflection.Assembly]::Load($bytes) > $null + + [LoadBytes.MyLoadBytesTest]::GetName() | Should -BeExactly "MyLoadBytesTest" + } + + It "Assembly loaded via 'Assembly.LoadFile' should be discoverable" { + [System.Reflection.Assembly]::LoadFile($loadFileFile) > $null + + [LoadFile.MyLoadFileTest]::GetName() | Should -BeExactly "MyLoadFileTest" + } +} From c0c17ded030b7a2901a89eb72b6a0a1880c14957 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 30 Mar 2020 09:46:12 -0700 Subject: [PATCH 102/275] Do not wrap return result to `PSObject` when converting ScriptBlock to delegate (#10619) This is a breaking change for the delegate types with the object return type: Before this change, the returned object will always be an PSObject instance. After this change, the returned object is the underlying object, which could still be an PSObject if that's what the script actually returns. --- .../engine/lang/scriptblock.cs | 11 ++-- .../engine/Api/LanguagePrimitive.Tests.ps1 | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/engine/lang/scriptblock.cs b/src/System.Management.Automation/engine/lang/scriptblock.cs index ccd9ac5d918..539be28fe2d 100644 --- a/src/System.Management.Automation/engine/lang/scriptblock.cs +++ b/src/System.Management.Automation/engine/lang/scriptblock.cs @@ -647,16 +647,17 @@ internal ReadOnlyCollection OutputType /// /// This does normal array reduction in the case of a one-element array. /// - internal static object GetRawResult(List result) + internal static object GetRawResult(List result, bool wrapToPSObject) { switch (result.Count) { case 0: return AutomationNull.Value; case 1: - return LanguagePrimitives.AsPSObjectOrNull(result[0]); + return wrapToPSObject ? LanguagePrimitives.AsPSObjectOrNull(result[0]) : result[0]; default: - return LanguagePrimitives.AsPSObjectOrNull(result.ToArray()); + object resultArray = result.ToArray(); + return wrapToPSObject ? LanguagePrimitives.AsPSObjectOrNull(resultArray) : resultArray; } } @@ -807,7 +808,7 @@ internal object InvokeAsDelegateHelper(object dollarUnder, object dollarThis, ob outputPipe: outputPipe, invocationInfo: null, args: args); - return GetRawResult(rawResult); + return GetRawResult(rawResult, wrapToPSObject: false); } #endregion @@ -934,7 +935,7 @@ internal object DoInvokeReturnAsIs( outputPipe: outputPipe, invocationInfo: null, args: args); - return GetRawResult(result); + return GetRawResult(result, wrapToPSObject: true); } internal void InvokeWithPipe( diff --git a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 index 155da067e81..e987d3314ca 100644 --- a/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 +++ b/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1 @@ -102,4 +102,54 @@ Describe "Language Primitive Tests" -Tags "CI" { $val | Should -BeTrue $result | Should -BeExactly $compareResult } + + It "Convert ScriptBlock to delegate type" { + $code = @' + using System; + namespace Test.API + { + public enum TestEnum + { + Music, + Video + } + public class LanguagePrimitivesTest + { + Func _handlerReturnObject; + Func _handlerReturnEnum; + public LanguagePrimitivesTest(Func handlerReturnObject, Func handlerReturnEnum) + { + _handlerReturnObject = handlerReturnObject; + _handlerReturnEnum = handlerReturnEnum; + } + + public bool TestHandlerReturnEnum() + { + var value = _handlerReturnEnum("bar"); + return value == TestEnum.Music; + } + + public bool TestHandlerReturnObject() + { + object value = _handlerReturnObject("bar"); + return value is TestEnum; + } + } + } +'@ + + if (-not ("Test.API.TestEnum" -as [type])) + { + Add-Type -TypeDefinition $code + } + + # The script actually returns a enum value, and the converted delegate should return the boxed enum value. + $handlerReturnObject = [System.Func[string, object]] { param([string]$str) [Test.API.TestEnum]::Music } + # The script actually returns a string, and the converted delegate should return the corresponding enum value. + $handlerReturnEnum = [System.Func[string, Test.API.TestEnum]] { param([string]$str) "Music" } + $test = [Test.API.LanguagePrimitivesTest]::new($handlerReturnObject, $handlerReturnEnum) + + $test.TestHandlerReturnEnum() | Should -BeTrue + $test.TestHandlerReturnObject() | Should -BeTrue + } } From a4c996d425d60f5c47e7591cec4e2c405543c904 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Tue, 31 Mar 2020 08:33:06 -0700 Subject: [PATCH 103/275] Fix foreach parallel when current drive is not available (#12197) --- .../engine/hostifaces/PSTask.cs | 4 ++++ .../Foreach-Object-Parallel.Tests.ps1 | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index fc868fbf957..ab2dd6204b8 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -449,6 +449,10 @@ public void Start(Runspace runspace) Runspace.DefaultRunspace = runspace; runspace.ExecutionContext.SessionState.Internal.SetLocation(_currentLocationPath); } + catch (DriveNotFoundException) + { + // Allow task to run if current drive is not available. + } finally { Runspace.DefaultRunspace = oldDefaultRunspace; diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 index b587577b31a..83293e15e17 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 @@ -104,6 +104,20 @@ Describe 'ForEach-Object -Parallel Basic Tests' -Tags 'CI' { $parallelScriptLocation = 1..1 | ForEach-Object -Parallel { $PWD } $parallelScriptLocation.Path | Should -BeExactly $PWD.Path } + + It 'Verifies no terminating error if current working drive is not found' { + $oldLocation = Get-Location + try + { + New-PSDrive -Name ZZ -PSProvider FileSystem -Root $TestDrive + Set-Location -Path 'ZZ:' + { 1..1 | ForEach-Object -Parallel { $_ } } | Should -Not -Throw + } + finally + { + Set-Location -Path $oldLocation + } + } } Describe 'ForEach-Object -Parallel common parameters' -Tags 'CI' { From 41fef6c4f76f6bad6f07feb919a2994d684ec3b4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2020 12:08:55 -0700 Subject: [PATCH 104/275] Bump `NJsonSchema` from `10.1.11` to `10.1.12` (#12230) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.11 to 10.1.12. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 63225ed24e6..52023d78fb0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 6b5d6a0075ea87577f658504b66a28464b362258 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2020 16:22:37 -0700 Subject: [PATCH 105/275] Bump PSReadLine from 2.0.0 to 2.0.1 (#12243) --- src/Modules/PSGalleryModules.csproj | 2 +- test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index cf9c8cb98a5..dec3d691eb4 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -6,7 +6,7 @@ - + diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index 63dbb9a03b9..022e7a69574 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -12,13 +12,13 @@ Describe "PSReadLine" -tags "CI" { Import-Module PSReadLine $module = Get-Module PSReadLine $module.Name | Should -BeExactly 'PSReadLine' - $module.Version | Should -BeExactly '2.0.0' + $module.Version | Should -BeExactly '2.0.1' } It "Should be installed to `$PSHOME" { $module = Get-Module (Join-Path -Path $PSHOME -ChildPath "Modules" -AdditionalChildPath "PSReadLine") -ListAvailable $module.Name | Should -BeExactly 'PSReadLine' - $module.Version | Should -BeExactly '2.0.0' + $module.Version | Should -BeExactly '2.0.1' $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/PSReadLine.psd1") } From 8d711542e09c5f4a5b3d1e35fc46e282381eeca8 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Thu, 2 Apr 2020 22:13:41 -0600 Subject: [PATCH 106/275] Change progress fg & bg colors to provide better contrast (#11455) --- .../host/msh/ConsoleHostUserInterface.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 48953bf2308..402a3a19a25 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1376,8 +1376,8 @@ public override void WriteErrorLine(string value) public ConsoleColor VerboseBackgroundColor { get; set; } = Console.BackgroundColor; // Progress colors - public ConsoleColor ProgressForegroundColor { get; set; } = ConsoleColor.Yellow; - public ConsoleColor ProgressBackgroundColor { get; set; } = ConsoleColor.DarkCyan; + public ConsoleColor ProgressForegroundColor { get; set; } = ConsoleColor.Black; + public ConsoleColor ProgressBackgroundColor { get; set; } = ConsoleColor.Yellow; #endregion Line-oriented interaction From 3f717c5491c82f1ed65db1852bef691b9377ba34 Mon Sep 17 00:00:00 2001 From: Paramesh Babu Date: Mon, 6 Apr 2020 21:42:07 -0700 Subject: [PATCH 107/275] Add Windows 10 IoT Core reference in Adopters.md (#12266) --- ADOPTERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ADOPTERS.md b/ADOPTERS.md index 48cec93627b..50e82219727 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -32,3 +32,4 @@ This is a list of adopters of using PowerShell in production or in their product Designed to let you complete tasks that should be part of a deployment, but are not possible in an ARM template today — for example, creating a Key Vault certificate or querying an external API for a new CIDR block. * [Azure Pipelines Hosted Agents](https://docs.microsoft.com/azure/devops/pipelines/agents/hosted?view=azure-devops) Windows, Ubuntu, and MacOS Agents used by Azure Pipelines customers have PowerShell pre-installed so that customers can make use of it for all their CI/CD needs. * [GitHub Actions Virtual-Environments for Hosted Runners](https://help.github.com/actions/reference/virtual-environments-for-github-hosted-runners) Windows, Ubuntu, and MacOS virtual environments used by customers of GitHub Actions include Powershell out of the box. +* [Windows 10 IoT Core](https://docs.microsoft.com/windows/iot-core/windows-iot-core) is a small form factor Windows edition for IoT devices and now you can easily include the [PowerShell package](https://github.com/ms-iot/iot-adk-addonkit/blob/master/Tools/IoTCoreImaging/Docs/Import-PSCoreRelease.md#Import-PSCoreRelease) in your imaging process. From 46071b7ff9c1d8da8efdc0411a8e38ccc1f8a17a Mon Sep 17 00:00:00 2001 From: Jack Casey Date: Tue, 7 Apr 2020 13:25:03 -0700 Subject: [PATCH 108/275] Add `-FromUnixTime` to `Get-Date` to allow Unix time input (#12179) --- .../commands/utility/GetDateCommand.cs | 15 ++++++++++++++- .../Get-Date.Tests.ps1 | 9 +++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs index aefbed7dbe2..4516568cc34 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetDateCommand.cs @@ -40,6 +40,12 @@ public DateTime Date } } + /// + /// Gets or sets whether to treat a numeric input as ticks, or unix time. + /// + [Parameter] + public SwitchParameter FromUnixTime; + private DateTime _date; private bool _dateSpecified; @@ -237,7 +243,14 @@ protected override void ProcessRecord() // use passed date object if specified if (_dateSpecified) { - dateToUse = Date; + if (FromUnixTime.IsPresent) + { + dateToUse = DateTimeOffset.FromUnixTimeSeconds(Date.Ticks).UtcDateTime; + } + else + { + dateToUse = Date; + } } // use passed year if specified 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 cdbb7508989..0cdc794921b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -192,6 +192,15 @@ Describe "Get-Date" -Tags "CI" { $timeDifference.Milliseconds | Should -BeLessThan 1 $timeDifference.Ticks | Should -BeLessThan 10000 } + + It "-FromUnixTime works" { + + # Test conversion of arbitrary date in Unix time: 2020-01-01​T00:00:00.000Z + Get-Date -Date 1577836800 -FromUnixTime | Should -Be (Get-Date -Date 637134336000000000 -AsUTC) + + # Test converstion of Unix time start date: 1970-01-01​T00:00:00.000Z + Get-Date -Date 0 -FromUnixTime | Should -Be (Get-Date -Date 621355968000000000 -AsUTC) + } } Describe "Get-Date -UFormat tests" -Tags "CI" { From 7837a536ebbce02f289f73b421f7b82fdd394874 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Tue, 7 Apr 2020 14:31:04 -0700 Subject: [PATCH 109/275] Fix possible race that leaks PowerShell object dispose in `ForEach-Object -Parallel` (#12227) --- src/System.Management.Automation/engine/hostifaces/PSTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index ab2dd6204b8..0c63c2a0b76 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -867,7 +867,7 @@ private void HandleTaskStateChanged(object sender, PSInvocationStateChangedEvent } task.StateChanged -= HandleTaskStateChangedDelegate; - if (!_stopping) + if (!_stopping || stateInfo.State != PSInvocationState.Stopped) { // StopAll disposes tasks. task.Dispose(); From 5f89a10f5b872406a9ac6cb1fcdea8078ea6a4ca Mon Sep 17 00:00:00 2001 From: Bryan Berns Date: Tue, 7 Apr 2020 17:33:15 -0400 Subject: [PATCH 110/275] Added Support For Big Endian `UTF-32` (#11947) --- .../commands/utility/UtilityCommon.cs | 5 ++ .../utils/EncodingUtils.cs | 5 +- .../Parser/RedirectionOperator.Tests.ps1 | 56 ++++++++----------- .../Get-Content.Tests.ps1 | 1 + .../Format-Hex.Tests.ps1 | 7 +++ 5 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs index 5308f836d4a..e4ef04b961a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs @@ -43,6 +43,11 @@ public enum TextEncodingType /// BigEndianUnicode, + /// + /// Big Endian UTF32 encoding. + /// + BigEndianUTF32, + /// /// UTF8 encoding. /// diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index a843bc381da..161ac75866e 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -16,6 +16,7 @@ internal static class EncodingConversion internal const string String = "string"; internal const string Unicode = "unicode"; internal const string BigEndianUnicode = "bigendianunicode"; + internal const string BigEndianUtf32 = "bigendianutf32"; internal const string Ascii = "ascii"; internal const string Utf8 = "utf8"; internal const string Utf8NoBom = "utf8NoBOM"; @@ -25,13 +26,14 @@ internal static class EncodingConversion internal const string Default = "default"; internal const string OEM = "oem"; internal static readonly string[] TabCompletionResults = { - Ascii, BigEndianUnicode, OEM, Unicode, Utf7, Utf8, Utf8Bom, Utf8NoBom, Utf32 + Ascii, BigEndianUnicode, BigEndianUtf32, OEM, Unicode, Utf7, Utf8, Utf8Bom, Utf8NoBom, Utf32 }; internal static Dictionary encodingMap = new Dictionary(StringComparer.OrdinalIgnoreCase) { { Ascii, System.Text.Encoding.ASCII }, { BigEndianUnicode, System.Text.Encoding.BigEndianUnicode }, + { BigEndianUtf32, new UTF32Encoding(bigEndian: true, byteOrderMark: true) }, { Default, ClrFacade.GetDefaultEncoding() }, { OEM, ClrFacade.GetOEMEncoding() }, { Unicode, System.Text.Encoding.Unicode }, @@ -116,6 +118,7 @@ internal sealed class ArgumentEncodingCompletionsAttribute : ArgumentCompletions public ArgumentEncodingCompletionsAttribute() : base( EncodingConversion.Ascii, EncodingConversion.BigEndianUnicode, + EncodingConversion.BigEndianUtf32, EncodingConversion.OEM, EncodingConversion.Unicode, EncodingConversion.Utf7, diff --git a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 index ed4e320d7c2..466f15bd695 100644 --- a/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 +++ b/test/powershell/Language/Parser/RedirectionOperator.Tests.ps1 @@ -45,42 +45,32 @@ Describe "Redirection operator now supports encoding changes" -Tags "CI" { } } - # $availableEncodings = "unknown","string","unicode","bigendianunicode","utf8","utf7", "utf32","ascii","default","oem" - $availableEncodings = (Get-Command Out-File).Parameters["Encoding"].Attributes.ValidValues - + $availableEncodings = + @([System.Text.Encoding]::ASCII + [System.Text.Encoding]::BigEndianUnicode + [System.Text.UTF32Encoding]::new($true,$true) + [System.Text.Encoding]::Unicode + [System.Text.Encoding]::UTF7 + [System.Text.Encoding]::UTF8 + [System.Text.Encoding]::UTF32) + foreach($encoding in $availableEncodings) { - $skipTest = $false - if ($encoding -eq "default") { - # [System.Text.Encoding]::Default is exposed by 'System.Private.CoreLib.dll' at - # runtime via reflection. However,it isn't exposed in the reference contract of - # 'System.Text.Encoding', and therefore we cannot use 'Encoding.Default' in our - # code. So we need to skip this encoding in the test. - $skipTest = $true - } - # some of the encodings accepted by Out-File aren't real, - # and Out-File has its own translation, so we'll - # not do that logic here, but simply ignore those encodings - # as they eventually are translated to "real" encoding - $enc = [System.Text.Encoding]::$encoding - if ( $enc ) - { - $msg = "Overriding encoding for Out-File is respected for $encoding" - $BOM = $enc.GetPreamble() - $TXT = $enc.GetBytes($asciiString) - $CR = $enc.GetBytes($asciiCR) - $expectedBytes = .{ $BOM; $TXT; $CR } - $PSDefaultParameterValues["Out-File:Encoding"] = "$encoding" - $asciiString > TESTDRIVE:/file.txt - $observedBytes = Get-Content -AsByteStream TESTDRIVE:/file.txt - # THE TEST - It $msg -Skip:$skipTest { - $observedBytes.Count | Should -Be $expectedBytes.Count - for($i = 0;$i -lt $observedBytes.Count; $i++) { - $observedBytes[$i] | Should -Be $expectedBytes[$i] - } + $encodingName = $encoding.EncodingName + $msg = "Overriding encoding for Out-File is respected for $encodingName" + $BOM = $encoding.GetPreamble() + $TXT = $encoding.GetBytes($asciiString) + $CR = $encoding.GetBytes($asciiCR) + $expectedBytes = @( $BOM; $TXT; $CR ) + $PSDefaultParameterValues["Out-File:Encoding"] = $encoding + $asciiString > TESTDRIVE:/file.txt + $observedBytes = Get-Content -AsByteStream TESTDRIVE:/file.txt + # THE TEST + It $msg { + $observedBytes.Count | Should -Be $expectedBytes.Count + for($i = 0;$i -lt $observedBytes.Count; $i++) { + $observedBytes[$i] | Should -Be $expectedBytes[$i] } - } } } 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 1d5ec99a952..6c50cee5aa8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Content.Tests.ps1 @@ -98,6 +98,7 @@ Describe "Get-Content" -Tags "CI" { @{EncodingName = 'OEM'}, @{EncodingName = 'Unicode'}, @{EncodingName = 'BigEndianUnicode'}, + @{EncodingName = 'BigEndianUTF32'}, @{EncodingName = 'UTF8'}, @{EncodingName = 'UTF8BOM'}, @{EncodingName = 'UTF8NoBOM'}, diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 index 6bc7e06a591..0ae47aac8e3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Hex.Tests.ps1 @@ -432,6 +432,13 @@ public enum TestSByteEnum : sbyte { Count = 1 ExpectedResult = "0000000000000000 00 68 00 65 00 6C 00 6C 00 6F h e l l o" } + @{ + Name = "Can process BigEndianUTF32 encoding 'fhx -InputObject 'hello' -Encoding BigEndianUTF32'" + Encoding = "BigEndianUTF32" + Count = 2 + ExpectedResult = "0000000000000000 00 00 00 68 00 00 00 65 00 00 00 6C 00 00 00 6C h e l l" + ExpectedSecondResult = "0000000000000010 00 00 00 6F o" + } @{ Name = "Can process Unicode encoding 'fhx -InputObject 'hello' -Encoding Unicode'" Encoding = "Unicode" From eb3e4a878173db8a3f021c501925e8895aee692c Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 7 Apr 2020 17:26:41 -0700 Subject: [PATCH 111/275] Fix the `Sync PSGalleryModules to Artifacts` build (#12277) Merging this to unblock daily build --- .../AzArtifactFeed/PSGalleryToAzArtifacts.yml | 6 +- .../SyncGalleryToAzArtifacts.psm1 | 87 +++++++------------ 2 files changed, 38 insertions(+), 55 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml b/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml index 1faffc3d247..fab28643168 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/PSGalleryToAzArtifacts.yml @@ -8,7 +8,11 @@ queue: name: Hosted VS2017 steps: - pwsh: | - Install-Module -Name PowerShellGet -MinimumVersion 2.0.1 -Force + $minVer = [version]"2.2.3" + $curVer = Get-Module PowerShellGet -ListAvailable | Select-Object -First 1 | ForEach-Object Version + if (-not $curVer -or $curVer -lt $minVer) { + Install-Module -Name PowerShellGet -MinimumVersion 2.2.3 -Force + } displayName: Update PSGet and PackageManagement condition: succeededOrFailed() diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index 54acd4a427f..043e6b65174 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -66,17 +66,20 @@ function SyncGalleryToAzArtifacts { } # Check if Az package version is less that gallery version - if (CompareVersions -lt -ReferencePackage $foundPackageOnAz -DifferencePackage $foundPackageOnGallery) { + $pkgOnAzVersion = [semver]::new($foundPackageOnAz.Version) + $pkgOnGalleryVersion = [semver]::new($foundPackageOnGallery.Version) + + if ($pkgOnAzVersion -lt $pkgOnGalleryVersion) { Write-Verbose -Verbose "Module needs to be updated $($package.Name) - $($foundPackageOnGallery.Version)" $modulesToUpdate += $foundPackageOnGallery - } elseif (CompareVersions -lt -ReferencePackage $foundPackageOnGallery -DifferencePackage $foundPackageOnAz) { + } elseif ($pkgOnGalleryVersion -lt $pkgOnAzVersion) { Write-Warning "Newer version found on Az Artifacts - $($foundPackageOnAz.Name) - $($foundPackageOnAz.Version)" } else { Write-Verbose -Verbose "Module is in sync - $($package.Name)" } } - "Gallery Packages:`n" + "`nGallery Packages:" $galleryPackages "`nAz Artifacts Packages:`n" @@ -90,66 +93,42 @@ function SyncGalleryToAzArtifacts { Save-Package -Provider NuGet -Source $galleryUrl -Name $package.Name -RequiredVersion $package.Version -Path $Destination } - # Remove dependent packages downloaded by Save-Module if there are already present in AzArtifacts feed. - try { - $null = Register-PackageSource -Name local -Location $Destination -ProviderName NuGet -Force - $packageNamesToKeep = @() - $savedPackages = Find-Package -Source local -AllVersions -AllowPreReleaseVersion + if ($modulesToUpdate.Length -gt 0) + { + # Remove dependent packages downloaded by Save-Package if there are already present in AzArtifacts feed. + try { + $null = Register-PackageSource -Name local -Location $Destination -ProviderName NuGet -Force + $packageNamesToKeep = @() + $savedPackages = Find-Package -Source local -AllVersions -AllowPreReleaseVersion - Write-Verbose -Verbose "Saved packages:" - $savedPackages | Out-String | Write-Verbose -Verbose + Write-Verbose -Verbose "Saved packages:" + $savedPackages | Out-String | Write-Verbose -Verbose - foreach($package in $savedPackages) { - $pkgVersion = NormalizeVersion -version $package.Version - $foundMatch = $azArtifactsPackages | Where-Object { $_.Name -eq $package.Name -and (NormalizeVersion -version $_.Version) -eq $pkgVersion } + foreach($package in $savedPackages) { + $pkgVersion = NormalizeVersion -version $package.Version + $foundMatch = $azArtifactsPackages | Where-Object { $_.Name -eq $package.Name -and (NormalizeVersion -version $_.Version) -eq $pkgVersion } - if(-not $foundMatch) { - Write-Verbose "Keeping package $($package.PackageFileName)" -Verbose - $packageNamesToKeep += "{0}*.nupkg" -f $package.Name + if(-not $foundMatch) { + Write-Verbose "Keeping package $($package.PackageFileName)" -Verbose + $packageNamesToKeep += "{0}*.nupkg" -f $package.Name + } } - } - - Remove-Item -Path $Destination -Exclude $packageNamesToKeep -Recurse -Force -Verbose - - Write-Verbose -Verbose "Packages kept for upload" - Get-ChildItem $Destination | Out-String | Write-Verbose -Verbose - } - finally { - Unregister-PackageSource -Name local -Force -ErrorAction SilentlyContinue - } - -} -Function CompareVersions { - param ( - [Microsoft.PackageManagement.Packaging.SoftwareIdentity] - $ReferencePackage, - [Microsoft.PackageManagement.Packaging.SoftwareIdentity] - $DifferencePackage, - [Parameter(Mandatory = $true, ParameterSetName='lt')] - [switch] - $lt, - [Parameter(Mandatory = $true, ParameterSetName='gt')] - [switch] - $gt - ) - - if ($ReferencePackage.Version -eq $DifferencePackage.Version) { - return $false - } - - $latest = SortPackage -p @($ReferencePackage,$DifferencePackage) | Select-Object -First 1 + if ($packageNamesToKeep.Length -gt 0) { + ## Removing only if we do have some packages to keep, + ## otherwise the '$Destination' folder will be removed. + Remove-Item -Path $Destination -Exclude $packageNamesToKeep -Recurse -Force -Verbose + } - if ($gt.IsPresent) { - return $ReferencePackage -eq $latest - } elseif ($lt.IsPresent) { - return $DifferencePackage -eq $latest - } else { - throw "Unknown parameter set" + Write-Verbose -Verbose "Packages kept for upload" + Get-ChildItem $Destination | Out-String | Write-Verbose -Verbose + } + finally { + Unregister-PackageSource -Name local -Force -ErrorAction SilentlyContinue + } } } - Function SortPackage { param( [Parameter(ValueFromPipeline = $true)] From 5f28df120ab95ebb8871d19d3bdb8046c5b9817c Mon Sep 17 00:00:00 2001 From: Michael Klement Date: Tue, 7 Apr 2020 20:37:13 -0400 Subject: [PATCH 112/275] In local invocations do not require `-PowerShellVersion 5.1` for `Get-FormatData` in order to see all format data. (#11270) --- .../common/GetFormatDataCommand.cs | 26 +++++++- .../engine/Utils.cs | 20 ++++++ .../Export-FormatData.Tests.ps1 | 5 +- .../Get-FormatData.Tests.ps1 | 62 +++++++++++++++---- 4 files changed, 97 insertions(+), 16 deletions(-) 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 ae9e83bce14..09a6a88693f 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 @@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Management.Automation; +using System.Management.Automation.Remoting; using System.Management.Automation.Runspaces; using Microsoft.PowerShell.Commands.Internal.Format; @@ -97,9 +98,28 @@ private static Dictionary> GetTypeGroupMap(IEnumerable protected override void ProcessRecord() { - bool writeOldWay = PowerShellVersion == null || - PowerShellVersion.Major < 5 || - (PowerShellVersion.Major == 5 && PowerShellVersion.Minor < 1); + // Remoting detection: + // * Automatic variable $PSSenderInfo is defined in true remoting contexts as well as in background jobs. + // * $PSSenderInfo.ApplicationArguments.PSVersionTable.PSVersion contains the client version, as a [version] instance. + // Note: Even though $PSVersionTable.PSVersion is of type [semver] in PowerShell 6+, it is of type [version] here, + // presumably because only the latter type deserializes type-faithfully. + var clientVersion = PowerShellVersion; + PSSenderInfo remotingClientInfo = GetVariableValue("PSSenderInfo") as PSSenderInfo; + if (clientVersion == null && remotingClientInfo != null) + { + clientVersion = PSObject.Base((PSObject.Base(remotingClientInfo.ApplicationArguments["PSVersionTable"]) as PSPrimitiveDictionary)?["PSVersion"]) as Version; + } + + // During remoting, remain compatible with v5.0- clients by default. + // Passing a -PowerShellVersion argument allows overriding the client version. + bool writeOldWay = + (remotingClientInfo != null && clientVersion == null) // To be safe: Remoting client version could unexpectedly not be determined. + || + (clientVersion != null + && + (clientVersion.Major < 5 + || + (clientVersion.Major == 5 && clientVersion.Minor < 1))); TypeInfoDataBase db = this.Context.FormatDBManager.Database; diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 6c122551995..a188a091e34 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -14,6 +14,7 @@ using System.Management.Automation.Configuration; using System.Management.Automation.Internal; using System.Management.Automation.Language; +using System.Management.Automation.Remoting; using System.Management.Automation.Runspaces; using System.Management.Automation.Security; using System.Numerics; @@ -2098,6 +2099,25 @@ public static bool TestImplicitRemotingBatching(string commandPipeline, System.M { return Utils.TryRunAsImplicitBatch(commandPipeline, runspace); } + + /// + /// Constructs a custom PSSenderInfo instance that can be assigned to $PSSenderInfo + /// in order to simulate a remoting session with respect to the $PSSenderInfo.ConnectionString (connection URL) + /// and $PSSenderInfo.ApplicationArguments.PSVersionTable.PSVersion (the remoting client's PowerShell version). + /// See Get-FormatDataTest.ps1. + /// + /// The connection URL to reflect in the returned instance's ConnectionString property. + /// The version number to report as the remoting client's PowerShell version. + /// The newly constructed custom PSSenderInfo instance. + public static PSSenderInfo GetCustomPSSenderInfo(string url, Version clientVersion) + { + var dummyPrincipal = new PSPrincipal(new PSIdentity("none", true, "someuser", null), null); + var pssi = new PSSenderInfo(dummyPrincipal, url); + pssi.ApplicationArguments = new PSPrimitiveDictionary(); + pssi.ApplicationArguments.Add("PSVersionTable", new PSObject(new PSPrimitiveDictionary())); + ((PSPrimitiveDictionary)PSObject.Base(pssi.ApplicationArguments["PSVersionTable"])).Add("PSVersion", new PSObject(clientVersion)); + return pssi; + } } /// 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 12af02aa27b..42b69c6fa14 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 @@ -2,7 +2,8 @@ # Licensed under the MIT License. Describe "Export-FormatData" -Tags "CI" { BeforeAll { - $fd = Get-FormatData + $clientVersion = '5.0' # Preliminarily preserve the original test semantics in place before https://github.com/PowerShell/PowerShell/pull/11270 + $fd = Get-FormatData -PowerShellVersion $clientVersion $testOutput = Join-Path -Path $TestDrive -ChildPath "outputfile" } @@ -23,7 +24,7 @@ Describe "Export-FormatData" -Tags "CI" { $runspace.Open() $runspace.CreatePipeline("Update-FormatData -AppendPath $TESTDRIVE\allformat.ps1xml").Invoke() - $actualAllFormat = $runspace.CreatePipeline("Get-FormatData -TypeName *").Invoke() + $actualAllFormat = $runspace.CreatePipeline("Get-FormatData -PowerShellVersion $clientVersion").Invoke() $fd.Count | Should -Be $actualAllFormat.Count Compare-Object $fd $actualAllFormat | Should -Be $null 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 baf349e107e..04bffe8df82 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FormatData.Tests.ps1 @@ -3,24 +3,64 @@ Describe "Get-FormatData" -Tags "CI" { Context "Check return type of Get-FormatData" { - It "Should return an object[] as the return type" { $result = Get-FormatData - ,$result | Should -BeOfType System.Object[] + , $result | Should -BeOfType "System.Object[]" } } - It "Can get format data requiring '-PowerShellVersion 5.1'" { - $format = Get-FormatData System.IO.FileInfo -PowerShellVersion 5.1 - $format.TypeNames | Should -HaveCount 2 - $format.TypeNames[0] | Should -BeExactly "System.IO.DirectoryInfo" - $format.TypeNames[1] | Should -BeExactly "System.IO.FileInfo" + # Note: Format data for [System.IO.FileInfo] (among others) is not to be + # returned to v5.0- remoting clients. + + Context "Local use: Can get format data requiring v5.1+ by default" { + BeforeAll { + $cmds = @( + @{ cmd = { Get-FormatData System.IO.FileInfo } } + @{ cmd = { (Get-FormatData System.IO.FileInfo &) | Receive-Job -Wait -AutoRemoveJob } } + ) + } + It "Can get format data requiring v5.1+ with " -TestCases $cmds { + param([scriptblock] $cmd) + $format = & $cmd + $format.TypeNames | Should -HaveCount 2 + $format.TypeNames[0] | Should -BeExactly "System.IO.DirectoryInfo" + $format.TypeNames[1] | Should -BeExactly "System.IO.FileInfo" - $isUnixStatEnabled = $EnabledExperimentalFeatures -contains 'PSUnixFileStat' - $format.FormatViewDefinition | Should -HaveCount ( $isUnixStatEnabled ? 5 : 4) + $isUnixStatEnabled = $EnabledExperimentalFeatures -contains 'PSUnixFileStat' + $format.FormatViewDefinition | Should -HaveCount ($isUnixStatEnabled ? 5 : 4) + } } - It "Should return nothing for format data requiring '-PowerShellVersion 5.1' and not provided" { - Get-FormatData System.IO.FileInfo | Should -BeNullOrEmpty + Context "Can override client version with -PowerShellVersion" { + BeforeAll { + $cmds = @( + @{ shouldBeNull = $true; cmd = { Get-FormatData System.IO.FileInfo -PowerShellVersion 5.0 } } + @{ shouldBeNull = $false; cmd = { Get-FormatData System.IO.FileInfo -PowerShellVersion 5.1 } } + @{ shouldBeNull = $false; cmd = { $PSSenderInfo = [System.Management.Automation.Internal.InternalTestHooks]::GetCustomPSSenderInfo('foo', [version] '5.0'); Get-FormatData System.IO.FileInfo -PowerShellVersion 5.1 } } + ) + } + It " should return for a null-output test" -TestCases $cmds { + param([scriptblock] $cmd, [bool] $shouldBeNull) + $null -eq $(& $cmd) | Should -Be $shouldBeNull + } } + + Context "Remote use: By default, don't get format data requiring v5.1+ for v5.0- clients" { + BeforeAll { + # Simulated PSSenderInfo instances for various PowerShell versions. + $pssiV50 = [System.Management.Automation.Internal.InternalTestHooks]::GetCustomPSSenderInfo('foo', [version] '5.0') + $pssiV51 = [System.Management.Automation.Internal.InternalTestHooks]::GetCustomPSSenderInfo('foo', [version] '5.1') + $pssiV70 = [System.Management.Automation.Internal.InternalTestHooks]::GetCustomPSSenderInfo('foo', [version] '7.0') + $cmds = @( + @{ shouldBeNull = $true; cmd = { $PSSenderInfo = $pssiV50; Get-FormatData System.IO.FileInfo } } + @{ shouldBeNull = $false; cmd = { $PSSenderInfo = $pssiV51; Get-FormatData System.IO.FileInfo } } + @{ shouldBeNull = $false; cmd = { $PSSenderInfo = $pssiV70; Get-FormatData System.IO.FileInfo } } + ) + } + It "When remoting, should return for a null-output test" -TestCases $cmds { + param([scriptblock] $cmd, [bool] $shouldBeNull) + $null -eq $(& $cmd) | Should -Be $shouldBeNull + } + } + } From 622eb4cf02462c07109f21453151a56339a9de05 Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Wed, 8 Apr 2020 01:39:51 +0100 Subject: [PATCH 113/275] Upgrade to .NET 5 Preview 2 (#12250) --- .devcontainer/Dockerfile | 2 +- assets/files.wxs | 16 +++++++-------- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- .../commands/utility/Send-MailMessage.cs | 10 +++++++--- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 6 +++--- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/WebListener/WebListener.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 13 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c94b049a896..a004c50f1cf 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM mcr.microsoft.com/dotnet/core/sdk:5.0.0-preview.1.20120.5 +FROM mcr.microsoft.com/dotnet/core/sdk:5.0.100-preview.2 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/assets/files.wxs b/assets/files.wxs index 72f696336be..4a8bb67b80e 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -403,9 +403,6 @@ - - - @@ -3089,15 +3086,18 @@ - - - + + + + + + @@ -3235,7 +3235,6 @@ - @@ -4077,7 +4076,6 @@ - @@ -4096,6 +4094,8 @@ + + diff --git a/global.json b/global.json index 8696bf07ded..ee1e3d9321f 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.1.20155.7" + "version": "5.0.100-preview.2.20176.6" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index aafcb94a14f..503b7c7c984 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 52023d78fb0..ad2ea2a2b51 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + 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 b4582f788a8..25da2e8025f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Send-MailMessage.cs @@ -374,9 +374,13 @@ protected override void EndProcessing() ErrorRecord er = new ErrorRecord(ex, "AuthenticationException", ErrorCategory.InvalidOperation, _mSmtpClient); WriteError(er); } - - // If we don't dispose the attachments, the sender can't modify or use the files sent. - _mMailMessage.Attachments.Dispose(); + finally + { + _mSmtpClient.Dispose(); + + // If we don't dispose the attachments, the sender can't modify or use the files sent. + _mMailMessage.Attachments.Dispose(); + } } #endregion diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 44e6378fb23..c2d8cfbd0ad 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 2401ed3bc85..d4ad1f36292 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index da504fc8563..46fc389e1a4 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index fd612866b5a..64cca263c93 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index f26bdcb1830..63c36611f72 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 940128ce0a8..fa6a947bc1e 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 00a4d777c4d..542f33a7477 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From b1e998046e12ebe5da9dee479f20d479aa2256d7 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 9 Apr 2020 04:28:54 +0500 Subject: [PATCH 114/275] Fix NRE in csv commands (#12281) --- .../commands/utility/CsvCommands.cs | 2 +- .../ConvertTo-Csv.Tests.ps1 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs index cb6e4a9024d..397ca036151 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs @@ -1013,7 +1013,7 @@ internal string ConvertPSObjectToCSV(PSObject mshObject, IList propertyN AppendStringWithEscapeAlways(_outputString, value); break; case BaseCsvWritingCommand.QuoteKind.AsNeeded: - if (value.Contains(_delimiter)) + if (value != null && value.Contains(_delimiter)) { AppendStringWithEscapeAlways(_outputString, value); } 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 7d91b0b4bfd..494051507f7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Csv.Tests.ps1 @@ -40,6 +40,7 @@ Describe "ConvertTo-Csv" -Tags "CI" { BeforeAll { $Name = "Hello"; $Data = "World"; $testObject = [pscustomobject]@{ FirstColumn = $Name; SecondColumn = $Data } + $testNullObject = [pscustomobject]@{ FirstColumn = $Name; SecondColumn = $null } } It "Should Be able to be called without error" { @@ -121,6 +122,11 @@ Describe "ConvertTo-Csv" -Tags "CI" { $result[0] | Should -BeExactly "`"FirstColumn`",`"SecondColumn`"" $result[1] | Should -BeExactly "`"Hello`",`"World`"" + + $result = $testNullObject | ConvertTo-Csv -UseQuotes Always -Delimiter ',' + + $result[0] | Should -BeExactly "`"FirstColumn`",`"SecondColumn`"" + $result[1] | Should -BeExactly "`"Hello`"," } It "UseQuotes Always is default" { @@ -135,6 +141,11 @@ Describe "ConvertTo-Csv" -Tags "CI" { $result[0] | Should -BeExactly "FirstColumn,SecondColumn" $result[1] | Should -BeExactly "Hello,World" + + $result = $testNullObject | ConvertTo-Csv -UseQuotes Never -Delimiter ',' + + $result[0] | Should -BeExactly "FirstColumn,SecondColumn" + $result[1] | Should -BeExactly "Hello," } It "UseQuotes AsNeeded" { @@ -142,6 +153,11 @@ Describe "ConvertTo-Csv" -Tags "CI" { $result[0] | Should -BeExactly "`"FirstColumn`"rSecondColumn" $result[1] | Should -BeExactly "Hellor`"World`"" + + $result = $testNullObject | ConvertTo-Csv -UseQuotes AsNeeded -Delimiter 'r' + + $result[0] | Should -BeExactly "`"FirstColumn`"rSecondColumn" + $result[1] | Should -BeExactly "Hellor" } } } From 8869e7a4cd4c52dcaa1ebcc7c0b6a4329e710a60 Mon Sep 17 00:00:00 2001 From: Chris Gardner Date: Mon, 13 Apr 2020 19:01:08 +0100 Subject: [PATCH 115/275] Specifying an alias and `-Syntax` to `Get-Command` returns the aliased commands syntax (#10784) @ChrisLGardner Thank you for your contribution and your patience. --- .../engine/GetCommandCommand.cs | 127 ++++++++++++++---- .../Get-Command.Tests.ps1 | 77 +++++++++++ 2 files changed, 179 insertions(+), 25 deletions(-) diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 0532c78d525..709c84b973c 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -531,9 +531,7 @@ private void OutputResultsHelper(IEnumerable results) { if (!string.IsNullOrEmpty(result.Syntax)) { - PSObject syntax = PSObject.AsPSObject(result.Syntax); - - syntax.IsHelpObject = true; + PSObject syntax = GetSyntaxObject(result); WriteObject(syntax); } @@ -571,6 +569,81 @@ private void OutputResultsHelper(IEnumerable results) #endif } + /// + /// Creates the syntax output based on if the command is an alias, script, application or command. + /// + /// + /// CommandInfo object containing the syntax to be output. + /// + /// + /// Syntax string cast as a PSObject for outputting. + /// + private PSObject GetSyntaxObject(CommandInfo command) + { + PSObject syntax = PSObject.AsPSObject(command.Syntax); + + // This is checking if the command name that's been passed in is one that was specified by a user, + // if not then we have to assume they specified an alias or a wildcard and do some extra formatting for those, + // if it is then just go with the default formatting. + // So if a user runs Get-Command -Name del -Syntax the code will find del and the command it resolves to as Remove-Item + // and attempt to return that, but as the user specified del we want to fiddle with the output a bit to make it clear + // that's an alias but still give the Remove-Item syntax. + if (this.Name != null && !Array.Exists(this.Name, name => name.Equals(command.Name, StringComparison.InvariantCultureIgnoreCase))) + { + string aliasName = _nameContainsWildcard ? command.Name : this.Name[0]; + + IDictionary aliasTable = SessionState.Internal.GetAliasTable(); + foreach (KeyValuePair tableEntry in aliasTable) + { + if ((Array.Exists(this.Name, name => name.Equals(tableEntry.Key, StringComparison.InvariantCultureIgnoreCase)) && + tableEntry.Value.Definition == command.Name) || + (_nameContainsWildcard && tableEntry.Value.Definition == command.Name)) + { + aliasName = tableEntry.Key; + break; + } + } + + string replacedSyntax = string.Empty; + switch (command) + { + case ExternalScriptInfo externalScript: + replacedSyntax = string.Format( + "{0} (alias) -> {1}{2}{3}", + aliasName, + string.Format("{0}{1}", externalScript.Path, Environment.NewLine), + Environment.NewLine, + command.Syntax.Replace(command.Name, aliasName)); + break; + case ApplicationInfo app: + replacedSyntax = app.Path; + break; + default: + if (aliasName.Equals(command.Name)) + { + replacedSyntax = command.Syntax; + } + else + { + replacedSyntax = string.Format( + "{0} (alias) -> {1}{2}{3}", + aliasName, + command.Name, + Environment.NewLine, + command.Syntax.Replace(command.Name, aliasName)); + } + + break; + } + + syntax = PSObject.AsPSObject(replacedSyntax); + } + + syntax.IsHelpObject = true; + + return syntax; + } + /// /// The comparer to sort CommandInfo objects in the result list. /// @@ -1229,33 +1302,37 @@ private bool IsCommandMatch(ref CommandInfo current, out bool isDuplicate) if (isCommandMatch) { - if (ArgumentList != null) + if (Syntax.IsPresent && current is AliasInfo ai) { - AliasInfo ai = current as AliasInfo; - if (ai != null) + // If the matching command was an alias, then use the resolved command + // instead of the alias... + current = ai.ResolvedCommand ?? CommandDiscovery.LookupCommandInfo( + ai.UnresolvedCommandName, + this.MyInvocation.CommandOrigin, + this.Context); + + // there are situations where both ResolvedCommand and UnresolvedCommandName + // are both null (often due to multiple versions of modules with aliases) + // therefore we need to exit early. + if (current == null) { - // If the matching command was an alias, then use the resolved command - // instead of the alias... - current = ai.ResolvedCommand; - if (current == null) - { - return false; - } - } - else if (!(current is CmdletInfo || current is IScriptCommandInfo)) - { - // If current is not a cmdlet or script, we need to throw a terminating error. - ThrowTerminatingError( - new ErrorRecord( - PSTraceSource.NewArgumentException( - "ArgumentList", - DiscoveryExceptions.CommandArgsOnlyForSingleCmdlet), - "CommandArgsOnlyForSingleCmdlet", - ErrorCategory.InvalidArgument, - current)); + return false; } } + if (ArgumentList != null && !(current is CmdletInfo || current is IScriptCommandInfo)) + { + // If current is not a cmdlet or script, we need to throw a terminating error. + ThrowTerminatingError( + new ErrorRecord( + PSTraceSource.NewArgumentException( + "ArgumentList", + DiscoveryExceptions.CommandArgsOnlyForSingleCmdlet), + "CommandArgsOnlyForSingleCmdlet", + ErrorCategory.InvalidArgument, + current)); + } + // If the command implements dynamic parameters // then we must make a copy of the CommandInfo which merges the // dynamic parameter metadata with the statically defined parameter diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 index 5725aede1d9..2238d83a385 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 @@ -103,3 +103,80 @@ Describe "Get-Command Feature tests" -Tag Feature { } } } + +Describe "Get-Command" -Tag CI { + BeforeAll { + Import-Module Microsoft.PowerShell.Management + } + Context "-Syntax tests" { + It "Should return a string object when -Name is an alias and -Syntax is specified" { + $Result = Get-Command -Name del -Syntax + + $Result | Should -BeOfType [String] + $Result | Should -Match 'del \[-Path\]' + } + + It "Should replace commands with aliases in matching commands when using a wildcard search" { + $Result = Get-Command -Name sp* -Syntax + + $Result | Should -BeOfType [String] + $Result -join '' | Should -Match 'sp \(alias\) -> Set-ItemProperty' + $Result -join '' | Should -Match 'sp \[-Path\]' + } + + It "Should not add the alias (alias) -> command decorator for non-alias commands" { + $Result = Get-Command -Name sp* -Syntax + + $Result -join '' | Should -Not -Match 'Split-Path \(alias\) -> Split-Path' + $Result -join '' | Should -Match 'Split-Path \[-Path\]' + } + + It "Should only replace aliases when given multiple entries including a command and an alias" { + $Result = Get-Command -Name get-help, del -Syntax + + $Result -join '' | Should -Match 'del \(alias\) -> Remove-Item' + $Result -join '' | Should -Match 'del \[-Path\]' + $Result -join '' | Should -Match 'Get-Help \[\[-Name\]' + $Result -join '' | Should -Not -Match 'del \(alias\) -> Get-Help' + } + + It "Should return the path to an aliased script when -Syntax is specified" { + # First, create a script file + $TestGcmSyntax = @' + [CmdletBinding()] + param( + [Parameter(Position=0, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] + [ValidateNotNullOrEmpty()] + [string[]] + $Name + ) + process { + "Processing ${Name}" + } +'@ + Set-Content -Path TestDrive:\Test-GcmSyntax.ps1 -Value $TestGcmSyntax + + # Now set up an alias for that file + New-Alias -Name tgs -Value TestDrive:\Test-GcmSyntax.ps1 + + $Result = Get-Command -Name tgs -Syntax + + $Result | Should -Match "tgs \(alias\) -> $([Regex]::Escape((Get-Item TestDrive:\\Test-GcmSyntax.ps1).FullName))" + } + } + + Context "-Name tests" { + It "Should return a AliasInfo object when -Name is an alias" { + $Result = Get-Command -Name del + + $Result | Should -BeOfType [System.Management.Automation.AliasInfo] + $Result.DisplayName | Should -Be 'del -> Remove-Item' + } + + It "Should return a CommandInfo object when -Name is a command" { + $Result = Get-Command -Name Remove-Item + + $Result | Should -BeOfType [System.Management.Automation.CommandInfo] + } + } +} From 9a92c62d300e62c4b65f6b631b8f7bd1d8461798 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Mon, 13 Apr 2020 23:05:26 -0700 Subject: [PATCH 116/275] Add null check for Windows PowerShell install path (#12296) Some Azure images have run into this problem where Start-Job fails even when running in pwsh child process rather than Windows PowerShell child. Fix is to guard against the missing registry entry. --- .../engine/hostifaces/PowerShellProcessInstance.cs | 8 +++++++- .../resources/RemotingErrorIdStrings.resx | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs index 938ba6d2874..35029df1e06 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs @@ -38,7 +38,8 @@ static PowerShellProcessInstance() PwshExePath = Path.Combine(Utils.DefaultPowerShellAppBase, "pwsh"); #else PwshExePath = Path.Combine(Utils.DefaultPowerShellAppBase, "pwsh.exe"); - WinPwshExePath = Path.Combine(Utils.GetApplicationBaseFromRegistry(Utils.DefaultPowerShellShellID), "powershell.exe"); + var winPowerShellDir = Utils.GetApplicationBaseFromRegistry(Utils.DefaultPowerShellShellID); + WinPwshExePath = string.IsNullOrEmpty(winPowerShellDir) ? null : Path.Combine(winPowerShellDir, "powershell.exe"); #endif } @@ -59,6 +60,11 @@ public PowerShellProcessInstance(Version powerShellVersion, PSCredential credent startingWindowsPowerShell51 = (powerShellVersion != null) && (powerShellVersion.Major == 5) && (powerShellVersion.Minor == 1); if (startingWindowsPowerShell51) { + if (WinPwshExePath == null) + { + throw new PSInvalidOperationException(RemotingErrorIdStrings.WindowsPowerShellNotPresent); + } + exePath = WinPwshExePath; if (useWow64) diff --git a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx index d5b70f46a44..b4f9dc40a89 100644 --- a/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx +++ b/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx @@ -1693,4 +1693,7 @@ All WinRM sessions connected to PowerShell session configurations, such as Micro Remote debugger exception: {0}, error message: {1} + + Unable to create Windows PowerShell process because Windows PowerShell could not be found on this machine. + From 14487bf85d48764239047843f7d324aace55143e Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 13 Apr 2020 23:08:01 -0700 Subject: [PATCH 117/275] Make GetWindowsPowerShellModulePath compatible with multiple PS installations (#12280) Add additional check for each component of PSModulePath (that is set for WinPS process) - if it is has pwsh.exe in the parent directory, then it is considered another PS Core installation and this location is also filtered out. --- .../engine/Modules/ModuleIntrinsics.cs | 21 ++++++++++++++++--- .../CompatiblePSEditions.Module.Tests.ps1 | 4 ++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index 3d03276613a..a4d343131f3 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -1234,7 +1234,7 @@ internal static string GetModulePath() #if !UNIX /// - /// Returns a PSModulePath suiteable for Windows PowerShell by removing this PowerShell's specific + /// Returns a PSModulePath suiteable for Windows PowerShell by removing PowerShell's specific /// paths from current PSModulePath. /// /// @@ -1261,9 +1261,24 @@ internal static string GetWindowsPowerShellModulePath() var modulePathList = new List(); foreach (var path in currentModulePath.Split(';')) { - if (!excludeModulePaths.Contains(path)) + var trimmedPath = path.Trim(); + if (!excludeModulePaths.Contains(trimmedPath)) { - modulePathList.Add(path); + // make sure this module path is Not part of other PS Core installation + var possiblePwshDir = Path.GetDirectoryName(trimmedPath); + + if (string.IsNullOrEmpty(possiblePwshDir)) + { + // i.e. module dir is in the drive root + modulePathList.Add(trimmedPath); + } + else + { + if (!File.Exists(Path.Combine(possiblePwshDir, "pwsh.dll"))) + { + modulePathList.Add(trimmedPath); + } + } } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index 582dfa0bf36..921b7af3798 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -646,6 +646,10 @@ Describe "PSModulePath changes interacting with other PowerShell processes" -Tag $errors | Should -Be $null } + It "Allows Windows PowerShell subprocesses to load WinPS version of `$PSHOME modules" { + powershell.exe -Command "Get-ChildItem | Out-Null;(Get-Module Microsoft.PowerShell.Management).Path" | Should -BeLike "*system32*" + } + It "Allows PowerShell subprocesses to call core modules" { $errors = & $pwsh -Command "Get-ChildItem" 2>&1 | Where-Object { $_ -is [System.Management.Automation.ErrorRecord] } $errors | Should -Be $null From a29cffd49d319cf8b6cb68ad4528a35aefd0819d Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Tue, 14 Apr 2020 07:21:19 +0100 Subject: [PATCH 118/275] Pin major Pester version to 4 to prevent breaking changes caused by upcoming release of v5 (#12262) --- .vsts-ci/misc-analysis.yml | 2 +- .vsts-ci/templates/nanoserver.yml | 2 +- build.psm1 | 2 +- tools/ci.psm1 | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.vsts-ci/misc-analysis.yml b/.vsts-ci/misc-analysis.yml index 0e4093b6f91..e35b508bfd8 100644 --- a/.vsts-ci/misc-analysis.yml +++ b/.vsts-ci/misc-analysis.yml @@ -34,7 +34,7 @@ jobs: condition: succeededOrFailed() - powershell: | - Install-module pester -Scope CurrentUser -Force + Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99 displayName: Install Pester condition: succeededOrFailed() diff --git a/.vsts-ci/templates/nanoserver.yml b/.vsts-ci/templates/nanoserver.yml index d7575836f84..c989d01c2f8 100644 --- a/.vsts-ci/templates/nanoserver.yml +++ b/.vsts-ci/templates/nanoserver.yml @@ -34,7 +34,7 @@ jobs: continueOnError: true - pwsh: | - Install-module pester -Scope CurrentUser -Force + Install-module Pester -Scope CurrentUser -Force -MaximumVersion 4.99 displayName: 'Install Pester' continueOnError: true diff --git a/build.psm1 b/build.psm1 index 86c7acd50b2..70dc91d90ab 100644 --- a/build.psm1 +++ b/build.psm1 @@ -689,7 +689,7 @@ function Restore-PSPester [ValidateNotNullOrEmpty()] [string] $Destination = ([IO.Path]::Combine((Split-Path (Get-PSOptions -DefaultToNew).Output), "Modules")) ) - Save-Module -Name Pester -Path $Destination -Repository PSGallery -RequiredVersion "4.8.0" + Save-Module -Name Pester -Path $Destination -Repository PSGallery -MaximumVersion 4.99 } function Compress-TestContent { diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 854da9da3fb..047753805b8 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -492,8 +492,9 @@ function Invoke-CIFinish $env:PSMsiX64Path = $artifacts | Where-Object { $_.EndsWith(".msi")} # Install the latest Pester and import it - Install-Module Pester -Force -SkipPublisherCheck - Import-Module Pester -Force + $maximumPesterVersion = '4.99' + Install-Module Pester -Force -SkipPublisherCheck -MaximumVersion $maximumPesterVersion + Import-Module Pester -Force -MaximumVersion $maximumPesterVersion # start the packaging tests and get the results $packagingTestResult = Invoke-Pester -Script (Join-Path $repoRoot '.\test\packaging\windows\') -PassThru From 8b3937ecfe086b811aaab680fa8b437615d1e5a0 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 14 Apr 2020 17:34:53 -0400 Subject: [PATCH 119/275] CodeFactor cleanup (#12251) * Code cleanup Signed-off-by: Reece Dunham * whoops * Update src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs Co-Authored-By: Travis Plunk Co-authored-by: Travis Plunk --- .devcontainer/Dockerfile | 2 +- .../CimAsyncOperation.cs | 15 ++-- .../CimBaseAction.cs | 8 +-- .../CimCmdletModuleInitialize.cs | 10 +-- .../CimSessionOperations.cs | 68 ++++++++++--------- .../CimSessionProxy.cs | 4 +- src/libpsl-native/README.md | 2 +- 7 files changed, 56 insertions(+), 53 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a004c50f1cf..305de6bdda3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update \ && apt-get -y install --no-install-recommends apt-utils 2>&1 \ # # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed - && apt-get -y install git procps lsb-release \ + && apt-get -y install --no-install-recommends git procps lsb-release \ # # Clean up && apt-get autoremove -y \ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs index 1dcfaa482f2..1e21b781742 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs @@ -27,7 +27,7 @@ internal abstract class CimAsyncOperation : IDisposable #region Constructor /// - /// Constructor. + /// The constructor. /// public CimAsyncOperation() { @@ -126,7 +126,7 @@ protected void OperationDeletedHandler(object cimSession, OperationEventArgs act /// /// /// - /// wrapper of cmdlet, for details. + /// Wrapper of cmdlet, for details. /// public void ProcessActions(CmdletOperationBase cmdletOperation) { @@ -146,12 +146,12 @@ public void ProcessActions(CmdletOperationBase cmdletOperation) /// /// - /// process remaining actions until all operations are completed or + /// Process remaining actions until all operations are completed or /// current cmdlet is terminated by user. /// /// /// - /// wrapper of cmdlet, for details. + /// Wrapper of cmdlet, for details. /// public void ProcessRemainActions(CmdletOperationBase cmdletOperation) { @@ -202,7 +202,6 @@ protected bool GetActionAndRemove(out CimBaseAction action) /// Add temporary object to cache. /// /// - /// Computer name of the cimsession. /// Cimsession wrapper object. protected void AddCimSessionProxy(CimSessionProxy sessionproxy) { @@ -382,7 +381,7 @@ protected object GetBaseObject(object value) /// /// /// Output the cimtype of the value, either Reference or ReferenceArray. - /// + /// The object. protected object GetReferenceOrReferenceArrayObject(object value, ref CimType referenceType) { PSReference cimReference = value as PSReference; @@ -496,7 +495,7 @@ protected virtual void Dispose(bool disposing) /// /// - /// Clean up managed resources + /// Clean up managed resources. /// /// private void Cleanup() @@ -585,7 +584,7 @@ private void Cleanup() #region protected members /// /// Event to notify ps thread that either a ACK message sent back - /// or a error happened. Currently only used by class + /// or a error happened. Currently only used by /// . /// protected ManualResetEventSlim ackedEvent; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs index 302fd16d9f1..345b27bb48b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs @@ -69,7 +69,7 @@ protected XOperationContextBase Context internal class CimSyncAction : CimBaseAction, IDisposable { /// - /// Constructor. + /// The constructor. /// public CimSyncAction() { @@ -91,7 +91,7 @@ public virtual CimResponseType GetResponse() /// /// - /// Set response result + /// Set the response result. /// /// internal CimResponseType ResponseType @@ -102,7 +102,7 @@ internal CimResponseType ResponseType /// /// /// Call this method when the action is completed or - /// the operation is terminated + /// the operation is terminated. /// /// internal virtual void OnComplete() @@ -112,7 +112,7 @@ internal virtual void OnComplete() /// /// - /// block current thread. + /// Block current thread. /// /// protected virtual void Block() diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs index 2de029c25f8..72f6f0e28e4 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs @@ -25,7 +25,7 @@ public sealed class CimCmdletsAssemblyInitializer : IModuleAssemblyInitializer { /// /// - /// constructor + /// The constructor. /// /// public CimCmdletsAssemblyInitializer() @@ -56,18 +56,18 @@ public void OnImport() /// /// - /// CimCmdlet alias entry + /// CimCmdlet alias entry. /// /// internal sealed class CimCmdletAliasEntry { /// /// - /// Constructor + /// The constructor. /// /// - /// - /// + /// The entry name. + /// The entry value. internal CimCmdletAliasEntry(string name, string value) { this._name = name; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs index 49b77c4830a..28d93fc668a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs @@ -221,10 +221,10 @@ internal class CimSessionState : IDisposable /// /// - /// session counter bound to current runspace. + /// Session counter bound to current runspace. /// /// - private UInt32 sessionNameCounter; + private uint sessionNameCounter; /// /// @@ -252,7 +252,7 @@ internal class CimSessionState : IDisposable /// Dictionary used to holds all CimSessions in current runspace by session id. /// /// - private Dictionary curCimSessionsById; + private Dictionary curCimSessionsById; /// /// @@ -265,7 +265,7 @@ internal class CimSessionState : IDisposable /// /// - /// constructor + /// The constructor. /// /// internal CimSessionState() @@ -297,7 +297,7 @@ internal int GetSessionsCount() /// /// /// Unique session id under current runspace. - internal UInt32 GenerateSessionId() + internal uint GenerateSessionId() { return this.sessionNameCounter++; } @@ -305,7 +305,7 @@ internal UInt32 GenerateSessionId() /// /// - /// Indicates whether this object was disposed or not + /// Indicates whether this object was disposed or not. /// /// private bool _disposed; @@ -381,17 +381,19 @@ public void Cleanup() /// /// - /// Add new CimSession object to cache + /// Add new CimSession object to cache. /// /// /// /// /// /// + /// + /// /// internal PSObject AddObjectToCache( CimSession session, - UInt32 sessionId, + uint sessionId, Guid instanceId, string name, string computerName, @@ -434,11 +436,11 @@ internal string GetRemoveSessionObjectTarget(PSObject psObject) string message = string.Empty; if (psObject.BaseObject is CimSession) { - UInt32 id = 0x0; + uint id = 0x0; Guid instanceId = Guid.Empty; string name = string.Empty; string computerName = string.Empty; - if (psObject.Properties[idPropName].Value is UInt32) + if (psObject.Properties[idPropName].Value is uint) { id = Convert.ToUInt32(psObject.Properties[idPropName].Value, null); } @@ -466,7 +468,7 @@ internal string GetRemoveSessionObjectTarget(PSObject psObject) /// /// - /// Remove given object from cache + /// Remove given object from cache. /// /// /// @@ -482,7 +484,7 @@ internal void RemoveOneSessionObjectFromCache(PSObject psObject) /// /// - /// Remove given object from cache + /// Remove given object from cache. /// /// /// @@ -562,7 +564,8 @@ private void AddErrorRecord( /// /// /// List of session wrapper objects. - internal IEnumerable QuerySession(IEnumerable ids, + internal IEnumerable QuerySession( + IEnumerable ids, out IEnumerable errorRecords) { HashSet sessions = new HashSet(); @@ -570,7 +573,7 @@ internal IEnumerable QuerySession(IEnumerable ids, List errRecords = new List(); errorRecords = errRecords; // NOTES: use template function to implement this will save duplicate code - foreach (UInt32 id in ids) + foreach (uint id in ids) { if (this.curCimSessionsById.ContainsKey(id)) { @@ -594,7 +597,8 @@ internal IEnumerable QuerySession(IEnumerable ids, /// /// /// List of session wrapper objects. - internal IEnumerable QuerySession(IEnumerable instanceIds, + internal IEnumerable QuerySession( + IEnumerable instanceIds, out IEnumerable errorRecords) { HashSet sessions = new HashSet(); @@ -781,7 +785,7 @@ internal class CimSessionBase #region constructor /// - /// Constructor. + /// The constructor. /// public CimSessionBase() { @@ -814,7 +818,7 @@ internal static ConcurrentDictionary cimSessions /// /// - /// Default runspace id + /// Default runspace Id. /// /// internal static Guid defaultRunspaceId = Guid.Empty; @@ -855,7 +859,7 @@ public static CimSessionState GetCimSessionState() /// /// - /// clean up the dictionaries if the runspace is closed or broken. + /// Clean up the dictionaries if the runspace is closed or broken. /// /// /// Runspace. @@ -905,7 +909,7 @@ internal class CimTestCimSessionContext : XOperationContextBase { /// /// - /// Constructor + /// The constructor. /// /// /// @@ -920,7 +924,7 @@ internal CimTestCimSessionContext( } /// - /// namespace + /// Namespace /// internal CimSessionWrapper CimSessionWrapper { @@ -935,7 +939,7 @@ internal CimSessionWrapper CimSessionWrapper /// /// - /// constructor + /// The constructor. /// /// internal CimNewSession() : base() @@ -988,7 +992,7 @@ internal void NewCimSession(NewCimSessionCommand cmdlet, /// /// - /// Add session to global cache + /// Add session to global cache, /// /// /// @@ -999,7 +1003,7 @@ internal void AddSessionToCache(CimSession cimSession, XOperationContextBase con DebugHelper.WriteLogEx(); CimTestCimSessionContext testCimSessionContext = context as CimTestCimSessionContext; - UInt32 sessionId = this.sessionState.GenerateSessionId(); + uint sessionId = this.sessionState.GenerateSessionId(); string originalSessionName = testCimSessionContext.CimSessionWrapper.Name; string sessionName = (originalSessionName != null) ? originalSessionName : string.Format(CultureInfo.CurrentUICulture, @"{0}{1}", CimSessionState.CimSessionClassName, sessionId); @@ -1017,11 +1021,11 @@ internal void AddSessionToCache(CimSession cimSession, XOperationContextBase con /// /// - /// process all actions in the action queue + /// Process all actions in the action queue. /// /// /// - /// wrapper of cmdlet, for details + /// Wrapper of cmdlet, for details. /// public void ProcessActions(CmdletOperationBase cmdletOperation) { @@ -1030,12 +1034,12 @@ public void ProcessActions(CmdletOperationBase cmdletOperation) /// /// - /// process remaining actions until all operations are completed or - /// current cmdlet is terminated by user + /// Process remaining actions until all operations are completed or + /// current cmdlet is terminated by user. /// /// /// - /// wrapper of cmdlet, for details + /// Wrapper of cmdlet, for details. /// public void ProcessRemainActions(CmdletOperationBase cmdletOperation) { @@ -1055,7 +1059,7 @@ public void ProcessRemainActions(CmdletOperationBase cmdletOperation) /// /// - /// Indicates whether this object was disposed or not + /// Indicates whether this object was disposed or not. /// /// protected bool Disposed @@ -1120,13 +1124,13 @@ protected virtual void Dispose(bool disposing) /// /// - /// Get CimSession based on given id/instanceid/computername/name + /// Get CimSession based on given id/instanceid/computername/name. /// /// internal class CimGetSession : CimSessionBase { /// - /// Constructor. + /// The constructor. /// public CimGetSession() : base() { @@ -1197,7 +1201,7 @@ public void GetCimSession(GetCimSessionCommand cmdlet) /// /// - /// Get CimSession based on given id/instanceid/computername/name + /// Get CimSession based on given id/instanceid/computername/name. /// /// internal class CimRemoveSession : CimSessionBase diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs index 4f8b0e3a986..a8e4fcd977f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs @@ -44,7 +44,7 @@ internal string Namespace /// /// - /// Session proxy + /// Session proxy. /// /// internal CimSessionProxy Proxy @@ -60,7 +60,7 @@ internal CimSessionProxy Proxy /// /// Class provides all information regarding the - /// current invocation to .net api. + /// current invocation to the .NET API. /// internal class InvocationContext { diff --git a/src/libpsl-native/README.md b/src/libpsl-native/README.md index 70998594406..940fe41150c 100644 --- a/src/libpsl-native/README.md +++ b/src/libpsl-native/README.md @@ -1,5 +1,5 @@ # libpsl-native -The code under `libpsl-native` is being migrated to [PowerShell-native](https://github.com/PowerShell/PowerShell-native) repository. +The code under `libpsl-native` is being migrated to the [PowerShell-native](https://github.com/PowerShell/PowerShell-native) repository. Please make PRs to the new repository. Code under here will be removed once the move is complete. From 07620b4b793b6508e80cb654eee40b528445047c Mon Sep 17 00:00:00 2001 From: Eugene Samoylov Date: Wed, 15 Apr 2020 22:23:25 +0500 Subject: [PATCH 120/275] Add `-Shuffle` switch to `Get-Random` command (#11093) --- .../commands/utility/GetRandomCommand.cs | 58 +++++++++++++------ .../Get-Random.Tests.ps1 | 8 ++- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index b4c015e6801..91955c0f26c 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -28,6 +28,7 @@ public class GetRandomCommand : PSCmdlet private const string RandomNumberParameterSet = "RandomNumberParameterSet"; private const string RandomListItemParameterSet = "RandomListItemParameterSet"; + private const string ShuffleParameterSet = "ShuffleParameterSet"; private static readonly object[] _nullInArray = new object[] { null }; private enum MyParameterSet @@ -50,7 +51,8 @@ private MyParameterSet EffectiveParameterSet { _effectiveParameterSet = MyParameterSet.RandomListItem; } - else if (ParameterSetName.Equals(GetRandomCommand.RandomListItemParameterSet, StringComparison.OrdinalIgnoreCase)) + else if (ParameterSetName == GetRandomCommand.RandomListItemParameterSet + || ParameterSetName == GetRandomCommand.ShuffleParameterSet) { _effectiveParameterSet = MyParameterSet.RandomListItem; } @@ -276,6 +278,7 @@ private double ConvertToDouble(object o, double defaultIfNull) /// List from which random elements are chosen. /// [Parameter(ParameterSetName = RandomListItemParameterSet, ValueFromPipeline = true, Position = 0, Mandatory = true)] + [Parameter(ParameterSetName = ShuffleParameterSet, ValueFromPipeline = true, Position = 0, Mandatory = true)] [System.Management.Automation.AllowNull] [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")] public object[] InputObject { get; set; } @@ -283,12 +286,23 @@ private double ConvertToDouble(object o, double defaultIfNull) /// /// Number of items to output (number of list items or of numbers). /// - [Parameter] + [Parameter(ParameterSetName = RandomNumberParameterSet)] + [Parameter(ParameterSetName = RandomListItemParameterSet)] [ValidateRange(1, int.MaxValue)] public int Count { get; set; } = 1; #endregion + #region Shuffle parameter + + /// + /// Gets or sets whether the command should return all input objects in randomized order. + /// + [Parameter(ParameterSetName = ShuffleParameterSet, Mandatory = true)] + public SwitchParameter Shuffle { get; set; } + + #endregion + #region Cmdlet processing methods private double GetRandomDouble(double minValue, double maxValue) @@ -492,29 +506,39 @@ protected override void ProcessRecord() { if (EffectiveParameterSet == MyParameterSet.RandomListItem) { - // this allows for $null to be in an array passed to InputObject - foreach (object item in InputObject ?? _nullInArray) + if (ParameterSetName == ShuffleParameterSet) { - // (3) - if (_numberOfProcessedListItems < Count) + // this allows for $null to be in an array passed to InputObject + foreach (object item in InputObject ?? _nullInArray) { - Debug.Assert(_chosenListItems.Count == _numberOfProcessedListItems, "Initial K elements should all be included in chosenListItems"); _chosenListItems.Add(item); } - else + } + else + { + foreach (object item in InputObject ?? _nullInArray) { - Debug.Assert(_chosenListItems.Count == Count, "After processing K initial elements, the length of chosenItems should stay equal to K"); - - // (1) - if (Generator.Next(_numberOfProcessedListItems + 1) < Count) + // (3) + if (_numberOfProcessedListItems < Count) { - // (2) - int indexToReplace = Generator.Next(_chosenListItems.Count); - _chosenListItems[indexToReplace] = item; + Debug.Assert(_chosenListItems.Count == _numberOfProcessedListItems, "Initial K elements should all be included in chosenListItems"); + _chosenListItems.Add(item); + } + else + { + Debug.Assert(_chosenListItems.Count == Count, "After processing K initial elements, the length of chosenItems should stay equal to K"); + + // (1) + if (Generator.Next(_numberOfProcessedListItems + 1) < Count) + { + // (2) + int indexToReplace = Generator.Next(_chosenListItems.Count); + _chosenListItems[indexToReplace] = item; + } } - } - _numberOfProcessedListItems++; + _numberOfProcessedListItems++; + } } } } 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 c0c87036671..760db706f30 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 @@ -156,6 +156,12 @@ Describe "Get-Random" -Tags "CI" { $randomNumber[6] | Should -BeNullOrEmpty } + It "Should return all the numbers for array of 1,2,3,5,8,13 in randomized order when the Shuffle switch is used" { + $randomNumber = Get-Random -InputObject 1, 2, 3, 5, 8, 13 -Shuffle + $randomNumber.Count | Should -Be 6 + $randomNumber | Should -BeIn 1, 2, 3, 5, 8, 13 + } + It "Should return for a string collection " { $randomNumber = Get-Random -InputObject "red", "yellow", "blue" $randomNumber | Should -Be ("red" -or "yellow" -or "blue") @@ -173,7 +179,7 @@ Describe "Get-Random" -Tags "CI" { $firstRandomNumber | Should -Not -Be $secondRandomNumber } - It "Should return the same number for hexadecimal number and regular number when the switch SetSeed it used " { + It "Should return the same number for hexadecimal number and regular number when the switch SetSeed is used " { $firstRandomNumber = Get-Random 0x07FFFFFFFF -SetSeed 20 $secondRandomNumber = Get-Random 34359738367 -SetSeed 20 $firstRandomNumber | Should -Be @secondRandomNumber From 60f28bcd3f2f0f6c4b60711100cd1ee9ed0d16aa Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 15 Apr 2020 11:40:56 -0700 Subject: [PATCH 121/275] Scripts to update to .NET prerelease version (#12284) --- DotnetRuntimeMetadata.json | 6 ++ build.psm1 | 2 +- nuget.config | 1 + tools/UpdateDotnetRuntime.ps1 | 142 ++++++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 DotnetRuntimeMetadata.json create mode 100644 tools/UpdateDotnetRuntime.ps1 diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json new file mode 100644 index 00000000000..fd4e75359d3 --- /dev/null +++ b/DotnetRuntimeMetadata.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "channel": "release", + "packageVersionPattern": "5.0.0-preview.2" + } +} diff --git a/build.psm1 b/build.psm1 index 70dc91d90ab..761d423ddcd 100644 --- a/build.psm1 +++ b/build.psm1 @@ -8,7 +8,7 @@ Set-StrictMode -Version 3.0 $script:TestModulePathSeparator = [System.IO.Path]::PathSeparator $script:Options = $null -$dotnetCLIChannel = 'release' +$dotnetCLIChannel = $(Get-Content $PSScriptRoot/DotnetRuntimeMetadata.json | ConvertFrom-Json).Sdk.Channel $dotnetCLIRequiredVersion = $(Get-Content $PSScriptRoot/global.json | ConvertFrom-Json).Sdk.Version # Track if tags have been sync'ed diff --git a/nuget.config b/nuget.config index 5ec994d9118..f6b2acb7d0c 100644 --- a/nuget.config +++ b/nuget.config @@ -2,6 +2,7 @@ + diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 new file mode 100644 index 00000000000..7d3f329c42e --- /dev/null +++ b/tools/UpdateDotnetRuntime.ps1 @@ -0,0 +1,142 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +[CmdletBinding()] +param ( +) + +<# + .DESCRIPTION Update the global.json with the new SDK version to be used. +#> +function Update-GlobalJson([string] $Version) { + $psGlobalJsonPath = Resolve-Path "$PSScriptRoot/../global.json" + $psGlobalJson = Get-Content -Path $psGlobalJsonPath -Raw | ConvertFrom-Json + $psGlobalJson.sdk.version = $Version + $psGlobalJson | ConvertTo-Json | Out-File -FilePath $psGlobalJsonPath -Force +} + +<# + .DESCRIPTION Iterate through all the csproj to find all the packages that need to be updated +#> +function Update-PackageVersion { + + class PkgVer { + [string] $Name + [string] $Version + [string] $NewVersion + [string] $Path + + PkgVer($n, $v, $nv, $p) { + $this.Name = $n + $this.Version = $v + $this.NewVersion = $nv + $this.Path = $p + } + } + + $skipModules = @( + "NJsonSchema" + "Markdig.Signed" + "PowerShellHelpFiles" + "Newtonsoft.Json" + "Microsoft.ApplicationInsights" + "Microsoft.Management.Infrastructure" + "Microsoft.PowerShell.Native" + "Microsoft.NETCore.Windows.ApiSets" + ) + + $packages = [System.Collections.Generic.Dictionary[[string], [PkgVer]]]::new() + + Get-ChildItem -Path "$PSScriptRoot/../src/" -Recurse -Filter "*.csproj" -Exclude 'PSGalleryModules.csproj' | ForEach-Object { + $prj = [xml] (Get-Content $_.FullName -Raw) + $pkgRef = $prj.Project.ItemGroup.PackageReference + + foreach ($p in $pkgRef) { + if ($null -ne $p -and -not $skipModules.Contains($p.Include)) { + if (-not $packages.ContainsKey($p.Include)) { + $packages.Add($p.Include, [PkgVer]::new($p.Include, $p.Version, $null, $_.FullName)) + } + } + } + } + + $versionPattern = (Get-Content "$PSScriptRoot/../DotnetRuntimeMetadata.json" | ConvertFrom-Json).sdk.packageVersionPattern + + $packages.GetEnumerator() | ForEach-Object { + $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPreReleaseVersions -Source 'dotnet5' + + $version = $_.Value.Version + + foreach ($p in $pkgs) { + if ($p.Version -like "$versionPattern*") { + if ([System.Management.Automation.SemanticVersion] ($version) -lt [System.Management.Automation.SemanticVersion] ($p.Version)) { + $_.Value.NewVersion = $p.Version + break + } + } + } + } + + $pkgsByPath = $packages.Values | Group-Object -Property Path + + $pkgsByPath | ForEach-Object { + Update-CsprojFile -Path $_.Name -Values $_.Group + } +} + +<# + .DESCRIPTION Update package versions to the latest as per the pattern mentioned in DotnetRuntimeMetadata.json +#> +function Update-CsprojFile([string] $path, $values) { + $fileContent = Get-Content $path -raw + $updated = $false + + foreach ($v in $values) { + if ($v.NewVersion) { + $stringToReplace = "" + $newString = "" + + $fileContent = $fileContent -replace $stringToReplace, $newString + $updated = $true + } + } + + if ($updated) { + $fileContent | Out-File -FilePath $path -Force + } +} + +$dotnetMetadataPath = "$PSScriptRoot/../DotnetRuntimeMetadata.json" +$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json + +# Channel is like: $Channel = "5.0.1xx-preview2" +$Channel = $dotnetMetadataJson.sdk.channel + +Import-Module "$PSScriptRoot/../build.psm1" -Force + +Find-Dotnet + +if(-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue)) +{ + $nugetFeed = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet5' } | Select-Object -ExpandProperty Value + Register-PackageSource -Name 'dotnet5' -Location $nugetFeed -ProviderName NuGet + Write-Verbose -Message "Register new package source 'dotnet5'" -verbose +} + +## Install latest version from the channel + +Install-Dotnet -Channel "$Channel" -Version 'latest' + +Write-Verbose -Message "Installing .NET SDK completed." -Verbose + +$latestSdkVersion = (dotnet --list-sdks | Select-Object -Last 1 ).Split() | Select-Object -First 1 + +Write-Verbose -Message "Installing .NET SDK completed, version - $latestSdkVersion" -Verbose + +Update-GlobalJson -Version $latestSdkVersion + +Write-Verbose -Message "Updating global.json completed." -Verbose + +Update-PackageVersion + +Write-Verbose -Message "Updating project files completed." -Verbose From b7c66ab3ef584956a2872856ee8b351784f522d9 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Wed, 15 Apr 2020 19:42:10 +0000 Subject: [PATCH 122/275] Linux: Initial support for Gentoo installations. (#11429) --- tools/install-powershell.sh | 52 +++++---- tools/installpsh-debian.sh | 10 +- tools/installpsh-gentoo.sh | 220 ++++++++++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+), 24 deletions(-) create mode 100755 tools/installpsh-gentoo.sh diff --git a/tools/install-powershell.sh b/tools/install-powershell.sh index c6a2fa41f76..ce4711d142b 100755 --- a/tools/install-powershell.sh +++ b/tools/install-powershell.sh @@ -71,6 +71,7 @@ install(){ else SCRIPTFOLDER=$(dirname "$(readlink -f "$0")") OS=$(uname) + DISTRIBUTOR_ID=$(lsb_release --id 2>/dev/null | sed -E 's/^.*:[[:space:]]*//') if [ "${OS}" == "SunOS" ] ; then OS=solaris ARCH=$(uname -p) @@ -107,6 +108,11 @@ install(){ DIST=$(. /etc/os-release && echo $NAME) PSUEDONAME=$(. /etc/os-release && echo $VERSION_CODENAME) REV=$(. /etc/os-release && echo $VERSION_ID) + elif [ "$DISTRIBUTOR_ID" = Gentoo ] ; then + DistroBasedOn='gentoo' + DIST=$(. /etc/os-release && echo $NAME) + PSUEDONAME=$(eselect --brief profile show | sed -E 's/[[:space:]]*//g') + REV=$( eselect --brief profile show | sed -E 's|^.*/([[:digit:].]+).*|\1|') fi if [ -f /etc/UnitedLinux-release ] ; then DIST="${DIST}[$( (tr "\n" ' ' | sed s/VERSION.*//) < /etc/UnitedLinux-release )]" @@ -127,29 +133,33 @@ install(){ echo " OSSTR: $OSSTR" - if [ "$DistroBasedOn" == "redhat" ] || [ "$DistroBasedOn" == "debian" ] || [ "$DistroBasedOn" == "osx" ] || [ "$DistroBasedOn" == "suse" ] || [ "$DistroBasedOn" == "amazonlinux" ]; then - echo "Configuring PowerShell Environment for: $DistroBasedOn $DIST $REV" - if [ -f "$SCRIPTFOLDER/installpsh-$DistroBasedOn.sh" ]; then - #Script files were copied local - use them - # shellcheck source=/dev/null - . "$SCRIPTFOLDER/installpsh-$DistroBasedOn.sh" - else - #Script files are not local - pull from remote - echo "Could not find \"installpsh-$DistroBasedOn.sh\" next to this script..." - echo "Pulling and executing it from \"$gitreposcriptroot/installpsh-$DistroBasedOn.sh\"" - if [ -n "$(command -v curl)" ]; then - echo "found and using curl" - bash <(curl -s $gitreposcriptroot/installpsh-"$DistroBasedOn".sh) "$@" - elif [ -n "$(command -v wget)" ]; then - echo "found and using wget" - bash <(wget -qO- $gitreposcriptroot/installpsh-"$DistroBasedOn".sh) "$@" + case "$DistroBasedOn" in + redhat|debian|osx|suse|amazonlinux|gentoo) + echo "Configuring PowerShell Environment for: $DistroBasedOn $DIST $REV" + if [ -f "$SCRIPTFOLDER/installpsh-$DistroBasedOn.sh" ]; then + #Script files were copied local - use them + # shellcheck source=/dev/null + . "$SCRIPTFOLDER/installpsh-$DistroBasedOn.sh" else - echo "Could not find curl or wget, install one of these or manually download \"$gitreposcriptroot/installpsh-$DistroBasedOn.sh\"" + #Script files are not local - pull from remote + echo "Could not find \"installpsh-$DistroBasedOn.sh\" next to this script..." + echo "Pulling and executing it from \"$gitreposcriptroot/installpsh-$DistroBasedOn.sh\"" + if [ -n "$(command -v curl)" ]; then + echo "found and using curl" + bash <(curl -s $gitreposcriptroot/installpsh-"$DistroBasedOn".sh) "$@" + elif [ -n "$(command -v wget)" ]; then + echo "found and using wget" + bash <(wget -qO- $gitreposcriptroot/installpsh-"$DistroBasedOn".sh) "$@" + else + echo "Could not find curl or wget, install one of these or manually download \"$gitreposcriptroot/installpsh-$DistroBasedOn.sh\"" + fi fi - fi - else - echo "Sorry, your operating system is based on $DistroBasedOn and is not supported by PowerShell or this installer at this time." - fi + ;; + *) + echo "Sorry, your operating system is based on $DistroBasedOn and is not supported by PowerShell or this installer at this time." + exit 1 + ;; + esac } # run the install function diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 78013558f7b..0314bc05260 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -101,7 +101,7 @@ fi SUDO='' if (( EUID != 0 )); then #Check that sudo is available - if [[ ("'$*'" =~ skip-sudo-check) && ("$(whereis sudo)" == *'/'* && "$(sudo -nv 2>&1)" != 'Sorry, user'*) ]]; then + if [[ ("'$*'" =~ skip-sudo-check) || ("$(whereis sudo)" == *'/'* && "$(sudo -nv 2>&1)" != 'Sorry, user'*) ]]; then SUDO='sudo' else echo "ERROR: You must either be root or be able to use sudo" >&2 @@ -133,10 +133,14 @@ if ! hash curl 2>/dev/null; then $SUDO apt-get install -y curl fi +# The executable to test. +PWSH=pwsh + if [[ "'$*'" =~ preview ]] ; then echo echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)" powershellpackageid=powershell-preview + PWSH=pwsh-preview fi currentversion=$(curl https://api.github.com/repos/powershell/powershell/releases/latest | sed '/tag_name/!d' | sed s/\"tag_name\"://g | sed s/\"//g | sed s/v// | sed s/,//g | sed s/\ //g) @@ -210,8 +214,8 @@ $SUDO apt-get update $SUDO apt-get install -y ${powershellpackageid} # shellcheck disable=SC2016 -pwsh -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME. -Run `"pwsh`" to start a PowerShell session."' +$PWSH -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME. +Run `"'"$PWSH"'`" to start a PowerShell session."' success=$? diff --git a/tools/installpsh-gentoo.sh b/tools/installpsh-gentoo.sh new file mode 100755 index 00000000000..36b07d06834 --- /dev/null +++ b/tools/installpsh-gentoo.sh @@ -0,0 +1,220 @@ +#!/bin/bash + +#call this code direction from the web with: +#bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-gentoo.sh) ARGUMENTS +#bash <(curl -s https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-gentoo.sh) + +#Usage - if you do not have the ability to run scripts directly from the web, +# pull all files in this repo folder and execute, this script +# automatically prefers local copies of sub-scripts + +#Completely automated install requires a root account or sudo with a password requirement + +#Switches +# -skip-sudo-check - use sudo without verifying its availability (hard to accurately do on some distros) +# -preview - installs the latest preview release of PowerShell side-by-side with any existing production releases + +#gitrepo paths are overrideable to run from your own fork or branch for testing or private distribution + +VERSION="1.2.0" +gitreposubpath="PowerShell/PowerShell/master" +gitreposcriptroot="https://raw.githubusercontent.com/$gitreposubpath/tools" +thisinstallerdistro=gentoo +gitscriptname="installpsh-gentoo.psh" +powershellpackageid=powershell + +echo ; +echo "*** PowerShell Development Environment Installer $VERSION for $thisinstallerdistro" +echo "*** Original script is at: $gitreposcriptroot/$gitscriptname" +echo +echo "*** Arguments used: $*" + +# Let's quit on interrupt of subcommands +trap ' + trap - INT # restore default INT handler + echo "Interrupted" + kill -s INT "$$" +' INT + +#Verify The Installer Choice (for direct runs of this script) +lowercase(){ + echo "$1" | tr "[:upper:]" "[:lower:]" +} + +OS=$(lowercase "$(uname)") +if [ "${OS}" == "windowsnt" ]; then + OS=windows + DistroBasedOn=windows +elif [ "${OS}" == "darwin" ]; then + OS=osx + DistroBasedOn=osx +else + OS=$(uname) + if [ "${OS}" == "SunOS" ] ; then + OS=solaris + DistroBasedOn=sunos + elif [ "${OS}" == "AIX" ] ; then + DistroBasedOn=aix + elif [ "${OS}" == "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + DistroBasedOn='redhat' + elif [ -f /etc/system-release ] ; then + DIST=$(sed s/\ release.*// < /etc/system-release) + if [[ $DIST == *"Amazon Linux"* ]] ; then + DistroBasedOn='amazonlinux' + else + DistroBasedOn='redhat' + fi + elif [ -f /etc/SuSE-release ] ; then + DistroBasedOn='suse' + elif [ -f /etc/mandrake-release ] ; then + DistroBasedOn='mandrake' + elif [ -f /etc/debian_version ] ; then + DistroBasedOn='debian' + elif [ "$(lsb_release --id 2>/dev/null | sed -E 's/^.*:[[:space:]]*//')" = Gentoo ] ; then + DistroBasedOn='gentoo' + fi + if [ -f /etc/UnitedLinux-release ] ; then + DIST="${DIST}[$( (tr "\n" ' ' | sed s/VERSION.*//) < /etc/UnitedLinux-release )]" + DistroBasedOn=unitedlinux + fi + OS=$(lowercase "$OS") + DistroBasedOn=$(lowercase "$DistroBasedOn") + fi +fi + +if [ "$DistroBasedOn" != "$thisinstallerdistro" ]; then + echo "*** This installer is only for $thisinstallerdistro and you are running $DistroBasedOn, please run \"$gitreposcriptroot\install-powershell.sh\" to see if your distro is supported AND to auto-select the appropriate installer if it is." + exit 1 +fi + +## Check requirements and prerequisites + +#Check for sudo if not root +if [[ "${CI}" == "true" ]]; then + echo "Running on CI (as determined by env var CI set to true), skipping SUDO check." + set -- "$@" '-skip-sudo-check' +fi + +SUDO='' +if (( EUID != 0 )); then + #Check that sudo is available + if [[ ("'$*'" =~ skip-sudo-check) || ("$(whereis sudo)" == *'/'* && "$(sudo -nv 2>&1)" != 'Sorry, user'*) ]]; then + SUDO='sudo' + else + echo "ERROR: You must either be root or be able to use sudo" >&2 + #exit 5 + fi +fi + +#Collect any variation details if required for this distro +# shellcheck disable=SC1091 +#END Collect any variation details if required for this distro + +#If there are known incompatible versions of this distro, put the test, message and script exit here: + +#END Verify The Installer Choice + +##END Check requirements and prerequisites + +echo +echo "*** Installing PowerShell for $DistroBasedOn..." +if ! hash curl 2>/dev/null; then + echo "curl not found, installing..." + $SUDO emerge -nv1 net-misc/curl +fi + +if ! hash dpkg 2>/dev/null; then + echo "dpkg not found, installing..." + $SUDO emerge -nv1 app-arch/dpkg +fi + +# The executable to test. +PWSH=pwsh + +if [[ "'$*'" =~ preview ]] ; then + echo + echo "-preview was used, the latest preview release will be installed (side-by-side with your production release)" + powershellpackageid=powershell-preview + PWSH=pwsh-preview +fi + +currentversion=$(curl -s https://api.github.com/repos/powershell/powershell/releases/latest | sed '/tag_name/!d' | sed s/\"tag_name\"://g | sed s/\"//g | sed s/v// | sed s/,//g | sed s/\ //g) + +printf "\n*** Current version on git is: $currentversion, repo version may differ slightly...\n\n" + +ubuntu_dist=18.04 + +# Find latest ubuntu packages. + +for ubuntu_dist in $(curl -sL 'https://packages.microsoft.com/ubuntu/' | sed -En 's,.*href="([[:digit:]][[:digit:].]+).*,\1,p' | sort -rV); do + if ! curl -sL "https://packages.microsoft.com/ubuntu/${ubuntu_dist}/prod/pool/main/p/${powershellpackageid}/" | grep -q '404 Not Found'; then + break + fi +done + +printf "*** Found packages for Ubuntu $ubuntu_dist...\n\n" + +latest_pkg=$(curl -sL "https://packages.microsoft.com/ubuntu/${ubuntu_dist}/prod/pool/main/p/${powershellpackageid}/" | sed -En 's/^.*href="([^"]+\.deb).*/\1/p' | sort -V | tail -1) + +if [ ! -f "$latest_pkg" ]; then + curl -sL "https://packages.microsoft.com/ubuntu/${ubuntu_dist}/prod/pool/main/p/${powershellpackageid}/${latest_pkg}" -o "$latest_pkg" +fi + +$SUDO dpkg -i --force-depends "$latest_pkg" 2>/dev/null + +# the postrm breaks removal +$SUDO rm -f /var/lib/dpkg/info/${powershellpackageid}.postrm + +printf "\n\n" + +# shellcheck disable=SC2016 +$PWSH -noprofile -c '"Congratulations! PowerShell is installed at $PSHOME. +Run `"'"$PWSH"'`" to start a PowerShell session."' + +success=$? + +if [[ "$success" != 0 ]]; then + echo "ERROR: PowerShell failed to install!" >&2 + exit "$success" +fi + +if [[ "'$*'" =~ includeide ]] ; then + echo + echo "*** Installing VS Code PowerShell IDE..." + + # install overlay for flatpak and flatpak if needed + if ! command -v flatpak >/dev/null; then + echo "*** Setting up Flatpak for VS Code..." + + if ! ( ( command -v layman >/dev/null && layman -l | grep -q flatpak-overlay ) || [ -f /etc/portage/repos.conf/flatpak-overlay.conf ] ); then + $SUDO sh -c 'cat >/etc/portage/repos.conf/flatpak-overlay.conf' < Date: Thu, 16 Apr 2020 16:57:55 -0700 Subject: [PATCH 123/275] Fix `WinCompat` module loading to treat Core edition modules higher priority (#12269) --- .../engine/Modules/ImportModuleCommand.cs | 146 +++++++++++++----- .../engine/Modules/ModuleCmdletBase.cs | 6 + .../engine/PSConfiguration.cs | 13 ++ .../CompatiblePSEditions.Module.Tests.ps1 | 91 +++++++++++ 4 files changed, 218 insertions(+), 38 deletions(-) diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index c7366460928..bec87e9a35a 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -591,6 +591,27 @@ private void ImportModule_ViaAssembly(ImportModuleOptions importModuleOptions, A } } + private PSModuleInfo ImportModule_LocallyViaName_WithTelemetry(ImportModuleOptions importModuleOptions, string name) + { + PSModuleInfo foundModule = ImportModule_LocallyViaName(importModuleOptions, name); + if (foundModule != null) + { + SetModuleBaseForEngineModules(foundModule.Name, this.Context); + + // report loading of the module in telemetry + // avoid double reporting for WinCompat modules that go through CommandDiscovery\AutoloadSpecifiedModule + if (!foundModule.IsWindowsPowerShellCompatModule) + { + ApplicationInsightsTelemetry.SendTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name); +#if LEGACYTELEMETRY + TelemetryAPI.ReportModuleLoad(foundModule); +#endif + } + } + + return foundModule; + } + private PSModuleInfo ImportModule_LocallyViaName(ImportModuleOptions importModuleOptions, string name) { try @@ -820,6 +841,24 @@ private PSModuleInfo ImportModule_LocallyViaName(ImportModuleOptions importModul return null; } + private PSModuleInfo ImportModule_LocallyViaFQName(ImportModuleOptions importModuleOptions, ModuleSpecification modulespec) + { + RequiredVersion = modulespec.RequiredVersion; + MinimumVersion = modulespec.Version; + MaximumVersion = modulespec.MaximumVersion; + BaseGuid = modulespec.Guid; + + PSModuleInfo foundModule = ImportModule_LocallyViaName(importModuleOptions, modulespec.Name); + + if (foundModule != null) + { + ApplicationInsightsTelemetry.SendTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name); + SetModuleBaseForEngineModules(foundModule.Name, this.Context); + } + + return foundModule; + } + #endregion Local import #region Remote import @@ -1024,7 +1063,10 @@ private PSModuleInfo ImportModule_RemotelyViaPsrpSession_SinglePreimportedModule { powerShell.AddCommand("Export-PSSession"); powerShell.AddParameter("OutputModule", wildcardEscapedPath); - powerShell.AddParameter("AllowClobber", true); + if (!importModuleOptions.NoClobberExportPSSession) + { + powerShell.AddParameter("AllowClobber", true); + } powerShell.AddParameter("Module", remoteModuleName); // remoteModulePath is currently unsupported by Get-Command and implicit remoting powerShell.AddParameter("Force", true); powerShell.AddParameter("FormatTypeName", "*"); @@ -1816,21 +1858,7 @@ protected override void ProcessRecord() { foreach (string name in Name) { - PSModuleInfo foundModule = ImportModule_LocallyViaName(importModuleOptions, name); - if (foundModule != null) - { - SetModuleBaseForEngineModules(foundModule.Name, this.Context); - - // report loading of the module in telemetry - // avoid double reporting for WinCompat modules that go through CommandDiscovery\AutoloadSpecifiedModule - if (!foundModule.IsWindowsPowerShellCompatModule) - { - ApplicationInsightsTelemetry.SendTelemetryMetric(TelemetryType.ModuleLoad, foundModule.Name); -#if LEGACYTELEMETRY - TelemetryAPI.ReportModuleLoad(foundModule); -#endif - } - } + ImportModule_LocallyViaName_WithTelemetry(importModuleOptions, name); } } else if (this.ParameterSetName.Equals(ParameterSet_ViaPsrpSession, StringComparison.OrdinalIgnoreCase)) @@ -1845,17 +1873,7 @@ protected override void ProcessRecord() { foreach (var modulespec in FullyQualifiedName) { - RequiredVersion = modulespec.RequiredVersion; - MinimumVersion = modulespec.Version; - MaximumVersion = modulespec.MaximumVersion; - BaseGuid = modulespec.Guid; - - PSModuleInfo foundModule = ImportModule_LocallyViaName(importModuleOptions, modulespec.Name); - ApplicationInsightsTelemetry.SendTelemetryMetric(TelemetryType.ModuleLoad, modulespec.Name); - if (foundModule != null) - { - SetModuleBaseForEngineModules(foundModule.Name, this.Context); - } + ImportModule_LocallyViaFQName(importModuleOptions, modulespec); } } else if (this.ParameterSetName.Equals(ParameterSet_FQName_ViaPsrpSession, StringComparison.OrdinalIgnoreCase)) @@ -1884,19 +1902,10 @@ private bool IsModuleInDenyList(string[] moduleDenyList, string moduleName, Modu { Debug.Assert(string.IsNullOrEmpty(moduleName) ^ (moduleSpec == null), "Either moduleName or moduleSpec must be specified"); - var exactModuleName = string.Empty; + // moduleName can be just a module name and it also can be a full path to psd1 from which we need to extract the module name + string exactModuleName = ModuleIntrinsics.GetModuleName(moduleSpec == null ? moduleName : moduleSpec.Name); bool match = false; - if (!string.IsNullOrEmpty(moduleName)) - { - // moduleName can be just a module name and it also can be a full path to psd1 from which we need to extract the module name - exactModuleName = Path.GetFileNameWithoutExtension(moduleName); - } - else if (moduleSpec != null) - { - exactModuleName = moduleSpec.Name; - } - foreach (var deniedModuleName in moduleDenyList) { // use case-insensitive module name comparison @@ -1941,6 +1950,49 @@ private List FilterModuleCollection(IEnumerable moduleCollection) return filteredModuleCollection; } + private void PrepareNoClobberWinCompatModuleImport(string moduleName, ModuleSpecification moduleSpec, ref ImportModuleOptions importModuleOptions) + { + Debug.Assert(string.IsNullOrEmpty(moduleName) ^ (moduleSpec == null), "Either moduleName or moduleSpec must be specified"); + + // moduleName can be just a module name and it also can be a full path to psd1 from which we need to extract the module name + string coreModuleToLoad = ModuleIntrinsics.GetModuleName(moduleSpec == null ? moduleName : moduleSpec.Name); + + var isModuleToLoadEngineModule = InitialSessionState.IsEngineModule(coreModuleToLoad); + string[] noClobberModuleList = PowerShellConfig.Instance.GetWindowsPowerShellCompatibilityNoClobberModuleList(); + if (isModuleToLoadEngineModule || ((noClobberModuleList != null) && noClobberModuleList.Contains(coreModuleToLoad, StringComparer.OrdinalIgnoreCase))) + { + // if it is one of engine modules - first try to load it from $PSHOME\Modules + // otherwise rely on $env:PSModulePath (in which WinPS module location has to go after CorePS module location) + if (isModuleToLoadEngineModule) + { + string expectedCoreModulePath = Path.Combine(ModuleIntrinsics.GetPSHomeModulePath(), coreModuleToLoad); + if (Directory.Exists(expectedCoreModulePath)) + { + coreModuleToLoad = expectedCoreModulePath; + } + } + + if (moduleSpec == null) + { + ImportModule_LocallyViaName_WithTelemetry(importModuleOptions, coreModuleToLoad); + } + else + { + ModuleSpecification tmpModuleSpec = new ModuleSpecification() + { + Guid = moduleSpec.Guid, + MaximumVersion = moduleSpec.MaximumVersion, + Version = moduleSpec.Version, + RequiredVersion = moduleSpec.RequiredVersion, + Name = coreModuleToLoad + }; + ImportModule_LocallyViaFQName(importModuleOptions, tmpModuleSpec); + } + + importModuleOptions.NoClobberExportPSSession = true; + } + } + internal override IList ImportModulesUsingWinCompat(IEnumerable moduleNames, IEnumerable moduleFullyQualifiedNames, ImportModuleOptions importModuleOptions) { IList moduleProxyList = new List(); @@ -1968,6 +2020,24 @@ internal override IList ImportModulesUsingWinCompat(IEnumerable(); } + // perform necessary preparations if module has to be imported with NoClobber mode + if (filteredModuleNames != null) + { + foreach(string moduleName in filteredModuleNames) + { + PrepareNoClobberWinCompatModuleImport(moduleName, null, ref importModuleOptions); + } + } + + if (filteredModuleFullyQualifiedNames != null) + { + foreach(var moduleSpec in filteredModuleFullyQualifiedNames) + { + PrepareNoClobberWinCompatModuleImport(null, moduleSpec, ref importModuleOptions); + } + } + + // perform the module import / proxy generation moduleProxyList = ImportModule_RemotelyViaPsrpSession(importModuleOptions, filteredModuleNames, filteredModuleFullyQualifiedNames, WindowsPowerShellCompatRemotingSession, usingWinCompat: true); foreach (PSModuleInfo moduleProxy in moduleProxyList) diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 4200ea32fb3..7da27ca0378 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -99,6 +99,12 @@ protected internal struct ImportModuleOptions /// This will be allowed when the manifest explicitly exports functions which will limit all visible module functions. /// internal bool AllowNestedModuleFunctionsToExport; + + /// + /// Flag that controls Export-PSSession -AllowClobber parameter in generating proxy modules from remote sessions. + /// Historically -AllowClobber in these scenarios was set as True. + /// + internal bool NoClobberExportPSSession; } /// diff --git a/src/System.Management.Automation/engine/PSConfiguration.cs b/src/System.Management.Automation/engine/PSConfiguration.cs index 820448dde29..6c585cc0a05 100644 --- a/src/System.Management.Automation/engine/PSConfiguration.cs +++ b/src/System.Management.Automation/engine/PSConfiguration.cs @@ -51,6 +51,7 @@ internal sealed class PowerShellConfig private const string ExecutionPolicyDefaultShellKey = "Microsoft.PowerShell:ExecutionPolicy"; private const string DisableImplicitWinCompatKey = "DisableImplicitWinCompat"; private const string WindowsPowerShellCompatibilityModuleDenyListKey = "WindowsPowerShellCompatibilityModuleDenyList"; + private const string WindowsPowerShellCompatibilityNoClobberModuleListKey = "WindowsPowerShellCompatibilityNoClobberModuleList"; // Provide a singleton internal static readonly PowerShellConfig Instance = new PowerShellConfig(); @@ -240,6 +241,18 @@ internal string[] GetWindowsPowerShellCompatibilityModuleDenyList() return settingValue; } + internal string[] GetWindowsPowerShellCompatibilityNoClobberModuleList() + { + string[] settingValue = ReadValueFromFile(ConfigScope.CurrentUser, WindowsPowerShellCompatibilityNoClobberModuleListKey); + if (settingValue == null) + { + // if the setting is not mentioned in configuration files, then the default WindowsPowerShellCompatibilityNoClobberModuleList value is null + settingValue = ReadValueFromFile(ConfigScope.AllUsers, WindowsPowerShellCompatibilityNoClobberModuleListKey); + } + + return settingValue; + } + /// /// Corresponding settings of the original Group Policies. /// diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index 921b7af3798..e21c8993391 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -554,6 +554,97 @@ Describe "Additional tests for Import-Module with WinCompat" -Tag "Feature" { } } + Context "Tests around Windows PowerShell Compatibility NoClobber module list" { + BeforeAll { + $pwsh = "$PSHOME/pwsh" + Add-ModulePath $basePath + $ConfigPath = Join-Path $TestDrive 'powershell.config.json' + } + + AfterAll { + Restore-ModulePath + } + + It "NoClobber WinCompat import works for an engine module through command discovery" { + + ConvertFrom-String -InputObject '1,2,3' -Delimiter ',' | Out-Null + $modules = Get-Module -Name Microsoft.PowerShell.Utility + $modules.Count | Should -Be 2 + $proxyModule = $modules | Where-Object {$_.ModuleType -eq 'Script'} + $coreModule = $modules | Where-Object {$_.ModuleType -eq 'Manifest'} + + $proxyModule.ExportedCommands.Keys | Should -Contain "ConvertFrom-String" + $proxyModule.ExportedCommands.Keys | Should -Not -Contain "Get-Date" + + $coreModule.ExportedCommands.Keys | Should -Contain "Get-Date" + $coreModule.ExportedCommands.Keys | Should -Not -Contain "ConvertFrom-String" + + $proxyModule | Remove-Module -Force + } + + It "NoClobber WinCompat import works for an engine module through -UseWindowsPowerShell parameter" { + + Import-Module Microsoft.PowerShell.Management -UseWindowsPowerShell + + $modules = Get-Module -Name Microsoft.PowerShell.Management + $modules.Count | Should -Be 2 + $proxyModule = $modules | Where-Object {$_.ModuleType -eq 'Script'} + $coreModule = $modules | Where-Object {$_.ModuleType -eq 'Manifest'} + + $proxyModule.ExportedCommands.Keys | Should -Contain "Get-WmiObject" + $proxyModule.ExportedCommands.Keys | Should -Not -Contain "Get-Item" + + $coreModule.ExportedCommands.Keys | Should -Contain "Get-Item" + $coreModule.ExportedCommands.Keys | Should -Not -Contain "Get-WmiObject" + + $proxyModule | Remove-Module -Force + } + + It "NoClobber WinCompat import works with ModuleSpecifications" { + + Import-Module -UseWindowsPowerShell -FullyQualifiedName @{ModuleName='Microsoft.PowerShell.Utility';ModuleVersion='0.0'} + + $modules = Get-Module -Name Microsoft.PowerShell.Utility + $modules.Count | Should -Be 2 + $proxyModule = $modules | Where-Object {$_.ModuleType -eq 'Script'} + $coreModule = $modules | Where-Object {$_.ModuleType -eq 'Manifest'} + + $proxyModule.ExportedCommands.Keys | Should -Contain "ConvertFrom-String" + $proxyModule.ExportedCommands.Keys | Should -Not -Contain "Get-Date" + + $coreModule.ExportedCommands.Keys | Should -Contain "Get-Date" + $coreModule.ExportedCommands.Keys | Should -Not -Contain "ConvertFrom-String" + + $proxyModule | Remove-Module -Force + } + + It "NoClobber WinCompat list in powershell.config is missing " { + '{"Microsoft.PowerShell:ExecutionPolicy": "RemoteSigned"}' | Out-File -Force $ConfigPath + & $pwsh -NoProfile -NonInteractive -settingsFile $ConfigPath -c "[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('TestWindowsPowerShellPSHomeLocation', `'$basePath`');Import-Module $ModuleName2 -WarningAction Ignore;Test-${ModuleName2}PSEdition" | Should -Be 'Desktop' + } + + It "NoClobber WinCompat list in powershell.config is empty " { + '{"Microsoft.PowerShell:ExecutionPolicy": "RemoteSigned", "WindowsPowerShellCompatibilityNoClobberModuleList": []}' | Out-File -Force $ConfigPath + & $pwsh -NoProfile -NonInteractive -settingsFile $ConfigPath -c "[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('TestWindowsPowerShellPSHomeLocation', `'$basePath`');Import-Module $ModuleName2 -WarningAction Ignore;Test-${ModuleName2}PSEdition" | Should -Be 'Desktop' + } + + It "NoClobber WinCompat list in powershell.config is working " { + $targetModuleFolder = Join-Path $TestDrive "TempWinCompatModuleFolder" + Copy-Item -Path "$basePath\$ModuleName2" -Destination "$targetModuleFolder\$ModuleName2" -Recurse -Force + $env:PSModulePath = $targetModuleFolder + [System.IO.Path]::PathSeparator + $env:PSModulePath + + $psm1 = Get-ChildItem -Recurse -Path $targetModuleFolder -Filter "$ModuleName2.psm1" + "function Test-$ModuleName2 { `$PSVersionTable.PSEdition }" | Out-File -FilePath $psm1.FullName -Force + + # Now Core version of the module has 1 function: Test-$ModuleName2 (returns 'Core') + # and WinPS version of the module has 2 functions: Test-$ModuleName2 (returns '$true'), Test-${ModuleName2}PSEdition (returns 'Desktop') + # when NoClobber WinCompat import is working Test-$ModuleName2 should return 'Core' + + '{"Microsoft.PowerShell:ExecutionPolicy": "RemoteSigned", "WindowsPowerShellCompatibilityNoClobberModuleList": ["' + $ModuleName2 + '"]}' | Out-File -Force $ConfigPath + & $pwsh -NoProfile -NonInteractive -settingsFile $ConfigPath -c "[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('TestWindowsPowerShellPSHomeLocation', `'$basePath`');Test-${ModuleName2}PSEdition;Test-$ModuleName2" | Should -Be @('Desktop','Core') + } + } + Context "Tests around PSModulePath in WinCompat process" { BeforeAll { $pwsh = "$PSHOME/pwsh" From 5f210c7eebd97b7aecab0a9fb057b3c1dd700b89 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2020 08:05:52 +0500 Subject: [PATCH 124/275] Bump PowerShellGet from 2.2.3 to 2.2.4 in /src/Modules (#12342) Bumps [PowerShellGet](https://github.com/PowerShell/PowerShellGet) from 2.2.3 to 2.2.4. - [Release notes](https://github.com/PowerShell/PowerShellGet/releases) - [Commits](https://github.com/PowerShell/PowerShellGet/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- src/Modules/PSGalleryModules.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index dec3d691eb4..734779705da 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -3,7 +3,7 @@ - + From 6d44fa99776a8ffdd0125b148ae79794674464db Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 17 Apr 2020 14:22:23 -0700 Subject: [PATCH 125/275] Bump to .NET 5 Preview 3 pre-release (#12353) --- DotnetRuntimeMetadata.json | 4 ++-- assets/files.wxs | 24 ++++++++++++------- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 +++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 ++++++++-------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 13 files changed, 44 insertions(+), 36 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index fd4e75359d3..6155e5f1ff2 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,6 +1,6 @@ { "sdk": { - "channel": "release", - "packageVersionPattern": "5.0.0-preview.2" + "channel": "release/5.0.1xx-preview3", + "packageVersionPattern": "5.0.0-preview.3" } } diff --git a/assets/files.wxs b/assets/files.wxs index 4a8bb67b80e..06a86358d51 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1634,6 +1634,9 @@ + + + @@ -2939,9 +2942,6 @@ - - - @@ -3092,12 +3092,18 @@ - - - + + + + + + + + + @@ -4017,7 +4023,6 @@ - @@ -4094,8 +4099,11 @@ - + + + + diff --git a/global.json b/global.json index ee1e3d9321f..5ef419488f8 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.2.20176.6" + "version": "5.0.100-preview.3.20216.6" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 503b7c7c984..ccdba31f35e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index ad2ea2a2b51..a52b681ed74 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index c2d8cfbd0ad..929e2ef94f6 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index d4ad1f36292..88acf919e89 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 46fc389e1a4..cdff83715dc 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 64cca263c93..cca3614ec03 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index c51c24fb5e1..d25bdc0ce09 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 63c36611f72..2b5fee9cec3 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index fa6a947bc1e..fd23aaf9252 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 542f33a7477..71c6bb88ca6 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 264bcb3fda0ba5f78e7b7bde790240ed0017a9df Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 18 Apr 2020 05:19:13 +0500 Subject: [PATCH 126/275] Update `UseNewEnvironment` parameter behavior of `Start-Process` cmdlet on Windows (#10830) --- .../commands/management/Process.cs | 85 ++++++++++++++----- .../Start-Process.Tests.ps1 | 60 +++++++++---- 2 files changed, 108 insertions(+), 37 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 576e7cb38b9..2ba50c23459 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -2348,22 +2348,8 @@ private static byte[] ConvertEnvVarsToByteArray(StringDictionary sd) return bytes; } - /// - /// This method will be used on all windows platforms, both full desktop and headless SKUs. - /// - private Process StartWithCreateProcess(ProcessStartInfo startinfo) + private void SetStartupInfo(ProcessStartInfo startinfo, ref ProcessNativeMethods.STARTUPINFO lpStartupInfo, ref int creationFlags) { - ProcessNativeMethods.STARTUPINFO lpStartupInfo = new ProcessNativeMethods.STARTUPINFO(); - SafeNativeMethods.PROCESS_INFORMATION lpProcessInformation = new SafeNativeMethods.PROCESS_INFORMATION(); - int error = 0; - GCHandle pinnedEnvironmentBlock = new GCHandle(); - string message = string.Empty; - - // building the cmdline with the file name given and it's arguments - StringBuilder cmdLine = BuildCommandLine(startinfo.FileName, startinfo.Arguments); - - try - { // RedirectionStandardInput if (_redirectstandardinput != null) { @@ -2375,6 +2361,7 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) { lpStartupInfo.hStdInput = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-10), false); } + // RedirectionStandardOutput if (_redirectstandardoutput != null) { @@ -2386,6 +2373,7 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) { lpStartupInfo.hStdOutput = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-11), false); } + // RedirectionStandardError if (_redirectstandarderror != null) { @@ -2397,11 +2385,10 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) { lpStartupInfo.hStdError = new SafeFileHandle(ProcessNativeMethods.GetStdHandle(-12), false); } + // STARTF_USESTDHANDLES lpStartupInfo.dwFlags = 0x100; - int creationFlags = 0; - if (startinfo.CreateNoWindow) { // No new window: Inherit the parent process's console window @@ -2411,6 +2398,7 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) { // CREATE_NEW_CONSOLE creationFlags |= 0x00000010; + // STARTF_USESHOWWINDOW lpStartupInfo.dwFlags |= 0x00000001; @@ -2438,15 +2426,41 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) // Create the new process suspended so we have a chance to get a corresponding Process object in case it terminates quickly. creationFlags |= 0x00000004; + } - IntPtr AddressOfEnvironmentBlock = IntPtr.Zero; - var environmentVars = startinfo.EnvironmentVariables; - if (environmentVars != null) + /// + /// This method will be used on all windows platforms, both full desktop and headless SKUs. + /// + private Process StartWithCreateProcess(ProcessStartInfo startinfo) + { + ProcessNativeMethods.STARTUPINFO lpStartupInfo = new ProcessNativeMethods.STARTUPINFO(); + SafeNativeMethods.PROCESS_INFORMATION lpProcessInformation = new SafeNativeMethods.PROCESS_INFORMATION(); + int error = 0; + GCHandle pinnedEnvironmentBlock = new GCHandle(); + IntPtr AddressOfEnvironmentBlock = IntPtr.Zero; + string message = string.Empty; + + // building the cmdline with the file name given and it's arguments + StringBuilder cmdLine = BuildCommandLine(startinfo.FileName, startinfo.Arguments); + + try + { + int creationFlags = 0; + + SetStartupInfo(startinfo, ref lpStartupInfo, ref creationFlags); + + // We follow the logic: + // - Ignore `UseNewEnvironment` when we run a process as another user. + // Setting initial environment variables makes sense only for current user. + // - Set environment variables if they present in ProcessStartupInfo. + if (!UseNewEnvironment) { - if (this.UseNewEnvironment) + var environmentVars = startinfo.EnvironmentVariables; + if (environmentVars != null) { // All Windows Operating Systems that we support are Windows NT systems, so we use Unicode for environment. creationFlags |= 0x400; + pinnedEnvironmentBlock = GCHandle.Alloc(ConvertEnvVarsToByteArray(environmentVars), GCHandleType.Pinned); AddressOfEnvironmentBlock = pinnedEnvironmentBlock.AddrOfPinnedObject(); } @@ -2456,6 +2470,7 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) if (_credential != null) { + // Run process as another user. ProcessNativeMethods.LogonFlags logonFlags = 0; if (startinfo.LoadUserProfile) { @@ -2504,6 +2519,22 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) } } + // Run process as current user. + if (UseNewEnvironment) + { + // All Windows Operating Systems that we support are Windows NT systems, so we use Unicode for environment. + creationFlags |= 0x400; + + IntPtr token = WindowsIdentity.GetCurrent().Token; + if (!ProcessNativeMethods.CreateEnvironmentBlock(out AddressOfEnvironmentBlock, token, false)) + { + Win32Exception win32ex = new Win32Exception(error); + message = StringUtil.Format(ProcessResources.InvalidStartProcess, win32ex.Message); + var errorRecord = new ErrorRecord(new InvalidOperationException(message), "InvalidOperationException", ErrorCategory.InvalidOperation, null); + ThrowTerminatingError(errorRecord); + } + } + ProcessNativeMethods.SECURITY_ATTRIBUTES lpProcessAttributes = new ProcessNativeMethods.SECURITY_ATTRIBUTES(); ProcessNativeMethods.SECURITY_ATTRIBUTES lpThreadAttributes = new ProcessNativeMethods.SECURITY_ATTRIBUTES(); flag = ProcessNativeMethods.CreateProcess(null, cmdLine, lpProcessAttributes, lpThreadAttributes, true, creationFlags, AddressOfEnvironmentBlock, startinfo.WorkingDirectory, lpStartupInfo, lpProcessInformation); @@ -2531,6 +2562,10 @@ private Process StartWithCreateProcess(ProcessStartInfo startinfo) { pinnedEnvironmentBlock.Free(); } + else + { + ProcessNativeMethods.DestroyEnvironmentBlock(AddressOfEnvironmentBlock); + } lpStartupInfo.Dispose(); lpProcessInformation.Dispose(); @@ -2720,6 +2755,14 @@ public static extern FileNakedHandle CreateFileW( System.IntPtr hTemplateFile ); + [DllImport("userenv.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool CreateEnvironmentBlock(out IntPtr lpEnvironment, IntPtr hToken, bool bInherit); + + [DllImport("userenv.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DestroyEnvironmentBlock(IntPtr lpEnvironment); + [Flags] internal enum LogonFlags { 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 0669e78426a..c557df36608 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 @@ -1,5 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. + Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { BeforeAll { @@ -19,7 +20,7 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { $pingParam = "-n 2 localhost" } elseif ($IsLinux -Or $IsMacOS) { - $pingParam = "-c 2 localhost" + $pingParam = "-c 2 localhost" } } @@ -27,7 +28,7 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { # This has been fixed on Linux, but not on macOS It "Should process arguments without error" { - $process = Start-Process ping -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process ping -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs $process.Length | Should -Be 1 $process.Id | Should -BeGreaterThan 1 @@ -35,7 +36,7 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { } It "Should work correctly when used with full path name" { - $process = Start-Process $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs $process.Length | Should -Be 1 $process.Id | Should -BeGreaterThan 1 @@ -43,7 +44,7 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { } It "Should invoke correct path when used with FilePath argument" { - $process = Start-Process -FilePath $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process -FilePath $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs $process.Length | Should -Be 1 $process.Id | Should -BeGreaterThan 1 @@ -51,18 +52,18 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { } It "Should invoke correct path when used with Path alias argument" { - $process = Start-Process -Path $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process -Path $pingCommand -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs - $process.Length | Should -Be 1 - $process.Id | Should -BeGreaterThan 1 + $process.Length | Should -Be 1 + $process.Id | Should -BeGreaterThan 1 } It "Should wait for command completion if used with Wait argument" { - $process = Start-Process ping -ArgumentList $pingParam -Wait -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process ping -ArgumentList $pingParam -Wait -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs } It "Should work correctly with WorkingDirectory argument" { - $process = Start-Process ping -WorkingDirectory $pingDirectory -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process ping -WorkingDirectory $pingDirectory -ArgumentList $pingParam -PassThru -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs $process.Length | Should -Be 1 $process.Id | Should -BeGreaterThan 1 @@ -70,7 +71,7 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { } It "Should handle stderr redirection without error" { - $process = Start-Process ping -ArgumentList $pingParam -PassThru -RedirectStandardError $tempFile -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs + $process = Start-Process ping -ArgumentList $pingParam -PassThru -RedirectStandardError $tempFile -RedirectStandardOutput "$TESTDRIVE/output" @extraArgs $process.Length | Should -Be 1 $process.Id | Should -BeGreaterThan 1 @@ -78,16 +79,16 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { } It "Should handle stdout redirection without error" { - $process = Start-Process ping -ArgumentList $pingParam -Wait -RedirectStandardOutput $tempFile @extraArgs - $dirEntry = get-childitem $tempFile - $dirEntry.Length | Should -BeGreaterThan 0 + $process = Start-Process ping -ArgumentList $pingParam -Wait -RedirectStandardOutput $tempFile @extraArgs + $dirEntry = get-childitem $tempFile + $dirEntry.Length | Should -BeGreaterThan 0 } # Marking this test 'pending' to unblock daily builds. Filed issue : https://github.com/PowerShell/PowerShell/issues/2396 It "Should handle stdin redirection without error" -Pending { - $process = Start-Process sort -Wait -RedirectStandardOutput $tempFile -RedirectStandardInput $assetsFile @extraArgs - $dirEntry = get-childitem $tempFile - $dirEntry.Length | Should -BeGreaterThan 0 + $process = Start-Process sort -Wait -RedirectStandardOutput $tempFile -RedirectStandardInput $assetsFile @extraArgs + $dirEntry = get-childitem $tempFile + $dirEntry.Length | Should -BeGreaterThan 0 } ## -Verb is supported in PowerShell on Windows full desktop. @@ -169,3 +170,30 @@ Describe "Start-Process tests requiring admin" -Tags "Feature","RequireAdminOnWi Get-Content $testdrive\foo.txt | Should -BeExactly $fooFile } } + +Describe "Start-Process" -Tags "Feature" { + + It "UseNewEnvironment parameter should reset environment variables for child process" { + + $PWSH = (Get-Process -Id $PID).MainModule.FileName + $outputFile = Join-Path -Path $TestDrive -ChildPath output.txt + + $env:TestEnvVariable | Should -BeNullOrEmpty + + $env:TestEnvVariable = 1 + $userName = $env:USERNAME + + try { + Start-Process $PWSH -ArgumentList '-NoProfile','-Command Write-Output \"$($env:TestEnvVariable);$($env:USERNAME)\"' -RedirectStandardOutput $outputFile -Wait + Get-Content -LiteralPath $outputFile | Should -BeExactly "1;$userName" + + # Check that: + # 1. Environment variables is resetted (TestEnvVariable is removed) + # 2. Environment variables comes from current user profile + Start-Process $PWSH -ArgumentList '-NoProfile','-Command Write-Output \"$($env:TestEnvVariable);$($env:USERNAME)\"' -RedirectStandardOutput $outputFile -Wait -UseNewEnvironment + Get-Content -LiteralPath $outputFile | Should -BeExactly ";$userName" + } finally { + $env:TestEnvVariable = $null + } + } +} From 022c14917f266818ca5d1e9c08955d85a0b70a87 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2020 11:00:38 +0500 Subject: [PATCH 127/275] Bump Markdig.Signed from 0.18.3 to 0.20.0 (#12379) Bumps [Markdig.Signed](https://github.com/lunet-io/markdig) from 0.18.3 to 0.20.0. - [Release notes](https://github.com/lunet-io/markdig/releases) - [Changelog](https://github.com/lunet-io/markdig/blob/master/changelog.md) - [Commits](https://github.com/lunet-io/markdig/compare/0.18.3...0.20.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.MarkdownRender.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj b/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj index 18825047bd6..6cc2b02c660 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj +++ b/src/Microsoft.PowerShell.MarkdownRender/Microsoft.PowerShell.MarkdownRender.csproj @@ -9,7 +9,7 @@ - + From c41c39be2a172440f8efd57baa0c9a596df76326 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2020 21:39:21 -0700 Subject: [PATCH 128/275] Bump System.IO.Packaging (#12365) --- src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 88acf919e89..a8018e8bda5 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,7 +18,7 @@ - + From 4989167fbf08009e5760c05f0172e3d1eac29118 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 20 Apr 2020 13:57:39 -0700 Subject: [PATCH 129/275] Add the `nuget.config` from root to the temporary build folder (#12394) --- tools/packaging/packaging.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e6650eb810c..6136442d48f 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2224,6 +2224,7 @@ function New-ReferenceAssembly $sourceProjectRoot = Join-Path $PSScriptRoot "projects/reference/$assemblyName" $sourceProjectFile = Join-Path $sourceProjectRoot "$assemblyName.csproj" Copy-Item -Path $sourceProjectFile -Destination "$projectFolder/$assemblyName.csproj" -Force + Copy-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath "../../nuget.config") -Destination $projectFolder Write-Host "##vso[artifact.upload containerfolder=artifact;artifactname=artifact]$projectFolder/$assemblyName.csproj" Write-Host "##vso[artifact.upload containerfolder=artifact;artifactname=artifact]$generatedSource" From ba53621894a030c2f5dfce0db81fa1e09408fd2f Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Mon, 20 Apr 2020 19:51:40 -0400 Subject: [PATCH 130/275] Allow shorter signed hex literals with appropriate type suffixes (#11844) --- .../engine/parser/tokenizer.cs | 59 ++++++++++++++----- .../Language/Parser/Parser.Tests.ps1 | 9 ++- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index e5e6467c388..64cd02d4185 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -1460,17 +1460,28 @@ private char Backtick(char c, out char surrogateCharacter) switch (c) { - case '0': return '\0'; - case 'a': return '\a'; - case 'b': return '\b'; - case 'e': return '\u001b'; - case 'f': return '\f'; - case 'n': return '\n'; - case 'r': return '\r'; - case 't': return '\t'; - case 'u': return ScanUnicodeEscape(out surrogateCharacter); - case 'v': return '\v'; - default: return c; + case '0': + return '\0'; + case 'a': + return '\a'; + case 'b': + return '\b'; + case 'e': + return '\u001b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'u': + return ScanUnicodeEscape(out surrogateCharacter); + case 'v': + return '\v'; + default: + return c; } } @@ -3557,8 +3568,9 @@ private static bool TryGetNumberValue( { try { - NumberStyles style = NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | - NumberStyles.AllowExponent; + NumberStyles style = NumberStyles.AllowLeadingSign + | NumberStyles.AllowDecimalPoint + | NumberStyles.AllowExponent; if (real) { @@ -3685,9 +3697,21 @@ private static bool TryGetNumberValue( } // If we're expecting a sign bit, remove the leading 0 added in ScanNumberHelper - if (!suffix.HasFlag(NumberSuffixFlags.Unsigned) && ((strNum.Length - 1) & 7) == 0) + if (!suffix.HasFlag(NumberSuffixFlags.Unsigned)) { - strNum = strNum.Slice(1); + var expectedLength = suffix switch + { + NumberSuffixFlags.SignedByte => 2, + NumberSuffixFlags.Short => 4, + NumberSuffixFlags.Long => 16, + // No suffix flag can mean int or long depending on input string length + _ => strNum.Length < 16 ? 8 : 16 + }; + + if (strNum.Length == expectedLength + 1) + { + strNum = strNum.Slice(1); + } } style = NumberStyles.AllowHexSpecifier; @@ -4988,7 +5012,10 @@ internal Token NextToken() _currentIndex = _tokenStart; c = GetChar(); - if (strNum == null) { return ScanGenericToken(c); } + if (strNum == null) + { + return ScanGenericToken(c); + } } return NewToken(TokenKind.Exclaim); diff --git a/test/powershell/Language/Parser/Parser.Tests.ps1 b/test/powershell/Language/Parser/Parser.Tests.ps1 index fd4d4a814e0..61df4e5b50c 100644 --- a/test/powershell/Language/Parser/Parser.Tests.ps1 +++ b/test/powershell/Language/Parser/Parser.Tests.ps1 @@ -703,7 +703,7 @@ foo``u{2195}abc if ( $IsLinux -or $IsMacOS ) { # because we execute on *nix based on executable bit, and the file name doesn't matter # so we can use the same filename as for windows, just make sure it's executable with chmod - "#!/bin/sh`necho ""Hello World""" | out-file -encoding ASCII $shellfile + "#!/bin/sh`necho ""Hello World""" | Out-File -encoding ASCII $shellfile /bin/chmod +x $shellfile } else { @@ -931,6 +931,7 @@ foo``u{2195}abc @{ Script = "0x0y"; ExpectedValue = "0"; ExpectedType = [sbyte] } @{ Script = "0x41y"; ExpectedValue = "65"; ExpectedType = [sbyte] } @{ Script = "-0x41y"; ExpectedValue = "-65"; ExpectedType = [sbyte] } + @{ Script = "0xFFy"; ExpectedValue = "-1"; ExpectedType = [sbyte] } #Binary @{ Script = "0b0y"; ExpectedValue = "0"; ExpectedType = [sbyte] } @{ Script = "0b10y"; ExpectedValue = "2"; ExpectedType = [sbyte] } @@ -957,6 +958,7 @@ foo``u{2195}abc @{ Script = "0x0s"; ExpectedValue = "0"; ExpectedType = [short] } @{ Script = "0x41s"; ExpectedValue = "65"; ExpectedType = [short] } @{ Script = "-0x41s"; ExpectedValue = "-65"; ExpectedType = [short] } + @{ Script = "0xFFFFs"; ExpectedValue = "-1"; ExpectedType = [short] } #Binary @{ Script = "0b0s"; ExpectedValue = "0"; ExpectedType = [short] } @{ Script = "0b10s"; ExpectedValue = "2"; ExpectedType = [short] } @@ -985,6 +987,7 @@ foo``u{2195}abc @{ Script = "0x0l"; ExpectedValue = "0"; ExpectedType = [long] } @{ Script = "0x41l"; ExpectedValue = "65"; ExpectedType = [long] } @{ Script = "-0x41l"; ExpectedValue = "-65"; ExpectedType = [long] } + @{ Script = "0xFFFFFFFFFFFFFFFFl"; ExpectedValue = "-1"; ExpectedType = [long] } #Binary @{ Script = "0b0l"; ExpectedValue = "0"; ExpectedType = [long] } @{ Script = "0b10l"; ExpectedValue = "2"; ExpectedType = [long] } @@ -1078,6 +1081,7 @@ foo``u{2195}abc #Hexadecimal @{ Script = "0x0uy"; ExpectedValue = "0"; ExpectedType = [byte] } @{ Script = "0x41uy"; ExpectedValue = "65"; ExpectedType = [byte] } + @{ Script = "0xFFuy"; ExpectedValue = [byte]::MaxValue; ExpectedType = [byte] } #Binary @{ Script = "0b0uy"; ExpectedValue = "0"; ExpectedType = [byte] } @{ Script = "0b10uy"; ExpectedValue = "2"; ExpectedType = [byte] } @@ -1098,6 +1102,8 @@ foo``u{2195}abc #Hexadecimal @{ Script = "0x0us"; ExpectedValue = "0"; ExpectedType = [ushort] } @{ Script = "0x41us"; ExpectedValue = "65"; ExpectedType = [ushort] } + @{ Script = "0x41us"; ExpectedValue = "65"; ExpectedType = [ushort] } + @{ Script = "0xFFFFus"; ExpectedValue = [ushort]::MaxValue; ExpectedType = [ushort] } #Binary @{ Script = "0b0us"; ExpectedValue = "0"; ExpectedType = [ushort] } @{ Script = "0b10us"; ExpectedValue = "2"; ExpectedType = [ushort] } @@ -1119,6 +1125,7 @@ foo``u{2195}abc #Hexadecimal @{ Script = "0x0ul"; ExpectedValue = "0"; ExpectedType = [ulong] } @{ Script = "0x41ul"; ExpectedValue = "65"; ExpectedType = [ulong] } + @{ Script = "0xFFFFFFFFFFFFFFFFul"; ExpectedValue = [ulong]::MaxValue; ExpectedType = [ulong] } #Binary @{ Script = "0b0ul"; ExpectedValue = "0"; ExpectedType = [ulong] } @{ Script = "0b10ul"; ExpectedValue = "2"; ExpectedType = [ulong] } From b408594d5549035bd8f1010fd4e6a16bcd967569 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 21 Apr 2020 09:44:15 -0700 Subject: [PATCH 131/275] Update .NET dependency update script to include test `csproj` files (#12372) --- tools/UpdateDotnetRuntime.ps1 | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 index 7d3f329c42e..eeabfb5efb9 100644 --- a/tools/UpdateDotnetRuntime.ps1 +++ b/tools/UpdateDotnetRuntime.ps1 @@ -45,16 +45,27 @@ function Update-PackageVersion { "Microsoft.NETCore.Windows.ApiSets" ) - $packages = [System.Collections.Generic.Dictionary[[string], [PkgVer]]]::new() + $packages = [System.Collections.Generic.Dictionary[[string], [PkgVer[]] ]]::new() - Get-ChildItem -Path "$PSScriptRoot/../src/" -Recurse -Filter "*.csproj" -Exclude 'PSGalleryModules.csproj' | ForEach-Object { + $paths = @( + "$PSScriptRoot/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj" + "$PSScriptRoot/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj" + "$PSScriptRoot/../src/" + "$PSScriptRoot/../test/tools/" + ) + + Get-ChildItem -Path $paths -Recurse -Filter "*.csproj" -Exclude 'PSGalleryModules.csproj','PSGalleryTestModules.csproj' | ForEach-Object { + Write-Verbose -Message "Reading - $($_.FullName)" -Verbose $prj = [xml] (Get-Content $_.FullName -Raw) $pkgRef = $prj.Project.ItemGroup.PackageReference foreach ($p in $pkgRef) { if ($null -ne $p -and -not $skipModules.Contains($p.Include)) { if (-not $packages.ContainsKey($p.Include)) { - $packages.Add($p.Include, [PkgVer]::new($p.Include, $p.Version, $null, $_.FullName)) + $packages.Add($p.Include, @([PkgVer]::new($p.Include, $p.Version, $null, $_.FullName))) + } + else { + $packages[$p.Include] += [PkgVer]::new($p.Include, $p.Version, $null, $_.FullName) } } } @@ -65,19 +76,22 @@ function Update-PackageVersion { $packages.GetEnumerator() | ForEach-Object { $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPreReleaseVersions -Source 'dotnet5' - $version = $_.Value.Version + foreach ($v in $_.Value) { + $version = $v.Version - foreach ($p in $pkgs) { - if ($p.Version -like "$versionPattern*") { - if ([System.Management.Automation.SemanticVersion] ($version) -lt [System.Management.Automation.SemanticVersion] ($p.Version)) { - $_.Value.NewVersion = $p.Version - break + foreach ($p in $pkgs) { + if ($p.Version -like "$versionPattern*") { + if ([System.Management.Automation.SemanticVersion] ($version) -lt [System.Management.Automation.SemanticVersion] ($p.Version)) { + $v.NewVersion = $p.Version + break + } } } } } - $pkgsByPath = $packages.Values | Group-Object -Property Path + # we need a ForEach-Object below to unravel each of the items in 'Values' which is an array of PkgVer + $pkgsByPath = $packages.Values | ForEach-Object { $_ } | Group-Object -Property Path $pkgsByPath | ForEach-Object { Update-CsprojFile -Path $_.Name -Values $_.Group From 947bddfe0474429672745b939d0ec511392e5879 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 22 Apr 2020 10:49:31 -0700 Subject: [PATCH 132/275] Add summary to compressed sections (#12429) --- tools/releaseTools.psm1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index 9d0f4876769..b31cfaaf2c2 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -12,6 +12,7 @@ class CommitNode { [string] $Body [string] $PullRequest [string] $ChangeLogMessage + [string] $ThankYouMessage [bool] $IsBreakingChange CommitNode($hash, $parents, $name, $email, $subject, $body) { @@ -266,6 +267,7 @@ function Get-ChangeLog } } $commit.ChangeLogMessage = ("- {0} (Thanks @{1}!)" -f (Get-ChangeLogMessage $commit.Subject), $commit.AuthorGitHubLogin) + $commit.ThankYouMessage = ("@{0}" -f ($commit.AuthorGitHubLogin)) } if ($commit.IsBreakingChange) { @@ -358,8 +360,13 @@ function PrintChangeLog($clSection, $sectionTitle, [switch] $Compress) { if ($Compress) { $items = $clSection.ChangeLogMessage -join "`n" + $thankYou = "We thank the following contributors!`n`n" + $thankYou += ($clSection.ThankYouMessage | Where-Object { if($_) { return $true} return $false}) -join ", " "
`n" + "`n" + $thankYou | ConvertFrom-Markdown | Select-Object -ExpandProperty Html + "`n" $items | ConvertFrom-Markdown | Select-Object -ExpandProperty Html "
" } From 5cd89a407d23c1376a3e6afdeafe60caa1f326d9 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 23 Apr 2020 00:13:48 +0500 Subject: [PATCH 133/275] Turn on `ReadyToRun` (#12361) Co-authored-by: Travis Plunk --- PowerShell.Common.props | 1 + build.psm1 | 25 ++----------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 9d27847530c..ddf96a5b71e 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -97,6 +97,7 @@ netcoreapp5.0 8.0 + true true true diff --git a/build.psm1 b/build.psm1 index 761d423ddcd..afba567d227 100644 --- a/build.psm1 +++ b/build.psm1 @@ -2233,6 +2233,7 @@ function Start-CrossGen { $CrossgenPath ) + $platformAssembliesPath = Split-Path $AssemblyPath -Parent $crossgenFolder = Split-Path $CrossgenPath @@ -2361,29 +2362,7 @@ function Start-CrossGen { "Microsoft.ApplicationInsights.dll" ) - # Common PowerShell libraries to crossgen - $psCoreAssemblyList = @( - "pwsh.dll", - "Microsoft.PowerShell.Commands.Utility.dll", - "Microsoft.PowerShell.Commands.Management.dll", - "Microsoft.PowerShell.Security.dll", - "Microsoft.PowerShell.ConsoleHost.dll", - "System.Management.Automation.dll" - ) - - # Add Windows specific libraries - if ($environment.IsWindows) { - $psCoreAssemblyList += @( - "Microsoft.PowerShell.CoreCLR.Eventing.dll", - "Microsoft.WSMan.Management.dll", - "Microsoft.WSMan.Runtime.dll", - "Microsoft.PowerShell.Commands.Diagnostics.dll", - "Microsoft.PowerShell.GraphicalHost.dll", - "Microsoft.Management.Infrastructure.CimCmdlets.dll" - ) - } - - $fullAssemblyList = $commonAssembliesForAddType + $psCoreAssemblyList + $fullAssemblyList = $commonAssembliesForAddType foreach ($assemblyName in $fullAssemblyList) { $assemblyPath = Join-Path $PublishPath $assemblyName From 38cff0b07dcb711bc1ea79887af6aa25d5c33c5f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 23 Apr 2020 11:47:14 -0700 Subject: [PATCH 134/275] Update `README.md` and `metadata.json` for upcoming release (#12441) --- README.md | 34 +++++++++++++++++----------------- tools/metadata.json | 4 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 97a5c8b44c8..d2d989f09d9 100644 --- a/README.md +++ b/README.md @@ -87,23 +87,23 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x86.msi -[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.ubuntu.18.04_amd64.deb -[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.ubuntu.16.04_amd64.deb -[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.debian.9_amd64.deb -[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview_7.1.0-preview.1-1.debian.10_amd64.deb -[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview-7.1.0_preview.1-1.rhel.7.x86_64.rpm -[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-preview-7.1.0_preview.1-1.centos.8.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-osx-x64.pkg -[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-arm32.zip -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/PowerShell-7.1.0-preview.1-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-osx-x64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.1/powershell-7.1.0-preview.1-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x86.msi +[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.ubuntu.18.04_amd64.deb +[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.ubuntu.16.04_amd64.deb +[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.debian.9_amd64.deb +[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.debian.10_amd64.deb +[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview-7.1.0_preview.2-1.rhel.7.x86_64.rpm +[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview-7.1.0_preview.2-1.centos.8.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-osx-x64.pkg +[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-arm32.zip +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-osx-x64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7 diff --git a/tools/metadata.json b/tools/metadata.json index 11756d05e2b..009102bbd4b 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { "StableReleaseTag": "v7.0.0", - "PreviewReleaseTag": "v7.1.0-preview.1", + "PreviewReleaseTag": "v7.1.0-preview.2", "ServicingReleaseTag": "v6.2.4", "ReleaseTag": "v7.0.0", "LTSReleaseTag" : ["v7.0.0"], - "NextReleaseTag": "v7.1.0-preview.2", + "NextReleaseTag": "v7.1.0-preview.3", "LTSRelease": false } From 53d1f0176d8445d64187396bef566cb188dad706 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 23 Apr 2020 23:01:47 -0700 Subject: [PATCH 135/275] Fix broken link for blogs in documents (#12471) --- CHANGELOG/6.0.md | 8 ++++---- README.md | 2 +- demos/WindowsPowerShellModules/README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG/6.0.md b/CHANGELOG/6.0.md index 23a486203d7..61a20553ab0 100644 --- a/CHANGELOG/6.0.md +++ b/CHANGELOG/6.0.md @@ -565,7 +565,7 @@ work is required for Microsoft to continue to sign and release packages from the PowerShell 6.0 will be exclusively built on top of CoreCLR, so we are removing a large amount of code that's built only for FullCLR. -To read more about this, check out [this blog post](https://blogs.msdn.microsoft.com/powershell/2017/07/14/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). +To read more about this, check out [this blog post](https://devblogs.microsoft.com/powershell/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). ## [6.0.0-beta.5] - 2017-08-02 @@ -623,7 +623,7 @@ To read more about this, check out [this blog post](https://blogs.msdn.microsoft PowerShell 6.0 will be exclusively built on top of CoreCLR, so we are removing a large amount of code that's built only for FullCLR. -To read more about this, check out [this blog post](https://blogs.msdn.microsoft.com/powershell/2017/07/14/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). +To read more about this, check out [this blog post](https://devblogs.microsoft.com/powershell/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). ## [6.0.0-beta.4] - 2017-07-12 @@ -767,7 +767,7 @@ For more information on this, we invite you to read [this blog post explaining P PowerShell Core has moved to using .NET Core 2.0 so that we can leverage all the benefits of .NET Standard 2.0. (#3556) To learn more about .NET Standard 2.0, there's some great starter content [on Youtube](https://www.youtube.com/playlist?list=PLRAdsfhKI4OWx321A_pr-7HhRNk7wOLLY), -on [the .NET blog](https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/), +on [the .NET blog](https://devblogs.microsoft.com/dotnet/introducing-net-standard/), and [on GitHub](https://github.com/dotnet/standard/blob/master/docs/faq.md). We'll also have more content soon in our [repository documentation](https://github.com/PowerShell/PowerShell/tree/master/docs) (which will eventually make its way to [official documentation](https://github.com/powershell/powershell-docs)). In a nutshell, .NET Standard 2.0 allows us to have universal, portable modules between Windows PowerShell (which uses the full .NET Framework) and PowerShell Core (which uses .NET Core). @@ -782,7 +782,7 @@ Many modules and cmdlets that didn't work in the past may now work on .NET Core, If you want to opt-out of this telemetry, simply delete `$PSHome\DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY`. Even before the first run of Powershell, deleting this file will bypass all telemetry. In the future, we plan on also enabling a configuration value for whatever is approved as part of [RFC0015](https://github.com/PowerShell/PowerShell-RFC/blob/master/X-Rejected/RFC0015-PowerShell-StartupConfig.md). -We also plan on exposing this telemetry data (as well as whatever insights we leverage from the telemetry) in [our community dashboard](https://blogs.msdn.microsoft.com/powershell/2017/01/31/powershell-open-source-community-dashboard/). +We also plan on exposing this telemetry data (as well as whatever insights we leverage from the telemetry) in [our community dashboard](https://devblogs.microsoft.com/powershell/powershell-open-source-community-dashboard/). If you have any questions or comments about our telemetry, please file an issue. diff --git a/README.md b/README.md index d2d989f09d9..6648f2322c0 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ To install a specific version, visit [releases](https://github.com/PowerShell/Po [Dashboard](https://aka.ms/psgithubbi) with visualizations for community contributions and project status using PowerShell, Azure, and PowerBI. -For more information on how and why we built this dashboard, check out this [blog post](https://blogs.msdn.microsoft.com/powershell/2017/01/31/powershell-open-source-community-dashboard/). +For more information on how and why we built this dashboard, check out this [blog post](https://devblogs.microsoft.com/powershell/powershell-open-source-community-dashboard/). ## Chat Room diff --git a/demos/WindowsPowerShellModules/README.md b/demos/WindowsPowerShellModules/README.md index b8e23cffb40..3cf63bd947e 100644 --- a/demos/WindowsPowerShellModules/README.md +++ b/demos/WindowsPowerShellModules/README.md @@ -3,7 +3,7 @@ ## Windows PowerShell vs PowerShell Core Existing Windows PowerShell users are familiar with the large number of modules available, however, they are not necessarily compatible with PowerShell Core. -More information regarding compatibility is in a [blog post](https://blogs.msdn.microsoft.com/powershell/2017/07/14/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). +More information regarding compatibility is in a [blog post](https://devblogs.microsoft.com/powershell/powershell-6-0-roadmap-coreclr-backwards-compatibility-and-more/). Windows PowerShell 5.1 is based on .Net Framework 4.6.1, while PowerShell Core is based on .Net Core 2.x. Although both adhere to .Net Standard 2.0 and can be compatible, some modules may be using APIs or cmdlets not supported on CoreCLR or using APIs from Windows PowerShell that have been deprecated and removed from PowerShell Core (for example, PSSnapins). From c27ae52bae82f45a45b406244c22a4285b373670 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 24 Apr 2020 10:46:42 -0700 Subject: [PATCH 136/275] Add `dependabot` rules to ignore updates from .NET (#12466) --- .dependabot/config.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.dependabot/config.yml b/.dependabot/config.yml index 69640b335c7..ea0745fd494 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -8,24 +8,52 @@ update_configs: update_schedule: "live" default_labels: - "CL-BuildPackaging" + ignored_updates: + - match: + dependency_name: "System.*" + - match: + dependency_name: "Microsoft.Win32.Registry.AccessControl" + - match: + dependency_name: "Microsoft.Windows.Compatibility" - package_manager: "dotnet:nuget" directory: "/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility" update_schedule: "live" default_labels: - "CL-BuildPackaging" + ignored_updates: + - match: + dependency_name: "System.*" + - match: + dependency_name: "Microsoft.Win32.Registry.AccessControl" + - match: + dependency_name: "Microsoft.Windows.Compatibility" - package_manager: "dotnet:nuget" directory: "/tools/packaging/projects/reference/System.Management.Automation" update_schedule: "live" default_labels: - "CL-BuildPackaging" + ignored_updates: + - match: + dependency_name: "System.*" + - match: + dependency_name: "Microsoft.Win32.Registry.AccessControl" + - match: + dependency_name: "Microsoft.Windows.Compatibility" - package_manager: "dotnet:nuget" directory: "/test/tools/Modules" update_schedule: "live" default_labels: - "CL-BuildPackaging" + ignored_updates: + - match: + dependency_name: "System.*" + - match: + dependency_name: "Microsoft.Win32.Registry.AccessControl" + - match: + dependency_name: "Microsoft.Windows.Compatibility" - package_manager: "dotnet:nuget" directory: "/src/Modules" From 16ec1cc32f9e60c9d76b074c865c32a5d2acf5a2 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 24 Apr 2020 10:47:34 -0700 Subject: [PATCH 137/275] Disable `PublishReadyToRun` for framework dependent packages (#12450) --- build.psm1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.psm1 b/build.psm1 index afba567d227..43485ca8463 100644 --- a/build.psm1 +++ b/build.psm1 @@ -391,6 +391,13 @@ Fix steps: $Arguments += "/property:IsWindows=false" } + # Framework Dependent builds do not support ReadyToRun as it needs a specific runtime to optimize for. + # The property is set in Powershell.Common.props file. + # We override the property through the build command line. + if($Options.Runtime -like 'fxdependent*') { + $Arguments += "/property:PublishReadyToRun=false" + } + $Arguments += "--configuration", $Options.Configuration $Arguments += "--framework", $Options.Framework From 1a7692fd1acdbdbd6ba6797d09e9ac361b732817 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 27 Apr 2020 20:40:09 +0500 Subject: [PATCH 138/275] Use new value for `TargetFramework` as `net5.0` instead of `netcoreapp5.0` (#12486) --- build.psm1 | 11 +++-------- src/ResGen/ResGen.csproj | 2 +- src/TypeCatalogGen/TypeCatalogGen.csproj | 2 +- test/tools/OpenCover/OpenCover.psm1 | 2 +- tools/packaging/packaging.psm1 | 10 +++++----- tools/packaging/packaging.strings.psd1 | 2 +- tools/packaging/projects/nuget/package.csproj | 2 +- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- .../Microsoft.PowerShell.ConsoleHost.csproj | 2 +- .../System.Management.Automation.csproj | 2 +- 10 files changed, 16 insertions(+), 21 deletions(-) diff --git a/build.psm1 b/build.psm1 index 43485ca8463..654f3346eaa 100644 --- a/build.psm1 +++ b/build.psm1 @@ -719,8 +719,8 @@ function New-PSOptions { [ValidateSet("Debug", "Release", "CodeCoverage", '')] [string]$Configuration, - [ValidateSet("netcoreapp5.0")] - [string]$Framework = "netcoreapp5.0", + [ValidateSet("net5.0")] + [string]$Framework = "net5.0", # These are duplicated from Start-PSBuild # We do not use ValidateScript since we want tab completion @@ -795,11 +795,6 @@ function New-PSOptions { $Top = [IO.Path]::Combine($PSScriptRoot, "src", $PowerShellDir) Write-Verbose "Top project directory is $Top" - if (-not $Framework) { - $Framework = "netcoreapp2.1" - Write-Verbose "Using framework '$Framework'" - } - $Executable = if ($Runtime -like 'fxdependent*') { "pwsh.dll" } elseif ($environment.IsLinux -or $environment.IsMacOS) { @@ -2306,7 +2301,7 @@ function Start-CrossGen { throw "crossgen is not available for this platform" } - $dotnetRuntimeVersion = $script:Options.Framework -replace 'netcoreapp' + $dotnetRuntimeVersion = $script:Options.Framework -replace 'net' # Get the CrossGen.exe for the correct runtime with the latest version $crossGenPath = Get-ChildItem $script:Environment.nugetPackagesRoot $crossGenExe -Recurse | ` diff --git a/src/ResGen/ResGen.csproj b/src/ResGen/ResGen.csproj index cbfd8ac696b..70170d7c1cb 100644 --- a/src/ResGen/ResGen.csproj +++ b/src/ResGen/ResGen.csproj @@ -2,7 +2,7 @@ Generates C# typed bindings for .resx files - netcoreapp5.0 + net5.0 resgen Exe true diff --git a/src/TypeCatalogGen/TypeCatalogGen.csproj b/src/TypeCatalogGen/TypeCatalogGen.csproj index b40cfc0dc04..1ba3029ff18 100644 --- a/src/TypeCatalogGen/TypeCatalogGen.csproj +++ b/src/TypeCatalogGen/TypeCatalogGen.csproj @@ -2,7 +2,7 @@ Generates CorePsTypeCatalog.cs given powershell.inc - netcoreapp5.0 + net5.0 TypeCatalogGen Exe true diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 7138e78853c..4d82418fd63 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -615,7 +615,7 @@ function Install-OpenCover .Description Invoke-OpenCover runs tests under OpenCover by executing tests on PowerShell located at $PowerShellExeDirectory. .EXAMPLE - Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/netcoreapp1.0/win7-x64 + Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64 #> function Invoke-OpenCover { diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 6136442d48f..052980e607a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -131,14 +131,14 @@ function Start-PSPackage { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "netcoreapp5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR } else { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $crossGenCorrect -or ## Last build didn't specify '-CrossGen' correctly -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "netcoreapp5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR } # Make sure the most recent build satisfies the package requirement @@ -1991,7 +1991,7 @@ function New-ILNugetPackage } <# - Copy the generated reference assemblies to the 'ref/netcoreapp3.0' folder properly. + Copy the generated reference assemblies to the 'ref/netcoreapp5.0' folder properly. This is a helper function used by 'New-ILNugetPackage' #> function CopyReferenceAssemblies @@ -2886,7 +2886,7 @@ function New-MSIPatch # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp3.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIPackage { @@ -3088,7 +3088,7 @@ function New-MSIPackage # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp3.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIXPackage { diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index c48b0d0efa0..8406eb7994e 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -142,7 +142,7 @@ open {0} - + diff --git a/tools/packaging/projects/nuget/package.csproj b/tools/packaging/projects/nuget/package.csproj index 3fd015db7f8..e20f5a13523 100644 --- a/tools/packaging/projects/nuget/package.csproj +++ b/tools/packaging/projects/nuget/package.csproj @@ -11,6 +11,6 @@ runtime=$(RID);version=$(SemVer);PackageName=$(PackageName) $(StagingPath) True - netcoreapp5.0 + net5.0 diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index fd23aaf9252..097724abcbd 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -1,6 +1,6 @@ - netcoreapp5.0 + net5.0 $(RefAsmVersion) true $(SnkFile) diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj index a66e15f0032..b393fe1cd2b 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj @@ -1,6 +1,6 @@ - netcoreapp5.0 + net5.0 $(RefAsmVersion) true $(SnkFile) diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 71c6bb88ca6..2a27986a7eb 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -1,6 +1,6 @@ - netcoreapp5.0 + net5.0 $(RefAsmVersion) true $(SnkFile) From f5b2a9236c1b01c8658d64fca2ad02d203eca59f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 27 Apr 2020 12:18:02 -0700 Subject: [PATCH 139/275] Mark ping tests as Pending due to stability issues in macOS (#12504) --- .../Test-Connection.Tests.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index 31e14a0ce7e..1bdbd7e69f6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -77,8 +77,8 @@ Describe "Test-Connection" -tags "CI" { $error[0].Exception.InnerException.ErrorCode | Should -Be $code } - # In VSTS, address is 0.0.0.0 - It "Force IPv4 with implicit PingOptions" { + # In VSTS, address is 0.0.0.0. Making pending due to instability in Az DevOps. + It "Force IPv4 with implicit PingOptions" -Pending:($IsMacOS) { $result = Test-Connection $hostName -Count 1 -IPv4 $result[0].Address | Should -BeExactly $realAddress @@ -249,7 +249,8 @@ Describe "Test-Connection" -tags "CI" { } Context "TraceRoute" { - It "TraceRoute works" { + # Mark it as pending due to instability in Az DevOps + It "TraceRoute works" -Pending:($IsMacOS) { # real address is an ipv4 address, so force IPv4 $result = Test-Connection $hostName -TraceRoute -IPv4 From 23b1dd46aef43fbfe126d62e80ebe27a21b7a81e Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 27 Apr 2020 14:14:57 -0700 Subject: [PATCH 140/275] Support passing PSPath to native commands (#12386) --- .../ExperimentalFeature.cs | 3 + .../engine/NativeCommandParameterBinder.cs | 240 ++++++++++++------ .../NativeCommandArguments.Tests.ps1 | 95 +++++++ 3 files changed, 264 insertions(+), 74 deletions(-) diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs index 32ffb718177..9337f48542b 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs @@ -120,6 +120,9 @@ static ExperimentalFeature() new ExperimentalFeature( name: "PSCultureInvariantReplaceOperator", description: "Use culture invariant to-string convertor for lval in replace operator"), + new ExperimentalFeature( + name: "PSNativePSPathResolution", + description: "Convert PSPath to filesystem path, if possible, for native commands"), }; EngineExperimentalFeatures = new ReadOnlyCollection(engineFeatures); diff --git a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs index d2c5d1de2ab..0091596a443 100644 --- a/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs +++ b/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs @@ -82,7 +82,7 @@ internal void BindParameters(Collection parameters) if (parameter.ParameterNameSpecified) { Diagnostics.Assert(!parameter.ParameterText.Contains(' '), "Parameters cannot have whitespace"); - PossiblyGlobArg(parameter.ParameterText, usedQuotes: false); + PossiblyGlobArg(parameter.ParameterText, StringConstantType.BareWord); if (parameter.SpaceAfterParameter) { @@ -107,23 +107,30 @@ internal void BindParameters(Collection parameters) // windbg -k com:port=\\devbox\pipe\debug,pipe,resets=0,reconnect // The parser produced an array of strings but marked the parameter so we // can properly reconstruct the correct command line. - bool usedQuotes = false; + StringConstantType stringConstantType = StringConstantType.BareWord; ArrayLiteralAst arrayLiteralAst = null; switch (parameter?.ArgumentAst) { case StringConstantExpressionAst sce: - usedQuotes = sce.StringConstantType != StringConstantType.BareWord; + stringConstantType = sce.StringConstantType; break; case ExpandableStringExpressionAst ese: - usedQuotes = ese.StringConstantType != StringConstantType.BareWord; + stringConstantType = ese.StringConstantType; break; case ArrayLiteralAst ala: arrayLiteralAst = ala; break; } - appendOneNativeArgument(Context, argValue, - arrayLiteralAst, sawVerbatimArgumentMarker, usedQuotes); + // Prior to PSNativePSPathResolution experimental feature, a single quote worked the same as a double quote + // so if the feature is not enabled, we treat any quotes as double quotes. When this feature is no longer + // experimental, this code here needs to be removed. + if (!ExperimentalFeature.IsEnabled("PSNativePSPathResolution") && stringConstantType == StringConstantType.SingleQuoted) + { + stringConstantType = StringConstantType.DoubleQuoted; + } + + AppendOneNativeArgument(Context, argValue, arrayLiteralAst, sawVerbatimArgumentMarker, stringConstantType); } } } @@ -157,14 +164,12 @@ internal string Arguments /// The object to append. /// If the argument was an array literal, the Ast, otherwise null. /// True if the argument occurs after --%. - /// True if the argument was a quoted string (single or double). - private void appendOneNativeArgument(ExecutionContext context, object obj, ArrayLiteralAst argArrayAst, bool sawVerbatimArgumentMarker, bool usedQuotes) + /// Bare, SingleQuoted, or DoubleQuoted. + private void AppendOneNativeArgument(ExecutionContext context, object obj, ArrayLiteralAst argArrayAst, bool sawVerbatimArgumentMarker, StringConstantType stringConstantType) { IEnumerator list = LanguagePrimitives.GetEnumerator(obj); - Diagnostics.Assert(argArrayAst == null - || obj is object[] && ((object[])obj).Length == argArrayAst.Elements.Count, - "array argument and ArrayLiteralAst differ in number of elements"); + Diagnostics.Assert((argArrayAst == null) || obj is object[] && ((object[])obj).Length == argArrayAst.Elements.Count, "array argument and ArrayLiteralAst differ in number of elements"); int currentElement = -1; string separator = string.Empty; @@ -218,9 +223,18 @@ private void appendOneNativeArgument(ExecutionContext context, object obj, Array if (NeedQuotes(arg)) { _arguments.Append('"'); + + if (stringConstantType == StringConstantType.DoubleQuoted) + { + _arguments.Append(ResolvePath(arg, Context)); + } + else + { + _arguments.Append(arg); + } + // need to escape all trailing backslashes so the native command receives it correctly // according to http://www.daviddeley.com/autohotkey/parameters/parameters.htm#WINCRULESDOC - _arguments.Append(arg); for (int i = arg.Length - 1; i >= 0 && arg[i] == '\\'; i--) { _arguments.Append('\\'); @@ -230,11 +244,12 @@ private void appendOneNativeArgument(ExecutionContext context, object obj, Array } else { - PossiblyGlobArg(arg, usedQuotes); + PossiblyGlobArg(arg, stringConstantType); } } } - } while (list != null); + } + while (list != null); } /// @@ -242,94 +257,168 @@ private void appendOneNativeArgument(ExecutionContext context, object obj, Array /// On Unix, do globbing as appropriate, otherwise just append . /// /// The argument that possibly needs expansion. - /// True if the argument was a quoted string (single or double). - private void PossiblyGlobArg(string arg, bool usedQuotes) + /// Bare, SingleQuoted, or DoubleQuoted. + private void PossiblyGlobArg(string arg, StringConstantType stringConstantType) { var argExpanded = false; #if UNIX // On UNIX systems, we expand arguments containing wildcard expressions against // the file system just like bash, etc. - if (!usedQuotes && WildcardPattern.ContainsWildcardCharacters(arg)) - { - // See if the current working directory is a filesystem provider location - // We won't do the expansion if it isn't since native commands can only access the file system. - var cwdinfo = Context.EngineSessionState.CurrentLocation; - // If it's a filesystem location then expand the wildcards - if (cwdinfo.Provider.Name.Equals(FileSystemProvider.ProviderName, StringComparison.OrdinalIgnoreCase)) + if (stringConstantType == StringConstantType.BareWord) + { + if (WildcardPattern.ContainsWildcardCharacters(arg)) { - // On UNIX, paths starting with ~ or absolute paths are not normalized - bool normalizePath = arg.Length == 0 || !(arg[0] == '~' || arg[0] == '/'); + // See if the current working directory is a filesystem provider location + // We won't do the expansion if it isn't since native commands can only access the file system. + var cwdinfo = Context.EngineSessionState.CurrentLocation; - // See if there are any matching paths otherwise just add the pattern as the argument - Collection paths = null; - try - { - paths = Context.EngineSessionState.InvokeProvider.ChildItem.Get(arg, false); - } - catch + // If it's a filesystem location then expand the wildcards + if (cwdinfo.Provider.Name.Equals(FileSystemProvider.ProviderName, StringComparison.OrdinalIgnoreCase)) { - // Fallthrough will append the pattern unchanged. - } + // On UNIX, paths starting with ~ or absolute paths are not normalized + bool normalizePath = arg.Length == 0 || !(arg[0] == '~' || arg[0] == '/'); - // Expand paths, but only from the file system. - if (paths?.Count > 0 && paths.All(p => p.BaseObject is FileSystemInfo)) - { - var sep = string.Empty; - foreach (var path in paths) + // See if there are any matching paths otherwise just add the pattern as the argument + Collection paths = null; + try { - _arguments.Append(sep); - sep = " "; - var expandedPath = (path.BaseObject as FileSystemInfo).FullName; - if (normalizePath) - { - expandedPath = - Context.SessionState.Path.NormalizeRelativePath(expandedPath, cwdinfo.ProviderPath); - } - // If the path contains spaces, then add quotes around it. - if (NeedQuotes(expandedPath)) - { - _arguments.Append("\""); - _arguments.Append(expandedPath); - _arguments.Append("\""); - } - else + paths = Context.EngineSessionState.InvokeProvider.ChildItem.Get(arg, false); + } + catch + { + // Fallthrough will append the pattern unchanged. + } + + // Expand paths, but only from the file system. + if (paths?.Count > 0 && paths.All(p => p.BaseObject is FileSystemInfo)) + { + var sep = string.Empty; + foreach (var path in paths) { - _arguments.Append(expandedPath); + _arguments.Append(sep); + sep = " "; + var expandedPath = (path.BaseObject as FileSystemInfo).FullName; + if (normalizePath) + { + expandedPath = + Context.SessionState.Path.NormalizeRelativePath(expandedPath, cwdinfo.ProviderPath); + } + // If the path contains spaces, then add quotes around it. + if (NeedQuotes(expandedPath)) + { + _arguments.Append("\""); + _arguments.Append(expandedPath); + _arguments.Append("\""); + } + else + { + _arguments.Append(expandedPath); + } + + argExpanded = true; } - - argExpanded = true; } } } - } - else if (!usedQuotes) - { - // Even if there are no wildcards, we still need to possibly - // expand ~ into the filesystem provider home directory path - ProviderInfo fileSystemProvider = Context.EngineSessionState.GetSingleProvider(FileSystemProvider.ProviderName); - string home = fileSystemProvider.Home; - if (string.Equals(arg, "~")) - { - _arguments.Append(home); - argExpanded = true; - } - else if (arg.StartsWith("~/", StringComparison.OrdinalIgnoreCase)) + else { - var replacementString = home + arg.Substring(1); - _arguments.Append(replacementString); - argExpanded = true; + // Even if there are no wildcards, we still need to possibly + // expand ~ into the filesystem provider home directory path + ProviderInfo fileSystemProvider = Context.EngineSessionState.GetSingleProvider(FileSystemProvider.ProviderName); + string home = fileSystemProvider.Home; + if (string.Equals(arg, "~")) + { + _arguments.Append(home); + argExpanded = true; + } + else if (arg.StartsWith("~/", StringComparison.OrdinalIgnoreCase)) + { + var replacementString = home + arg.Substring(1); + _arguments.Append(replacementString); + argExpanded = true; + } } } #endif // UNIX + if (stringConstantType != StringConstantType.SingleQuoted) + { + arg = ResolvePath(arg, Context); + } + if (!argExpanded) { _arguments.Append(arg); } } + /// + /// Check if string is prefixed by psdrive, if so, expand it if filesystem path. + /// + /// The potential PSPath to resolve. + /// The current ExecutionContext. + /// Resolved PSPath if applicable otherwise the original path + internal static string ResolvePath(string path, ExecutionContext context) + { + if (ExperimentalFeature.IsEnabled("PSNativePSPathResolution")) + { +#if !UNIX + // on Windows, we need to expand ~ to point to user's home path + if (string.Equals(path, "~", StringComparison.Ordinal) || path.StartsWith(TildeDirectorySeparator, StringComparison.Ordinal) || path.StartsWith(TildeAltDirectorySeparator, StringComparison.Ordinal)) + { + try + { + ProviderInfo fileSystemProvider = context.EngineSessionState.GetSingleProvider(FileSystemProvider.ProviderName); + return new StringBuilder(fileSystemProvider.Home) + .Append(path.Substring(1)) + .Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar) + .ToString(); + } + catch + { + return path; + } + } + + // check if the driveName is an actual disk drive on Windows, if so, no expansion + if (path.Length >= 2 && path[1] == ':') + { + foreach (var drive in DriveInfo.GetDrives()) + { + if (drive.Name.StartsWith(new string(path[0], 1), StringComparison.OrdinalIgnoreCase)) + { + return path; + } + } + } +#endif + + if (path.Contains(':')) + { + LocationGlobber globber = new LocationGlobber(context.SessionState); + try + { + ProviderInfo providerInfo; + + // replace the argument with resolved path if it's a filesystem path + string pspath = globber.GetProviderPath(path, out providerInfo); + if (string.Equals(providerInfo.Name, FileSystemProvider.ProviderName, StringComparison.OrdinalIgnoreCase)) + { + path = pspath; + } + } + catch + { + // if it's not a provider path, do nothing + } + } + } + + return path; + } + /// /// Check to see if the string contains spaces and therefore must be quoted. /// @@ -384,6 +473,9 @@ private static string GetEnumerableArgSeparator(ArrayLiteralAst arrayLiteralAst, /// The native command to bind to. ///
private NativeCommand _nativeCommand; + private static readonly string TildeDirectorySeparator = $"~{Path.DirectorySeparatorChar}"; + private static readonly string TildeAltDirectorySeparator = $"~{Path.AltDirectorySeparatorChar}"; + #endregion private members } } diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 index 693697d84de..c5b5a5f66dd 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 @@ -64,3 +64,98 @@ Describe "Native Command Arguments" -tags "CI" { } } } + +Describe 'PSPath to native commands' { + BeforeAll { + $featureEnabled = $EnabledExperimentalFeatures.Contains('PSNativePSPathResolution') + $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() + + $PSDefaultParameterValues["it:skip"] = (-not $featureEnabled) + + if ($IsWindows) { + $cmd = "cmd" + $cmdArg1 = "/c" + $cmdArg2 = "type" + $dir = "cmd" + $dirArg1 = "/c" + $dirArg2 = "dir" + } + else { + $cmd = "cat" + $dir = "ls" + } + + Set-Content -Path testdrive:/test.txt -Value 'Hello' + Set-Content -Path "testdrive:/test file.txt" -Value 'Hello' + Set-Content -Path "env:/test var" -Value 'Hello' + $filePath = Join-Path -Path ~ -ChildPath (New-Guid) + Set-Content -Path $filePath -Value 'Home' + $complexDriveName = 'My test! ;+drive' + New-PSDrive -Name $complexDriveName -Root $testdrive -PSProvider FileSystem + } + + AfterAll { + $global:PSDefaultParameterValues = $originalDefaultParameterValues + + Remove-Item -Path "env:/test var" + Remove-Item -Path $filePath + Remove-PSDrive -Name $complexDriveName + } + + It 'PSPath with ~/path works' { + $out = & $cmd $cmdArg1 $cmdArg2 $filePath + $LASTEXITCODE | Should -Be 0 + $out | Should -BeExactly 'Home' + } + + It 'PSPath with ~ works' { + $out = & $dir $dirArg1 $dirArg2 ~ + $LASTEXITCODE | Should -Be 0 + $out | Should -Not -BeNullOrEmpty + } + + It 'PSPath that is file system path works with native commands: ' -TestCases @( + @{ path = "testdrive:/test.txt" } + @{ path = "testdrive:/test file.txt" } + ){ + param($path) + + $out = & $cmd $cmdArg1 $cmdArg2 "$path" + $LASTEXITCODE | Should -Be 0 + $out | Should -BeExactly 'Hello' + } + + It 'PSPath passed with single quotes should be treated as literal' { + $out = & $cmd $cmdArg1 $cmdArg2 'testdrive:/test.txt' + $LASTEXITCODE | Should -Not -Be 0 + $out | Should -BeNullOrEmpty + } + + It 'PSPath that is not a file system path fails with native commands: ' -TestCases @( + @{ path = "env:/PSModulePath" } + @{ path = "env:/test var" } + ){ + param($path) + + $out = & $cmd $cmdArg1 $cmdArg2 "$path" + $LASTEXITCODE | Should -Not -Be 0 + $out | Should -BeNullOrEmpty + } + + It 'Relative PSPath works' { + New-Item -Path $testdrive -Name TestFolder -ItemType Directory -ErrorAction Stop + $pwd = Get-Location + Set-Content -Path (Join-Path -Path $testdrive -ChildPath 'TestFolder' -AdditionalChildPath 'test.txt') -Value 'hello' + Set-Location -Path (Join-Path -Path $testdrive -ChildPath 'TestFolder') + Set-Location -Path $pwd + $out = & $cmd $cmdArg1 $cmdArg2 "TestDrive:test.txt" + $LASTEXITCODE | Should -Be 0 + $out | Should -BeExactly 'Hello' + } + + It 'Complex PSDrive name works' { + $out = & $cmd $cmdArg1 $cmdArg2 "${complexDriveName}:/test.txt" + $LASTEXITCODE | Should -Be 0 + $out | Should -BeExactly 'Hello' + } +} From 86b6a9d5ca3d53f19afa8e88249f2a4ee790e000 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 28 Apr 2020 04:24:42 +0500 Subject: [PATCH 141/275] Set correct `PSProvider` full name (#11813) --- .../engine/DataStoreAdapterProvider.cs | 11 ++- .../engine/Modules/ImportProvider.Tests.ps1 | 68 +++++++++++++++++++ .../engine/Modules/ModuleCmdletBase.cs | 2 +- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 src/System.Management.Automation/engine/Modules/ImportProvider.Tests.ps1 diff --git a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs index 84d8a80fbcb..d341b2803dd 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs @@ -37,6 +37,7 @@ public class ProviderInfo private SessionState _sessionState; private string _fullName; + private string _cachedModuleName; /// /// Gets the name of the provider. @@ -44,7 +45,7 @@ public class ProviderInfo public string Name { get; } /// - /// Gets the full name of the provider including the pssnapin name if available. + /// Gets the full name of the provider including the module name if available. /// internal string FullName { @@ -77,7 +78,13 @@ string GetFullName(string name, string psSnapInName, string moduleName) return result; } - return _fullName ?? (_fullName = GetFullName(Name, PSSnapInName, ModuleName)); + if (_fullName != null && ModuleName.Equals(_cachedModuleName, StringComparison.Ordinal)) + { + return _fullName; + } + + _cachedModuleName = ModuleName; + return _fullName = GetFullName(Name, PSSnapInName, ModuleName); } } diff --git a/src/System.Management.Automation/engine/Modules/ImportProvider.Tests.ps1 b/src/System.Management.Automation/engine/Modules/ImportProvider.Tests.ps1 new file mode 100644 index 00000000000..993138e80be --- /dev/null +++ b/src/System.Management.Automation/engine/Modules/ImportProvider.Tests.ps1 @@ -0,0 +1,68 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +Describe "Import PowerShell provider" -Tags "CI" { + BeforeAll { + $testModulePath = Join-Path $TestDrive "ReproModule" + New-Item -Path $testModulePath -ItemType Directory > $null + + New-ModuleManifest -Path "$testModulePath/ReproModule.psd1" -RootModule 'testmodule.dll' + + $testBinaryModulePath = Join-Path $testModulePath "testmodule.dll" + $binaryModule = @' +using System; +using System.Collections.ObjectModel; +using System.Management.Automation; +using System.Management.Automation.Provider; + +namespace module { + [CmdletProvider( + "SamplePrv", + ProviderCapabilities.ShouldProcess)] + public class SampleProvider : ContainerCmdletProvider { + protected override bool IsValidPath(string path) { + return true; + } + + protected override bool ItemExists(string path) { + return path == "test.txt"; + } + + protected override void GetItem(string path) { + Item resultItem; + if (path == "test.txt") { + resultItem = new Item { Name = "test.txt" }; + } else { + throw new Exception("Item not found."); + } + + WriteItemObject(resultItem, path, false); + } + + protected override Collection InitializeDefaultDrives() { + var drive = new PSDriveInfo( + "defaultSampleDrive", + ProviderInfo, + "/", + "Sample default drive", + null); + var result = new Collection {drive}; + return result; + } + + private class Item { + public string Name { get; set; } + } + } +} +'@ + Add-Type -OutputAssembly $testBinaryModulePath -TypeDefinition $binaryModule + + $pwsh = "$PSHOME\pwsh" + } + + It "Import a PowerShell provider with correct name" { + $result = & $pwsh -NoProfile -Command "Import-Module -Name $testModulePath; Get-Item ReproModule\SamplePrv::test.txt" + $result.PSPath | Should -BeExactly "ReproModule\SamplePrv::test.txt" + } +} diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 7da27ca0378..a4b30616132 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -3088,7 +3088,7 @@ internal PSModuleInfo LoadModuleManifest( // In that case, the nested module will first be loaded with a different session state, and then when trying to load the RootModule via 'LoadModuleNamedInManifest', // the same loaded nested module will be reused for the RootModule by 'LoadModuleNamedInManifest'. - // Change the module name to match the manifest name, not the original name + // Change the module name to match the manifest name, not the original name. newManifestInfo.SetName(manifestInfo.Name); // Copy in any nested modules... From 7c1cc868b201b35dcc2fdc7ff768474c30e6e047 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 28 Apr 2020 04:28:17 +0500 Subject: [PATCH 142/275] Use new `TargetFramwork` as `net5.0` in packaging scripts (#12503) --- PowerShell.Common.props | 2 +- test/tools/OpenCover/OpenCover.psm1 | 4 ++-- tools/packaging/packaging.psm1 | 23 ++++++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index ddf96a5b71e..177eef87842 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -95,7 +95,7 @@ Microsoft Corporation (c) Microsoft Corporation. All rights reserved. - netcoreapp5.0 + net5.0 8.0 true diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 4d82418fd63..748e0d1b853 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -615,7 +615,7 @@ function Install-OpenCover .Description Invoke-OpenCover runs tests under OpenCover by executing tests on PowerShell located at $PowerShellExeDirectory. .EXAMPLE - Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64 + Invoke-OpenCover -TestPath $PWD/test/powershell -PowerShellExeDirectory $PWD/src/powershell-win-core/bin/CodeCoverage/net5.0/win7-x64 #> function Invoke-OpenCover { @@ -624,7 +624,7 @@ function Invoke-OpenCover [parameter()]$OutputLog = "$HOME/Documents/OpenCover.xml", [parameter()]$TestPath = "${script:psRepoPath}/test/powershell", [parameter()]$OpenCoverPath = "$HOME/OpenCover", - [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/netcoreapp5.0/win7-x64/publish", + [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/net5.0/win7-x64/publish", [parameter()]$PesterLogElevated = "$HOME/Documents/TestResultsElevated.xml", [parameter()]$PesterLogUnelevated = "$HOME/Documents/TestResultsUnelevated.xml", [parameter()]$PesterLogFormat = "NUnitXml", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 052980e607a..776814a8e11 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -8,6 +8,7 @@ $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.p Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force $DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "debian.9", "debian.10", "debian.11") $RedhatDistributions = @("rhel.7","centos.8") +$script:netCoreRuntime = 'net5.0' function Start-PSPackage { [CmdletBinding(DefaultParameterSetName='Version',SupportsShouldProcess=$true)] @@ -131,14 +132,14 @@ function Start-PSPackage { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne $script:netCoreRuntime ## Last build wasn't for CoreCLR } else { -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $crossGenCorrect -or ## Last build didn't specify '-CrossGen' correctly -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly $Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' - $Script:Options.Framework -ne "net5.0" ## Last build wasn't for CoreCLR + $Script:Options.Framework -ne $script:netCoreRuntime ## Last build wasn't for CoreCLR } # Make sure the most recent build satisfies the package requirement @@ -1719,7 +1720,7 @@ function CreateNugetPlatformFolder [string] $PlatformBinPath ) - $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/netcoreapp5.0") + $destPath = New-Item -ItemType Directory -Path (Join-Path $PackageRuntimesFolder "$Platform/lib/$script:netCoreRuntime") $fullPath = Join-Path $PlatformBinPath $file if (-not(Test-Path $fullPath)) { @@ -1819,7 +1820,7 @@ function New-ILNugetPackage $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName 'runtimes') -ItemType Directory #region ref - $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/netcoreapp5.0') -ItemType Directory -Force + $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/$script:netCoreRuntime') -ItemType Directory -Force CopyReferenceAssemblies -assemblyName $fileBaseName -refBinPath $refBinPath -refNugetPath $refFolder -assemblyFileList $fileList #endregion ref @@ -1863,8 +1864,8 @@ function New-ILNugetPackage "Microsoft.PowerShell.Utility" ) - $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\netcoreapp5.0\Modules") -ItemType Directory -Force - $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\netcoreapp5.0\Modules") -ItemType Directory -Force + $winModuleFolder = New-Item (Join-Path $contentFolder "runtimes\win\lib\$script:netCoreRuntime\Modules") -ItemType Directory -Force + $unixModuleFolder = New-Item (Join-Path $contentFolder "runtimes\unix\lib\$script:netCoreRuntime\Modules") -ItemType Directory -Force foreach ($module in $winBuiltInModules) { $source = Join-Path $WinFxdBinPath "Modules\$module" @@ -1991,7 +1992,7 @@ function New-ILNugetPackage } <# - Copy the generated reference assemblies to the 'ref/netcoreapp5.0' folder properly. + Copy the generated reference assemblies to the 'ref/net5.0' folder properly. This is a helper function used by 'New-ILNugetPackage' #> function CopyReferenceAssemblies @@ -2234,7 +2235,7 @@ function New-ReferenceAssembly Write-Log "Running: dotnet $arguments" Start-NativeExecution -sb {dotnet $arguments} - $refBinPath = Join-Path $projectFolder "bin/Release/netcoreapp5.0/$assemblyName.dll" + $refBinPath = Join-Path $projectFolder "bin/Release/$script:netCoreRuntime/$assemblyName.dll" if ($null -eq $refBinPath) { throw "Reference assembly was not built." } @@ -2886,7 +2887,7 @@ function New-MSIPatch # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIPackage { @@ -3088,7 +3089,7 @@ function New-MSIPackage # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIXPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIXPackage { @@ -3678,7 +3679,7 @@ function New-GlobalToolNupkg } $packageInfo | ForEach-Object { - $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/netcoreapp5.0/any") -ItemType Directory + $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory $packageType = $_.Type From aa859c024c58ef2577a5347ac8ebd16ea67dc6be Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 28 Apr 2020 10:30:26 -0700 Subject: [PATCH 143/275] Fix quotes to allow variable expansion (#12512) --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 776814a8e11..1e4b356b6c3 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1820,7 +1820,7 @@ function New-ILNugetPackage $packageRuntimesFolder = New-Item (Join-Path $filePackageFolder.FullName 'runtimes') -ItemType Directory #region ref - $refFolder = New-Item (Join-Path $filePackageFolder.FullName 'ref/$script:netCoreRuntime') -ItemType Directory -Force + $refFolder = New-Item (Join-Path $filePackageFolder.FullName "ref/$script:netCoreRuntime") -ItemType Directory -Force CopyReferenceAssemblies -assemblyName $fileBaseName -refBinPath $refBinPath -refNugetPath $refFolder -assemblyFileList $fileList #endregion ref From 1bda154fc79a48c3e49ef516ea2ff7af8221fb2a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 10:35:40 -0700 Subject: [PATCH 144/275] Bump `Xunit.SkippableFact` from `1.3.12` to `1.4.8` (#12480) --- test/xUnit/xUnit.tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xUnit/xUnit.tests.csproj b/test/xUnit/xUnit.tests.csproj index 919ccfef369..e23db1ae2d2 100644 --- a/test/xUnit/xUnit.tests.csproj +++ b/test/xUnit/xUnit.tests.csproj @@ -24,7 +24,7 @@ - + From 767899d47b58d86bb6b87f24817a8a3f130f2e41 Mon Sep 17 00:00:00 2001 From: Jack Casey Date: Tue, 28 Apr 2020 10:45:10 -0700 Subject: [PATCH 145/275] Fix inconsistent exception message in `-replace` operator (#12388) --- src/System.Management.Automation/engine/lang/parserutils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 28dcda71479..180a1fe0f69 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -927,7 +927,7 @@ internal static object ReplaceOperator(ExecutionContext context, IScriptExtent e { // only allow 1 or 2 arguments to -replace throw InterpreterError.NewInterpreterException(rval, typeof(RuntimeException), errorPosition, - "BadReplaceArgument", ParserStrings.BadReplaceArgument, ignoreCase ? "-ireplace" : "-replace", rList.Count); + "BadReplaceArgument", ParserStrings.BadReplaceArgument, errorPosition.Text, rList.Count); } if (rList.Count > 0) From ee1934b1ce8f59e7e0425b1757ec343fc86354fc Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 22:59:16 +0500 Subject: [PATCH 146/275] Bump PackageManagement from 1.4.6 to 1.4.7 in /src/Modules (#12506) * Bump PackageManagement from 1.4.6 to 1.4.7 in /src/Modules Bumps PackageManagement from 1.4.6 to 1.4.7. Signed-off-by: dependabot-preview[bot] * Update files.wxs Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Travis Plunk --- assets/files.wxs | 4 ---- src/Modules/PSGalleryModules.csproj | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 06a86358d51..ddb6fbf6a21 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1823,9 +1823,6 @@ - - - @@ -3698,7 +3695,6 @@ - diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index 734779705da..1bbabbcfd17 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -4,7 +4,7 @@ - + From 1c4ecb6ec5503e0693d58f31278dc44140fc30c7 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 28 Apr 2020 23:07:54 +0500 Subject: [PATCH 147/275] Update the owner list for `ConsoleHost` (#12508) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f1e9368cdab..26e01101693 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -33,7 +33,7 @@ src/Microsoft.PowerShell.Commands.Management/ @daxian-dbw @adityapatwardhan src/Microsoft.PowerShell.Commands.Utility/ @JamesWTruher @PaulHigin # Area: Console -src/Microsoft.PowerShell.ConsoleHost/ @daxian-dbw @anmenaga +src/Microsoft.PowerShell.ConsoleHost/ @daxian-dbw @anmenaga @TylerLeonhardt # Area: Demos demos/ @joeyaiello @SteveL-MSFT @HemantMahawar From 7c1fa6c799b22b7d393c65b50bc16de3d7ca5f60 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2020 13:18:31 -0700 Subject: [PATCH 148/275] Bump `Microsoft.ApplicationInsights` from `2.13.1` to `2.14.0` (#12479) --- .../System.Management.Automation.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index cca3614ec03..f64f075430d 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -14,7 +14,7 @@ - + From cc0d20aa08c45fccd943c7208d4929645a99ff8b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 28 Apr 2020 14:18:16 -0700 Subject: [PATCH 149/275] Bump .NET to 5.0.0-preview.4 (#12507) --- DotnetRuntimeMetadata.json | 4 ++-- assets/files.wxs | 12 ----------- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/powershell/Host/Startup.Tests.ps1 | 1 + test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 13 files changed, 28 insertions(+), 39 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index 6155e5f1ff2..e6e0da33faa 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,6 +1,6 @@ { "sdk": { - "channel": "release/5.0.1xx-preview3", - "packageVersionPattern": "5.0.0-preview.3" + "channel": "release/5.0.1xx-preview4", + "packageVersionPattern": "5.0.0-preview.4" } } diff --git a/assets/files.wxs b/assets/files.wxs index ddb6fbf6a21..b60fd4bcdec 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1619,18 +1619,9 @@ - - - - - - - - - @@ -3643,10 +3634,7 @@ - - - diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index ccdba31f35e..f19a3b6fe9f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index a52b681ed74..6a6b2d4a237 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 929e2ef94f6..eb2a3636d03 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index a8018e8bda5..143c2d42a7f 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index cdff83715dc..f8b134c550b 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index f64f075430d..3cde802e7e2 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 8f419fbc37f..87c110c1465 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -71,6 +71,7 @@ Describe "Validate start of console host" -Tag CI { 'System.Management.dll' 'System.Security.Claims.dll' 'System.Security.Cryptography.Primitives.dll' + 'System.Security.Principal.dll' 'System.Threading.Overlapped.dll' ) } diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index d25bdc0ce09..9884358d56c 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 2b5fee9cec3..aa3bb4b56c9 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 097724abcbd..e5695d5ae97 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 2a27986a7eb..224aed14f37 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 0087f78c26f3627bb5382d88b0d1ab3db489ed5a Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 29 Apr 2020 04:25:33 +0100 Subject: [PATCH 150/275] Update TFM reference in build docs (#12514) --- docs/building/linux.md | 2 +- docs/building/macos.md | 2 +- docs/building/windows-core.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/building/linux.md b/docs/building/linux.md index 351f02cef4c..2d25af84bb2 100644 --- a/docs/building/linux.md +++ b/docs/building/linux.md @@ -71,7 +71,7 @@ Start-PSBuild Congratulations! If everything went right, PowerShell is now built. The `Start-PSBuild` script will output the location of the executable: -`./src/powershell-unix/bin/Debug/netcoreapp3.0/linux-x64/publish/pwsh`. +`./src/powershell-unix/bin/Debug/net5.0/linux-x64/publish/pwsh`. You should now be running the PowerShell Core that you just built, if your run the above executable. You can run our cross-platform Pester tests with `Start-PSPester`, and our xUnit tests with `Start-PSxUnit`. diff --git a/docs/building/macos.md b/docs/building/macos.md index d969753e636..e398451e8da 100644 --- a/docs/building/macos.md +++ b/docs/building/macos.md @@ -36,4 +36,4 @@ We cannot do this for you in the build module due to #[847][]. Start a PowerShell session by running `pwsh`, and then use `Start-PSBuild` from the module. -After building, PowerShell will be at `./src/powershell-unix/bin/Debug/netcoreapp3.0/osx-x64/publish/pwsh`. +After building, PowerShell will be at `./src/powershell-unix/bin/Debug/net5.0/osx-x64/publish/pwsh`. diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 207f38f0855..5e9aa73cf09 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -58,11 +58,11 @@ Import-Module ./build.psm1 Start-PSBuild ``` -Congratulations! If everything went right, PowerShell is now built and executable as `./src/powershell-win-core/bin/Debug/netcoreapp3.0/win7-x64/publish/pwsh.exe`. +Congratulations! If everything went right, PowerShell is now built and executable as `./src/powershell-win-core/bin/Debug/net5.0/win7-x64/publish/pwsh.exe`. This location is of the form `./[project]/bin/[configuration]/[framework]/[rid]/publish/[binary name]`, and our project is `powershell`, configuration is `Debug` by default, -framework is `netcoreapp3.0`, runtime identifier is `win7-x64` by default, +framework is `net5.0`, runtime identifier is `win7-x64` by default, and binary name is `pwsh`. The function `Get-PSOutput` will return the path to the executable; thus you can execute the development copy via `& (Get-PSOutput)`. From 20a1e1cc3d99b5f45ee1283ce60624715b96008e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Wed, 29 Apr 2020 14:42:00 -0700 Subject: [PATCH 151/275] Update dotnet metadata for next channel for automated updates (#12502) --- DotnetRuntimeMetadata.json | 3 ++- tools/UpdateDotnetRuntime.ps1 | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index e6e0da33faa..d5afbda85f1 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,6 +1,7 @@ { "sdk": { "channel": "release/5.0.1xx-preview4", - "packageVersionPattern": "5.0.0-preview.4" + "packageVersionPattern": "5.0.0-preview.4", + "nextChannel": "net5/preview4" } } diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 index eeabfb5efb9..550330471b1 100644 --- a/tools/UpdateDotnetRuntime.ps1 +++ b/tools/UpdateDotnetRuntime.ps1 @@ -3,6 +3,8 @@ [CmdletBinding()] param ( + [Parameter()] + [string]$SDKVersionOverride ) <# @@ -139,7 +141,9 @@ if(-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue)) ## Install latest version from the channel -Install-Dotnet -Channel "$Channel" -Version 'latest' +$sdkVersion = if ($SDKVersionOverride) { $SDKVersionOverride } else { "latest" } + +Install-Dotnet -Channel "$Channel" -Version $sdkVersion Write-Verbose -Message "Installing .NET SDK completed." -Verbose From 9e3b34035fa25e35b29d972505ca07147677b851 Mon Sep 17 00:00:00 2001 From: HumanEquivalentUnit Date: Thu, 30 Apr 2020 16:54:20 +0100 Subject: [PATCH 152/275] Change Get-FileHash to close file handles before writing output (#12474) --- .../commands/utility/GetHash.cs | 96 +++++++++++-------- .../Get-FileHash.Tests.ps1 | 15 +++ 2 files changed, 71 insertions(+), 40 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs index c851c2bc815..65e55a86ab1 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetHash.cs @@ -126,49 +126,10 @@ protected override void ProcessRecord() foreach (string path in pathsToProcess) { - byte[] bytehash = null; - string hash = null; - Stream openfilestream = null; - - try + if (ComputeFileHash(path, out string hash)) { - openfilestream = File.OpenRead(path); - bytehash = hasher.ComputeHash(openfilestream); - - hash = BitConverter.ToString(bytehash).Replace("-", string.Empty); WriteHashResult(Algorithm, hash, path); } - catch (FileNotFoundException ex) - { - var errorRecord = new ErrorRecord( - ex, - "FileNotFound", - ErrorCategory.ObjectNotFound, - path); - WriteError(errorRecord); - } - catch (UnauthorizedAccessException ex) - { - var errorRecord = new ErrorRecord( - ex, - "UnauthorizedAccessError", - ErrorCategory.InvalidData, - path); - WriteError(errorRecord); - } - catch (IOException ioException) - { - var errorRecord = new ErrorRecord( - ioException, - "FileReadError", - ErrorCategory.ReadError, - path); - WriteError(errorRecord); - } - finally - { - openfilestream?.Dispose(); - } } } @@ -190,6 +151,61 @@ protected override void EndProcessing() } } + /// + /// Read the file and calculate the hash. + /// + /// Path to file which will be hashed. + /// Will contain the hash of the file content. + /// Boolean value indicating whether the hash calculation succeeded or failed. + private bool ComputeFileHash(string path, out string hash) + { + byte[] bytehash = null; + Stream openfilestream = null; + + hash = null; + + try + { + openfilestream = File.OpenRead(path); + + bytehash = hasher.ComputeHash(openfilestream); + hash = BitConverter.ToString(bytehash).Replace("-", string.Empty); + } + catch (FileNotFoundException ex) + { + var errorRecord = new ErrorRecord( + ex, + "FileNotFound", + ErrorCategory.ObjectNotFound, + path); + WriteError(errorRecord); + } + catch (UnauthorizedAccessException ex) + { + var errorRecord = new ErrorRecord( + ex, + "UnauthorizedAccessError", + ErrorCategory.InvalidData, + path); + WriteError(errorRecord); + } + catch (IOException ioException) + { + var errorRecord = new ErrorRecord( + ioException, + "FileReadError", + ErrorCategory.ReadError, + path); + WriteError(errorRecord); + } + finally + { + openfilestream?.Dispose(); + } + + return hash != null; + } + /// /// Create FileHashInfo object and output it. /// 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 eac9bd9c908..6cb3118fecd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 @@ -77,4 +77,19 @@ Describe "Get-FileHash" -Tags "CI" { $result.Path | Should -Be $testDocument } } + + Context "File should be closed before Get-FileHash writes pipeline output" { + It "Should be able to edit the file without 'file is in use' exceptions" { + # This test runs against a copy of the document + # because it involves renaming it, + # and that might break tests added later on. + $testDocumentCopy = "${testDocument}-copy" + Copy-Item -Path $testdocument -Destination $testDocumentCopy + + $newPath = Get-FileHash -Path $testDocumentCopy | Rename-Item -NewName {$_.Hash} -PassThru + $newPath.FullName | Should -Exist + + Remove-Item -Path $testDocumentCopy -Force + } + } } From ef1c0d7d5102afd348995c463e493d00ae719859 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 30 Apr 2020 17:35:54 +0100 Subject: [PATCH 153/275] Document why `PackageVersion` is used in `PowerShell.Common.props` (#12523) Co-Authored-By: Nick Guerrera --- PowerShell.Common.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 177eef87842..6cae0785ec3 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -56,12 +56,12 @@ $(PSCoreFormattedVersion) $(PSCoreBuildVersion) + ..\..\assets\Powershell_av_colors.ico ..\..\assets\Powershell_black.ico From 902524f621005bc845b041c13a51edace4d4c08a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Apr 2020 10:21:49 -0700 Subject: [PATCH 154/275] Create sync.yml --- .github/workflows/sync.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 00000000000..fa81bb80999 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,18 @@ +name: Sync Fork + +on: + schedule: + - cron: '*/30 * * * *' + +jobs: + sync: + + runs-on: ubuntu-latest + + steps: + - uses: TG908/fork-sync@v1.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + owner: llvm + base: master + head: master From 8128a036f76b2d912ab5c0294d69086ed921a780 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 30 Apr 2020 10:22:09 -0700 Subject: [PATCH 155/275] Delete sync.yml --- .github/workflows/sync.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml deleted file mode 100644 index fa81bb80999..00000000000 --- a/.github/workflows/sync.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Sync Fork - -on: - schedule: - - cron: '*/30 * * * *' - -jobs: - sync: - - runs-on: ubuntu-latest - - steps: - - uses: TG908/fork-sync@v1.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - owner: llvm - base: master - head: master From c19a417321b17b1f52dc2ab1c8316aa4e2a08d12 Mon Sep 17 00:00:00 2001 From: Joshua Cotton Date: Thu, 30 Apr 2020 14:20:53 -0400 Subject: [PATCH 156/275] Allow `/` in relative paths for `using module` (#7424) (#12492) --- .../engine/parser/SymbolResolver.cs | 4 ++-- .../Classes/scripting.Classes.using.tests.ps1 | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/SymbolResolver.cs b/src/System.Management.Automation/engine/parser/SymbolResolver.cs index a453f0095ac..42091ba2e7b 100644 --- a/src/System.Management.Automation/engine/parser/SymbolResolver.cs +++ b/src/System.Management.Automation/engine/parser/SymbolResolver.cs @@ -498,8 +498,8 @@ private Collection GetModulesFromUsingModule(UsingStatementAst usi return null; } - // case 1: relative path. Relative for file in the same folder should include .\ - bool isPath = fullyQualifiedNameStr.Contains(@"\"); + // case 1: relative path. Relative for file in the same folder should include .\ or ./ + bool isPath = fullyQualifiedNameStr.Contains('\\') || fullyQualifiedNameStr.Contains('/'); if (isPath && !LocationGlobber.IsAbsolutePath(fullyQualifiedNameStr)) { string rootPath = Path.GetDirectoryName(_parser._fileName); diff --git a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 index 18c3661d5af..8ea691888a5 100644 --- a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 @@ -339,7 +339,7 @@ using module Foo } } - Context 'Side by side' { + Context 'Side by side' { BeforeAll { # Add side-by-side module $newVersion = '3.4.5' @@ -523,6 +523,19 @@ using module FooForPaths Pop-Location } } + + It 'can be accessed by relative path with .' -TestCases @( + @{ Separator = '\' }, + @{ Separator = '/' } + ) { + param([string]$Separator) + $name = 'relative-slash-paths' + 'function Get-TestString { "Worked" }' | Set-Content "TestDrive:\modules\$name.psm1" + + "using module .$Separator$name.psm1; Get-TestString" | Set-Content "TestDrive:\modules\$name.ps1" + + & "TestDrive:\modules\$name.ps1" | Should -BeExactly "Worked" + } } Context "module has non-terminating error handled with 'SilentlyContinue'" { @@ -547,4 +560,3 @@ using module $testFile } } } - From 8de0ddc6d16474ec895bf3559fd15683656589fc Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 30 Apr 2020 11:28:32 -0700 Subject: [PATCH 157/275] Add ability to `Install-Dotnet` to specify directory (#12469) --- build.psm1 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/build.psm1 b/build.psm1 index 654f3346eaa..0550342c78d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1628,7 +1628,8 @@ function Install-Dotnet { param( [string]$Channel = $dotnetCLIChannel, [string]$Version = $dotnetCLIRequiredVersion, - [switch]$NoSudo + [switch]$NoSudo, + [string]$InstallDir ) # This allows sudo install to be optional; needed when running in containers / as root @@ -1662,7 +1663,12 @@ function Install-Dotnet { $installScript = "dotnet-install.sh" Start-NativeExecution { & $curl -sO $installObtainUrl/$installScript - bash ./$installScript -c $Channel -v $Version + + if (-not $InstallDir) { + bash ./$installScript -c $Channel -v $Version + } else { + bash ./$installScript -c $Channel -v $Version -i $InstallDir + } } } elseif ($environment.IsWindows) { Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet @@ -1670,12 +1676,22 @@ function Install-Dotnet { Invoke-WebRequest -Uri $installObtainUrl/$installScript -OutFile $installScript if (-not $environment.IsCoreCLR) { - & ./$installScript -Channel $Channel -Version $Version + if (-not $InstallDir) { + & ./$installScript -Channel $Channel -Version $Version + } else { + & ./$installScript -Channel $Channel -Version $Version -InstallDir $InstallDir + } } else { # dotnet-install.ps1 uses APIs that are not supported in .NET Core, so we run it with Windows PowerShell $fullPSPath = Join-Path -Path $env:windir -ChildPath "System32\WindowsPowerShell\v1.0\powershell.exe" $fullDotnetInstallPath = Join-Path -Path $PWD.Path -ChildPath $installScript - Start-NativeExecution { & $fullPSPath -NoLogo -NoProfile -File $fullDotnetInstallPath -Channel $Channel -Version $Version } + Start-NativeExecution { + if (-not $InstallDir) { + & $fullPSPath -NoLogo -NoProfile -File $fullDotnetInstallPath -Channel $Channel -Version $Version + } else { + & $fullPSPath -NoLogo -NoProfile -File $fullDotnetInstallPath -Channel $Channel -Version $Version -InstallDir $InstallDir + } + } } } } From a543b304bc2deca850f032f9834e1649fb3d650f Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 30 Apr 2020 11:41:33 -0700 Subject: [PATCH 158/275] Add the .NET SDK installation path to the current process path (#12525) --- tools/UpdateDotnetRuntime.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 index 550330471b1..b49d1c47e43 100644 --- a/tools/UpdateDotnetRuntime.ps1 +++ b/tools/UpdateDotnetRuntime.ps1 @@ -13,6 +13,11 @@ param ( function Update-GlobalJson([string] $Version) { $psGlobalJsonPath = Resolve-Path "$PSScriptRoot/../global.json" $psGlobalJson = Get-Content -Path $psGlobalJsonPath -Raw | ConvertFrom-Json + + if ($psGlobalJson.sdk.version -eq $Version) { + throw '.NET SDK version is not updated' + } + $psGlobalJson.sdk.version = $Version $psGlobalJson | ConvertTo-Json | Out-File -FilePath $psGlobalJsonPath -Force } @@ -118,7 +123,7 @@ function Update-CsprojFile([string] $path, $values) { } if ($updated) { - $fileContent | Out-File -FilePath $path -Force + ($fileContent).TrimEnd() | Out-File -FilePath $path -Force } } @@ -147,6 +152,16 @@ Install-Dotnet -Channel "$Channel" -Version $sdkVersion Write-Verbose -Message "Installing .NET SDK completed." -Verbose +$isWindowsEnv = [System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Win32NT + +$dotnetPath = if ($IsWindowsEnv) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } + +$pathSep = [System.IO.Path]::PathSeparator + +if (-not (($ENV:PATH -split $pathSep) -contains "$dotnetPath")) { + $env:PATH = "$dotnetPath" + $pathSep + "$ENV:PATH" +} + $latestSdkVersion = (dotnet --list-sdks | Select-Object -Last 1 ).Split() | Select-Object -First 1 Write-Verbose -Message "Installing .NET SDK completed, version - $latestSdkVersion" -Verbose From 6d1d62f2f83b526997d23e0606be9d5708246e9f Mon Sep 17 00:00:00 2001 From: David Seibel <933503+davidseibel@users.noreply.github.com> Date: Thu, 30 Apr 2020 16:23:55 -0400 Subject: [PATCH 159/275] Compare-Object Apply -IncludeEqual when -ExcludeDifferent is specified (#12317) --- .../commands/utility/Compare-Object.cs | 9 ++------- .../Compare-Object.Tests.ps1 | 12 +++++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) 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 5ee48da98de..ae6e48180e5 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs @@ -372,18 +372,13 @@ private void Emit(OrderByPropertyEntry entry, string sideIndicator) #region Overrides /// - /// If the parameter 'ExcludeDifferent' is present, then we need to turn on the - /// 'IncludeEqual' switch unless it's turned off by the user specifically. + /// If the parameter 'ExcludeDifferent' is present, then the 'IncludeEqual' + /// switch is turned on unless it's turned off by the user specifically. /// protected override void BeginProcessing() { if (ExcludeDifferent) { - if (_isIncludeEqualSpecified == false) - { - return; - } - if (_isIncludeEqualSpecified && !_includeEqual) { return; 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 55819fba180..3f8a521cb15 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 @@ -76,10 +76,10 @@ Describe "Compare-Object" -Tags "CI" { { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $anonexistentvariable } | Should -Throw } - It "Should give a 0 array when using excludedifferent switch without also using the includeequal switch" { - $actualOutput = Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -ExcludeDifferent + It "Should only display equal lines when excludeDifferent switch is used without the includeequal switch" { + $actualOutput = Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -ExcludeDifferent - $actualOutput.Length | Should -Be 0 + $actualOutput.Length | Should -Be 2 } It "Should only display equal lines when excludeDifferent switch is used alongside the includeequal switch" { @@ -88,6 +88,12 @@ Describe "Compare-Object" -Tags "CI" { $actualOutput.Length | Should -Be 2 } + It "Should give a 0 array when using excludedifferent switch when also setting the includeequal switch to false" { + $actualOutput = Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -ExcludeDifferent -IncludeEqual:$false + + $actualOutput.Length | Should -Be 0 + } + It "Should be able to pass objects to pipeline using the passthru switch" { { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -Passthru | Format-Wide } | Should -Not -Throw } From 633e52f34539852fad0f72a74e92f9d560ebae75 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 4 May 2020 18:17:52 -0700 Subject: [PATCH 160/275] Update .NET SDK to `5.0.100-preview.4.20229.10` (#12538) --- assets/files.wxs | 18 ++++++++++++++--- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/powershell/Host/Startup.Tests.ps1 | 1 - .../Get-Member.Tests.ps1 | 8 +++++--- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 14 files changed, 46 insertions(+), 33 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index b60fd4bcdec..c87c85a486b 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1628,6 +1628,15 @@ + + + + + + + + + @@ -3089,8 +3098,8 @@ - - + + @@ -4086,8 +4095,11 @@ - + + + + diff --git a/global.json b/global.json index 5ef419488f8..0cc5aa5256d 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.3.20216.6" + "version": "5.0.100-preview.4.20229.10" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index f19a3b6fe9f..d120f5bec65 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 6a6b2d4a237..c36ec4e42e9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index eb2a3636d03..e82741bf417 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 143c2d42a7f..a0ffd4408bc 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index f8b134c550b..65e3a8d2c1a 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 3cde802e7e2..1b5d1f1795c 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 87c110c1465..8f419fbc37f 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -71,7 +71,6 @@ Describe "Validate start of console host" -Tag CI { 'System.Management.dll' 'System.Security.Claims.dll' 'System.Security.Cryptography.Primitives.dll' - 'System.Security.Principal.dll' 'System.Threading.Overlapped.dll' ) } 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 03ccf110754..db0a76a85d6 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 @@ -43,9 +43,11 @@ Describe "Get-Member" -Tags "CI" { It "Should be able to be called on IntPtr" { $results = [System.IntPtr] | Get-Member -Type Property -Static | Sort-Object -Property Name - $results.Count | Should -BeExactly 2 - $results[0].Name | Should -BeExactly 'Size' - $results[1].Name | Should -BeExactly 'Zero' + $results.Count | Should -BeExactly 4 + $results[0].Name | Should -BeExactly 'MaxValue' + $results[1].Name | Should -BeExactly 'MinValue' + $results[2].Name | Should -BeExactly 'Size' + $results[3].Name | Should -BeExactly 'Zero' } It "Should work with incomplete parameter '-i'" { diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 9884358d56c..49ffb7c5e60 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index aa3bb4b56c9..957fc422ee7 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index e5695d5ae97..15eb091df9e 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 224aed14f37..1f1534643c3 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From cdfa073a755c7a384d1ec2ce105cc50d4b2ffff5 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 5 May 2020 07:23:15 +0100 Subject: [PATCH 161/275] Update log message in Start-PSBootstrap (#12573) --- build.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 0550342c78d..72e3472a0eb 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1871,7 +1871,7 @@ function Start-PSBootstrap { Write-Log "dotnet not present. Installing dotnet." } else { - Write-Log "dotnet out of date ($dotNetVersion). Updating dotnet." + Write-Log "dotnet version $dotNetVersion does not match required version. Installing dotnet." } $DotnetArguments = @{ Channel=$Channel; Version=$Version; NoSudo=$NoSudo } From cefbf3d6a972d9f1365c4ce5c5d6285133c2f304 Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Tue, 5 May 2020 12:48:37 -0400 Subject: [PATCH 162/275] Update @PoshChan config to include SSH (#12526) --- .poshchan/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.poshchan/settings.json b/.poshchan/settings.json index bb3c3661696..21ad0f08b48 100644 --- a/.poshchan/settings.json +++ b/.poshchan/settings.json @@ -6,11 +6,13 @@ "windows": "PowerShell-CI-Windows", "macos": "PowerShell-CI-macOS", "linux": "PowerShell-CI-Linux", + "ssh": "PowerShell-CI-SSH", "all": [ "PowerShell-CI-static-analysis", "PowerShell-CI-Windows", "PowerShell-CI-macOS", - "PowerShell-CI-Linux" + "PowerShell-CI-Linux", + "PowerShell-CI-SSH" ] }, "authorized_users": [ From ab65ac918cc32571465626779a8cd0a20943eec5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 5 May 2020 12:35:03 -0700 Subject: [PATCH 163/275] Update the build to sign any unsigned files as 3rd party Dlls (#12581) --- tools/packaging/packaging.psd1 | 2 +- tools/packaging/packaging.psm1 | 44 +++++++++++++++---- .../templates/windows-packaging.yml | 42 +++++++++++++++++- tools/releaseBuild/generatePackgeSigning.ps1 | 10 ++++- 4 files changed, 85 insertions(+), 13 deletions(-) diff --git a/tools/packaging/packaging.psd1 b/tools/packaging/packaging.psd1 index 0caae3ec701..2a1df399f13 100644 --- a/tools/packaging/packaging.psd1 +++ b/tools/packaging/packaging.psd1 @@ -6,7 +6,7 @@ Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="1.0.0" PowerShellVersion="5.0" CmdletsToExport=@() -FunctionsToExport=@('Start-PSPackage','New-PSSignedBuildZip', 'New-MSIPatch', 'Expand-PSSignedBuild', 'Publish-NugetToMyGet', 'New-DotnetSdkContainerFxdPackage', 'New-GlobalToolNupkg', 'New-ILNugetPackage') +FunctionsToExport=@('Start-PSPackage','New-PSSignedBuildZip', 'New-PSBuildZip', 'New-MSIPatch', 'Expand-PSSignedBuild', 'Publish-NugetToMyGet', 'New-DotnetSdkContainerFxdPackage', 'New-GlobalToolNupkg', 'New-ILNugetPackage', 'Update-PSSignedBuildFolder') RootModule="packaging.psm1" RequiredModules = @("build") } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1e4b356b6c3..1e7fa61430a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -598,14 +598,7 @@ function New-PSSignedBuildZip [string]$VstsVariableName ) - # Replace unsigned binaries with signed - $signedFilesFilter = Join-Path -Path $signedFilesPath -ChildPath '*' - Get-ChildItem -path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | Foreach-Object -Process { - $relativePath = $_.ToLowerInvariant().Replace($signedFilesPath.ToLowerInvariant(),'') - $destination = Join-Path -Path $buildPath -ChildPath $relativePath - Write-Log "replacing $destination with $_" - Copy-Item -Path $_ -Destination $destination -force - } + Update-PSSignedBuildFolder -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath # Remove '$signedFilesPath' now that signed binaries are copied if (Test-Path $signedFilesPath) @@ -613,6 +606,20 @@ function New-PSSignedBuildZip Remove-Item -Recurse -Force -Path $signedFilesPath } + New-PSBuildZip -BuildPath $BuildPath -DestinationFolder $DestinationFolder -VstsVariableName $VstsVariableName +} + +function New-PSBuildZip +{ + param( + [Parameter(Mandatory)] + [string]$BuildPath, + [Parameter(Mandatory)] + [string]$DestinationFolder, + [parameter(HelpMessage='VSTS variable to set for path to zip')] + [string]$VstsVariableName + ) + $name = split-path -Path $BuildPath -Leaf $zipLocationPath = Join-Path -Path $DestinationFolder -ChildPath "$name-signed.zip" Compress-Archive -Path $BuildPath\* -DestinationPath $zipLocationPath @@ -628,6 +635,27 @@ function New-PSSignedBuildZip } } + +function Update-PSSignedBuildFolder +{ + param( + [Parameter(Mandatory)] + [string]$BuildPath, + [Parameter(Mandatory)] + [string]$SignedFilesPath + ) + + # Replace unsigned binaries with signed + $signedFilesFilter = Join-Path -Path $SignedFilesPath -ChildPath '*' + Get-ChildItem -path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | Foreach-Object -Process { + $relativePath = $_.ToLowerInvariant().Replace($SignedFilesPath.ToLowerInvariant(),'') + $destination = Join-Path -Path $BuildPath -ChildPath $relativePath + Write-Log "replacing $destination with $_" + Copy-Item -Path $_ -Destination $destination -force + } +} + + function Expand-PSSignedBuild { param( diff --git a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml index 36fcef54c4c..a1fad655c5a 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-packaging.yml @@ -134,14 +134,52 @@ jobs: - powershell: | Import-Module $(PowerShellRoot)/build.psm1 -Force Import-Module $(PowerShellRoot)/tools/packaging -Force - $signedFilesPath = '$(System.ArtifactsDirectory)\signed\' + $BuildPath = '$(System.ArtifactsDirectory)\$(SymbolsFolder)' + + Update-PSSignedBuildFolder -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath + $dlls = Get-ChildItem $BuildPath\*.dll -Recurse + $signatures = $dlls | Get-AuthenticodeSignature + $missingSignatures = $signatures | Where-Object { $_.status -eq 'notsigned'}| select-object -ExpandProperty Path + tools/releaseBuild/generatePackgeSigning.ps1 -ThirdPartyFiles $missingSignatures -path "$(System.ArtifactsDirectory)\thirtdparty.xml" + displayName: Create ThirdParty Signing Xml + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - task: PkgESCodeSign@10 + displayName: 'CodeSign ThirdParty $(Architecture)' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + signConfigXml: '$(System.ArtifactsDirectory)\thirtdparty.xml' + inPathRoot: '$(System.ArtifactsDirectory)\$(SymbolsFolder)' + outPathRoot: '$(System.ArtifactsDirectory)\signedThirdParty' + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + Get-ChildItem '$(System.ArtifactsDirectory)\signedThirdParty\*' + displayName: Captrue ThirdParty Signed files + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + Import-Module $(PowerShellRoot)/build.psm1 -Force + Import-Module $(PowerShellRoot)/tools/packaging -Force + $signedFilesPath = '$(System.ArtifactsDirectory)\signedThirdParty\' + $BuildPath = '$(System.ArtifactsDirectory)\$(SymbolsFolder)' + + Update-PSSignedBuildFolder -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath + displayName: Merge ThirdParty signed files with Build + condition: and(succeeded(), eq(variables['SHOULD_SIGN'], 'true')) + + - powershell: | + Import-Module $(PowerShellRoot)/build.psm1 -Force + Import-Module $(PowerShellRoot)/tools/packaging -Force + $destFolder = '$(System.ArtifactsDirectory)\signedZip' $BuildPath = '$(System.ArtifactsDirectory)\$(SymbolsFolder)' New-Item -ItemType Directory -Path $destFolder -Force - $BuildPackagePath = New-PSSignedBuildZip -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath -DestinationFolder $destFolder + $BuildPackagePath = New-PSBuildZip -BuildPath $BuildPath -DestinationFolder $destFolder Write-Verbose -Verbose "New-PSSignedBuildZip returned `$BuildPackagePath as: $BuildPackagePath" Write-Host "##vso[artifact.upload containerfolder=results;artifactname=results]$BuildPackagePath" diff --git a/tools/releaseBuild/generatePackgeSigning.ps1 b/tools/releaseBuild/generatePackgeSigning.ps1 index be3512d28d4..34f9ed74bc7 100644 --- a/tools/releaseBuild/generatePackgeSigning.ps1 +++ b/tools/releaseBuild/generatePackgeSigning.ps1 @@ -7,14 +7,16 @@ param( [string[]] $AuthenticodeFiles, [string[]] $NuPkgFiles, [string[]] $MacDeveloperFiles, - [string[]] $LinuxFiles + [string[]] $LinuxFiles, + [string[]] $ThirdPartyFiles ) if ((!$AuthenticodeDualFiles -or $AuthenticodeDualFiles.Count -eq 0) -and (!$AuthenticodeFiles -or $AuthenticodeFiles.Count -eq 0) -and (!$NuPkgFiles -or $NuPkgFiles.Count -eq 0) -and (!$MacDeveloperFiles -or $MacDeveloperFiles.Count -eq 0) -and - (!$LinuxFiles -or $LinuxFiles.Count -eq 0)) + (!$LinuxFiles -or $LinuxFiles.Count -eq 0) -and + (!$ThirdPartyFiles -or $ThirdPartyFiles.Count -eq 0)) { throw "At least one file must be specified" } @@ -89,6 +91,10 @@ foreach ($file in $LinuxFiles) { New-FileElement -File $file -SignType 'LinuxPack' -XmlDoc $signingXml -Job $job } +foreach ($file in $ThirdPartyFiles) { + New-FileElement -File $file -SignType 'ThirdParty' -XmlDoc $signingXml -Job $job +} + $signingXml.Save($path) $updateScriptPath = Join-Path -Path $PSScriptRoot -ChildPath 'updateSigning.ps1' & $updateScriptPath -SigningXmlPath $path From 2c0f138a96c100093c1af8c091410f47647311c4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 08:54:09 +0500 Subject: [PATCH 164/275] Bump NJsonSchema from 10.1.12 to 10.1.13 (#12583) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.12 to 10.1.13. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index c36ec4e42e9..23369135b62 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 71d8876e6052f883e1831af4ed808a87a7a52161 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 7 May 2020 15:54:59 +0500 Subject: [PATCH 165/275] Bump NJsonSchema from 10.1.13 to 10.1.14 (#12598) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.13 to 10.1.14. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 23369135b62..34a3cf3a1df 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From f4382202ae4622bf26795e29a7b39b9d7cdfb3fb Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 7 May 2020 13:00:30 +0100 Subject: [PATCH 166/275] Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584) --- build.psm1 | 22 +-- demos/Apache/apache-demo.ps1 | 6 +- demos/Docker-PowerShell/Docker-PowerShell.ps1 | 4 +- demos/SystemD/SystemD/SystemD.psm1 | 2 +- demos/SystemD/journalctl-demo.ps1 | 6 +- demos/python/class1.ps1 | 2 +- demos/python/demo_script.ps1 | 4 +- .../Windows/PSDiagnostics/PSDiagnostics.psm1 | 38 ++--- .../Install-PowerShellRemoting.ps1 | 4 +- test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 | 4 +- test/common/markdown/markdown-link.tests.ps1 | 18 +-- .../networktest/DockerRemoting.Tests.ps1 | 30 ++-- .../networktest/New-DockerTestBuild.ps1 | 8 +- test/nanoserver/nanoserver.tests.ps1 | 6 +- test/powershell/Host/Base-Directory.Tests.ps1 | 4 +- test/powershell/Host/ConsoleHost.Tests.ps1 | 28 ++-- test/powershell/Host/Logging.Tests.ps1 | 8 +- test/powershell/Host/Startup.Tests.ps1 | 4 +- .../TabCompletion/TabCompletion.Tests.ps1 | 22 +-- .../Installer/WindowsInstaller.Tests.ps1 | 4 +- .../Scripting.Classes.BasicParsing.Tests.ps1 | 10 +- .../scripting.Classes.NestedModules.tests.ps1 | 8 +- .../scripting.Classes.inheritance.tests.ps1 | 2 +- .../Classes/scripting.Classes.using.tests.ps1 | 14 +- .../Operators/ComparisonOperator.Tests.ps1 | 4 +- .../Operators/PipelineChainOperator.Tests.ps1 | 2 +- .../Operators/TernaryOperator.Tests.ps1 | 4 +- .../Parser/ExtensibleCompletion.Tests.ps1 | 6 +- .../LanguageAndParser.TestFollowup.Tests.ps1 | 4 +- .../Parser/ParameterBinding.Tests.ps1 | 12 +- .../Language/Parser/Parser.Tests.ps1 | 2 +- .../Language/Parser/Parsing.Tests.ps1 | 2 +- .../Language/Parser/UsingAssembly.Tests.ps1 | 4 +- .../Language/Parser/UsingNamespace.Tests.ps1 | 2 +- .../Scripting/ActionPreference.Tests.ps1 | 12 +- .../CheckRestrictedlanguage.Tests.ps1 | 6 +- .../Debugging/DebuggerCommand.Tests.ps1 | 56 +++---- .../Debugging/DebuggerScriptTests.Tests.ps1 | 138 +++++++++--------- .../Scripting/Debugging/Debugging.Tests.ps1 | 14 +- .../Debugging/DebuggingInHost.Tests.ps1 | 2 +- .../DeserializedTypeConversion.Tests.ps1 | 8 +- .../Scripting/Dynamicparameters.Tests.ps1 | 2 +- .../Language/Scripting/Generics.Tests.ps1 | 4 +- ...htableToPSCustomObjectConversion.Tests.ps1 | 8 +- .../Language/Scripting/I18n.Tests.ps1 | 38 ++--- .../Language/Scripting/LineEndings.Tests.ps1 | 4 +- .../NativeLinuxCommands.Tests.ps1 | 4 +- .../OrderedAttributeForHashTables.Tests.ps1 | 6 +- .../Scripting/OutErrorVariable.Tests.ps1 | 72 ++++----- .../Scripting/ParameterBinding.Tests.ps1 | 8 +- .../Language/Scripting/ScriptHelp.Tests.ps1 | 62 ++++---- .../CompatiblePSEditions.Module.Tests.ps1 | 2 +- .../Enter-PSHostProcess.Tests.ps1 | 2 +- .../Get-Command.Tests.ps1 | 2 +- .../History.Tests.ps1 | 2 +- .../Import-Module.Tests.ps1 | 4 +- .../Microsoft.PowerShell.Core/Job.Tests.ps1 | 16 +- .../Out-Default.Tests.ps1 | 2 +- .../Out-Host.Tests.ps1 | 2 +- ...ster.Commands.Cmdlets.GetCommand.Tests.ps1 | 12 +- .../RemoteImportModule.Tests.ps1 | 2 +- .../Where-Object.Tests.ps1 | 20 +-- .../Get-WinEvent.Tests.ps1 | 38 ++--- .../New-WinEvent.Tests.ps1 | 4 +- ...s.LocalAccounts.LocalGroupMember.Tests.ps1 | 2 +- ....Cmdlets.LocalAccounts.LocalUser.Tests.ps1 | 24 +-- .../Alias.Tests.ps1 | 2 +- .../Clear-Content.Tests.ps1 | 4 +- .../Clear-EventLog.Tests.ps1 | 2 +- .../ControlService.Tests.ps1 | 10 +- .../Copy.Item.Tests.ps1 | 2 +- .../FileSystem.Tests.ps1 | 8 +- .../Get-ChildItem.Tests.ps1 | 12 +- .../Get-ComputerInfo.Tests.ps1 | 4 +- .../Get-EventLog.Tests.ps1 | 4 +- .../Get-HotFix.Tests.ps1 | 2 +- .../Get-Item.Tests.ps1 | 26 ++-- .../Get-Location.Tests.ps1 | 2 +- .../Get-Process.Tests.ps1 | 8 +- .../Get-Service.Tests.ps1 | 12 +- .../ItemProperty.Tests.ps1 | 16 +- .../Join-Path.Tests.ps1 | 10 +- .../Move-Item.Tests.ps1 | 4 +- .../New-EventLog.Tests.ps1 | 10 +- .../New-PSDrive.Tests.ps1 | 4 +- .../Registry.Tests.ps1 | 6 +- .../Remove-EventLog.Tests.ps1 | 6 +- .../Remove-Item.Tests.ps1 | 8 +- .../Rename-Item.Tests.ps1 | 12 +- .../Restart-Computer.Tests.ps1 | 6 +- .../Set-Content.Tests.ps1 | 2 +- .../Set-Item.Tests.ps1 | 10 +- .../Start-Process.Tests.ps1 | 4 +- .../Test-Connection.Tests.ps1 | 8 +- .../Test-Path.Tests.ps1 | 8 +- .../TimeZone.Tests.ps1 | 4 +- .../UnixStat.Tests.ps1 | 2 +- .../AclCmdlets.Tests.ps1 | 10 +- .../CertificateProvider.Tests.ps1 | 44 +++--- .../CmsMessage2.Tests.ps1 | 2 +- .../ExecutionPolicy.Tests.ps1 | 10 +- .../FileCatalog.Tests.ps1 | 12 +- .../GetCredential.Tests.ps1 | 8 +- .../SecureString.Tests.ps1 | 6 +- .../UserConfigProviderModVersion1.psm1 | 2 +- .../UserConfigProviderModVersion2.psm1 | 2 +- .../UserConfigProviderModVersion3.psm1 | 2 +- .../Add-Member.Tests.ps1 | 50 +++---- .../Compare-Object.Tests.ps1 | 16 +- .../ConvertTo-Html.Tests.ps1 | 12 +- .../ConvertTo-Json.Tests.ps1 | 2 +- .../ConvertTo-SecureString.Tests.ps1 | 2 +- .../Debug-Runspace.Tests.ps1 | 6 +- .../Eventing.Tests.ps1 | 20 +-- .../Export-Alias.Tests.ps1 | 42 +++--- .../Export-FormatData.Tests.ps1 | 2 +- .../Foreach-Object-Parallel.Tests.ps1 | 2 +- .../Format-Custom.Tests.ps1 | 2 +- .../Format-Table.Tests.ps1 | 22 +-- .../Format-Wide.Tests.ps1 | 4 +- .../Get-Alias.Tests.ps1 | 24 +-- .../Get-Command.Tests.ps1 | 2 +- .../Get-Date.Tests.ps1 | 44 +++--- .../Get-Error.Tests.ps1 | 2 +- .../Get-Event.Tests.ps1 | 2 +- .../Get-Member.Tests.ps1 | 12 +- .../Get-Random.Tests.ps1 | 4 +- .../Get-Variable.Tests.ps1 | 6 +- .../Get-Verb.Tests.ps1 | 10 +- .../Group-Object.Tests.ps1 | 2 +- .../Implicit.Remoting.Tests.ps1 | 58 ++++---- .../Import-Alias.Tests.ps1 | 22 +-- .../ImportExportCSV.Delimiter.Tests.ps1 | 34 ++--- .../Invoke-Expression.Tests.ps1 | 4 +- .../Invoke-Item.Tests.ps1 | 6 +- .../Join-String.Tests.ps1 | 2 +- .../Json.Tests.ps1 | 22 +-- .../New-Event.Tests.ps1 | 8 +- .../New-Object.Tests.ps1 | 4 +- .../New-Variable.Tests.ps1 | 38 ++--- .../Out-File.Tests.ps1 | 4 +- .../Out-String.Tests.ps1 | 2 +- .../PowerShellData.tests.ps1 | 6 +- .../Read-Host.Tests.ps1 | 4 +- .../Register-EngineEvent.Tests.ps1 | 2 +- .../Remove-Event.Tests.ps1 | 12 +- .../RunspaceCmdlets.Tests.ps1 | 12 +- .../Select-Object.Tests.ps1 | 6 +- .../Select-String.Tests.ps1 | 42 +++--- .../Set-Alias.Tests.ps1 | 12 +- .../Set-PSBreakpoint.Tests.ps1 | 60 ++++---- .../Set-Variable.Tests.ps1 | 8 +- .../Sort-Object.Tests.ps1 | 16 +- .../Tee-Object.Tests.ps1 | 2 +- .../Trace-Command.Tests.ps1 | 8 +- .../Unblock-File.Tests.ps1 | 2 +- .../Update-FormatData.Tests.ps1 | 2 +- .../Update-TypeData.Tests.ps1 | 2 +- .../Wait-Debugger.Tests.ps1 | 2 +- .../WebCmdlets.Tests.ps1 | 36 ++--- .../Write-Error.Tests.ps1 | 4 +- .../Write-Progress.Tests.ps1 | 8 +- .../XMLCommand.Tests.ps1 | 2 +- .../assets/localized.ps1 | 2 +- .../clixml.tests.ps1 | 4 +- .../command.tests.ps1 | 26 ++-- .../object.tests.ps1 | 10 +- .../string.tests.ps1 | 18 +-- .../Start-Transcript.Tests.ps1 | 6 +- .../MOF-Compilation.Tests.ps1 | 4 +- .../PSDesiredStateConfiguration.Tests.ps1 | 42 +++--- .../configuration.Tests.ps1 | 2 +- .../PSDiagnostics/PSDiagnostics.Tests.ps1 | 10 +- .../Modules/PSReadLine/PSReadLine.Tests.ps1 | 26 ++-- .../PackageManagement.Tests.ps1 | 24 +-- .../Modules/ThreadJob/ThreadJob.Tests.ps1 | 14 +- .../powershell/Provider/AutomountVHDDrive.ps1 | 10 +- .../Pester.AutomountedDrives.Tests.ps1 | 2 +- .../Provider/ProviderIntrinsics.Tests.ps1 | 2 +- test/powershell/SDK/Breakpoint.Tests.ps1 | 2 +- test/powershell/SDK/PSDebugging.Tests.ps1 | 4 +- .../engine/Api/BasicEngine.Tests.ps1 | 2 +- .../engine/Api/Serialization.Tests.ps1 | 6 +- .../engine/Api/TypeInference.Tests.ps1 | 32 ++-- .../engine/Basic/CommandDiscovery.Tests.ps1 | 28 ++-- .../engine/Basic/DefaultCommands.Tests.ps1 | 2 +- .../engine/Basic/Encoding.Tests.ps1 | 2 +- .../Basic/GroupPolicySettings.Tests.ps1 | 18 +-- test/powershell/engine/Cdxml/Cdxml.Tests.ps1 | 34 ++--- test/powershell/engine/ETS/Adapter.Tests.ps1 | 2 +- .../engine/ETS/CimAdapter.Tests.ps1 | 12 +- .../powershell/engine/ETS/TypeTable.Tests.ps1 | 6 +- .../engine/Formatting/ErrorView.Tests.ps1 | 4 +- .../Help/HelpSystem.OnlineHelp.Tests.ps1 | 6 +- .../engine/Help/HelpSystem.Tests.ps1 | 6 +- .../engine/Help/UpdatableHelpSystem.Tests.ps1 | 20 +-- test/powershell/engine/Job/Jobs.Tests.ps1 | 6 +- .../Module/TestModuleManifest.Tests.ps1 | 6 +- .../engine/Remoting/PSSession.Tests.ps1 | 4 +- .../Remoting/RemoteSession.Basic.Tests.ps1 | 4 +- .../Remoting/SSHRemotingCmdlets.Tests.ps1 | 2 +- .../CimCmdletsResources.Tests.ps1 | 2 +- .../SecurityResources.Tests.ps1 | 2 +- .../engine/ResourceValidation/TestRunner.ps1 | 2 +- .../UtilityResources.Tests.ps1 | 2 +- .../WSManResources.Tests.ps1 | 2 +- test/shebang/script.ps1 | 4 +- .../Start-CodeCoverageRun.ps1 | 16 +- .../Modules/HelpersCommon/HelpersCommon.psm1 | 10 +- .../Modules/HelpersHostCS/HelpersHostCS.psm1 | 2 +- .../HelpersSecurity/HelpersSecurity.psm1 | 2 +- .../Modules/HttpListener/HttpListener.psm1 | 2 +- test/tools/Modules/PSSysLog/PSSysLog.psm1 | 10 +- .../Modules/WebListener/WebListener.psm1 | 4 +- test/tools/OpenCover/OpenCover.psm1 | 54 +++---- tools/UpdateDotnetRuntime.ps1 | 6 +- tools/WindowsCI.psm1 | 6 +- tools/ci.psm1 | 14 +- tools/install-powershell.ps1 | 2 +- tools/packaging/packaging.psm1 | 44 +++--- .../GenericLinuxFiles/PowerShellPackage.ps1 | 8 +- .../PowerShellPackage.ps1 | 28 ++-- .../dockerInstall.psm1 | 12 +- .../SyncGalleryToAzArtifacts.psm1 | 2 +- tools/releaseBuild/generatePackgeSigning.ps1 | 2 +- .../macOS/PowerShellPackageVsts.ps1 | 4 +- tools/releaseBuild/setReleaseTag.ps1 | 12 +- tools/releaseBuild/vstsbuild.ps1 | 8 +- tools/releaseTools.psm1 | 16 +- tools/windows/Reset-PWSHSystemPath.ps1 | 6 +- 230 files changed, 1315 insertions(+), 1315 deletions(-) diff --git a/build.psm1 b/build.psm1 index 72e3472a0eb..bf4a5fbc22e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -538,10 +538,10 @@ Fix steps: $cryptoTarget = "/lib64/libcrypto.so.10" } - if ( ! (test-path "$publishPath/libssl.so.1.0.0")) { + if ( ! (Test-Path "$publishPath/libssl.so.1.0.0")) { $null = New-Item -Force -ItemType SymbolicLink -Target $sslTarget -Path "$publishPath/libssl.so.1.0.0" -ErrorAction Stop } - if ( ! (test-path "$publishPath/libcrypto.so.1.0.0")) { + if ( ! (Test-Path "$publishPath/libcrypto.so.1.0.0")) { $null = New-Item -Force -ItemType SymbolicLink -Target $cryptoTarget -Path "$publishPath/libcrypto.so.1.0.0" -ErrorAction Stop } } @@ -888,7 +888,7 @@ function Get-PesterTag { $alltags = @{} $warnings = @() - get-childitem -Recurse $testbase -File | Where-Object {$_.name -match "tests.ps1"}| ForEach-Object { + Get-ChildItem -Recurse $testbase -File | Where-Object {$_.name -match "tests.ps1"}| ForEach-Object { $fullname = $_.fullname $tok = $err = $null $ast = [System.Management.Automation.Language.Parser]::ParseFile($FullName, [ref]$tok,[ref]$err) @@ -1276,7 +1276,7 @@ function Start-PSPester { break } - $count = ($lines | measure-object).Count + $count = ($lines | Measure-Object).Count if ($count -eq 0) { Start-Sleep -Seconds 1 @@ -1469,7 +1469,7 @@ function Test-XUnitTestResults throw "Cannot convert $TestResultsFile to xml : $($_.message)" } - $failedTests = $results.assemblies.assembly.collection | Where-Object failed -gt 0 + $failedTests = $results.assemblies.assembly.collection | Where-Object failed -GT 0 if(-not $failedTests) { @@ -1521,7 +1521,7 @@ function Test-PSPesterResults throw "Test result file '$testResultsFile' not found for $TestArea." } - $x = [xml](Get-Content -raw $testResultsFile) + $x = [xml](Get-Content -Raw $testResultsFile) if ([int]$x.'test-results'.failures -gt 0) { Write-Log -Error "TEST FAILURES" @@ -2093,7 +2093,7 @@ function script:Use-MSBuild { # msbuild v14 and msbuild v4 behaviors are different for XAML generation $frameworkMsBuildLocation = "${env:SystemRoot}\Microsoft.Net\Framework\v4.0.30319\msbuild" - $msbuild = get-command msbuild -ErrorAction Ignore + $msbuild = Get-Command msbuild -ErrorAction Ignore if ($msbuild) { # all good, nothing to do return @@ -2873,17 +2873,17 @@ assembly PROCESS { #### MAIN #### foreach ( $log in $Logfile ) { - foreach ( $logpath in (resolve-path $log).path ) { - write-progress "converting file $logpath" + foreach ( $logpath in (Resolve-Path $log).path ) { + Write-Progress "converting file $logpath" if ( ! $logpath) { throw "Cannot resolve $Logfile" } - $x = [xml](get-content -raw -readcount 0 $logpath) + $x = [xml](Get-Content -Raw -ReadCount 0 $logpath) if ( $x.psobject.properties['test-results'] ) { $Logs += convert-pesterlog $x $logpath -includeempty:$includeempty } elseif ( $x.psobject.properties['assemblies'] ) { $Logs += convert-xunitlog $x $logpath -includeEmpty:$includeEmpty } else { - write-error "Cannot determine log type" + Write-Error "Cannot determine log type" } } } diff --git a/demos/Apache/apache-demo.ps1 b/demos/Apache/apache-demo.ps1 index 1168bc7a39d..299ce0cc0de 100644 --- a/demos/Apache/apache-demo.ps1 +++ b/demos/Apache/apache-demo.ps1 @@ -8,12 +8,12 @@ Write-Host -Foreground Blue "Get installed Apache Modules like *proxy* and Sort Get-ApacheModule | Where-Object {$_.ModuleName -like "*proxy*"} | Sort-Object ModuleName | Out-Host #Graceful restart of Apache -Write-host -Foreground Blue "Restart Apache Server gracefully" +Write-Host -Foreground Blue "Restart Apache Server gracefully" Restart-ApacheHTTPServer -Graceful | Out-Host #Enumerate current virtual hosts (web sites) Write-Host -Foreground Blue "Enumerate configured Apache Virtual Hosts" -Get-ApacheVHost |out-host +Get-ApacheVHost |Out-Host #Add a new virtual host Write-Host -Foreground Yellow "Create a new Apache Virtual Host" @@ -21,7 +21,7 @@ New-ApacheVHost -ServerName "mytestserver" -DocumentRoot /var/www/html/mytestser #Enumerate new set of virtual hosts Write-Host -Foreground Blue "Enumerate Apache Virtual Hosts Again" -Get-ApacheVHost |out-host +Get-ApacheVHost |Out-Host #Cleanup Write-Host -Foreground Blue "Remove demo virtual host" diff --git a/demos/Docker-PowerShell/Docker-PowerShell.ps1 b/demos/Docker-PowerShell/Docker-PowerShell.ps1 index 51b07f2d345..18eb844fd32 100644 --- a/demos/Docker-PowerShell/Docker-PowerShell.ps1 +++ b/demos/Docker-PowerShell/Docker-PowerShell.ps1 @@ -20,10 +20,10 @@ Run-ContainerImage hello-world # Linux cls # List all containers that have exited -Get-Container | Where-Object State -eq "exited" +Get-Container | Where-Object State -EQ "exited" # That found the right one, so go ahead and remove it -Get-Container | Where-Object State -eq "exited" | Remove-Container +Get-Container | Where-Object State -EQ "exited" | Remove-Container # Now remove the container image Remove-ContainerImage hello-world diff --git a/demos/SystemD/SystemD/SystemD.psm1 b/demos/SystemD/SystemD/SystemD.psm1 index 770451bdd05..d1bf0d8e890 100644 --- a/demos/SystemD/SystemD/SystemD.psm1 +++ b/demos/SystemD/SystemD/SystemD.psm1 @@ -11,7 +11,7 @@ Function Get-SystemDJournal { $Result = & $sudocmd $cmd $journalctlParameters -o json --no-pager Try { - $JSONResult = $Result|ConvertFrom-JSON + $JSONResult = $Result|ConvertFrom-Json $JSONResult } Catch diff --git a/demos/SystemD/journalctl-demo.ps1 b/demos/SystemD/journalctl-demo.ps1 index 1fe7198e4b7..2597bdc3b66 100644 --- a/demos/SystemD/journalctl-demo.ps1 +++ b/demos/SystemD/journalctl-demo.ps1 @@ -4,9 +4,9 @@ Import-Module $PSScriptRoot/SystemD/SystemD.psm1 #list recent journal events -Write-host -Foreground Blue "Get recent SystemD journal messages" +Write-Host -Foreground Blue "Get recent SystemD journal messages" Get-SystemDJournal -args "-xe" |Out-Host #Drill into SystemD unit messages -Write-host -Foreground Blue "Get recent SystemD journal messages for services and return Unit, Message" -Get-SystemDJournal -args "-xe" | Where-Object {$_._SYSTEMD_UNIT -like "*.service"} | Format-Table _SYSTEMD_UNIT, MESSAGE | Select-Object -first 10 | Out-Host +Write-Host -Foreground Blue "Get recent SystemD journal messages for services and return Unit, Message" +Get-SystemDJournal -args "-xe" | Where-Object {$_._SYSTEMD_UNIT -like "*.service"} | Format-Table _SYSTEMD_UNIT, MESSAGE | Select-Object -First 10 | Out-Host diff --git a/demos/python/class1.ps1 b/demos/python/class1.ps1 index d79e6c7ff20..b74c0c8d5d6 100644 --- a/demos/python/class1.ps1 +++ b/demos/python/class1.ps1 @@ -10,5 +10,5 @@ # picking up the Python script from the same directory # -& $PSScriptRoot/class1.py | ConvertFrom-JSON +& $PSScriptRoot/class1.py | ConvertFrom-Json diff --git a/demos/python/demo_script.ps1 b/demos/python/demo_script.ps1 index dfa5bb5f6b4..af2067642a1 100644 --- a/demos/python/demo_script.ps1 +++ b/demos/python/demo_script.ps1 @@ -20,7 +20,7 @@ $data @" #!/usr/bin/python3 print('Hi!') -"@ | out-file -encoding ascii hi +"@ | Out-File -Encoding ascii hi # Make it executable chmod +x hi @@ -35,7 +35,7 @@ cat class1.py ./class1.py # Capture the data as structured objects (arrays and hashtables) -$data = ./class1.py | ConvertFrom-JSON +$data = ./class1.py | ConvertFrom-Json # look at the first element of the returned array $data[0] diff --git a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 index 16bb19e76ea..ce0739eb622 100644 --- a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 +++ b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psm1 @@ -130,35 +130,35 @@ function Enable-WSManTrace { # winrm - "{04c6e16d-b99f-4a3a-9b3e-b8325bbc781e} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii + "{04c6e16d-b99f-4a3a-9b3e-b8325bbc781e} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii # winrsmgr - "{c0a36be8-a515-4cfa-b2b6-2676366efff7} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{c0a36be8-a515-4cfa-b2b6-2676366efff7} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append # WinrsExe - "{f1cab2c0-8beb-4fa2-90e1-8f17e0acdd5d} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{f1cab2c0-8beb-4fa2-90e1-8f17e0acdd5d} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append # WinrsCmd - "{03992646-3dfe-4477-80e3-85936ace7abb} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{03992646-3dfe-4477-80e3-85936ace7abb} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append # IPMIPrv - "{651d672b-e11f-41b7-add3-c2f6a4023672} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{651d672b-e11f-41b7-add3-c2f6a4023672} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append #IpmiDrv - "{D5C6A3E9-FA9C-434e-9653-165B4FC869E4} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{D5C6A3E9-FA9C-434e-9653-165B4FC869E4} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append # WSManProvHost - "{6e1b64d7-d3be-4651-90fb-3583af89d7f1} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{6e1b64d7-d3be-4651-90fb-3583af89d7f1} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append # Event Forwarding - "{6FCDF39A-EF67-483D-A661-76D715C6B008} 0xffffffff 0xff" | out-file $script:wsmprovfile -encoding ascii -append + "{6FCDF39A-EF67-483D-A661-76D715C6B008} 0xffffffff 0xff" | Out-File $script:wsmprovfile -Encoding ascii -Append - Start-Trace -SessionName $script:wsmsession -ETS -OutputFilePath $script:wsmanlogfile -Format bincirc -MinBuffers 16 -MaxBuffers 256 -BufferSizeInKb 64 -MaxLogFileSizeInMB 256 -ProviderFilePath $script:wsmprovfile + Start-Trace -SessionName $script:wsmsession -ETS -OutputFilePath $script:wsmanlogfile -Format bincirc -MinBuffers 16 -MaxBuffers 256 -BufferSizeInKB 64 -MaxLogFileSizeInMB 256 -ProviderFilePath $script:wsmprovfile } function Disable-WSManTrace { - Stop-Trace $script:wsmsession -ets + Stop-Trace $script:wsmsession -ETS } function Enable-PSWSManCombinedTrace @@ -177,27 +177,27 @@ function Enable-PSWSManCombinedTrace $logfile = $PSHOME + "\\Traces\\PSTrace.etl" } - "Microsoft-Windows-PowerShell 0 5" | out-file $provfile -encoding ascii - "Microsoft-Windows-WinRM 0 5" | out-file $provfile -encoding ascii -append + "Microsoft-Windows-PowerShell 0 5" | Out-File $provfile -Encoding ascii + "Microsoft-Windows-WinRM 0 5" | Out-File $provfile -Encoding ascii -Append if (!(Test-Path $PSHOME\Traces)) { - New-Item -ItemType Directory -Force $PSHOME\Traces | out-null + New-Item -ItemType Directory -Force $PSHOME\Traces | Out-Null } if (Test-Path $logfile) { - Remove-Item -Force $logfile | out-null + Remove-Item -Force $logfile | Out-Null } - Start-Trace -SessionName $script:pssession -OutputFilePath $logfile -ProviderFilePath $provfile -ets + Start-Trace -SessionName $script:pssession -OutputFilePath $logfile -ProviderFilePath $provfile -ETS - remove-item $provfile -Force -ea 0 + Remove-Item $provfile -Force -ea 0 } function Disable-PSWSManCombinedTrace { - Stop-Trace -SessionName $script:pssession -ets + Stop-Trace -SessionName $script:pssession -ETS } function Set-LogProperties @@ -220,7 +220,7 @@ function Set-LogProperties $retention = $LogDetails.Retention.ToString() $autobackup = $LogDetails.AutoBackup.ToString() $maxLogSize = $LogDetails.MaxLogSize.ToString() - $osVersion = [Version] (Get-Ciminstance Win32_OperatingSystem).Version + $osVersion = [Version] (Get-CimInstance Win32_OperatingSystem).Version if (($LogDetails.Type -eq "Analytic") -or ($LogDetails.Type -eq "Debug")) { @@ -347,7 +347,7 @@ function Disable-PSTrace } } } -add-type @" +Add-Type @" using System; namespace Microsoft.PowerShell.Diagnostics diff --git a/src/powershell-native/Install-PowerShellRemoting.ps1 b/src/powershell-native/Install-PowerShellRemoting.ps1 index b08194fc201..f42fcde2da6 100644 --- a/src/powershell-native/Install-PowerShellRemoting.ps1 +++ b/src/powershell-native/Install-PowerShellRemoting.ps1 @@ -215,7 +215,7 @@ function Install-PluginEndpoint { try { - Write-Host "`nGet-PSSessionConfiguration $pluginEndpointName" -foregroundcolor "green" + Write-Host "`nGet-PSSessionConfiguration $pluginEndpointName" -ForegroundColor "green" Get-PSSessionConfiguration $pluginEndpointName -ErrorAction Stop } catch [Microsoft.PowerShell.Commands.WriteErrorException] @@ -227,6 +227,6 @@ function Install-PluginEndpoint { Install-PluginEndpoint -Force $Force Install-PluginEndpoint -Force $Force -VersionIndependent -Write-Host "Restarting WinRM to ensure that the plugin configuration change takes effect.`nThis is required for WinRM running on Windows SKUs prior to Windows 10." -foregroundcolor Magenta +Write-Host "Restarting WinRM to ensure that the plugin configuration change takes effect.`nThis is required for WinRM running on Windows SKUs prior to Windows 10." -ForegroundColor Magenta Restart-Service winrm diff --git a/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 index 2a574af68f4..40fa0ec1027 100644 --- a/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 +++ b/test/SSHRemoting/SSHRemoting.Basic.Tests.ps1 @@ -23,8 +23,8 @@ Describe "SSHRemoting Basic Tests" -tags CI { Context "New-PSSession Tests" { AfterEach { - if ($script:session -ne $null) { Remove-PSSession -session $script:session } - if ($script:sessions -ne $null) { Remove-PSSession -session $script:sessions } + if ($script:session -ne $null) { Remove-PSSession -Session $script:session } + if ($script:sessions -ne $null) { Remove-PSSession -Session $script:sessions } } It "Verifies new connection with implicit current User" { diff --git a/test/common/markdown/markdown-link.tests.ps1 b/test/common/markdown/markdown-link.tests.ps1 index 197250d3663..7ff5480be32 100644 --- a/test/common/markdown/markdown-link.tests.ps1 +++ b/test/common/markdown/markdown-link.tests.ps1 @@ -17,12 +17,12 @@ Describe "Verify Markdown Links" { } # Cleanup jobs for reliability - get-job | remove-job -force + Get-Job | Remove-Job -Force } AfterAll { # Cleanup jobs to leave the process the same - get-job | remove-job -force + Get-Job | Remove-Job -Force } $groups = Get-ChildItem -Path "$PSScriptRoot\..\..\..\*.md" -Recurse | Where-Object {$_.DirectoryName -notlike '*node_modules*'} | Group-Object -Property directory @@ -31,7 +31,7 @@ Describe "Verify Markdown Links" { # start all link verification in parallel Foreach($group in $groups) { - Write-Verbose -verbose "starting jobs for $($group.Name) ..." + Write-Verbose -Verbose "starting jobs for $($group.Name) ..." $job = Start-ThreadJob { param([object] $group) foreach($file in $group.Group) @@ -46,13 +46,13 @@ Describe "Verify Markdown Links" { $jobs.add($group.name,$job) } - Write-Verbose -verbose "Getting results ..." + Write-Verbose -Verbose "Getting results ..." # Get the results and verify foreach($key in $jobs.keys) { $job = $jobs.$key $results = Receive-Job -Job $job -Wait - Remove-job -job $Job + Remove-Job -Job $Job foreach($jobResult in $results) { $file = $jobResult.file @@ -85,14 +85,14 @@ Describe "Verify Markdown Links" { if($passes) { - it " should work" -TestCases $passes { + It " should work" -TestCases $passes { noop } } if($trueFailures) { - it " should work" -TestCases $trueFailures { + It " should work" -TestCases $trueFailures { param($url) # there could be multiple reasons why a failure is ok @@ -111,7 +111,7 @@ Describe "Verify Markdown Links" { # If invoke-WebRequest can handle the URL, re-verify, with 6 retries try { - $null = Invoke-WebRequest -uri $url -RetryIntervalSec 10 -MaximumRetryCount 6 + $null = Invoke-WebRequest -Uri $url -RetryIntervalSec 10 -MaximumRetryCount 6 } catch [Microsoft.PowerShell.Commands.HttpResponseException] { @@ -128,7 +128,7 @@ Describe "Verify Markdown Links" { if($verifyFailures) { - it " should work" -TestCases $verifyFailures -Pending { + It " should work" -TestCases $verifyFailures -Pending { } } diff --git a/test/docker/networktest/DockerRemoting.Tests.ps1 b/test/docker/networktest/DockerRemoting.Tests.ps1 index df6ed5833fb..5f5a13c5b4c 100644 --- a/test/docker/networktest/DockerRemoting.Tests.ps1 +++ b/test/docker/networktest/DockerRemoting.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ $dockerimage = docker images --format "{{ .Repository }}" $imageName if ( $dockerimage -ne $imageName ) { $pending = $true - write-warning "Docker image '$imageName' not found, not running tests" + Write-Warning "Docker image '$imageName' not found, not running tests" return } else { @@ -15,18 +15,18 @@ Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ } # give the containers something to do, otherwise they will exit and be removed - Write-Verbose -verbose "setting up docker container PowerShell server" + Write-Verbose -Verbose "setting up docker container PowerShell server" $server = docker run -d $imageName powershell -c Start-Sleep -Seconds $timeout - Write-Verbose -verbose "setting up docker container PowerShell client" + Write-Verbose -Verbose "setting up docker container PowerShell client" $client = docker run -d $imageName powershell -c Start-Sleep -Seconds $timeout # get fullpath to installed core powershell - Write-Verbose -verbose "Getting path to PowerShell" + Write-Verbose -Verbose "Getting path to PowerShell" $powershellcorepath = docker exec $server powershell -c "(get-childitem 'c:\program files\powershell\*\pwsh.exe').fullname" if ( ! $powershellcorepath ) { $pending = $true - write-warning "Cannot find powershell executable, not running tests" + Write-Warning "Cannot find powershell executable, not running tests" return } $powershellcoreversion = ($powershellcorepath -split "[\\/]")[-2] @@ -34,27 +34,27 @@ Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ $powershellcoreConfiguration = "powershell.${powershellcoreversion}" # capture the hostnames of the containers which will be used by the tests - write-verbose -verbose "getting server hostname" + Write-Verbose -Verbose "getting server hostname" $serverhostname = docker exec $server hostname - write-verbose -verbose "getting client hostname" + Write-Verbose -Verbose "getting client hostname" $clienthostname = docker exec $client hostname # capture the versions of full and core PowerShell - write-verbose -verbose "getting powershell full version" + Write-Verbose -Verbose "getting powershell full version" $fullVersion = docker exec $client powershell -c "`$PSVersionTable.psversion.tostring()" if ( ! $fullVersion ) { $pending = $true - write-warning "Cannot determine PowerShell full version, not running tests" + Write-Warning "Cannot determine PowerShell full version, not running tests" return } - write-verbose -verbose "getting powershell version" + Write-Verbose -Verbose "getting powershell version" $coreVersion = docker exec $client "$powershellcorepath" -c "`$PSVersionTable.psversion.tostring()" if ( ! $coreVersion ) { $pending = $true - write-warning "Cannot determine PowerShell version, not running tests" + Write-Warning "Cannot determine PowerShell version, not running tests" return } } @@ -67,22 +67,22 @@ Describe "Basic remoting test with docker" -tags @("Scenario","Slow"){ } } - It "Full powershell can get correct remote powershell version" -pending:$pending { + It "Full powershell can get correct remote powershell version" -Pending:$pending { $result = docker exec $client powershell -c "`$ss = [security.securestring]::new(); '11aa!!AA'.ToCharArray() | ForEach-Object { `$ss.appendchar(`$_)}; `$c = [pscredential]::new('testuser',`$ss); `$ses=new-pssession $serverhostname -configurationname $powershellcoreConfiguration -auth basic -credential `$c; invoke-command -session `$ses { `$PSVersionTable.psversion.tostring() }" $result | Should -Be $coreVersion } - It "Full powershell can get correct remote powershell full version" -pending:$pending { + It "Full powershell can get correct remote powershell full version" -Pending:$pending { $result = docker exec $client powershell -c "`$ss = [security.securestring]::new(); '11aa!!AA'.ToCharArray() | ForEach-Object { `$ss.appendchar(`$_)}; `$c = [pscredential]::new('testuser',`$ss); `$ses=new-pssession $serverhostname -auth basic -credential `$c; invoke-command -session `$ses { `$PSVersionTable.psversion.tostring() }" $result | Should -Be $fullVersion } - It "Core powershell can get correct remote powershell version" -pending:$pending { + It "Core powershell can get correct remote powershell version" -Pending:$pending { $result = docker exec $client "$powershellcorepath" -c "`$ss = [security.securestring]::new(); '11aa!!AA'.ToCharArray() | ForEach-Object { `$ss.appendchar(`$_)}; `$c = [pscredential]::new('testuser',`$ss); `$ses=new-pssession $serverhostname -configurationname $powershellcoreConfiguration -auth basic -credential `$c; invoke-command -session `$ses { `$PSVersionTable.psversion.tostring() }" $result | Should -Be $coreVersion } - It "Core powershell can get correct remote powershell full version" -pending:$pending { + It "Core powershell can get correct remote powershell full version" -Pending:$pending { $result = docker exec $client "$powershellcorepath" -c "`$ss = [security.securestring]::new(); '11aa!!AA'.ToCharArray() | ForEach-Object { `$ss.appendchar(`$_)}; `$c = [pscredential]::new('testuser',`$ss); `$ses=new-pssession $serverhostname -auth basic -credential `$c; invoke-command -session `$ses { `$PSVersionTable.psversion.tostring() }" $result | Should -Be $fullVersion } diff --git a/test/docker/networktest/New-DockerTestBuild.ps1 b/test/docker/networktest/New-DockerTestBuild.ps1 index 8f548e7bc41..b7347bd5dc8 100644 --- a/test/docker/networktest/New-DockerTestBuild.ps1 +++ b/test/docker/networktest/New-DockerTestBuild.ps1 @@ -16,7 +16,7 @@ $script:Constants = @{ #### DOCKER OPS ##### # is docker installed? -$dockerExe = get-command docker -ea silentlycontinue +$dockerExe = Get-Command docker -ea silentlycontinue if ( $dockerExe.name -ne "docker.exe" ) { throw "Cannot find docker, is it installed?" } @@ -43,7 +43,7 @@ if ( $TestImage -eq $Constants.TestImageName) #### MSI CHECKS #### # check to see if the MSI is present -$MsiExists = test-path $Constants.MsiName +$MsiExists = Test-Path $Constants.MsiName $msg = "{0} exists, use -Force to remove or -UseExistingMsi to use" -f $Constants.MsiName if ( $MsiExists -and ! ($force -or $useExistingMsi)) { @@ -53,7 +53,7 @@ if ( $MsiExists -and ! ($force -or $useExistingMsi)) # remove the msi if ( $MsiExists -and $Force -and ! $UseExistingMsi ) { - Remove-Item -force $Constants.MsiName + Remove-Item -Force $Constants.MsiName $MsiExists = $false } @@ -70,7 +70,7 @@ elseif ( $MsiExists -and ! $UseExistingMsi ) } # last check before bulding the image -if ( ! (test-path $Constants.MsiName) ) +if ( ! (Test-Path $Constants.MsiName) ) { throw ("{0} does not exist, giving up" -f $Constants.MsiName) } diff --git a/test/nanoserver/nanoserver.tests.ps1 b/test/nanoserver/nanoserver.tests.ps1 index 1b1ec6b0576..85112f461f0 100644 --- a/test/nanoserver/nanoserver.tests.ps1 +++ b/test/nanoserver/nanoserver.tests.ps1 @@ -4,14 +4,14 @@ Describe "Verify PowerShell Runs" { BeforeAll{ $options = (Get-PSOptions) - $path = split-path -path $options.Output + $path = Split-Path -Path $options.Output Write-Verbose "Path: '$path'" -Verbose - $rootPath = split-Path -path $path + $rootPath = Split-Path -Path $path $mount = 'C:\powershell' $container = 'mcr.microsoft.com/powershell:nanoserver-1803' } - it "Verify Version " { + It "Verify Version " { $version = docker run --rm -v "${rootPath}:${mount}" ${container} "${mount}\publish\pwsh" -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' $version | Should -Match '^7\.' } diff --git a/test/powershell/Host/Base-Directory.Tests.ps1 b/test/powershell/Host/Base-Directory.Tests.ps1 index 246db8fb839..a55af971f09 100644 --- a/test/powershell/Host/Base-Directory.Tests.ps1 +++ b/test/powershell/Host/Base-Directory.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Configuration file locations" -tags "CI","Slow" { } It @ItArgs "PSReadLine history save location should be correct" { - & $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should -Be $expectedReadline + & $powershell -noprofile { (Get-PSReadLineOption).HistorySavePath } | Should -Be $expectedReadline } # This feature (and thus test) has been disabled because of the AssemblyLoadContext scenario @@ -104,7 +104,7 @@ Describe "Configuration file locations" -tags "CI","Slow" { It @ItArgs "PSReadLine history should respect XDG_DATA_HOME" { $env:XDG_DATA_HOME = $TestDrive $expected = [IO.Path]::Combine($TestDrive, "powershell", "PSReadLine", "ConsoleHost_history.txt") - & $powershell -noprofile { (Get-PSReadlineOption).HistorySavePath } | Should -Be $expected + & $powershell -noprofile { (Get-PSReadLineOption).HistorySavePath } | Should -Be $expected } # This feature (and thus test) has been disabled because of the AssemblyLoadContext scenario diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index ba1a4910938..d8eec255184 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -351,12 +351,12 @@ export $envVarName='$guid' # must use an explicit scope of LocalMachine to ensure the setting is written to the expected file. # Skip the tests on Unix platforms because *-ExecutionPolicy cmdlets don't work by design. - It "Verifies PowerShell reads from the custom -settingsFile" -skip:(!$IsWindows) { + It "Verifies PowerShell reads from the custom -settingsFile" -Skip:(!$IsWindows) { $actualValue = & $powershell -NoProfile -SettingsFile $CustomSettingsFile -Command {(Get-ExecutionPolicy -Scope LocalMachine).ToString()} $actualValue | Should -Be $DefaultExecutionPolicy } - It "Verifies PowerShell writes to the custom -settingsFile" -skip:(!$IsWindows) { + It "Verifies PowerShell writes to the custom -settingsFile" -Skip:(!$IsWindows) { $expectedValue = 'AllSigned' # Update the execution policy; this should update the settings file. @@ -371,7 +371,7 @@ export $envVarName='$guid' $actualValue | Should -Be $expectedValue } - It "Verify PowerShell removes a setting from the custom -settingsFile" -skip:(!$IsWindows) { + It "Verify PowerShell removes a setting from the custom -settingsFile" -Skip:(!$IsWindows) { # Remove the LocalMachine execution policy; this should update the settings file. & $powershell -NoProfile -SettingsFile $CustomSettingsFile -Command {Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine } @@ -385,8 +385,8 @@ export $envVarName='$guid' $p = [PSCustomObject]@{X=10;Y=20} It "xml input" { - $p | & $powershell -noprofile { $input | Foreach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } } | Should -Be 30 - $p | & $powershell -noprofile -inputFormat xml { $input | Foreach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } } | Should -Be 30 + $p | & $powershell -noprofile { $input | ForEach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } } | Should -Be 30 + $p | & $powershell -noprofile -inputFormat xml { $input | ForEach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } } | Should -Be 30 } It "text input" { @@ -395,8 +395,8 @@ export $envVarName='$guid' } It "xml output" { - & $powershell -noprofile { [PSCustomObject]@{X=10;Y=20} } | Foreach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } | Should -Be 30 - & $powershell -noprofile -outputFormat xml { [PSCustomObject]@{X=10;Y=20} } | Foreach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } | Should -Be 30 + & $powershell -noprofile { [PSCustomObject]@{X=10;Y=20} } | ForEach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } | Should -Be 30 + & $powershell -noprofile -outputFormat xml { [PSCustomObject]@{X=10;Y=20} } | ForEach-Object {$a = 0} { $a += $_.X + $_.Y } { $a } | Should -Be 30 } It "text output" { @@ -638,17 +638,17 @@ namespace StackTest { $env:XDG_CONFIG_HOME = $XDG_CONFIG_HOME } - It "Should start if Data, Config, and Cache location is not accessible" -skip:($IsWindows) { + It "Should start if Data, Config, and Cache location is not accessible" -Skip:($IsWindows) { $env:XDG_CACHE_HOME = "/dev/cpu" $env:XDG_DATA_HOME = "/dev/cpu" $env:XDG_CONFIG_HOME = "/dev/cpu" - $output = & $powershell -noprofile -Command { (get-command).count } + $output = & $powershell -noprofile -Command { (Get-Command).count } [int]$output | Should -BeGreaterThan 0 } } Context "HOME environment variable" { - It "Should start if HOME is not defined" -skip:($IsWindows) { + It "Should start if HOME is not defined" -Skip:($IsWindows) { bash -c "unset HOME;$powershell -c '1+1'" | Should -BeExactly 2 } } @@ -769,7 +769,7 @@ namespace StackTest { Context "ApartmentState WPF tests" -Tag Slow { It "WPF requires STA and will work" -Skip:(!$IsWindows -or [System.Management.Automation.Platform]::IsNanoServer) { - add-type -AssemblyName presentationframework + Add-Type -AssemblyName presentationframework $xaml = [xml]@" " -testcases $testcases { + It "pwsh can startup in a directory named " -TestCases $testcases { param ( $dirname ) try { Push-Location -LiteralPath "${TESTDRIVE}/${dirname}" @@ -1013,6 +1013,6 @@ Describe 'Pwsh startup and PATH' -Tag CI { Describe 'Console host name' -Tag CI { It 'Name is pwsh' -Pending { # waiting on https://github.com/dotnet/runtime/issues/33673 - (Get-Process -id $PID).Name | Should -BeExactly 'pwsh' + (Get-Process -Id $PID).Name | Should -BeExactly 'pwsh' } } diff --git a/test/powershell/Host/Logging.Tests.ps1 b/test/powershell/Host/Logging.Tests.ps1 index 30895cd2c5e..5159d46551f 100644 --- a/test/powershell/Host/Logging.Tests.ps1 +++ b/test/powershell/Host/Logging.Tests.ps1 @@ -204,7 +204,7 @@ $PID $items | Should -Not -Be $null $items.Count | Should -BeGreaterThan 2 - $createdEvents = $items | where-object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} + $createdEvents = $items | Where-Object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} $createdEvents.Count | Should -BeGreaterOrEqual 3 # Verify we log that we are executing a file @@ -233,7 +233,7 @@ $PID $items | Should -Not -Be $null $items.Count | Should -BeGreaterThan 2 - $createdEvents = $items | where-object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} + $createdEvents = $items | Where-Object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} $createdEvents.Count | Should -BeGreaterOrEqual 3 # Verify we log that we are executing a file @@ -353,7 +353,7 @@ $PID $items | Should -Not -Be $null $items.Count | Should -BeGreaterThan 2 - $createdEvents = $items | where-object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} + $createdEvents = $items | Where-Object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} $createdEvents.Count | Should -BeGreaterOrEqual 3 # Verify we log that we are executing a file @@ -391,7 +391,7 @@ $PID $items | Should -Not -Be $null $items.Count | Should -BeGreaterThan 2 - $createdEvents = $items | where-object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} + $createdEvents = $items | Where-Object {$_.EventId -eq 'ScriptBlock_Compile_Detail:ExecuteCommand.Create.Verbose'} $createdEvents.Count | Should -BeGreaterOrEqual 3 # Verify we log that we are executing a file diff --git a/test/powershell/Host/Startup.Tests.ps1 b/test/powershell/Host/Startup.Tests.ps1 index 8f419fbc37f..05b2534bc9a 100644 --- a/test/powershell/Host/Startup.Tests.ps1 +++ b/test/powershell/Host/Startup.Tests.ps1 @@ -105,8 +105,8 @@ Describe "Validate start of console host" -Tag CI { $diffs = Compare-Object -ReferenceObject $allowedAssemblies -DifferenceObject $loadedAssemblies if ($null -ne $diffs) { - $assembliesAllowedButNotLoaded = $diffs | Where-Object SideIndicator -eq "<=" | ForEach-Object InputObject - $assembliesLoadedButNotAllowed = $diffs | Where-Object SideIndicator -eq "=>" | ForEach-Object InputObject + $assembliesAllowedButNotLoaded = $diffs | Where-Object SideIndicator -EQ "<=" | ForEach-Object InputObject + $assembliesLoadedButNotAllowed = $diffs | Where-Object SideIndicator -EQ "=>" | ForEach-Object InputObject if ($assembliesAllowedButNotLoaded) { Write-Host ("Assemblies that are expected but not loaded: {0}" -f ($assembliesAllowedButNotLoaded -join ", ")) diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index cebb2a2f82d..6cdb521d782 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -34,12 +34,12 @@ Describe "TabCompletion" -Tags CI { $res.CompletionMatches[0].CompletionText | Should -BeExactly 'ToString(' } - It 'Should complete dotnet method with null conditional operator' -skip:$nullConditionalFeatureDisabled { + It 'Should complete dotnet method with null conditional operator' -Skip:$nullConditionalFeatureDisabled { $res = TabExpansion2 -inputScript '(1)?.ToSt' -cursorColumn '(1)?.ToSt'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly 'ToString(' } - It 'Should complete dotnet method with null conditional operator without first letter' -skip:$nullConditionalFeatureDisabled { + It 'Should complete dotnet method with null conditional operator without first letter' -Skip:$nullConditionalFeatureDisabled { $res = TabExpansion2 -inputScript '(1)?.' -cursorColumn '(1)?.'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly 'CompareTo(' } @@ -147,18 +147,18 @@ Describe "TabCompletion" -Tags CI { $res.CompletionMatches.Count | Should -BeGreaterThan 0 } - It 'Should complete keyword' -skip { + It 'Should complete keyword' -Skip { $res = TabExpansion2 -inputScript 'using nam' -cursorColumn 'using nam'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly 'namespace' } - It 'Should first suggest -Full and then -Functionality when using Get-Help -Fu' -skip { + It 'Should first suggest -Full and then -Functionality when using Get-Help -Fu' -Skip { $res = TabExpansion2 -inputScript 'Get-Help -Fu' -cursorColumn 'Get-Help -Fu'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly '-Full' $res.CompletionMatches[1].CompletionText | Should -BeExactly '-Functionality' } - It 'Should first suggest -Full and then -Functionality when using help -Fu' -skip { + It 'Should first suggest -Full and then -Functionality when using help -Fu' -Skip { $res = TabExpansion2 -inputScript 'help -Fu' -cursorColumn 'help -Fu'.Length $res.CompletionMatches[0].CompletionText | Should -BeExactly '-Full' $res.CompletionMatches[1].CompletionText | Should -BeExactly '-Functionality' @@ -349,7 +349,7 @@ Describe "TabCompletion" -Tags CI { } } $line = "$nativeCommand --f" - $res = TaBexpansion2 -inputScript $line -cursorColumn $line.Length + $res = TabExpansion2 -inputScript $line -cursorColumn $line.Length $res.CompletionMatches | Should -HaveCount 1 $res.CompletionMatches.CompletionText | Should -BeExactly "--flag" } @@ -365,7 +365,7 @@ Describe "TabCompletion" -Tags CI { } } $line = "$nativeCommand -o" - $res = TaBexpansion2 -inputScript $line -cursorColumn $line.Length + $res = TabExpansion2 -inputScript $line -cursorColumn $line.Length $res.CompletionMatches | Should -HaveCount 1 $res.CompletionMatches.CompletionText | Should -BeExactly "-option" } @@ -380,8 +380,8 @@ Describe "TabCompletion" -Tags CI { Context "Script name completion" { BeforeAll { - setup -f 'install-powershell.ps1' -content "" - setup -f 'remove-powershell.ps1' -content "" + Setup -f 'install-powershell.ps1' -Content "" + Setup -f 'remove-powershell.ps1' -Content "" $scriptWithWildcardCases = @( @{ @@ -415,7 +415,7 @@ Describe "TabCompletion" -Tags CI { Pop-Location } - it "Input should successfully complete" -TestCases $scriptWithWildcardCases { + It "Input should successfully complete" -TestCases $scriptWithWildcardCases { param($command, $expectedCommand) $res = TabExpansion2 -inputScript $command -cursorColumn $command.Length $res.CompletionMatches.Count | Should -BeGreaterThan 0 @@ -699,7 +699,7 @@ Describe "TabCompletion" -Tags CI { ## if $PSHOME contains a space tabcompletion adds ' around the path @{ inputStr = 'cd $PSHOME\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null } @{ inputStr = 'cd "$PSHOME\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null } - @{ inputStr = '$PSHOME\System.Management.Au'; expected = if($PSHOME.Contains(' ')) { "`& '$(Join-Path $PSHOME 'System.Management.Automation.dll')'" } else { Join-Path $PSHOME 'System.Management.Automation.dll'; setup = $null }} + @{ inputStr = '$PSHOME\System.Management.Au'; expected = if($PSHOME.Contains(' ')) { "`& '$(Join-Path $PSHOME 'System.Management.Automation.dll')'" } else { Join-Path $PSHOME 'System.Management.Automation.dll'; Setup = $null }} @{ inputStr = '"$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null } @{ inputStr = '& "$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null } ## tab completion AST-based tests diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index 0fc2c020a0c..d1ce05e8f23 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -13,7 +13,7 @@ Describe "Windows Installer" -Tags "Scenario" { ) } - It "WiX (Windows Installer XML) file contains pre-requisites link $preRequisitesLink" -skip:$skipTest { + It "WiX (Windows Installer XML) file contains pre-requisites link $preRequisitesLink" -Skip:$skipTest { $wixProductFile = Join-Path -Path $PSScriptRoot -ChildPath "..\..\..\assets\Product.wxs" (Get-Content $wixProductFile -Raw).Contains($preRequisitesLink) | Should -BeTrue } @@ -21,7 +21,7 @@ Describe "Windows Installer" -Tags "Scenario" { ## Running 'Invoke-WebRequest' with WMF download URLs has been failing intermittently, ## because sometimes the URLs lead to a 'this download is no longer available' page. ## We use a retry logic here. Retry for 5 times with 1 second interval. - It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases -skip:$skipTest { + It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases -Skip:$skipTest { param ($Url) foreach ($i in 1..5) { diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index 8ba3edc8099..9bef836e19b 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -105,7 +105,7 @@ Describe 'Positive Parse Properties Tests' -Tags "CI" { class C12c { [void] f() { [System.Management.Automation.Host.Rectangle]$foo = [System.Management.Automation.Host.Rectangle]::new(0, 0, 0, 0) } } } - context "Positive ParseMethods return type Test" { + Context "Positive ParseMethods return type Test" { # Method with return type of self class C9 { [C9] f() { return [C9]::new() } } $c9 = [C9]::new().f() @@ -710,7 +710,7 @@ visibleX visibleY # Get-Member should not include hidden members by default $member = $instance | Get-Member hiddenZ - it "Get-Member should not find hidden member w/o -Force" { $member | Should -BeNullOrEmpty } + It "Get-Member should not find hidden member w/o -Force" { $member | Should -BeNullOrEmpty } # Get-Member should include hidden members with -Force $member = $instance | Get-Member hiddenZ -Force @@ -742,10 +742,10 @@ Describe 'Scoped Types Test' -Tags "CI" { { class C1 { [string] GetContext() { return "f2 scope" } } - return (new-object C1).GetContext() + return (New-Object C1).GetContext() } - It "New-Object at test scope" { (new-object C1).GetContext() | Should -BeExactly "Test scope" } + It "New-Object at test scope" { (New-Object C1).GetContext() | Should -BeExactly "Test scope" } It "[C1]::new() at test scope" { [C1]::new().GetContext() | Should -BeExactly "Test scope" } It "[C1]::new() in nested scope" { (f1) | Should -BeExactly "f1 scope" } @@ -804,7 +804,7 @@ Describe 'Type building' -Tags "CI" { Describe 'RuntimeType created for TypeDefinitionAst' -Tags "CI" { - It 'can make cast to the right RuntimeType in two different contexts' -pending { + It 'can make cast to the right RuntimeType in two different contexts' -Pending { $ssfe = [System.Management.Automation.Runspaces.SessionStateFunctionEntry]::new("foo", @' class Base diff --git a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 index e94d57e115b..a2260a6f164 100644 --- a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 @@ -9,7 +9,7 @@ Describe 'NestedModules' -Tags "CI" { [string[]]$NestedContents ) - new-item -type directory -Force "TestDrive:\$Name" > $null + New-Item -type directory -Force "TestDrive:\$Name" > $null $manifestParams = @{ Path = "TestDrive:\$Name\$Name.psd1" } @@ -21,7 +21,7 @@ Describe 'NestedModules' -Tags "CI" { if ($NestedContents) { $manifestParams['NestedModules'] = 1..$NestedContents.Count | ForEach-Object { - $null = new-item -type directory TestDrive:\$Name\Nested$_ + $null = New-Item -type directory TestDrive:\$Name\Nested$_ $null = Set-Content -Path "${TestDrive}\$Name\Nested$_\Nested$_.psm1" -Value $NestedContents[$_ - 1] "Nested$_" } @@ -29,7 +29,7 @@ Describe 'NestedModules' -Tags "CI" { New-ModuleManifest @manifestParams - $resolvedTestDrivePath = Split-Path ((get-childitem TestDrive:\)[0].FullName) + $resolvedTestDrivePath = Split-Path ((Get-ChildItem TestDrive:\)[0].FullName) if (-not ($env:PSModulePath -like "*$resolvedTestDrivePath*")) { $env:PSModulePath += "$([System.IO.Path]::PathSeparator)$resolvedTestDrivePath" } @@ -103,7 +103,7 @@ using module WithRoot # We need to think about it: should it work or not. # Currently, types are resolved in compile-time to the 'local' versions # So at runtime we don't call the module versions. - It 'Can execute type creation in the module context with new()' -pending { + It 'Can execute type creation in the module context with new()' -Pending { & (Get-Module ABC) { [C]::new().foo() } | Should -Be C & (Get-Module NoRoot) { [A]::new().foo() } | Should -Be A2 & (Get-Module WithRoot) { [A]::new().foo() } | Should -Be A0 diff --git a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 index f19507d59e5..cf304d5918e 100644 --- a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 @@ -103,7 +103,7 @@ Describe 'Classes inheritance syntax' -Tags "CI" { [void]ExitNestedPrompt(){ throw "Unsupported" } [void]NotifyBeginApplication() { } [void]NotifyEndApplication() { } - [string]get_Name() { return $this.myName; write-host "MyName" } + [string]get_Name() { return $this.myName; Write-Host "MyName" } [version]get_Version() { return $this.myVersion } [System.Globalization.CultureInfo]get_CurrentCulture() { return $this.myCurrentCulture } [System.Globalization.CultureInfo]get_CurrentUICulture() { return $this.myCurrentUICulture } diff --git a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 index 8ea691888a5..fb3778463da 100644 --- a/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.using.tests.ps1 @@ -14,15 +14,15 @@ Describe 'using module' -Tags "CI" { ) if ($manifest) { - new-item -type directory -Force "${TestDrive}\$ModulePathPrefix\$Name\$Version" > $null + New-Item -type directory -Force "${TestDrive}\$ModulePathPrefix\$Name\$Version" > $null Set-Content -Path "${TestDrive}\$ModulePathPrefix\$Name\$Version\$Name.psm1" -Value $Content New-ModuleManifest -RootModule "$Name.psm1" -Path "${TestDrive}\$ModulePathPrefix\$Name\$Version\$Name.psd1" -ModuleVersion $Version } else { - new-item -type directory -Force "${TestDrive}\$ModulePathPrefix\$Name" > $null + New-Item -type directory -Force "${TestDrive}\$ModulePathPrefix\$Name" > $null Set-Content -Path "${TestDrive}\$ModulePathPrefix\$Name\$Name.psm1" -Value $Content } - $resolvedTestDrivePath = Split-Path ((get-childitem "${TestDrive}\$ModulePathPrefix")[0].FullName) + $resolvedTestDrivePath = Split-Path ((Get-ChildItem "${TestDrive}\$ModulePathPrefix")[0].FullName) if (-not ($env:PSModulePath -like "*$resolvedTestDrivePath*")) { $env:PSModulePath += "$([System.IO.Path]::PathSeparator)$resolvedTestDrivePath" } @@ -416,7 +416,7 @@ function foo() } '@ # resolve name to absolute path - $scriptToProcessPath = (get-childitem $scriptToProcessPath).FullName + $scriptToProcessPath = (Get-ChildItem $scriptToProcessPath).FullName $iss = [System.Management.Automation.Runspaces.initialsessionstate]::CreateDefault() $iss.StartupScripts.Add($scriptToProcessPath) @@ -442,7 +442,7 @@ function foo() New-TestModule -Name FooForPaths -Content 'class Foo { [string] GetModuleName() { return "FooForPaths" } }' $env:PSModulePath = $originalPSModulePath - new-item -type directory -Force TestDrive:\FooRelativeConsumer + New-Item -type directory -Force TestDrive:\FooRelativeConsumer Set-Content -Path "${TestDrive}\FooRelativeConsumer\FooRelativeConsumer.ps1" -Value @' using module ..\modules\FooForPaths class Bar : Foo {} @@ -471,7 +471,7 @@ class Bar : Foo {} } It "can be accessed by absolute path" { - $resolvedTestDrivePath = Split-Path ((get-childitem TestDrive:\modules)[0].FullName) + $resolvedTestDrivePath = Split-Path ((Get-ChildItem TestDrive:\modules)[0].FullName) $s = @" using module $resolvedTestDrivePath\FooForPaths [Foo]::new() @@ -483,7 +483,7 @@ using module $resolvedTestDrivePath\FooForPaths } It "can be accessed by absolute path with file extension" { - $resolvedTestDrivePath = Split-Path ((get-childitem TestDrive:\modules)[0].FullName) + $resolvedTestDrivePath = Split-Path ((Get-ChildItem TestDrive:\modules)[0].FullName) $barObject = [scriptblock]::Create(@" using module $resolvedTestDrivePath\FooForPaths\FooForPaths.psm1 [Foo]::new() diff --git a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 index a94c1835e59..76069143327 100644 --- a/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/ComparisonOperator.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "ComparisonOperator" -tag "CI" { +Describe "ComparisonOperator" -Tag "CI" { It "Should be for " -TestCases @( @{lhs = 1; operator = "-lt"; rhs = 2; result = $true}, @@ -84,7 +84,7 @@ Describe "ComparisonOperator" -tag "CI" { } } -Describe "Bytewise Operator" -tag "CI" { +Describe "Bytewise Operator" -Tag "CI" { It "Test -bor on enum with [byte] as underlying type" { $result = [System.Security.AccessControl.AceFlags]::ObjectInherit -bxor ` diff --git a/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 b/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 index e3581666552..e2e54c32170 100644 --- a/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/PipelineChainOperator.Tests.ps1 @@ -341,6 +341,6 @@ function Test-FullyTerminatingError It "Recognises invalid assignment" { { Invoke-Expression -Command '$x = $x, $y += $z = testexe -returncode 0 && testexe -returncode 1' - } | Should -Throw -ErrorID 'InvalidLeftHandSide,Microsoft.PowerShell.Commands.InvokeExpressionCommand' + } | Should -Throw -ErrorId 'InvalidLeftHandSide,Microsoft.PowerShell.Commands.InvokeExpressionCommand' } } diff --git a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 index 12b5bccbe2d..32928474144 100644 --- a/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 +++ b/test/powershell/Language/Operators/TernaryOperator.Tests.ps1 @@ -40,7 +40,7 @@ Describe "Using of ternary operator" -Tags CI { @{ Script = { $IsCoreCLR ? $false ? 'nested-if-true' : $true ? 'nested-nested-if-true' : 'nested-nested-if-false' : 'if-false' }; ExpectedValue = 'nested-nested-if-true' } ## Binary operator has higher precedence order than ternary - @{ Script = { !$IsCoreCLR ? 'Core' : 'Desktop' -eq 'Core' }; ExpectedValue = !$IsCoreCLR ? 'Core' : ('Desktop' -eq 'Core') } + @{ Script = { !$IsCoreCLR ? 'Core' : 'Desktop' -EQ 'Core' }; ExpectedValue = !$IsCoreCLR ? 'Core' : ('Desktop' -eq 'Core') } @{ Script = { ($IsCoreCLR ? 'Core' : 'Desktop') -eq 'Core' }; ExpectedValue = $true } ) } @@ -57,7 +57,7 @@ Describe "Using of ternary operator" -Tags CI { } It "Ternary expression which generates a terminating error should halt appropriately" { - { (write-error -Message error -ErrorAction Stop) ? 1 : 2 } | Should -Throw -ErrorId Microsoft.PowerShell.Commands.WriteErrorException + { (Write-Error -Message error -ErrorAction Stop) ? 1 : 2 } | Should -Throw -ErrorId Microsoft.PowerShell.Commands.WriteErrorException } It "Use ternary operator in parameter default values" { diff --git a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 index 8229634e45b..3c9edd43915 100644 --- a/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 +++ b/test/powershell/Language/Parser/ExtensibleCompletion.Tests.ps1 @@ -108,7 +108,7 @@ function Test-Completions { $skip = $false if ( $expected.CompletionText -Match "System.Management.Automation.PerformanceData|System.Management.Automation.Security" ) { $skip = $true } - It ($expected.CompletionText) -skip:$skip { + It ($expected.CompletionText) -Skip:$skip { $expected.Found | Should -BeTrue } } @@ -435,7 +435,7 @@ Describe "ArgumentCompletionsAttribute tests" -Tags "CI" { param($attributeName, $cmdletName) $line = "$cmdletName -Alpha val" - $res = TaBexpansion2 -inputScript $line -cursorColumn $line.Length + $res = TabExpansion2 -inputScript $line -cursorColumn $line.Length $res.CompletionMatches.Count | Should -Be 3 $res.CompletionMatches.CompletionText -join " " | Should -BeExactly "value1 value2 value3" { TestArgumentCompletionsAttribute -Alpha unExpectedValue } | Should -Not -Throw @@ -445,7 +445,7 @@ Describe "ArgumentCompletionsAttribute tests" -Tags "CI" { param($attributeName, $cmdletName) $line = "$cmdletName -Param1 val" - $res = TaBexpansion2 -inputScript $line -cursorColumn $line.Length + $res = TabExpansion2 -inputScript $line -cursorColumn $line.Length $res.CompletionMatches.Count | Should -Be 3 $res.CompletionMatches.CompletionText -join " " | Should -BeExactly "value1 value2 value3" { TestArgumentCompletionsAttribute -Param1 unExpectedValue } | Should -Not -Throw diff --git a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 index 07843346f06..b5a80b23155 100644 --- a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 +++ b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$powershellexe = (get-process -id $PID).mainmodule.filename +$powershellexe = (Get-Process -Id $PID).mainmodule.filename Describe "Clone array" -Tags "CI" { It "Cast in target expr" { @@ -27,7 +27,7 @@ Describe "Set fields through PSMemberInfo" -Tags "CI" { ([AStruct]@{s = "abc" }).s | Should -BeExactly "abc" } It "via new-object" { - (new-object AStruct -prop @{s="abc"}).s | Should -BeExactly "abc" + (New-Object AStruct -prop @{s="abc"}).s | Should -BeExactly "abc" } It "via PSObject" { $x = [AStruct]::new() diff --git a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 index e0f2aa909b1..a480997271f 100644 --- a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 @@ -79,23 +79,23 @@ Describe 'Argument transformation attribute on optional argument with explicit $ It "Script function takes uint64" { Invoke-ScriptFunctionTakesUInt64 | Should -Be 42 } - it "csharp cmdlet takes object" { + It "csharp cmdlet takes object" { Invoke-CSharpCmdletTakesObject | Should -Be "passed in null" } - it "csharp cmdlet takes uint64" { + It "csharp cmdlet takes uint64" { Invoke-CSharpCmdletTakesUInt64 | Should -Be 0 } - it "script function takes object when parameter is null" { + It "script function takes object when parameter is null" { Invoke-ScriptFunctionTakesObject -Address $null | Should -Be 42 } - it "script function takes unit64 when parameter is null" { + It "script function takes unit64 when parameter is null" { Invoke-ScriptFunctionTakesUInt64 -Address $null | Should -Be 42 } - it "script csharp cmdlet takes object when parameter is null" { + It "script csharp cmdlet takes object when parameter is null" { Invoke-CSharpCmdletTakesObject -Address $null | Should -Be 42 } - it "script csharp cmdlet takes uint64 when parameter is null" { + It "script csharp cmdlet takes uint64 when parameter is null" { Invoke-CSharpCmdletTakesUInt64 -Address $null | Should -Be 42 } } diff --git a/test/powershell/Language/Parser/Parser.Tests.ps1 b/test/powershell/Language/Parser/Parser.Tests.ps1 index 61df4e5b50c..b3163ba2f27 100644 --- a/test/powershell/Language/Parser/Parser.Tests.ps1 +++ b/test/powershell/Language/Parser/Parser.Tests.ps1 @@ -703,7 +703,7 @@ foo``u{2195}abc if ( $IsLinux -or $IsMacOS ) { # because we execute on *nix based on executable bit, and the file name doesn't matter # so we can use the same filename as for windows, just make sure it's executable with chmod - "#!/bin/sh`necho ""Hello World""" | Out-File -encoding ASCII $shellfile + "#!/bin/sh`necho ""Hello World""" | Out-File -Encoding ASCII $shellfile /bin/chmod +x $shellfile } else { diff --git a/test/powershell/Language/Parser/Parsing.Tests.ps1 b/test/powershell/Language/Parser/Parsing.Tests.ps1 index 67a740a0ede..23a152cef11 100644 --- a/test/powershell/Language/Parser/Parsing.Tests.ps1 +++ b/test/powershell/Language/Parser/Parsing.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -set-strictmode -v 2 +Set-StrictMode -v 2 Describe 'for statement parsing' -Tags "CI" { ShouldBeParseError 'for' MissingOpenParenthesisAfterKeyword 4 -CheckColumnNumber diff --git a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 index ea3a8cfee0a..caf7af1551f 100644 --- a/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingAssembly.Tests.ps1 @@ -44,7 +44,7 @@ public class ABC {} $err[0].ErrorId | Should -Be CannotLoadAssemblyWithUriSchema } - It "parse does not load the assembly" -pending { + It "parse does not load the assembly" -Pending { $assemblies = [Appdomain]::CurrentDomain.GetAssemblies().GetName().Name $assemblies -contains "UsingAssemblyTest$guid" | Should -BeFalse @@ -73,7 +73,7 @@ public class ABC {} $e.Exception.InnerException.ErrorRecord.FullyQualifiedErrorId | Should -Be 'ErrorLoadingAssembly' } #> - It "Assembly loaded at runtime" -pending { + It "Assembly loaded at runtime" -Pending { $assemblies = & "$PSHOME/pwsh" -noprofile -command @" using assembly .\UsingAssemblyTest$guid.dll [Appdomain]::CurrentDomain.GetAssemblies().GetName().Name diff --git a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 index 359e1245ea1..58d9b8738cc 100644 --- a/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 +++ b/test/powershell/Language/Parser/UsingNamespace.Tests.ps1 @@ -60,7 +60,7 @@ Describe "Using Namespace" -Tags "CI" { New-Object CompilerGeneratedAttribute | Should -Be System.Runtime.CompilerServices.CompilerGeneratedAttribute } - It "Attributes w/ using namespace" -pending { + It "Attributes w/ using namespace" -Pending { function foo { [DebuggerStepThrough()] diff --git a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 index e5f1410d8bc..1188fe0d465 100644 --- a/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 +++ b/test/powershell/Language/Scripting/ActionPreference.Tests.ps1 @@ -209,7 +209,7 @@ Describe "Tests for (error, warning, etc) action preference" -Tags "CI" { } } -Describe 'ActionPreference.Break tests' -tag 'CI' { +Describe 'ActionPreference.Break tests' -Tag 'CI' { BeforeAll { Register-DebuggerHandler @@ -239,7 +239,7 @@ Describe 'ActionPreference.Break tests' -tag 'CI' { Test-Break -ErrorAction Break } - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'v', 'v') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'v', 'v') } It 'Should show 3 debugger commands were invoked' { @@ -280,7 +280,7 @@ Describe 'ActionPreference.Break tests' -tag 'CI' { Test-Break -ErrorAction Break } - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'v', 'v') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'v', 'v') } It 'Should show 3 debugger commands were invoked' { @@ -321,7 +321,7 @@ Describe 'ActionPreference.Break tests' -tag 'CI' { Test-Break -ErrorAction Break } - $results = @(Test-Debugger -ScriptBlock $testScript) + $results = @(Test-Debugger -Scriptblock $testScript) } It 'Should show 1 debugger command was invoked' { @@ -354,7 +354,7 @@ Describe 'ActionPreference.Break tests' -tag 'CI' { Test-Break -ErrorAction Break } - $results = @(Test-Debugger -ScriptBlock $testScript) + $results = @(Test-Debugger -Scriptblock $testScript) } It 'Should show 2 debugger commands were invoked' { @@ -390,7 +390,7 @@ Describe 'ActionPreference.Break tests' -tag 'CI' { Test-Break *>$null } - $results = @(Test-Debugger -ScriptBlock $testScript) + $results = @(Test-Debugger -Scriptblock $testScript) } It 'Should show 7 debugger commands were invoked' { diff --git a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 index ab2dc8ecdcc..ed96d03cd31 100644 --- a/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 +++ b/test/powershell/Language/Scripting/CheckRestrictedlanguage.Tests.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. Describe "Test restricted language check method on scriptblocks" -Tags "CI" { BeforeAll { - set-strictmode -v 2 + Set-StrictMode -v 2 function list { $l = [System.Collections.Generic.List[String]]::new() @@ -62,12 +62,12 @@ Describe "Test restricted language check method on scriptblocks" -Tags "CI" { } It 'Check for restricted commands' { - { {get-date}.CheckRestrictedLangauge($null, $null, $false) } | Should -Throw -ErrorId 'MethodNotFound' + { {Get-Date}.CheckRestrictedLangauge($null, $null, $false) } | Should -Throw -ErrorId 'MethodNotFound' } It 'Check for allowed commands and variables' { - { { get-process | where name -Match $pattern | foreach $prop }.CheckRestrictedLanguage( + { { Get-Process | where name -Match $pattern | foreach $prop }.CheckRestrictedLanguage( (list get-process where foreach), (list prop pattern) , $false) } | Should -Not -Throw diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 index 9bf520cd2a9..ef4277602ef 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerCommand.Tests.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe 'Basic debugger command tests' -tag 'CI' { +Describe 'Basic debugger command tests' -Tag 'CI' { BeforeAll { Register-DebuggerHandler @@ -27,11 +27,11 @@ Describe 'Basic debugger command tests' -tag 'CI' { $bp = Set-PSBreakpoint -Command Get-Process Get-Process -Id $PID > $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue '?','h') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue '?','h') $result = @{ '?' = if ($results.Count -gt 0) {$results[0].Output -join [Environment]::NewLine} 'h' = if ($results.Count -gt 1) {$results[1].Output -join [Environment]::NewLine} @@ -71,7 +71,7 @@ Describe 'Basic debugger command tests' -tag 'CI' { $bp = Set-PSBreakpoint -Command Get-Process Get-Process -Id $PID > $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } @@ -81,13 +81,13 @@ Describe 'Basic debugger command tests' -tag 'CI' { 3: $bp = Set-PSBreakpoint -Command Get-Process 4:* Get-Process -Id $PID > $null 5: } finally { - 6: Remove-PSBreakPoint -Breakpoint $bp + 6: Remove-PSBreakpoint -Breakpoint $bp 7: } 8: '@ $testScriptList = NormalizeLineEnd -string $testScriptList - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'l','list') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'l','list') $result = @{ 'l' = if ($results.Count -gt 0) {$results[0].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} 'list' = if ($results.Count -gt 1) {$results[1].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} @@ -120,21 +120,21 @@ Describe 'Basic debugger command tests' -tag 'CI' { $bp = Set-PSBreakpoint -Command Get-Process Get-Process -Id $PID > $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } $testScriptList = @' 4:* Get-Process -Id $PID > $null 5: } finally { - 6: Remove-PSBreakPoint -Breakpoint $bp + 6: Remove-PSBreakpoint -Breakpoint $bp 7: } 8: '@ $testScriptList = NormalizeLineEnd -string $testScriptList - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'l 4','list 4') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'l 4','list 4') $result = @{ 'l 4' = if ($results.Count -gt 0) {$results[0].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} 'list 4' = if ($results.Count -gt 1) {$results[1].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} @@ -167,7 +167,7 @@ Describe 'Basic debugger command tests' -tag 'CI' { $bp = Set-PSBreakpoint -Command Get-Process Get-Process -Id $PID > $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } @@ -178,7 +178,7 @@ Describe 'Basic debugger command tests' -tag 'CI' { $testScriptList = NormalizeLineEnd -string $testScriptList - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'l 3 2','list 3 2') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'l 3 2','list 3 2') $result = @{ 'l 3 2' = if ($results.Count -gt 0) {$results[0].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} 'list 3 2' = if ($results.Count -gt 1) {$results[1].Output -replace '\s+$' -join [Environment]::NewLine -replace "^[`r`n]+|[`r`n]+$"} @@ -211,11 +211,11 @@ Describe 'Basic debugger command tests' -tag 'CI' { $bp = Set-PSBreakpoint -Command Get-Process Get-Process -Id $PID > $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } - $results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'k','Get-PSCallStack') + $results = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'k','Get-PSCallStack') $result = @{ 'k' = if ($results.Count -gt 0) {$results[0].Output} 'Get-PSCallStack' = if ($results.Count -gt 1) {$results[1].Output} @@ -238,7 +238,7 @@ Describe 'Basic debugger command tests' -tag 'CI' { } -Describe 'Simple debugger stepping command tests' -tag 'CI' { +Describe 'Simple debugger stepping command tests' -Tag 'CI' { BeforeAll { Register-DebuggerHandler @@ -258,13 +258,13 @@ Describe 'Simple debugger stepping command tests' -tag 'CI' { 'Red fish, blue fish' } *> $null } finally { - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } } $result = @{ - 's' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 's','s','s','s') - 'stepInto' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'stepInto','stepInto','stepInto','stepInto') + 's' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 's','s','s','s') + 'stepInto' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'stepInto','stepInto','stepInto','stepInto') } } @@ -311,13 +311,13 @@ Describe 'Simple debugger stepping command tests' -tag 'CI' { Get-Date | ConvertTo-Csv } *> $null } finally { - Remove-PSBreakPoint -Breakpoint $bp1,$bp2 + Remove-PSBreakpoint -Breakpoint $bp1,$bp2 } } $result = @{ - 'v' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'v','v','v','v') - 'stepOver' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'stepOver','stepOver','stepOver','stepOver') + 'v' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'v','v','v','v') + 'stepOver' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'stepOver','stepOver','stepOver','stepOver') } } @@ -362,13 +362,13 @@ Describe 'Simple debugger stepping command tests' -tag 'CI' { $date = Get-Date $date | ConvertTo-Csv } finally { - Remove-PSBreakPoint -Breakpoint $bps + Remove-PSBreakpoint -Breakpoint $bps } } $result = @{ - 'o' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'o','o','o') - 'stepOut' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'stepOut','stepOut','stepOut') + 'o' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'o','o','o') + 'stepOut' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'stepOut','stepOut','stepOut') } } @@ -398,7 +398,7 @@ Describe 'Simple debugger stepping command tests' -tag 'CI' { } } -Describe 'Debugger bug fix tests' -tag 'CI' { +Describe 'Debugger bug fix tests' -Tag 'CI' { BeforeAll { Register-DebuggerHandler @@ -413,16 +413,16 @@ Describe 'Debugger bug fix tests' -tag 'CI' { $testScript = { function Test-Issue9824 { $bp = Set-PSBreakpoint -Command Remove-PSBreakpoint - Remove-PSBreakPoint -Breakpoint $bp + Remove-PSBreakpoint -Breakpoint $bp } Test-Issue9824 1 + 1 } $result = @{ - 's' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 's','s','s') - 'v' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'v','v','v') - 'o' = @(Test-Debugger -ScriptBlock $testScript -CommandQueue 'o','o') + 's' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 's','s','s') + 'v' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'v','v','v') + 'o' = @(Test-Debugger -Scriptblock $testScript -CommandQueue 'o','o') } } diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 index 6889fd04421..f574fba5790 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 @@ -22,18 +22,18 @@ Describe "Breakpoints set on custom FileSystem provider files should work" -Tags $scriptName = "DebuggerScriptTests-ExposeBug221362.ps1" $scriptFullName = [io.path]::Combine($scriptPath, $scriptName) - write-output '"hello"' > $scriptFullName + Write-Output '"hello"' > $scriptFullName # # Create a file system provider # - new-psdrive -name tmpTestA1 -psprovider FileSystem -root $scriptPath > $null + New-PSDrive -Name tmpTestA1 -PSProvider FileSystem -Root $scriptPath > $null # # Verify that the breakpoint is hit when using the provider # Push-Location tmpTestA1:\ - $breakpoint = set-psbreakpoint .\$scriptName 1 -action { continue } + $breakpoint = Set-PSBreakpoint .\$scriptName 1 -Action { continue } & .\$scriptName It "Breakpoint hit count" { @@ -44,7 +44,7 @@ Describe "Breakpoints set on custom FileSystem provider files should work" -Tags { Pop-Location - if ($null -ne $breakpoint) { $breakpoint | remove-psbreakpoint } + if ($null -ne $breakpoint) { $breakpoint | Remove-PSBreakpoint } if (Test-Path $scriptFullName) { Remove-Item $scriptFullName -Force } if ($null -ne (Get-PSDrive -Name tmpTestA1 2> $null)) { Remove-PSDrive -Name tmpTestA1 -Force } } @@ -64,7 +64,7 @@ Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" { # $scriptFile = [io.path]::Combine([io.path]::GetTempPath(), "DebuggerScriptTests-ExposeBug245331.ps1") - write-output ' + Write-Output ' function fibonacci { param($number) @@ -89,7 +89,7 @@ Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" { # # Set the breakpoint and verify it is hit # - $breakpoint = Set-PsBreakpoint $scriptFile 17 -action { continue; } + $breakpoint = Set-PSBreakpoint $scriptFile 17 -Action { continue; } & $scriptFile @@ -99,7 +99,7 @@ Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" { } finally { - if ($null -ne $breakpoint) { $breakpoint | remove-psbreakpoint } + if ($null -ne $breakpoint) { $breakpoint | Remove-PSBreakpoint } if (Test-Path $scriptFile) { Remove-Item -Path $scriptFile -Force } } } @@ -123,7 +123,7 @@ Describe "Function calls clear debugger cache too early" -Tags "CI" { # $scriptFile = [io.path]::Combine([io.path]::GetTempPath(), "DebuggerScriptTests-ExposeBug248703.ps1") - write-output ' + Write-Output ' function Hello { write-output "hello" @@ -137,8 +137,8 @@ Describe "Function calls clear debugger cache too early" -Tags "CI" { # # Set the breakpoints and verify they are hit # - $breakpoint1 = Set-PsBreakpoint $scriptFile 7 -action { continue; } - $breakpoint2 = Set-PsBreakpoint $scriptFile 9 -action { continue; } + $breakpoint1 = Set-PSBreakpoint $scriptFile 7 -Action { continue; } + $breakpoint2 = Set-PSBreakpoint $scriptFile 9 -Action { continue; } & $scriptFile @@ -152,8 +152,8 @@ Describe "Function calls clear debugger cache too early" -Tags "CI" { } finally { - if ($null -ne $breakpoint1) { $breakpoint1 | remove-psbreakpoint } - if ($null -ne $breakpoint2) { $breakpoint2 | remove-psbreakpoint } + if ($null -ne $breakpoint1) { $breakpoint1 | Remove-PSBreakpoint } + if ($null -ne $breakpoint2) { $breakpoint2 | Remove-PSBreakpoint } if (Test-Path $scriptFile) { Remove-Item $scriptFile -Force } } } @@ -180,7 +180,7 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { get-unique '@ - $breakpoints = Set-PsBreakpoint $script 1,2,3 -action { continue } + $breakpoints = Set-PSBreakpoint $script 1,2,3 -Action { continue } $null = & $script @@ -198,7 +198,7 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { } finally { - if ($null -ne $breakpoints) { $breakpoints | remove-psbreakpoint } + if ($null -ne $breakpoints) { $breakpoints | Remove-PSBreakpoint } if (Test-Path $script) { Remove-Item $script -Force @@ -210,7 +210,7 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { BeforeAll { if ( $IsCoreCLR ) { return } # no COM on core $scriptPath1 = Join-Path $TestDrive SBPShortPathBug133807.DRT.tmp.ps1 - $scriptPath1 = setup -f SBPShortPathBug133807.DRT.tmp.ps1 -content ' + $scriptPath1 = Setup -f SBPShortPathBug133807.DRT.tmp.ps1 -Content ' 1..3 | ForEach-Object { $_ } | sort-object | get-unique' @@ -218,7 +218,7 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { $f = $a.GetFile($scriptPath1) $scriptPath2 = $f.ShortPath - $breakpoints = Set-PsBreakpoint $scriptPath2 1,2,3 -action { continue } + $breakpoints = Set-PSBreakpoint $scriptPath2 1,2,3 -Action { continue } $null = & $scriptPath2 } @@ -227,15 +227,15 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { if ($null -ne $breakpoints) { $breakpoints | Remove-PSBreakpoint } } - It "Short path Breakpoint on line 1 hit count" -skip:$IsCoreCLR { + It "Short path Breakpoint on line 1 hit count" -Skip:$IsCoreCLR { $breakpoints[0].HitCount | Should -Be 1 } - It "Short path Breakpoint on line 2 hit count" -skip:$IsCoreCLR { + It "Short path Breakpoint on line 2 hit count" -Skip:$IsCoreCLR { $breakpoints[1].HitCount | Should -Be 3 } - It "Short path Breakpoint on line 3 hit count" -skip:$IsCoreCLR { + It "Short path Breakpoint on line 3 hit count" -Skip:$IsCoreCLR { $breakpoints[2].HitCount | Should -Be 1 } } @@ -251,7 +251,7 @@ Describe "Unit tests for various script breakpoints" -Tags "CI" { if ($null -eq $path) { - $path = split-path $MyInvocation.InvocationName + $path = Split-Path $MyInvocation.InvocationName } # @@ -290,7 +290,7 @@ Describe "Unit tests for various script breakpoints" -Tags "CI" { # # Ensure there are no breakpoints at start of test # - Get-PsBreakpoint | Remove-PsBreakpoint + Get-PSBreakpoint | Remove-PSBreakpoint # # Create a couple of scripts @@ -298,54 +298,54 @@ Describe "Unit tests for various script breakpoints" -Tags "CI" { $scriptFile1 = [io.path]::Combine([io.path]::GetTempPath(), "DebuggerScriptTests-Get-PsBreakpoint1.ps1") $scriptFile2 = [io.path]::Combine([io.path]::GetTempPath(), "DebuggerScriptTests-Get-PsBreakpoint2.ps1") - write-output '' > $scriptFile1 - write-output '' > $scriptFile2 + Write-Output '' > $scriptFile1 + Write-Output '' > $scriptFile2 # # Set several breakpoints of different types # - $line1 = Set-PsBreakpoint $scriptFile1 1 - $line2 = Set-PsBreakpoint $scriptFile2 2 + $line1 = Set-PSBreakpoint $scriptFile1 1 + $line2 = Set-PSBreakpoint $scriptFile2 2 - $cmd1 = Set-PsBreakpoint -c command1 -s $scriptFile1 - $cmd2 = Set-PsBreakpoint -c command2 -s $scriptFile2 - $cmd3 = Set-PsBreakpoint -c command3 + $cmd1 = Set-PSBreakpoint -c command1 -s $scriptFile1 + $cmd2 = Set-PSBreakpoint -c command2 -s $scriptFile2 + $cmd3 = Set-PSBreakpoint -c command3 - $var1 = Set-PsBreakpoint -v variable1 -s $scriptFile1 - $var2 = Set-PsBreakpoint -v variable2 -s $scriptFile2 - $var3 = Set-PsBreakpoint -v variable3 + $var1 = Set-PSBreakpoint -v variable1 -s $scriptFile1 + $var2 = Set-PSBreakpoint -v variable2 -s $scriptFile2 + $var3 = Set-PSBreakpoint -v variable3 # # The default parameter set must return all breakpoints # - Verify { get-psbreakpoint } $line1,$line2,$cmd1,$cmd2,$cmd3,$var1,$var2,$var3 + Verify { Get-PSBreakpoint } $line1,$line2,$cmd1,$cmd2,$cmd3,$var1,$var2,$var3 # # Query by ID # - Verify { get-psbreakpoint -id $line1.ID,$cmd1.ID,$var1.ID } $line1,$cmd1,$var1 # -id - Verify { get-psbreakpoint $line2.ID,$cmd2.ID,$var2.ID } $line2,$cmd2,$var2 # positional - Verify { $cmd3.ID,$var3.ID | get-psbreakpoint } $cmd3,$var3 # value from pipeline + Verify { Get-PSBreakpoint -Id $line1.ID,$cmd1.ID,$var1.ID } $line1,$cmd1,$var1 # -id + Verify { Get-PSBreakpoint $line2.ID,$cmd2.ID,$var2.ID } $line2,$cmd2,$var2 # positional + Verify { $cmd3.ID,$var3.ID | Get-PSBreakpoint } $cmd3,$var3 # value from pipeline - VerifyException { get-psbreakpoint -id $null } "ParameterBindingValidationException" - VerifyException { get-psbreakpoint -id $line1.ID -script $scriptFile1 } "ParameterBindingException" + VerifyException { Get-PSBreakpoint -Id $null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Id $line1.ID -Script $scriptFile1 } "ParameterBindingException" # # Query by Script # - Verify { get-psbreakpoint -script $scriptFile1 } $line1,$cmd1,$var1 # -script - Verify { get-psbreakpoint $scriptFile2 } $line2,$cmd2,$var2 # positional - Verify { $scriptFile2 | get-psbreakpoint } $line2,$cmd2,$var2 # value from pipeline + Verify { Get-PSBreakpoint -Script $scriptFile1 } $line1,$cmd1,$var1 # -script + Verify { Get-PSBreakpoint $scriptFile2 } $line2,$cmd2,$var2 # positional + Verify { $scriptFile2 | Get-PSBreakpoint } $line2,$cmd2,$var2 # value from pipeline - VerifyException { get-psbreakpoint -script $null } "ParameterBindingValidationException" - VerifyException { get-psbreakpoint -script $scriptFile1,$null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Script $null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Script $scriptFile1,$null } "ParameterBindingValidationException" # Verify that relative paths are handled correctly $directoryName = [System.IO.Path]::GetDirectoryName($scriptFile1) $fileName = [System.IO.Path]::GetFileName($scriptFile1) Push-Location $directoryName - Verify { get-psbreakpoint -script $fileName } $line1,$cmd1,$var1 + Verify { Get-PSBreakpoint -Script $fileName } $line1,$cmd1,$var1 Pop-Location # @@ -354,28 +354,28 @@ Describe "Unit tests for various script breakpoints" -Tags "CI" { $commandType = [Microsoft.PowerShell.Commands.BreakpointType]"command" $variableType = [Microsoft.PowerShell.Commands.BreakpointType]"variable" - Verify { get-psbreakpoint -type "line" } $line1,$line2 # -type - Verify { get-psbreakpoint $commandType } $cmd1,$cmd2,$cmd3 # positional - Verify { $variableType | get-psbreakpoint } $var1,$var2,$var3 # value from pipeline - Verify { get-psbreakpoint -type "line" -script $scriptFile1 } @($line1) # -script parameter + Verify { Get-PSBreakpoint -Type "line" } $line1,$line2 # -type + Verify { Get-PSBreakpoint $commandType } $cmd1,$cmd2,$cmd3 # positional + Verify { $variableType | Get-PSBreakpoint } $var1,$var2,$var3 # value from pipeline + Verify { Get-PSBreakpoint -Type "line" -Script $scriptFile1 } @($line1) # -script parameter - VerifyException { get-psbreakpoint -type $null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Type $null } "ParameterBindingValidationException" # # Query by Command # - Verify { get-psbreakpoint -command "command1","command2" } $cmd1,$cmd2 # -command - Verify { get-psbreakpoint -command "command1","command2" -script $scriptFile1 } @($cmd1) # -script parameter + Verify { Get-PSBreakpoint -Command "command1","command2" } $cmd1,$cmd2 # -command + Verify { Get-PSBreakpoint -Command "command1","command2" -Script $scriptFile1 } @($cmd1) # -script parameter - VerifyException { get-psbreakpoint -command $null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Command $null } "ParameterBindingValidationException" # # Query by Variable # - Verify { get-psbreakpoint -variable "variable1","variable2" } $var1,$var2 # -command - Verify { get-psbreakpoint -variable "variable1","variable2" -script $scriptFile1 } @($var1) # -script parameter + Verify { Get-PSBreakpoint -Variable "variable1","variable2" } $var1,$var2 # -command + Verify { Get-PSBreakpoint -Variable "variable1","variable2" -Script $scriptFile1 } @($var1) # -script parameter - VerifyException { get-psbreakpoint -variable $null } "ParameterBindingValidationException" + VerifyException { Get-PSBreakpoint -Variable $null } "ParameterBindingValidationException" } finally { @@ -404,7 +404,7 @@ Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" { if ($null -eq $path) { - $path = split-path $MyInvocation.InvocationName + $path = Split-Path $MyInvocation.InvocationName } try @@ -414,7 +414,7 @@ Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" { # $scriptFile = [io.path]::Combine([io.path]::GetTempPath(), "DebuggerScriptTests-InMemoryBreakpoints.ps1") - write-output ' + Write-Output ' function Function1 { write-host "In Function1" # line 4 @@ -450,9 +450,9 @@ Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" { # # Set a couple of line breakpoints on the file, dot-source it and verify that the breakpoints are hit # - $breakpoint1 = Set-PsBreakpoint $scriptFile 4 -action { continue; } - $breakpoint2 = Set-PsBreakpoint $scriptFile 9 -action { continue; } - $breakpoint3 = Set-PsBreakpoint $scriptFile 24 -action { continue; } + $breakpoint1 = Set-PSBreakpoint $scriptFile 4 -Action { continue; } + $breakpoint2 = Set-PSBreakpoint $scriptFile 9 -Action { continue; } + $breakpoint3 = Set-PSBreakpoint $scriptFile 24 -Action { continue; } . $scriptFile @@ -500,7 +500,7 @@ Describe "Unit tests for line breakpoints on modules" -Tags "CI" { New-Item -ItemType Directory $moduleDirectory 2> $null - write-output ' + Write-Output ' function ModuleFunction1 { write-output "In ModuleFunction1" # line 4 @@ -542,15 +542,15 @@ Describe "Unit tests for line breakpoints on modules" -Tags "CI" { # $ENV:PSModulePath = $moduleRoot - import-module $moduleName + Import-Module $moduleName # # Set a couple of line breakpoints on the module and verify that they are hit # - $breakpoint1 = Set-PsBreakpoint $moduleFile 4 -action { continue } - $breakpoint2 = Set-PsBreakpoint $moduleFile 9 -action { continue } - $breakpoint3 = Set-PsBreakpoint $moduleFile 24 -Action { continue } - $breakpoint4 = Set-PsBreakpoint $moduleFile 25 -Action { continue } + $breakpoint1 = Set-PSBreakpoint $moduleFile 4 -Action { continue } + $breakpoint2 = Set-PSBreakpoint $moduleFile 9 -Action { continue } + $breakpoint3 = Set-PSBreakpoint $moduleFile 24 -Action { continue } + $breakpoint4 = Set-PSBreakpoint $moduleFile 25 -Action { continue } ModuleFunction1 @@ -579,8 +579,8 @@ Describe "Unit tests for line breakpoints on modules" -Tags "CI" { if ($null -ne $breakpoint2) { Remove-PSBreakpoint $breakpoint2 } if ($null -ne $breakpoint3) { Remove-PSBreakpoint $breakpoint3 } if ($null -ne $breakpoint4) { Remove-PSBreakpoint $breakpoint4 } - get-module $moduleName | remove-module - if (Test-Path $moduleDirectory) { Remove-Item $moduleDirectory -Recurse -force -ErrorAction silentlycontinue } + Get-Module $moduleName | Remove-Module + if (Test-Path $moduleDirectory) { Remove-Item $moduleDirectory -Recurse -Force -ErrorAction silentlycontinue } } } @@ -639,7 +639,7 @@ Describe "Sometimes line breakpoints are ignored" -Tags "CI" { if ($null -ne $bp1) { Remove-PSBreakpoint $bp1 } if ($null -ne $bp2) { Remove-PSBreakpoint $bp2 } - if (Test-Path -Path $tempFileName1) { Remove-Item $tempFileName1 -force } - if (Test-Path -Path $tempFileName2) { Remove-Item $tempFileName2 -force } + if (Test-Path -Path $tempFileName1) { Remove-Item $tempFileName1 -Force } + if (Test-Path -Path $tempFileName2) { Remove-Item $tempFileName2 -Force } } } diff --git a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 index 15cfc38736b..c7c1b6a1105 100644 --- a/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/Debugging.Tests.ps1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe 'Basic debugger tests' -tag 'CI' { +Describe 'Basic debugger tests' -Tag 'CI' { BeforeAll { Register-DebuggerHandler @@ -17,7 +17,7 @@ Describe 'Basic debugger tests' -tag 'CI' { function Test-DollarQuestionMark { [CmdletBinding()] param() - Get-Process -id ([int]::MaxValue) + Get-Process -Id ([int]::MaxValue) if (-not $?) { 'The value of $? was preserved during debugging.' } else { @@ -27,7 +27,7 @@ Describe 'Basic debugger tests' -tag 'CI' { $global:DollarQuestionMarkResults = Test-DollarQuestionMark -ErrorAction Break } - $global:results = @(Test-Debugger -ScriptBlock $testScript -CommandQueue '$?') + $global:results = @(Test-Debugger -Scriptblock $testScript -CommandQueue '$?') } AfterAll { @@ -51,7 +51,7 @@ Describe 'Basic debugger tests' -tag 'CI' { } } -Describe "Breakpoints when set should be hit" -tag "CI" { +Describe "Breakpoints when set should be hit" -Tag "CI" { Context "Basic tests" { BeforeAll { $script = @' @@ -63,11 +63,11 @@ Describe "Breakpoints when set should be hit" -tag "CI" { 'bbb' '@ $path = Setup -PassThru -File BasicTest.ps1 -Content $script - $bps = 1..6 | ForEach-Object { set-psbreakpoint -script $path -line $_ -Action { continue } } + $bps = 1..6 | ForEach-Object { Set-PSBreakpoint -Script $path -Line $_ -Action { continue } } } AfterAll { - $bps | Remove-PSBreakPoint + $bps | Remove-PSBreakpoint } It "A redirected breakpoint is hit" { @@ -333,7 +333,7 @@ elseif (Test-Path $PSCommandPath) } } -Describe "It should be possible to reset runspace debugging" -tag "Feature" { +Describe "It should be possible to reset runspace debugging" -Tag "Feature" { BeforeAll { $script = @' "line 1" diff --git a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 index c523f549247..c3bf960da56 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggingInHost.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Tests Debugger GetCallStack() on runspaces when attached to a WinRM host process" -Tags "CI" { - It -skip "Disabled test because it is fragile and does not consistently succeed on test VMs" { } + It -Skip "Disabled test because it is fragile and does not consistently succeed on test VMs" { } return try diff --git a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 index 6122906c352..81ec74d4094 100644 --- a/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/DeserializedTypeConversion.Tests.ps1 @@ -88,7 +88,7 @@ Describe "Tests conversion of deserialized types to original type using object p Context 'Type conversion and parameter binding of deserialized Type case 1: type definition contains public fields' { BeforeAll { - $t1 = new-object test1 -Property @{name="TestName1";port=80;scriptText="1..5"} + $t1 = New-Object test1 -Property @{name="TestName1";port=80;scriptText="1..5"} $s = [System.Management.Automation.PSSerializer]::Serialize($t1) $dst1 = [System.Management.Automation.PSSerializer]::Deserialize($s) } @@ -114,7 +114,7 @@ Describe "Tests conversion of deserialized types to original type using object p Context 'Type conversion and parameter binding of deserialized Type case 2: type definition contains public properties' { BeforeAll { - $t2 = new-object test2 -Property @{Name="TestName2";Port=80;ScriptText="1..5"} + $t2 = New-Object test2 -Property @{Name="TestName2";Port=80;ScriptText="1..5"} $s = [System.Management.Automation.PSSerializer]::Serialize($t2) $dst2 = [System.Management.Automation.PSSerializer]::Deserialize($s) } @@ -138,7 +138,7 @@ Describe "Tests conversion of deserialized types to original type using object p Context 'Type conversion and parameter binding of deserialized Type case 1: type definition contains 2 public properties and 1 read only property' { BeforeAll { - $t3 = new-object test3 -Property @{Name="TestName3";Port=80} + $t3 = New-Object test3 -Property @{Name="TestName3";Port=80} $s = [System.Management.Automation.PSSerializer]::Serialize($t3) $dst3 = [System.Management.Automation.PSSerializer]::Deserialize($s) } @@ -165,7 +165,7 @@ Describe "Tests conversion of deserialized types to original type using object p Context 'Type conversion and parameter binding of deserialized Type case 1: type definition contains 2 public properties' { BeforeAll { - $t4 = new-object test4 -Property @{Name="TestName4";Port=80} + $t4 = New-Object test4 -Property @{Name="TestName4";Port=80} $s = [System.Management.Automation.PSSerializer]::Serialize($t4) $dst4 = [System.Management.Automation.PSSerializer]::Deserialize($s) } diff --git a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 index 99aa4ff3274..b266732cba7 100644 --- a/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 +++ b/test/powershell/Language/Scripting/Dynamicparameters.Tests.ps1 @@ -76,6 +76,6 @@ Describe "Dynamic parameter support in script cmdlets." -Tags "CI" { } It "Parameter is defined in Class" { - foo-bar -path class -name "myName" | Should -BeExactly 'myName' + foo-bar -path class -Name "myName" | Should -BeExactly 'myName' } } diff --git a/test/powershell/Language/Scripting/Generics.Tests.ps1 b/test/powershell/Language/Scripting/Generics.Tests.ps1 index 96484f7a31c..ccc266eef8a 100644 --- a/test/powershell/Language/Scripting/Generics.Tests.ps1 +++ b/test/powershell/Language/Scripting/Generics.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Generics support" -Tags "CI" { $x = [dictionary[dictionary[list[int],string], stack[double]]]::new() $x.gettype().fullname | Should -Match "double" - $y = new-object "dictionary[dictionary[list[int],string], stack[double]]" + $y = New-Object "dictionary[dictionary[list[int],string], stack[double]]" $y.gettype().fullname | Should -Match "double" } @@ -65,7 +65,7 @@ Describe "Generics support" -Tags "CI" { $e | Should -Match "\[T\]" } - It 'Array type works properly' -skip:$IsCoreCLR{ + It 'Array type works properly' -Skip:$IsCoreCLR{ $x = [system.array]::ConvertAll.OverloadDefinitions $x | Should -Match "static\s+TOutput\[\]\s+ConvertAll\[TInput,\s+TOutput\]\(" } diff --git a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 index e9936f9bf9e..09570e0e1e9 100644 --- a/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 +++ b/test/powershell/Language/Scripting/HashtableToPSCustomObjectConversion.Tests.ps1 @@ -35,7 +35,7 @@ Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { It 'Type Validation: ' -TestCases:$testdata { param ($Name, $Cmd, $ExpectedType) - Invoke-expression $Cmd -OutVariable a + Invoke-Expression $Cmd -OutVariable a $a = Get-Variable -Name a -ValueOnly $a | Should -BeOfType $ExpectedType } @@ -47,7 +47,7 @@ Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { $p = 0 # Checks if the first property is One - $x.psobject.Properties | foreach-object ` + $x.psobject.Properties | ForEach-Object ` { if ($p -eq 0) { @@ -64,7 +64,7 @@ Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { $p = 0 # Checks if the first property is One - $x.psobject.Properties | foreach-object ` + $x.psobject.Properties | ForEach-Object ` { if ($p -eq 0) { @@ -136,7 +136,7 @@ Describe "Tests for hashtable to PSCustomObject conversion" -Tags "CI" { $obj = $null $ht = @{one=1;two=2} - { $obj = New-Object System.Management.Automation.PSCustomObject -property $ht } | + { $obj = New-Object System.Management.Automation.PSCustomObject -Property $ht } | Should -Throw -ErrorId "CannotFindAppropriateCtor,Microsoft.PowerShell.Commands.NewObjectCommand" $obj | Should -BeNullOrEmpty } diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 index 078aeb54c0e..41855bffab9 100644 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ b/test/powershell/Language/Scripting/I18n.Tests.ps1 @@ -30,7 +30,7 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import default culture is done correctly' { - import-localizedData mydata; + Import-LocalizedData mydata; $mydata.string1 | Should -BeExactly 'string1 for en-US' $mydata.string2 | Should -BeExactly 'string2 for en-US' @@ -38,12 +38,12 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import specific culture(en-US)' { - import-localizedData mydata -uiculture en-US + Import-LocalizedData mydata -UICulture en-US $mydata.string1 | Should -BeExactly 'string1 for en-US' $mydata.string2 | Should -BeExactly 'string2 for en-US' - import-localizedData mydata -uiculture fr-FR + Import-LocalizedData mydata -UICulture fr-FR $mydata.string1 | Should -BeExactly 'string1 for fr-FR' $mydata.string2 | Should -BeExactly 'string2 for fr-FR' @@ -51,7 +51,7 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import non existing culture is done correctly' { - import-localizedData mydata -uiculture nl-NL -ErrorAction SilentlyContinue -ErrorVariable ev + Import-LocalizedData mydata -UICulture nl-NL -ErrorAction SilentlyContinue -ErrorVariable ev $ev | Should -Not -BeNullOrEmpty $ev[0].Exception | Should -BeOfType System.Management.Automation.PSInvalidOperationException @@ -59,12 +59,12 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import different file name is done correctly' { - import-localizedData mydata -filename foo + Import-LocalizedData mydata -FileName foo $mydata.string1 | Should -BeExactly 'string1 from foo in en-US' $mydata.string2 | Should -BeExactly 'string2 from foo in en-US' - import-localizedData mydata -filename foo -uiculture fr-FR + Import-LocalizedData mydata -FileName foo -UICulture fr-FR $mydata.string1 | Should -BeExactly 'string1 from foo in fr-FR' $mydata.string2 | Should -BeExactly 'string2 from foo in fr-FR' @@ -72,12 +72,12 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import different file base is done correctly' { - import-localizedData mydata -basedirectory "${dir}\newbase" + Import-LocalizedData mydata -BaseDirectory "${dir}\newbase" $mydata.string1 | Should -BeExactly 'string1 for en-US under newbase' $mydata.string2 | Should -BeExactly 'string2 for en-US under newbase' - import-localizedData mydata -basedirectory "${dir}\newbase" -uiculture fr-FR + Import-LocalizedData mydata -BaseDirectory "${dir}\newbase" -UICulture fr-FR $mydata.string1 | Should -BeExactly 'string1 for fr-FR under newbase' $mydata.string2 | Should -BeExactly 'string2 for fr-FR under newbase' @@ -85,12 +85,12 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import different file base and file name' { - import-localizedData mydata -basedirectory "${dir}\newbase" -filename foo + Import-LocalizedData mydata -BaseDirectory "${dir}\newbase" -FileName foo $mydata.string1 | Should -BeExactly 'string1 for en-US from foo under newbase' $mydata.string2 | Should -BeExactly 'string2 for en-US from foo under newbase' - import-localizedData mydata -basedirectory "${dir}\newbase" -filename foo -uiculture fr-FR + Import-LocalizedData mydata -BaseDirectory "${dir}\newbase" -FileName foo -UICulture fr-FR $mydata.string1 | Should -BeExactly 'string1 for fr-FR from foo under newbase' $mydata.string2 | Should -BeExactly 'string2 for fr-FR from foo under newbase' @@ -98,7 +98,7 @@ Describe 'Testing of script internationalization' -Tags "CI" { It "Import variable that doesn't exist" { - import-localizedData mydata2 + Import-LocalizedData mydata2 $mydata2.string1 | Should -BeExactly 'string1 for en-US' $mydata2.string2 | Should -BeExactly 'string2 for en-US' @@ -109,7 +109,7 @@ Describe 'Testing of script internationalization' -Tags "CI" { $script:exception = $null & { trap {$script:exception = $_ ; continue } - import-localizedData mydata -filename bad + Import-LocalizedData mydata -FileName bad } $script:exception.exception | Should -Not -BeNullOrEmpty @@ -118,7 +118,7 @@ Describe 'Testing of script internationalization' -Tags "CI" { It 'Import if psd1 file is done correctly' { - import-localizedData mydata -filename if + Import-LocalizedData mydata -FileName if if ($PSCulture -eq 'en-US') { @@ -143,13 +143,13 @@ Describe 'Testing of script internationalization' -Tags "CI" { $script:exception = $null & { trap {$script:exception = $_.Exception ; continue } - invoke-expression $cmd + Invoke-Expression $cmd } $exception | Should -Match $Expected } - it 'Check alternate syntax that also supports complex variable names' { + It 'Check alternate syntax that also supports complex variable names' { & { $script:mydata = data { 123 } @@ -159,22 +159,22 @@ Describe 'Testing of script internationalization' -Tags "CI" { $mydata = data { 456 } & { # This import should not clobber the one at script scope - import-localizedData mydata -uiculture en-US + Import-LocalizedData mydata -UICulture en-US } $mydata | Should -Be 456 & { # This import should clobber the one at script scope - import-localizedData script:mydata -uiculture en-US + Import-LocalizedData script:mydata -UICulture en-US } $script:mydata.string1 | Should -BeExactly 'string1 for en-US' } It 'Check fallback to current directory plus -SupportedCommand parameter is done correctly' { - new-alias MyConvertFrom-StringData ConvertFrom-StringData + New-Alias MyConvertFrom-StringData ConvertFrom-StringData - import-localizeddata local:mydata -uiculture fr-ca -filename I18n.Tests_fallback.psd1 -SupportedCommand MyConvertFrom-StringData + Import-LocalizedData local:mydata -UICulture fr-ca -FileName I18n.Tests_fallback.psd1 -SupportedCommand MyConvertFrom-StringData $mydata[0].string1 | Should -BeExactly 'fallback string1 for en-US' $mydata[1] | Should -Be 42 } diff --git a/test/powershell/Language/Scripting/LineEndings.Tests.ps1 b/test/powershell/Language/Scripting/LineEndings.Tests.ps1 index e7b89e1f5b4..af9e149d285 100644 --- a/test/powershell/Language/Scripting/LineEndings.Tests.ps1 +++ b/test/powershell/Language/Scripting/LineEndings.Tests.ps1 @@ -130,8 +130,8 @@ Describe 'Line endings' -Tags "CI" { # wrap the content in the specified begin and end quoting characters. $content = "$($Begin)$($expected)$($End)" # BUG: Set-Content is failing on linux if the file does not exit. - $null = New-item -path TESTDRIVE:$fileName -force - $content | Set-content -NoNewline -Encoding ascii -Path TESTDRIVE:\$fileName + $null = New-Item -Path TESTDRIVE:$fileName -Force + $content | Set-Content -NoNewline -Encoding ascii -Path TESTDRIVE:\$fileName $actual = &( "TESTDRIVE:\$fileName") # $actual should be the content string ($expected) without the begin and end quoting characters. diff --git a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 index a75b80747ac..b0c7ce4e53a 100644 --- a/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 +++ b/test/powershell/Language/Scripting/NativeExecution/NativeLinuxCommands.Tests.ps1 @@ -14,7 +14,7 @@ Describe "NativeLinuxCommands" -tags "CI" { } It "Should find Application grep" { - (get-command grep).CommandType | Should -Be Application + (Get-Command grep).CommandType | Should -Be Application } It "Should pipe to grep and get result" { @@ -22,7 +22,7 @@ Describe "NativeLinuxCommands" -tags "CI" { } It "Should find Application touch" { - (get-command touch).CommandType | Should -Be Application + (Get-Command touch).CommandType | Should -Be Application } It "Should not redirect standard input if native command is the first command in pipeline (1)" { diff --git a/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 b/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 index 379a41e4301..71fd1f83bc2 100644 --- a/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 +++ b/test/powershell/Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -Tags "CI" { It 'New-Object - Property Parameter Must take IDictionary' { - $a = new-object psobject -property ([ordered]@{one=1;two=2}) + $a = New-Object psobject -Property ([ordered]@{one=1;two=2}) $a | Should -Not -BeNullOrEmpty $a.one | Should -Be 1 } @@ -26,7 +26,7 @@ Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -T '@ - { $script:a = select-xml -content $helpXml -xpath "//command:name" -namespace ( + { $script:a = Select-Xml -Content $helpXml -XPath "//command:name" -Namespace ( [ordered]@{command="http://schemas.microsoft.com/maml/dev/command/2004/10"; maml="http://schemas.microsoft.com/maml/2004/10"; dev="http://schemas.microsoft.com/maml/dev/2004/10"}) } | Should -Not -Throw @@ -64,7 +64,7 @@ Describe 'Test for cmdlet to support Ordered Attribute on hash literal nodes' -T $script:a = $null - {$script:a = Get-ChildItem | select-object -property Name, ( + {$script:a = Get-ChildItem | Select-Object -Property Name, ( [ordered]@{Name="IsDirectory"; Expression ={$_.PSIsContainer}})} | Should -Not -Throw diff --git a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 index c69d5969849..a49801996e9 100644 --- a/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 +++ b/test/powershell/Language/Scripting/OutErrorVariable.Tests.ps1 @@ -25,7 +25,7 @@ Describe "Tests OutVariable only" -Tags "CI" { param() "bar" - get-foo1 -outVariable script:a + get-foo1 -OutVariable script:a } } @@ -71,7 +71,7 @@ Describe "Tests OutVariable only" -Tags "CI" { It 'Nested OutVariable' { - get-bar -outVariable b > $null + get-bar -OutVariable b > $null $script:a | Should -BeExactly 'foo' $b | Should -BeExactly @("bar", "foo") } @@ -84,7 +84,7 @@ Describe "Test ErrorVariable only" -Tags "CI" { [CmdletBinding()] param() - write-error "foo" + Write-Error "foo" } function get-foo2 @@ -100,8 +100,8 @@ Describe "Test ErrorVariable only" -Tags "CI" { [CmdletBinding()] param() - write-error "bar" - get-foo1 -errorVariable script:a + Write-Error "bar" + get-foo1 -ErrorVariable script:a } } @@ -141,10 +141,10 @@ Describe "Test ErrorVariable only" -Tags "CI" { } It 'Appending ErrorVariable Case 2: $PSCmdlet.writeerror' { - write-error "foo" -errorVariable script:foo 2> $null + Write-Error "foo" -ErrorVariable script:foo 2> $null $a = 'a','b' - get-foo2 -errorVariable +a 2> $null + get-foo2 -ErrorVariable +a 2> $null $a.count | Should -Be 3 $a| ForEach-Object {$_.ToString()} | Should -BeExactly @('a', 'b', 'foo') @@ -152,7 +152,7 @@ Describe "Test ErrorVariable only" -Tags "CI" { It 'Nested ErrorVariable' { - get-bar -errorVariable b 2> $null + get-bar -ErrorVariable b 2> $null $script:a | Should -BeExactly 'foo' $b | Should -BeExactly @("bar","foo") @@ -160,7 +160,7 @@ Describe "Test ErrorVariable only" -Tags "CI" { It 'Nested ErrorVariable with redirection' { - get-bar -errorVariable b 2>&1 > $null + get-bar -ErrorVariable b 2>&1 > $null $script:a | Should -BeExactly 'foo' $b | Should -BeExactly @("bar", "foo") @@ -176,8 +176,8 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param() - write-output "foo-output" - write-error "foo-error" + Write-Output "foo-output" + Write-Error "foo-error" } function get-foo1 @@ -185,7 +185,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param() - write-error "foo" + Write-Error "foo" } function get-foo2 @@ -201,8 +201,8 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param() - write-error "bar" - get-foo1 -errorVariable script:a + Write-Error "bar" + get-foo1 -ErrorVariable script:a } function get-foo3 @@ -211,8 +211,8 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { param() "foo-output-0" - write-output "foo-output-1" - write-error "foo-error" + Write-Output "foo-output-1" + Write-Error "foo-error" } function get-bar2 @@ -221,15 +221,15 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { param() "bar-output-0" - write-output "bar-output-1" - write-error "bar-error" - get-foo3 -OutVariable script:foo_out -errorVariable script:foo_err + Write-Output "bar-output-1" + Write-Error "bar-error" + get-foo3 -OutVariable script:foo_out -ErrorVariable script:foo_err } } It 'Update OutVariable and ErrorVariable' { - get-foo3 -OutVariable out -errorVariable err 2> $null > $null + get-foo3 -OutVariable out -ErrorVariable err 2> $null > $null $out | Should -BeExactly @("foo-output-0", "foo-output-1") $err | Should -BeExactly "foo-error" @@ -237,7 +237,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { It 'Update OutVariable and ErrorVariable' { - get-bar2 -OutVariable script:bar_out -errorVariable script:bar_err 2> $null > $null + get-bar2 -OutVariable script:bar_out -ErrorVariable script:bar_err 2> $null > $null $foo_out | Should -BeExactly @("foo-output-0", "foo-output-1") $foo_err | Should -BeExactly 'foo-error' @@ -252,7 +252,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param() - write-error "foo-error" + Write-Error "foo-error" try { @@ -262,7 +262,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { {} } - get-foo4 -errorVariable err 2> $null + get-foo4 -ErrorVariable err 2> $null $err | Should -BeExactly @("foo-error", "foo-exception") } @@ -275,8 +275,8 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { process { - write-output $foo - write-error $foo + Write-Output $foo + Write-Error $foo } } @@ -293,7 +293,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { Context 'Error variable in multi-command pipeline (with native cmdlet)' { BeforeAll { - (get-foo -ErrorVariable foo_err | get-item -ErrorVariable get_item_err ) 2>&1 > $null + (get-foo -ErrorVariable foo_err | Get-Item -ErrorVariable get_item_err ) 2>&1 > $null } It '$foo_err should be "foo-error"' { @@ -314,12 +314,12 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param([Parameter(ValueFromPipeline = $true)][string] $i) - write-error 'bar-error' - write-output 'bar-output' + Write-Error 'bar-error' + Write-Output 'bar-output' get-foo } - (get-foo -errorVariable foo_err | get-bar3 -errorVariable bar_err) 2>&1 > $null + (get-foo -ErrorVariable foo_err | get-bar3 -ErrorVariable bar_err) 2>&1 > $null $foo_err | Should -BeExactly 'foo-error' $bar_err | Should -BeExactly @("bar-error", "foo-error") @@ -332,8 +332,8 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param([Parameter(ValueFromPipeline = $true)][string] $i) - write-error "foo-error" - write-output $i + Write-Error "foo-error" + Write-Output $i } function get-bar4 @@ -341,11 +341,11 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { [CmdletBinding()] param([Parameter(ValueFromPipeline = $true)][string] $i) - write-error "bar-error" - get-foo6 "foo-output" -errorVariable script:foo_err1 | get-foo6 -errorVariable script:foo_err2 + Write-Error "bar-error" + get-foo6 "foo-output" -ErrorVariable script:foo_err1 | get-foo6 -ErrorVariable script:foo_err2 } - get-bar4 -errorVariable script:bar_err 2>&1 > $null + get-bar4 -ErrorVariable script:bar_err 2>&1 > $null $script:foo_err1 | Should -BeExactly "foo-error" $script:foo_err2 | Should -BeExactly "foo-error" @@ -359,7 +359,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { param([Parameter(ValueFromPipeline = $true)][string] $output) $output - write-error "foo-error" + Write-Error "foo-error" } function get-bar5 @@ -368,7 +368,7 @@ Describe "Update both OutVariable and ErrorVariable" -Tags "CI" { param() "bar-output" - write-error "bar-error" + Write-Error "bar-error" get-foo7 "foo-output" -ErrorVariable script:foo_err1 -ov script:foo_out1 | get-foo7 -ErrorVariable script:foo_err2 -ov script:foo_out2 get-foo7 "foo-output" -ErrorVariable script:foo_err3 -ov script:foo_out3 | get-foo7 -ErrorVariable script:foo_err4 -ov script:foo_out4 } diff --git a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 index 2a51f444816..95d62071ad1 100644 --- a/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Scripting/ParameterBinding.Tests.ps1 @@ -137,7 +137,7 @@ Describe "Tests for parameter binding" -Tags "CI" { } } - $b = 1..10 | select-object @{name='foo'; expression={$_ * 10}} | get-foo + $b = 1..10 | Select-Object @{name='foo'; expression={$_ * 10}} | get-foo $b -join ',' | Should -BeExactly '10,20,30,40,50,60,70,80,90,100' } @@ -451,12 +451,12 @@ Describe "Tests for parameter binding" -Tags "CI" { } #known issue 2069 - It 'Some conversions should be attempted before trying to encode a collection' -skip:$IsCoreCLR { + It 'Some conversions should be attempted before trying to encode a collection' -Skip:$IsCoreCLR { try { $null = [Test.Language.ParameterBinding.MyClass] } catch { - add-type -PassThru -TypeDefinition @' + Add-Type -PassThru -TypeDefinition @' using System.Management.Automation; using System; using System.Collections; @@ -486,7 +486,7 @@ Describe "Tests for parameter binding" -Tags "CI" { } } } -'@ | ForEach-Object {$_.assembly} | Import-module +'@ | ForEach-Object {$_.assembly} | Import-Module } Get-TestCmdlet -MyParameter @{ a = 42 } | Should -BeExactly 'hashtable' diff --git a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 index 5e585bc001d..b1e6d0849c3 100644 --- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 +++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 @@ -134,44 +134,44 @@ Describe 'get-help HelpFunc1' -Tags "Feature" { } Context 'Get-Help helpFunc1' { - $x = get-help helpFunc1 + $x = Get-Help helpFunc1 TestHelpFunc1 $x } Context 'Get-Help dynamicHelpFunc1' { - $x = get-help dynamicHelpFunc1 + $x = Get-Help dynamicHelpFunc1 TestHelpFunc1 $x } Context 'get-help helpFunc1 -component blah' { - $x = get-help helpFunc1 -component blah -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Component blah -ErrorAction SilentlyContinue -ErrorVariable e TestHelpError $x $e 'HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand' } Context 'get-help helpFunc1 -component Something' { - $x = get-help helpFunc1 -component Something -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Component Something -ErrorAction SilentlyContinue -ErrorVariable e TestHelpFunc1 $x It '$e should be empty' { $e.Count | Should -Be 0 } } Context 'get-help helpFunc1 -role blah' { - $x = get-help helpFunc1 -component blah -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Component blah -ErrorAction SilentlyContinue -ErrorVariable e TestHelpError $x $e 'HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand' } Context 'get-help helpFunc1 -role CrazyUser' { - $x = get-help helpFunc1 -role CrazyUser -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Role CrazyUser -ErrorAction SilentlyContinue -ErrorVariable e TestHelpFunc1 $x It '$e should be empty' { $e.Count | Should -Be 0 } } Context '$x = get-help helpFunc1 -functionality blah' { - $x = get-help helpFunc1 -functionality blah -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Functionality blah -ErrorAction SilentlyContinue -ErrorVariable e TestHelpError $x $e 'HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand' } Context '$x = get-help helpFunc1 -functionality Useless' { - $x = get-help helpFunc1 -functionality Useless -ErrorAction SilentlyContinue -ErrorVariable e + $x = Get-Help helpFunc1 -Functionality Useless -ErrorAction SilentlyContinue -ErrorVariable e TestHelpFunc1 $x It '$e should be empty' { $e.Count | Should -Be 0 } } @@ -187,7 +187,7 @@ Describe 'get-help file' -Tags "CI" { } AfterAll { - remove-item $tmpfile -Force -ErrorAction silentlycontinue + Remove-Item $tmpfile -Force -ErrorAction silentlycontinue } Context 'get-help file1' { @@ -202,7 +202,7 @@ Describe 'get-help file' -Tags "CI" { get-help foo '@ > $tmpfile - $x = get-help $tmpfile + $x = Get-Help $tmpfile It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } $x = & $tmpfile It '$x.Synopsis' { $x.Synopsis | Should -BeExactly 'Function help, not script help' } @@ -223,7 +223,7 @@ Describe 'get-help file' -Tags "CI" { get-help foo '@ > $tmpfile - $x = get-help $tmpfile + $x = Get-Help $tmpfile It '$x.Synopsis' { $x.Synopsis | Should -BeExactly 'Script help, not function help' } $x = & $tmpfile It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } @@ -240,7 +240,7 @@ Describe 'get-help other tests' -Tags "CI" { } AfterAll { - remove-item $tempFile -Force -ErrorAction silentlycontinue + Remove-Item $tempFile -Force -ErrorAction silentlycontinue } Context 'get-help missingHelp' { @@ -253,7 +253,7 @@ Describe 'get-help other tests' -Tags "CI" { function missingHelp { param($abc) } - $x = get-help missingHelp + $x = Get-Help missingHelp It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } It '$x.Synopsis' { $x.Synopsis.Trim() | Should -BeExactly 'missingHelp [[-abc] ]' } } @@ -267,7 +267,7 @@ Describe 'get-help other tests' -Tags "CI" { function helpFunc2 { param($abc) } - $x = get-help helpFunc2 + $x = Get-Help helpFunc2 It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } It '$x.Synopsis' { $x.Synopsis.Trim() | Should -BeExactly 'This help block goes on helpFunc2' } } @@ -289,7 +289,7 @@ Describe 'get-help other tests' -Tags "CI" { "@ Set-Content $tempFile $script - $x = get-help $tempFile + $x = Get-Help $tempFile It '$x.Synopsis' { $x.Synopsis | Should -BeExactly "This is script help" } $x = & $tempFile @@ -313,7 +313,7 @@ Describe 'get-help other tests' -Tags "CI" { "@ Set-Content $tempFile $script - $x = get-help $tempFile + $x = Get-Help $tempFile It $x.Synopsis { $x.Synopsis | Should -BeExactly "This is script help" } $x = & $tempFile @@ -348,7 +348,7 @@ Describe 'get-help other tests' -Tags "CI" { '@ Set-Content $tempFile $script - $x = get-help $tempFile + $x = Get-Help $tempFile It '$x.Synopsis' { $x.Synopsis | Should -BeExactly "Changes Admin passwords across all KDE servers." } It '$x.parameters.parameter[0].required' { $x.parameters.parameter[0].required | Should -BeTrue} @@ -393,7 +393,7 @@ Describe 'get-help other tests' -Tags "CI" { { } - $x = get-help helpFunc4 + $x = Get-Help helpFunc4 $x.Synopsis | Should -BeExactly "" } @@ -403,7 +403,7 @@ Describe 'get-help other tests' -Tags "CI" { { # .EXTERNALHELP scriptHelp.Tests.xml } - $x = get-help helpFunc5 + $x = Get-Help helpFunc5 It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } It '$x.Synopsis' { $x.Synopsis | Should -BeExactly "A useless function, really." } } @@ -415,7 +415,7 @@ Describe 'get-help other tests' -Tags "CI" { } if ($PSUICulture -ieq "en-us") { - $x = get-help helpFunc6 + $x = Get-Help helpFunc6 It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } It '$x.Synopsis' { $x.Synopsis | Should -BeExactly "Useless. Really, trust me on this one." } } @@ -428,7 +428,7 @@ Describe 'get-help other tests' -Tags "CI" { } if ($PSUICulture -ieq "en-us") { - $x = get-help helpFunc6 + $x = Get-Help helpFunc6 It '$x should not be $null' { $x | Should -Not -BeNullOrEmpty } It '$x.Synopsis' { $x.Synopsis | Should -BeExactly "Useless in newbase. Really, trust me on this one." } } @@ -446,9 +446,9 @@ Describe 'get-help other tests' -Tags "CI" { It '$x.Category' { $x.Category | Should -BeExactly 'Cmdlet' } # Make sure help is a function, or the test would fail - if ($null -ne (get-command -type Function help)) + if ($null -ne (Get-Command -type Function help)) { - if ((get-content function:help) -Match "FORWARDHELP") + if ((Get-Content function:help) -Match "FORWARDHELP") { $x = Get-Help help It '$x.Name' { $x.Name | Should -BeExactly 'Get-Help' } @@ -466,7 +466,7 @@ Describe 'get-help other tests' -Tags "CI" { function helpFunc8 { } - get-help helpFunc8 + Get-Help helpFunc8 } $x = Get-Help func8 @@ -486,7 +486,7 @@ Describe 'get-help other tests' -Tags "CI" { function func9 { } - get-help func9 + Get-Help func9 } $x = Get-Help helpFunc9 It 'help is on the outer functon' { $x.Synopsis | Should -BeExactly 'Help on helpFunc9, not func9' } @@ -503,7 +503,7 @@ Describe 'get-help other tests' -Tags "CI" { { } - $x = get-help helpFunc10 + $x = Get-Help helpFunc10 $x.Synopsis | Should -BeExactly 'Help on helpFunc10' } @@ -539,7 +539,7 @@ Describe 'get-help other tests' -Tags "CI" { ) } - $x = get-help helpFunc11 -det + $x = Get-Help helpFunc11 -det $x.Parameters.parameter | ForEach-Object { It '$_.description' { $_.description[0].text | Should -Match "^$($_.Name)\s+help" } } @@ -573,8 +573,8 @@ Describe 'get-help other tests' -Tags "CI" { Adds .txt to bar #> } - $x = get-help helpFunc12 - It '$x.syntax' { ($x.syntax | Out-String -width 250) | Should -Match "helpFunc12 \[-Name] \[\[-Extension] ] \[\[-NoType] ] \[-ASwitch] \[\[-AnEnum] \{Alias.*All}] \[]" } + $x = Get-Help helpFunc12 + It '$x.syntax' { ($x.syntax | Out-String -Width 250) | Should -Match "helpFunc12 \[-Name] \[\[-Extension] ] \[\[-NoType] ] \[-ASwitch] \[\[-AnEnum] \{Alias.*All}] \[]" } It '$x.syntax.syntaxItem.parameter[3].position' { $x.syntax.syntaxItem.parameter[3].position | Should -BeExactly 'named' } It '$x.syntax.syntaxItem.parameter[3].parameterValue' { $x.syntax.syntaxItem.parameter[3].parameterValue | Should -BeNullOrEmpty } It '$x.parameters.parameter[3].parameterValue' { $x.parameters.parameter[3].parameterValue | Should -Not -BeNullOrEmpty } @@ -607,7 +607,7 @@ Describe 'get-help other tests' -Tags "CI" { ) } - $x = get-help helpFunc13 + $x = Get-Help helpFunc13 It '$x.Parameters.parameter[0].globbing' { $x.Parameters.parameter[0].globbing | Should -BeExactly 'true' } It '$x.Parameters.parameter[1].defaultValue' { $x.Parameters.parameter[1].defaultValue | Should -BeExactly '42' } @@ -664,7 +664,7 @@ Describe 'get-help other tests' -Tags "CI" { param() } - $x = get-help foo + $x = Get-Help foo It '$x.examples.example[0].introduction[0].text' { $x.examples.example[0].introduction[0].text | Should -BeExactly "PS > " } It '$x.examples.example[0].code' { $x.examples.example[0].code | Should -BeExactly "`$a = Get-Service`n`$a | group Status" } It '$x.examples.example[0].remarks[0].text' { $x.examples.example[0].remarks[0].text | Should -BeNullOrEmpty } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 index e21c8993391..1a9c0e496f7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 @@ -346,7 +346,7 @@ Describe "Import-Module from CompatiblePSEditions-checked paths" -Tag "CI" { (Invoke-Command -Session $s {Get-Location}).Path | Should -BeExactly $PWD.Path # after WinCompat cleanup local $PWD changes should not cause errors - Remove-module $ModuleName -Force + Remove-Module $ModuleName -Force Pop-Location } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 index de59f609687..e586d047804 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 @@ -145,7 +145,7 @@ Describe "Enter-PSHostProcess tests" -Tag Feature { # If opening the runspace fails, then print out the trace with the callstack Wait-UntilTrue { $rs.RunspaceStateInfo.State -eq [System.Management.Automation.Runspaces.RunspaceState]::Opened } | - Should -BeTrue -Because (get-content $splat.FilePath -Raw) + Should -BeTrue -Because (Get-Content $splat.FilePath -Raw) $ps = [powershell]::Create() $ps.Runspace = $rs diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 index e7bfc6be41f..600d04cef6f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Get-Command.Tests.ps1 @@ -245,7 +245,7 @@ Describe "Get-Command Tests" -Tags "CI" { } It "verify if get the proper dynamic parameter type skipped by issue #1430" -Pending { - $results = Get-Command TestGetCommand-DynamicParametersDCR -TestToRun returngenericparameter -parametertype System.Diagnostics.Process + $results = Get-Command TestGetCommand-DynamicParametersDCR -TestToRun returngenericparameter -ParameterType System.Diagnostics.Process VerifyParameterType -cmdlet $results[0] -parameterName "TypedValue" -parameterType System.Diagnostics.Process } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 index 335512b83d4..e241e46d338 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/History.Tests.ps1 @@ -122,7 +122,7 @@ Describe "History cmdlet test cases" -Tags "CI" { EndExecutionTime = $end } $history | Add-History - $h = Get-History -count 1 + $h = Get-History -Count 1 $h.Duration | Should -Be $duration } } 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 2d243f708fb..b6f40b0d5fc 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 @@ -81,7 +81,7 @@ Describe "Import-Module with ScriptsToProcess" -Tags "CI" { AfterEach { $m = @('module1','module2','script1','script2') - remove-module $m -Force -ErrorAction SilentlyContinue + Remove-Module $m -Force -ErrorAction SilentlyContinue Remove-Item out.txt -Force -ErrorAction SilentlyContinue } @@ -163,7 +163,7 @@ Describe "Import-Module for Binary Modules" -Tags 'CI' { try { $TestModulePath = Join-Path $TESTDRIVE "System.$extension" $job = Start-Job -ScriptBlock { - $module = Import-Module $using:TestModulePath -Passthru; + $module = Import-Module $using:TestModulePath -PassThru; $module.ImplementingAssembly.Location; Test-BinaryModuleCmdlet1 } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 index 640dbff7beb..06d84230dce 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 @@ -29,8 +29,8 @@ Describe "Job Cmdlet Tests" -Tag "CI" { { Get-Job $j -ErrorAction Stop } | Should -Throw -ErrorId "JobWithSpecifiedNameNotFound,Microsoft.PowerShell.Commands.GetJobCommand" } It "Receive-Job can retrieve job results" { - Wait-Job -Timeout 60 -id $j.id | Should -Not -BeNullOrEmpty - receive-job -id $j.id | Should -Be 2 + Wait-Job -Timeout 60 -Id $j.id | Should -Not -BeNullOrEmpty + Receive-Job -Id $j.id | Should -Be 2 } It "-RunAs32 not supported from 64-bit pwsh" -Skip:(-not [System.Environment]::Is64BitProcess) { { Start-Job -ScriptBlock {} -RunAs32 } | Should -Throw -ErrorId "RunAs32NotSupported,Microsoft.PowerShell.Commands.StartJobCommand" @@ -44,7 +44,7 @@ Describe "Job Cmdlet Tests" -Tag "CI" { It "Start-Job accepts arguments" { $sb = { Write-Output $args[1]; Write-Output $args[0] } $j = Start-Job -ScriptBlock $sb -ArgumentList "$TestDrive", 42 - Wait-job -Timeout (5 * 60) $j | Should -Be $j + Wait-Job -Timeout (5 * 60) $j | Should -Be $j $r = Receive-Job $j $r -Join "," | Should -Be "42,$TestDrive" } @@ -150,7 +150,7 @@ Describe "Job Cmdlet Tests" -Tag "CI" { } } } -Describe "Debug-job test" -tag "Feature" { +Describe "Debug-job test" -Tag "Feature" { BeforeAll { $rs = [runspacefactory]::CreateRunspace() $rs.Open() @@ -165,7 +165,7 @@ Describe "Debug-job test" -tag "Feature" { } # we check this via implication. # if we're debugging a job, then the debugger will have a callstack - It "Debug-Job will break into debugger" -pending { + It "Debug-Job will break into debugger" -Pending { $ps.AddScript('$job = start-job { 1..300 | ForEach-Object { Start-Sleep 1 } }').Invoke() $ps.Commands.Clear() $ps.Runspace.Debugger.GetCallStack() | Should -BeNullOrEmpty @@ -178,7 +178,7 @@ Describe "Debug-job test" -tag "Feature" { } } -Describe "Ampersand background test" -tag "CI","Slow" { +Describe "Ampersand background test" -Tag "CI","Slow" { Context "Simple background job" { AfterEach { Get-Job | Remove-Job -Force @@ -194,7 +194,7 @@ Describe "Ampersand background test" -tag "CI","Slow" { } It "doesn't cause error when variable is missing" { Remove-Item variable:name -ErrorAction Ignore - $j = write-output "Hi $name" & + $j = Write-Output "Hi $name" & Receive-Job $j -Wait | Should -BeExactly "Hi " } It "Copies variables to the child process" { @@ -215,7 +215,7 @@ Describe "Ampersand background test" -tag "CI","Slow" { $PID | Should -Not -BeExactly $cpid } It "starts in the current directory" { - $j = Get-Location | Foreach-Object -MemberName Path & + $j = Get-Location | ForEach-Object -MemberName Path & Receive-Job -Wait $j | Should -Be ($PWD.Path) } It "Test that output redirection is done in the background job" { 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 b4145180663..cce03ba9281 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Default.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Out-Default Tests" -tag CI { +Describe "Out-Default Tests" -Tag CI { BeforeAll { # due to https://github.com/PowerShell/PowerShell/issues/3405, `Out-Default -Transcript` emits output to pipeline # as running in Pester effectively wraps everything in parenthesis, workaround is to use another powershell 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 cdd3fd28da4..e6ab852dfd8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Out-Host.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Out-Host Tests" -tag CI { +Describe "Out-Host Tests" -Tag CI { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) 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 6b048587223..8cbbd2a3390 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 @@ -34,15 +34,15 @@ Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { } It "Test wildcard with relative directory path" { - push-location $TestDrive + Push-Location $TestDrive $result = Get-Command -Name .\WildCardCommandA* - pop-location + Pop-Location $result | Should -Not -BeNullOrEmpty $result | Should -Be WildCardCommandA.exe } It "Test with PowerShell wildcard and relative path" { - push-location $TestDrive + Push-Location $TestDrive # This should use the wildcard to find WildCardCommandA.exe $result = Get-Command -Name .\WildCardCommand[A].exe @@ -59,7 +59,7 @@ Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { It "Get-Command -ShowCommandInfo property field test" { $properties = ($commandInfo | Get-Member -MemberType NoteProperty) - $propertiesAsString = $properties.name | out-string + $propertiesAsString = $properties.name | Out-String $propertiesAsString | Should -MatchExactly 'CommandType' $propertiesAsString | Should -MatchExactly 'Definition' $propertiesAsString | Should -MatchExactly 'Module' @@ -86,7 +86,7 @@ Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { It "Get-Command -ShowCommandInfo ParameterSets property field test" { $properties = ($commandInfo.ParameterSets[0] | Get-Member -MemberType NoteProperty) - $propertiesAsString = $properties.name | out-string + $propertiesAsString = $properties.name | Out-String $propertiesAsString | Should -MatchExactly 'IsDefault' $propertiesAsString | Should -MatchExactly 'Name' $propertiesAsString | Should -MatchExactly 'Parameters' @@ -94,7 +94,7 @@ Describe "Tests Get-Command with relative paths and wildcards" -Tag "CI" { It "Get-Command -ShowCommandInfo Parameters property field test" { $properties = ($commandInfo.ParameterSets[0].Parameters | Get-Member -MemberType NoteProperty) - $propertiesAsString = $properties.name | out-string + $propertiesAsString = $properties.name | Out-String $propertiesAsString | Should -MatchExactly 'HasParameterSet' $propertiesAsString | Should -MatchExactly 'IsMandatory' $propertiesAsString | Should -MatchExactly 'Name' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 index 06203b517d2..e783a6f69e7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/RemoteImportModule.Tests.ps1 @@ -9,7 +9,7 @@ Describe "Remote import-module tests" -Tags 'Feature','RequireAdminOnWindows' { $PSDefaultParameterValues["it:skip"] = $true } else { $pssession = New-RemoteSession - Invoke-Command -Session $pssession -ScriptBlock { $env:PSModulePath += ";${using:testdrive}" } + Invoke-Command -Session $pssession -Scriptblock { $env:PSModulePath += ";${using:testdrive}" } # pending https://github.com/PowerShell/PowerShell/issues/4819 # $cimsession = New-RemoteSession -CimSession $null = New-Item -ItemType Directory -Path $modulePath diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 index 83a7cb18693..c12a1bdb516 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Where-Object.Tests.ps1 @@ -51,7 +51,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -contains Value' { - $Result = $Computers | Where-Object Drives -contains 'D' + $Result = $Computers | Where-Object Drives -Contains 'D' $Result | Should -HaveCount 2 } @@ -63,7 +63,7 @@ Describe "Where-Object" -Tags "CI" { It 'Where-Object $Array -in Prop' { $Array = 'SPC-1234','BGP-5678' - $Result = $Computers | Where-Object ComputerName -in $Array + $Result = $Computers | Where-Object ComputerName -In $Array $Result | Should -HaveCount 2 } @@ -73,7 +73,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -ge 2' { - $Result = $Computers | Where-Object NumberOfCores -ge 2 + $Result = $Computers | Where-Object NumberOfCores -GE 2 $Result | Should -HaveCount 2 } @@ -83,7 +83,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -gt 2' { - $Result = $Computers | Where-Object NumberOfCores -gt 2 + $Result = $Computers | Where-Object NumberOfCores -GT 2 $Result | Should -HaveCount 1 } @@ -93,7 +93,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -le 2' { - $Result = $Computers | Where-Object NumberOfCores -le 2 + $Result = $Computers | Where-Object NumberOfCores -LE 2 $Result | Should -HaveCount 2 } @@ -103,7 +103,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -lt 2' { - $Result = $Computers | Where-Object NumberOfCores -lt 2 + $Result = $Computers | Where-Object NumberOfCores -LT 2 $Result | Should -HaveCount 1 } @@ -113,7 +113,7 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -like Value' { - $Result = $Computers | Where-Object ComputerName -like 'MGC-9101' + $Result = $Computers | Where-Object ComputerName -Like 'MGC-9101' $Result | Should -HaveCount 1 } @@ -123,13 +123,13 @@ Describe "Where-Object" -Tags "CI" { } It 'Where-Object Prop -like Value' { - $Result = $Computers | Where-Object ComputerName -match '^MGC.+' + $Result = $Computers | Where-Object ComputerName -Match '^MGC.+' $Result | Should -HaveCount 1 } It 'Where-Object should handle dynamic (DLR) objects' { $dynObj = [TestDynamic]::new() - $Result = $dynObj, $dynObj | Where-Object FooProp -eq 123 + $Result = $dynObj, $dynObj | Where-Object FooProp -EQ 123 $Result | Should -HaveCount 2 $Result[0] | Should -Be $dynObj $Result[1] | Should -Be $dynObj @@ -137,7 +137,7 @@ Describe "Where-Object" -Tags "CI" { It 'Where-Object should handle dynamic (DLR) objects, even without property name hint' { $dynObj = [TestDynamic]::new() - $Result = $dynObj, $dynObj | Where-Object HiddenProp -eq 789 + $Result = $dynObj, $dynObj | Where-Object HiddenProp -EQ 789 $Result | Should -HaveCount 2 $Result[0] | Should -Be $dynObj $Result[1] | Should -Be $dynObj 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 62e9bf2a74d..3d881d3b2da 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 @@ -15,12 +15,12 @@ Describe 'Get-WinEvent' -Tags "CI" { } Context "Get-WinEvent ListProvider parameter" { It 'Get-WinEvent can list the providers' { - $result = Get-WinEvent -listprovider * -erroraction ignore + $result = Get-WinEvent -ListProvider * -ErrorAction ignore $result | Should -Not -BeNullOrEmpty } It 'Get-WinEvent can get a provider by name' { - $providers = Get-WinEvent -listprovider MSI* -erroraction ignore - $result = Get-WinEvent -listprovider ($providers[0].name) + $providers = Get-WinEvent -ListProvider MSI* -ErrorAction ignore + $result = Get-WinEvent -ListProvider ($providers[0].name) $result | Should -Not -BeNullOrEmpty } @@ -30,9 +30,9 @@ Describe 'Get-WinEvent' -Tags "CI" { BeforeAll { if ( ! $IsWindows ) { return } $foundEvents = $false - $providers = Get-WinEvent -listprovider * -erroraction ignore + $providers = Get-WinEvent -ListProvider * -ErrorAction ignore foreach($provider in $providers) { - $events = Get-WinEvent -provider $provider.name -erroraction ignore + $events = Get-WinEvent -provider $provider.name -ErrorAction ignore if ( $events.Count -gt 2 ) { $providerForTests = $provider $foundEvents = $true @@ -48,17 +48,17 @@ Describe 'Get-WinEvent' -Tags "CI" { } } It 'Get-WinEvent can get events via logname' { - $results = get-winevent -logname $providerForTests.LogLinks.LogName -MaxEvents 10 + $results = Get-WinEvent -LogName $providerForTests.LogLinks.LogName -MaxEvents 10 $results | Should -Not -BeNullOrEmpty } It 'Throw if count of lognames exceeds Windows API limit' { if ([System.Environment]::OSVersion.Version.Major -ge 10) { - { get-winevent -logname * } | Should -Throw -ErrorId "LogCountLimitExceeded,Microsoft.PowerShell.Commands.GetWinEventCommand" + { Get-WinEvent -LogName * } | Should -Throw -ErrorId "LogCountLimitExceeded,Microsoft.PowerShell.Commands.GetWinEventCommand" } } It 'Get-WinEvent can use the simplest of filters' { $filter = @{ ProviderName = $providerForTests.Name } - $testEvents = Get-WinEvent -filterhashtable $filter + $testEvents = Get-WinEvent -FilterHashtable $filter $testEventDict = [System.Collections.Generic.Dictionary[int, System.Diagnostics.Eventing.Reader.EventLogRecord]]::new() foreach ($te in $testEvents) @@ -78,21 +78,21 @@ Describe 'Get-WinEvent' -Tags "CI" { } It 'Get-WinEvent can use a filter which includes two items' { $filter = @{ ProviderName = $providerForTests.Name; Id = $events[0].Id} - $results = Get-WinEvent -filterHashtable $filter + $results = Get-WinEvent -FilterHashtable $filter $results | Should -Not -BeNullOrEmpty } It 'Get-WinEvent can retrieve event via XmlQuery' { $level = $events[0].Level $logname = $providerForTests.loglinks.logname $filter = "" - $results = Get-WinEvent -filterXml $filter -max 3 + $results = Get-WinEvent -FilterXml $filter -max 3 $results | Should -Not -BeNullOrEmpty } It 'Get-WinEvent can retrieve event via XPath' { $level = $events[0].Level $logname = $providerForTests.loglinks.logname $xpathFilter = "*[System[Level=$level]]" - $results = Get-WinEvent -logname $logname -filterXPath $xpathFilter -max 3 + $results = Get-WinEvent -LogName $logname -FilterXPath $xpathFilter -max 3 $results | Should -Not -BeNullOrEmpty } @@ -112,7 +112,7 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = @{ path = "$eventLogFile"; Param2 = "Windows x64"} - $results = Get-WinEvent -filterHashtable $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -FilterHashtable $filter -ErrorAction silentlycontinue @($results).Count | Should -Be 1 $results.RecordId | Should -Be 10 } @@ -121,7 +121,7 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = @{ path = "$eventLogFile"; DriverName = "Remote Desktop Easy Print", "Microsoft enhanced Point and Print compatibility driver" } - $results = Get-WinEvent -filterHashtable $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -FilterHashtable $filter -ErrorAction silentlycontinue @($results).Count | Should -Be 2 ($results.RecordId -contains 9) | Should -BeTrue ($results.RecordId -contains 11) | Should -BeTrue @@ -131,7 +131,7 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = @{ path = "$eventLogFile"; PackageAware="Not package aware"; DriverName = "Remote Desktop Easy Print", "Microsoft enhanced Point and Print compatibility driver" } - $results = Get-WinEvent -filterHashtable $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -FilterHashtable $filter -ErrorAction silentlycontinue @($results).Count | Should -Be 2 ($results.RecordId -contains 9) | Should -BeTrue ($results.RecordId -contains 11) | Should -BeTrue @@ -141,7 +141,7 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = "*/UserData/*/Param2='Windows x64'" - $results = Get-WinEvent -path $eventLogFile -filterXPath $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -Path $eventLogFile -FilterXPath $filter -ErrorAction silentlycontinue @($results).Count | Should -Be 1 $results.RecordId | Should -Be 10 } @@ -152,9 +152,9 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = @{ path = "$eventLogFile"} - $results = Get-WinEvent -filterHashtable $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -FilterHashtable $filter -ErrorAction silentlycontinue $filterSuppress = @{ path = "$eventLogFile"; SuppressHashFilter=@{Id=370}} - $resultsSuppress = Get-WinEvent -filterHashtable $filterSuppress -ErrorAction silentlycontinue + $resultsSuppress = Get-WinEvent -FilterHashtable $filterSuppress -ErrorAction silentlycontinue @($results).Count | Should -Be 3 @($resultsSuppress).Count | Should -Be 2 } @@ -163,9 +163,9 @@ Describe 'Get-WinEvent' -Tags "CI" { # the provided log file has been edited to remove MS PII, so we must use -ErrorAction silentlycontinue $eventLogFile = [io.path]::Combine($PSScriptRoot, "assets", "Saved-Events.evtx") $filter = @{ path = "$eventLogFile"} - $results = Get-WinEvent -filterHashtable $filter -ErrorAction silentlycontinue + $results = Get-WinEvent -FilterHashtable $filter -ErrorAction silentlycontinue $filterSuppress = @{ path = "$eventLogFile"; SuppressHashFilter=@{Param2 = "Windows x64"}} - $resultsSuppress = Get-WinEvent -filterHashtable $filterSuppress -ErrorAction silentlycontinue + $resultsSuppress = Get-WinEvent -FilterHashtable $filterSuppress -ErrorAction silentlycontinue @($results).Count | Should -Be 3 @($resultsSuppress).Count | Should -Be 2 } 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 1ea8871d2a4..3d4cb49df65 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/New-WinEvent.Tests.ps1 @@ -22,7 +22,7 @@ Describe 'New-WinEvent' -Tags "CI" { It 'Simple New-WinEvent without any payload' { New-WinEvent -ProviderName $ProviderName -Id $SimpleEventId -Version 1 $filter = @{ ProviderName = $ProviderName; Id = $SimpleEventId} - (Get-WinEvent -filterHashtable $filter).Count | Should -BeGreaterThan 0 + (Get-WinEvent -FilterHashtable $filter).Count | Should -BeGreaterThan 0 } It 'No provider found error' { @@ -42,7 +42,7 @@ Describe 'New-WinEvent' -Tags "CI" { } It 'PayloadMismatch error' { - $logPath = join-path $TestDrive 'testlog1.txt' + $logPath = Join-Path $TestDrive 'testlog1.txt' # this will print the warning with expected event template to the file New-WinEvent -ProviderName $ProviderName -Id $ComplexEventId *> $logPath Get-Content $logPath -Raw | Should -Match 'data name="FragmentPayload"' 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 d6b3052bc1c..dce8ee06db1 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 @@ -222,7 +222,7 @@ try { It "Errors on adding nonexistent user to group" { $sb = { - Add-LocalGroupMember -name TestGroup1 -Member TestNonexistentUser1 + Add-LocalGroupMember -Name TestGroup1 -Member TestNonexistentUser1 } VerifyFailingTest $sb "PrincipalNotFound,Microsoft.PowerShell.Commands.AddLocalGroupMemberCommand" } 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 2658d282f86..e6e5ebb8d4f 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 @@ -6,9 +6,9 @@ return -Set-Variable dateInFuture -option Constant -value "12/12/2036 09:00" -Set-Variable dateInPast -option Constant -value "12/12/2010 09:00" -Set-Variable dateInvalid -option Constant -value "12/12/2016 25:00" +Set-Variable dateInFuture -Option Constant -Value "12/12/2036 09:00" +Set-Variable dateInPast -Option Constant -Value "12/12/2010 09:00" +Set-Variable dateInvalid -Option Constant -Value "12/12/2016 25:00" function RemoveTestUsers { @@ -66,7 +66,7 @@ try { Describe "Verify Expected LocalUser Aliases are present" -Tags @('CI', 'RequireAdminOnWindows') { It "Test command presence" { - $result = get-alias | ForEach-Object { if ($_.Source -eq "Microsoft.PowerShell.LocalAccounts") {$_}} + $result = Get-Alias | ForEach-Object { if ($_.Source -eq "Microsoft.PowerShell.LocalAccounts") {$_}} $result.Name -contains "algm" | Should -BeTrue $result.Name -contains "dlu" | Should -BeTrue @@ -328,7 +328,7 @@ try { It "Errors when Password is an empty string" { $sb = { - New-LocalUser TestUserNew1 -Password (ConvertTo-SecureString "" -Asplaintext -Force) + New-LocalUser TestUserNew1 -Password (ConvertTo-SecureString "" -AsPlainText -Force) } VerifyFailingTest $sb "ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand" } @@ -375,7 +375,7 @@ try { It "Can set PasswordNeverExpires to create a user with null for PasswordExpires date" { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - $result = New-LocalUser TestUserNew1 -Password (ConvertTo-SecureString "p@ssw0rd" -Asplaintext -Force) -PasswordNeverExpires + $result = New-LocalUser TestUserNew1 -Password (ConvertTo-SecureString "p@ssw0rd" -AsPlainText -Force) -PasswordNeverExpires $result.Name | Should -BeExactly TestUserNew1 $result.PasswordExpires | Should -BeNullOrEmpty @@ -750,21 +750,21 @@ try { It "Errors when Password is an empty string" { $sb = { - Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString "" -Asplaintext -Force) + Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString "" -AsPlainText -Force) } VerifyFailingTest $sb "ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand" } It "Errors when Password is null" { $sb = { - Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString $null -Asplaintext -Force) + Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString $null -AsPlainText -Force) } VerifyFailingTest $sb "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand" } It "Can set Password value at max 256" { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString ("123@"+"A"*252) -asplaintext -Force) + Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString ("123@"+"A"*252) -AsPlainText -Force) $result = Get-LocalUser -Name TestUserSet1 $result.Name | Should -BeExactly TestUserSet1 @@ -775,14 +775,14 @@ try { It "Errors when Password over max 257" { $sb = { - Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString ("A"*257) -asplaintext -Force) -ErrorAction Stop + Set-LocalUser -Name TestUserSet1 -Password (ConvertTo-SecureString ("A"*257) -AsPlainText -Force) -ErrorAction Stop } VerifyFailingTest $sb "InvalidPassword,Microsoft.PowerShell.Commands.SetLocalUserCommand" } It 'Can use PasswordNeverExpires:$true to null a PasswordExpires date' { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - $user = New-LocalUser TestUserSet2 -Password (ConvertTo-SecureString "p@ssw0rd" -Asplaintext -Force) + $user = New-LocalUser TestUserSet2 -Password (ConvertTo-SecureString "p@ssw0rd" -AsPlainText -Force) $user | Set-LocalUser -PasswordNeverExpires:$true $result = Get-LocalUser TestUserSet2 @@ -792,7 +792,7 @@ try { It 'Can use PasswordNeverExpires:$false to activate a PasswordExpires date' { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - $user = New-LocalUser TestUserSet2 -Password (ConvertTo-SecureString "p@ssw0rd" -Asplaintext -Force) -PasswordNeverExpires + $user = New-LocalUser TestUserSet2 -Password (ConvertTo-SecureString "p@ssw0rd" -AsPlainText -Force) -PasswordNeverExpires $user | Set-LocalUser -PasswordNeverExpires:$false $result = Get-LocalUser TestUserSet2 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 index f16521d1c1d..059934ea2cd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Alias.Tests.ps1 @@ -76,7 +76,7 @@ Describe "Extended Alias Provider Tests" -Tags "Feature" { It "Verifying Whatif" { $before = (Get-Item -Path "Alias:\${testAliasName}").Definition - Set-Item -Path "Alias:\${testAliasName}" -Value "Get-Location" -Whatif + Set-Item -Path "Alias:\${testAliasName}" -Value "Get-Location" -WhatIf $after = (Get-Item -Path "Alias:\${testAliasName}").Definition $after | Should -BeExactly $before # Definition should not have changed } 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 0ed9b0d906d..e2ab56fc809 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-Content.Tests.ps1 @@ -65,7 +65,7 @@ Describe "Clear-Content cmdlet tests" -Tags "CI" { } # we could suppress the WhatIf output here if we use the testhost, but it's not necessary - It "The filesystem provider supports should process" -skip:(!$IsWindows) { + It "The filesystem provider supports should process" -Skip:(!$IsWindows) { Clear-Content -Path TestDrive:\$file2 -WhatIf "TestDrive:\$file2" | Should -FileContentMatch "This is content" } @@ -75,7 +75,7 @@ Describe "Clear-Content cmdlet tests" -Tags "CI" { $cci.SupportsShouldProcess | Should -BeTrue } - It "Alternate streams should be cleared with clear-content" -skip:(!$IsWindows) { + It "Alternate streams should be cleared with clear-content" -Skip:(!$IsWindows) { # make sure that the content is correct # this is here rather than BeforeAll because only windows can write to an alternate stream Set-Content -Path "TestDrive:/$file3" -Stream $streamName -Value $streamContent 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 533d1f0c84e..adc68f2acea 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clear-EventLog.Tests.ps1 @@ -14,7 +14,7 @@ Describe "Clear-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { It "should be able to Clear-EventLog" -Pending:($true) { Remove-EventLog -LogName TestLog -ErrorAction Ignore { New-EventLog -LogName TestLog -Source TestSource -ErrorAction Stop } | Should -Not -Throw - { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop } | Should -Not -Throw + { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop } | Should -Not -Throw { Get-EventLog -LogName TestLog } | Should -Not -Throw $result = Get-EventLog -LogName TestLog $result.Count | Should -Be 1 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 index d7ac5aa1e21..b20a57a0915 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ControlService.Tests.ps1 @@ -84,11 +84,11 @@ Describe "Control Service cmdlet tests" -Tags "Feature","RequireAdminOnWindows" @{script={Stop-Service dcomlaunch -ErrorAction Stop};errorid="ServiceHasDependentServices,Microsoft.PowerShell.Commands.StopServiceCommand"}, @{script={Suspend-Service winrm -ErrorAction Stop};errorid="CouldNotSuspendServiceNotSupported,Microsoft.PowerShell.Commands.SuspendServiceCommand"}, @{script={Resume-Service winrm -ErrorAction Stop};errorid="CouldNotResumeServiceNotSupported,Microsoft.PowerShell.Commands.ResumeServiceCommand"}, - @{script={Stop-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StopServiceCommand"}, - @{script={Start-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StartServiceCommand"}, - @{script={Resume-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.ResumeServiceCommand"}, - @{script={Suspend-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.SuspendServiceCommand"}, - @{script={Restart-Service $(new-guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.RestartServiceCommand"} + @{script={Stop-Service $(New-Guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StopServiceCommand"}, + @{script={Start-Service $(New-Guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StartServiceCommand"}, + @{script={Resume-Service $(New-Guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.ResumeServiceCommand"}, + @{script={Suspend-Service $(New-Guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.SuspendServiceCommand"}, + @{script={Restart-Service $(New-Guid) -ErrorAction Stop};errorid="NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.RestartServiceCommand"} ) { param($script,$errorid) { & $script } | Should -Throw -ErrorId $errorid 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 6d3009cb060..7ee3677b5bd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Copy.Item.Tests.ps1 @@ -550,7 +550,7 @@ Describe "Validate Copy-Item Remotely" -Tags "CI" { BeforeAll { # Create test file. $testFilePath = Join-Path "TestDrive:" "testfile.txt" - if (test-path $testFilePath) + if (Test-Path $testFilePath) { Remove-Item $testFilePath -Force -ErrorAction SilentlyContinue } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 index 4d47ead944e..e38bf0c6176 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 @@ -703,8 +703,8 @@ Describe "Hard link and symbolic link tests" -Tags "CI", "RequireAdminOnWindows" $link = Join-Path $TestDrive "sym-to-folder" New-Item -ItemType Directory -Path $folder > $null New-Item -ItemType File -Path $file -Value "some content" > $null - New-Item -ItemType SymbolicLink -Path $link -value $folder > $null - $childA = Get-Childitem $folder + New-Item -ItemType SymbolicLink -Path $link -Value $folder > $null + $childA = Get-ChildItem $folder Remove-Item -Path $link -Recurse $childB = Get-ChildItem $folder $childB.Count | Should -Be 1 @@ -983,7 +983,7 @@ Describe "Extended FileSystem Item/Content Cmdlet Provider Tests" -Tags "Feature } It "Verify Filter" { - $result = Get-Item -Path "TestDrive:\*" -filter "*2.txt" + $result = Get-Item -Path "TestDrive:\*" -Filter "*2.txt" $result.Name | Should -BeExactly $testFile2 } @@ -1085,7 +1085,7 @@ Describe "Extended FileSystem Item/Content Cmdlet Provider Tests" -Tags "Feature } It "Verify Include and Exclude Intersection" { - Remove-Item "TestDrive:\*" -Include "*.txt" -exclude "*2*" + Remove-Item "TestDrive:\*" -Include "*.txt" -Exclude "*2*" $file1 = Get-Item $testFile -ErrorAction SilentlyContinue $file2 = Get-Item $testFile2 -ErrorAction SilentlyContinue $file1 | Should -BeNullOrEmpty 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 7490f13c9a9..0dafa6f31de 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -83,7 +83,7 @@ Describe "Get-ChildItem" -Tags "CI" { } It "Should have all the proper fields and be populated" { - $var = Get-Childitem . + $var = Get-ChildItem . $var.Name.Length | Should -BeGreaterThan 0 $var.Mode.Length | Should -BeGreaterThan 0 @@ -92,7 +92,7 @@ Describe "Get-ChildItem" -Tags "CI" { } It "Should have mode property populated for protected files on Windows" -Skip:(!$IsWindows) { - $files = Get-Childitem -Force ~\NT* + $files = Get-ChildItem -Force ~\NT* $files.Count | Should -BeGreaterThan 0 foreach ($file in $files) { @@ -110,14 +110,14 @@ Describe "Get-ChildItem" -Tags "CI" { } It "Should list hidden files as well when 'Force' parameter is used" { - $files = Get-ChildItem -path $TestDrive -Force + $files = Get-ChildItem -Path $TestDrive -Force $files | Should -Not -BeNullOrEmpty $files.Count | Should -Be 6 $files.Name.Contains($item_F) | Should -BeTrue } It "Should list only hidden files when 'Hidden' parameter is used" { - $files = Get-ChildItem -path $TestDrive -Hidden + $files = Get-ChildItem -Path $TestDrive -Hidden $files | Should -Not -BeNullOrEmpty $files.Count | Should -Be 1 $files[0].Name | Should -BeExactly $item_F @@ -170,7 +170,7 @@ Describe "Get-ChildItem" -Tags "CI" { # VSTS machines don't have a page file It "Should give .sys file if the fullpath is specified with hidden and force parameter" -Pending { # Don't remove!!! It is special test for hidden and opened file with exclusive lock. - $file = Get-ChildItem -path "$env:SystemDrive\\pagefile.sys" -Hidden + $file = Get-ChildItem -Path "$env:SystemDrive\\pagefile.sys" -Hidden $file | Should -Not -Be $null $file.Count | Should -Be 1 $file.Name | Should -Be "pagefile.sys" @@ -217,7 +217,7 @@ Describe "Get-ChildItem" -Tags "CI" { $env:__FOODBAR = 'food' $env:__foodbar = 'bar' - $foodbar = Get-Childitem env: | Where-Object {$_.Name -eq '__foodbar'} + $foodbar = Get-ChildItem env: | Where-Object {$_.Name -eq '__foodbar'} $count = if ($IsWindows) { 1 } else { 2 } ($foodbar | Measure-Object).Count | Should -Be $count } 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 dc43edc85fc..fd62292eb36 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ComputerInfo.Tests.ps1 @@ -472,7 +472,7 @@ public static extern int LCIDToLocaleName(uint localeID, System.Text.StringBuild { $hal = $null $systemDirectory = Get-CimClassPropVal Win32_OperatingSystem SystemDirectory - $halPath = Join-Path -path $systemDirectory -ChildPath "hal.dll" + $halPath = Join-Path -Path $systemDirectory -ChildPath "hal.dll" $query = 'SELECT * FROM CIM_DataFile Where Name="C:\WINDOWS\system32\hal.dll"' $query = $query -replace '\\','\\' $instance = Get-CimInstance -Query $query @@ -1049,7 +1049,7 @@ try { $ObservedList = $ComputerInformation.$property $ExpectedList = $Expected.$property $SpecialPropertyList = ($ObservedList)[0].psobject.properties.name - Compare-Object $ObservedList $ExpectedList -property $SpecialPropertyList | Should -BeNullOrEmpty + Compare-Object $ObservedList $ExpectedList -Property $SpecialPropertyList | Should -BeNullOrEmpty } else { 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 f1e93020077..ca83259a151 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-EventLog.Tests.ps1 @@ -28,7 +28,7 @@ Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { $logs.Count | Should -BeGreaterThan 3 } It "should be able to Get-EventLog -LogName Application -Newest 100" -Pending:($true) { - { $result=get-eventlog -LogName Application -Newest 100 -ErrorAction Stop } | Should -Not -Throw + { $result=Get-EventLog -LogName Application -Newest 100 -ErrorAction Stop } | Should -Not -Throw $result | Should -Not -BeNullOrEmpty $result.Length | Should -BeLessThan 100 $result[0] | Should -BeOfType EventLogEntry @@ -37,7 +37,7 @@ Describe "Get-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { { Get-EventLog -LogName System -List -ErrorAction Stop } | Should -Throw -ErrorId "AmbiguousParameterSet,Microsoft.PowerShell.Commands.GetEventLogCommand" } It "should be able to Get-EventLog -LogName * with multiple matches" -Pending:($true) { - { $result=get-eventlog -LogName * -ErrorAction Stop } | Should -Not -Throw + { $result=Get-EventLog -LogName * -ErrorAction Stop } | Should -Not -Throw $result | Should -Not -BeNullOrEmpty $result | Should -BeExactly "Security" $result.Count | Should -BeGreaterThan 3 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 index bdf5cf84fa9..02f6bbf9c4f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-HotFix.Tests.ps1 @@ -60,7 +60,7 @@ Describe "Get-HotFix Tests" -Tag CI { } It "Get-Hotfix can accept ComputerName via pipeline" { - { [PSCustomObject]@{ComputerName = 'UnavailableComputer'} | Get-HotFix } | Should -Throw -ErrorID 'Microsoft.PowerShell.Commands.GetHotFixCommand' + { [PSCustomObject]@{ComputerName = 'UnavailableComputer'} | Get-HotFix } | Should -Throw -ErrorId 'Microsoft.PowerShell.Commands.GetHotFixCommand' [PSCustomObject]@{ComputerName = 'localhost'} | Get-HotFix | Should -Not -BeNullOrEmpty } } 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 c6031b966d9..86b831ba8d0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Item.Tests.ps1 @@ -31,13 +31,13 @@ Describe "Get-Item" -Tags "CI" { $null = New-Item -type file "$TESTDRIVE/file[abc].txt" $null = New-Item -type file "$TESTDRIVE/filea.txt" # if literalpath is not correct we would see filea.txt - $item = Get-Item -literalpath "$TESTDRIVE/file[abc].txt" + $item = Get-Item -LiteralPath "$TESTDRIVE/file[abc].txt" @($item).Count | Should -Be 1 $item.Name | Should -BeExactly 'file[abc].txt' } It "Should have mode flags set" { - Get-ChildItem $PSScriptRoot | foreach-object { $_.Mode | Should -Not -BeNullOrEmpty } + Get-ChildItem $PSScriptRoot | ForEach-Object { $_.Mode | Should -Not -BeNullOrEmpty } } It "Should not return the item unless force is used if hidden" { @@ -48,11 +48,11 @@ Describe "Get-Item" -Tags "CI" { } ${result} = Get-Item "${hiddenFile}" -ErrorAction SilentlyContinue ${result} | Should -BeNullOrEmpty - ${result} = Get-Item -force "${hiddenFile}" -ErrorAction SilentlyContinue + ${result} = Get-Item -Force "${hiddenFile}" -ErrorAction SilentlyContinue ${result}.FullName | Should -BeExactly ${item}.FullName } - It "Should get properties for special reparse points" -skip:$skipNotWindows { + It "Should get properties for special reparse points" -Skip:$skipNotWindows { $result = Get-Item -Path $HOME/Cookies -Force $result.LinkType | Should -BeExactly "Junction" $result.Target | Should -Not -BeNullOrEmpty @@ -89,7 +89,7 @@ Describe "Get-Item" -Tags "CI" { $result.Name | Should -BeExactly "file2.txt" } It "Should respect combinations of filter, include, and exclude" { - $result = get-item "${testBaseDir}/*" -filter *.txt -include "file[12].txt" -exclude file2.txt + $result = Get-Item "${testBaseDir}/*" -Filter *.txt -Include "file[12].txt" -Exclude file2.txt ($result).Count | Should -Be 1 $result.Name | Should -BeExactly "file1.txt" } @@ -114,10 +114,10 @@ Describe "Get-Item" -Tags "CI" { $altStreamPath = "$TESTDRIVE/altStream.txt" $stringData = "test data" $streamName = "test" - $item = new-item -type file $altStreamPath - Set-Content -path $altStreamPath -Stream $streamName -Value $stringData + $item = New-Item -type file $altStreamPath + Set-Content -Path $altStreamPath -Stream $streamName -Value $stringData } - It "Should find an alternate stream if present" -skip:$skipNotWindows { + It "Should find an alternate stream if present" -Skip:$skipNotWindows { $result = Get-Item $altStreamPath -Stream $streamName $result.Length | Should -Be ($stringData.Length + [Environment]::NewLine.Length) $result.Stream | Should -Be $streamName @@ -125,13 +125,13 @@ Describe "Get-Item" -Tags "CI" { } Context "Registry Provider" { - It "Can retrieve an item from registry" -skip:$skipNotWindows { + It "Can retrieve an item from registry" -Skip:$skipNotWindows { ${result} = Get-Item HKLM:/Software ${result} | Should -BeOfType Microsoft.Win32.RegistryKey } } - Context "Environment provider" -tag "CI" { + Context "Environment provider" -Tag "CI" { BeforeAll { $env:testvar="b" $env:testVar="a" @@ -143,7 +143,7 @@ Describe "Get-Item" -Tags "CI" { } It "get-item testVar" { - (get-item env:\testVar).Value | Should -BeExactly "a" + (Get-Item env:\testVar).Value | Should -BeExactly "a" } It "get-item is case-sensitive/insensitive as appropriate" { @@ -153,7 +153,7 @@ Describe "Get-Item" -Tags "CI" { $expectedValue = "a" } - (get-item env:\testvar).Value | Should -BeExactly $expectedValue + (Get-Item env:\testvar).Value | Should -BeExactly $expectedValue } } } @@ -165,7 +165,7 @@ Describe "Get-Item environment provider on Windows with accidental case-variant AfterAll { $env:testVar = $null } - It "Reports the effective value among accidental case-variant duplicates on Windows" -skip:$skipNotWindows { + It "Reports the effective value among accidental case-variant duplicates on Windows" -Skip:$skipNotWindows { if (-not (Get-Command -ErrorAction Ignore node.exe)) { Write-Warning "Test skipped, because prerequisite Node.js is not installed." } else { 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 395da72fd8e..d97cdee6c1a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Location.Tests.ps1 @@ -7,7 +7,7 @@ Describe "Get-Location" -Tags "CI" { } AfterEach { - Pop-location + Pop-Location } It "Should list the output of the current working directory" { 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 2fa7ef45387..cd3f115fbec 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Get-Process" -Tags "CI" { } It "Should have not empty Name flags set for Get-Process object" -Pending:$IsMacOS { - $ps | foreach-object { $_.Name | Should -Not -BeNullOrEmpty } + $ps | ForEach-Object { $_.Name | Should -Not -BeNullOrEmpty } } It "Should throw an error for non existing process id." { @@ -59,7 +59,7 @@ Describe "Get-Process" -Tags "CI" { } It "Should throw an exception when process id is null." { - { Get-Process -id $null } | Should -Throw -ErrorId "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetProcessCommand" + { Get-Process -Id $null } | Should -Throw -ErrorId "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetProcessCommand" } It "Should throw an exception when -InputObject parameter is null." { @@ -118,12 +118,12 @@ Describe "Get-Process Formatting" -Tags "Feature" { Describe "Process Parent property" -Tags "CI" { It "Has Parent process property" { - $powershellexe = (get-process -id $PID).mainmodule.filename + $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent' | Should -Not -BeNullOrEmpty } It "Has valid parent process ID property" { - $powershellexe = (get-process -id $PID).mainmodule.filename + $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent.Id' | Should -Be $PID } } 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 42959ceff08..9429229c537 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 @@ -55,10 +55,10 @@ Describe "Get-Service cmdlet tests" -Tags "CI" { @{ script = { Get-Service -DisplayName Net* } ; expected = { Get-Service | Where-Object { $_.DisplayName -like 'Net*' } } }, @{ script = { Get-Service -Include Net* -Exclude *logon } ; expected = { Get-Service | Where-Object { $_.Name -match '^net.*?(?'" -TestCases @( - @{ script = { Get-Service -Name (new-guid) -ErrorAction Stop} ; + @{ script = { Get-Service -Name (New-Guid) -ErrorAction Stop} ; ErrorId = "NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand" }, - @{ script = { Get-Service -DisplayName (new-guid) -ErrorAction Stop}; + @{ script = { Get-Service -DisplayName (New-Guid) -ErrorAction Stop}; ErrorId = "NoServiceFoundForGivenDisplayName,Microsoft.PowerShell.Commands.GetServiceCommand" } ) { param($script,$errorid) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 index cbc6abeb084..9a0d1f999e5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/ItemProperty.Tests.ps1 @@ -2,20 +2,20 @@ # 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" + Get-ItemPropertyValue -Path $TESTDRIVE -Name Attributes | Should -Be "Directory" } It "Can clear the PropertyValue with Clear-ItemProperty" { - setup -f file1.txt + Setup -f file1.txt Set-ItemProperty $TESTDRIVE/file1.txt -Name Attributes -Value ReadOnly - Get-ItemPropertyValue -path $TESTDRIVE/file1.txt -Name Attributes | Should -Match "ReadOnly" + Get-ItemPropertyValue -Path $TESTDRIVE/file1.txt -Name Attributes | Should -Match "ReadOnly" Clear-ItemProperty $TESTDRIVE/file1.txt -Name Attributes - Get-ItemPropertyValue -path $TESTDRIVE/file1.txt -Name Attributes | Should -Not -Match "ReadOnly" + Get-ItemPropertyValue -Path $TESTDRIVE/file1.txt -Name Attributes | Should -Not -Match "ReadOnly" } # these cmdlets are targeted at the windows registry, and don't have an linux equivalent Context "Registry targeted cmdlets" { - It "Copy ItemProperty" -pending { } - It "Move ItemProperty" -pending { } - It "New ItemProperty" -pending { } - It "Rename ItemProperty" -pending { } + It "Copy ItemProperty" -Pending { } + It "Move ItemProperty" -Pending { } + It "New ItemProperty" -Pending { } + It "Rename ItemProperty" -Pending { } } } 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 50aba67bbe7..8cb6391cd7b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Join-Path.Tests.ps1 @@ -10,20 +10,20 @@ Describe "Join-Path cmdlet tests" -Tags "CI" { } It "should output multiple paths when called with multiple -Path targets" { Setup -Dir SubDir1 - (Join-Path -Path TestDrive:,$TestDrive -ChildPath "SubDir1" -resolve).Length | Should -Be 2 + (Join-Path -Path TestDrive:,$TestDrive -ChildPath "SubDir1" -Resolve).Length | Should -Be 2 } It "should throw 'DriveNotFound' when called with -Resolve and drive does not exist" { - { Join-Path bogusdrive:\\somedir otherdir -resolve -ErrorAction Stop; Throw "Previous statement unexpectedly succeeded..." } | + { Join-Path bogusdrive:\\somedir otherdir -Resolve -ErrorAction Stop; Throw "Previous statement unexpectedly succeeded..." } | Should -Throw -ErrorId "DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand" } It "should throw 'PathNotFound' when called with -Resolve and item does not exist" { - { Join-Path "Bogus" "Path" -resolve -ErrorAction Stop; Throw "Previous statement unexpectedly succeeded..." } | + { Join-Path "Bogus" "Path" -Resolve -ErrorAction Stop; Throw "Previous statement unexpectedly succeeded..." } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.JoinPathCommand" } #[BugId(BugDatabase.WindowsOutOfBandReleases, 905237)] Note: Result should be the same on non-Windows platforms too It "should return one object when called with a Windows FileSystem::Redirector" { - set-location ("env:"+$SepChar) - $result=join-path FileSystem::windir system32 + Set-Location ("env:"+$SepChar) + $result=Join-Path FileSystem::windir system32 $result.Count | Should -Be 1 $result | Should -BeExactly ("FileSystem::windir"+$SepChar+"system32") } 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 cd6db3c689e..3f0b06d4506 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Move-Item.Tests.ps1 @@ -3,10 +3,10 @@ Describe "Move-Item tests" -Tag "CI" { BeforeAll { $content = "This is content" - Setup -f originalfile.txt -content "This is content" + Setup -f originalfile.txt -Content "This is content" $source = "$TESTDRIVE/originalfile.txt" $target = "$TESTDRIVE/ItemWhichHasBeenMoved.txt" - Setup -f [orig-file].txt -content "This is not content" + Setup -f [orig-file].txt -Content "This is not content" $sourceSp = "$TestDrive/``[orig-file``].txt" $targetSpName = "$TestDrive/ItemWhichHasBeen[Moved].txt" $targetSp = "$TestDrive/ItemWhichHasBeen``[Moved``].txt" 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 84226229de4..97777d6bd73 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-EventLog.Tests.ps1 @@ -20,34 +20,34 @@ Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { It "should be able to create a New-EventLog with a -Source parameter" -Skip:($true) { {New-EventLog -LogName TestLog -Source TestSource -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop} | Should -Not -Throw $result=Get-EventLog -LogName TestLog $result.Count | Should -Be 1 } It "should be able to create a New-EventLog with a -ComputerName parameter" -Skip:($true) { {New-EventLog -LogName TestLog -Source TestSource -ComputerName $env:COMPUTERNAME -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop} | Should -Not -Throw $result=Get-EventLog -LogName TestLog $result.Count | Should -Be 1 $result.EventID | Should -Be 1 } It "should be able to create a New-EventLog with a -CategoryResourceFile parameter" -Skip:($true) { {New-EventLog -LogName TestLog -Source TestSource -CategoryResourceFile "CategoryMessageFile" -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 2 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 2 -ErrorAction Stop} | Should -Not -Throw $result=Get-EventLog -LogName TestLog $result.Count | Should -Be 1 $result.EventID | Should -Be 2 } It "should be able to create a New-EventLog with a -MessageResourceFile parameter" -Skip:($true) { {New-EventLog -LogName TestLog -Source TestSource -MessageResourceFile "ResourceMessageFile" -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 3 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 3 -ErrorAction Stop} | Should -Not -Throw $result=Get-EventLog -LogName TestLog $result.Count | Should -Be 1 $result.EventID | Should -Be 3 } It "should be able to create a New-EventLog with a -ParameterResourceFile parameter" -Skip:($true) { {New-EventLog -LogName TestLog -Source TestSource -ParameterResourceFile "ParameterMessageFile" -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 4 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 4 -ErrorAction Stop} | Should -Not -Throw $result=Get-EventLog -LogName TestLog $result.Count | Should -Be 1 $result.EventID | Should -Be 4 diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 index 2e96797ecce..77d76b6ec6a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-PSDrive.Tests.ps1 @@ -17,11 +17,11 @@ Describe "Tests for New-PSDrive cmdlet." -Tag "CI","RequireAdminOnWindows" { { New-PSDrive -Name $PSDriveName -PSProvider FileSystem -Root $RemoteShare -Persist -ErrorAction Stop } | Should -Not -Throw } - it "Should throw exception if root is not a remote share." -Skip:(-not $IsWindows) { + It "Should throw exception if root is not a remote share." -Skip:(-not $IsWindows) { { New-PSDrive -Name $PSDriveName -PSProvider FileSystem -Root "TestDrive:\" -Persist -ErrorAction Stop } | Should -Throw -ErrorId 'DriveRootNotNetworkPath' } - it "Should throw exception if PSDrive is not a drive letter supported by operating system." -Skip:(-not $IsWindows) { + It "Should throw exception if PSDrive is not a drive letter supported by operating system." -Skip:(-not $IsWindows) { $PSDriveName = 'AB' { New-PSDrive -Name $PSDriveName -PSProvider FileSystem -Root $RemoteShare -Persist -ErrorAction Stop } | Should -Throw -ErrorId 'DriveNameNotSupportedForPersistence' } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 index f0baa46e8b0..635e3f2940f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Registry.Tests.ps1 @@ -97,7 +97,7 @@ Describe "Basic Registry Provider Tests" -Tags @("CI", "RequireAdminOnWindows") It "Verify Rename-Item" { $existBefore = Test-Path $testKey - $renamedKey = Rename-Item -path $testKey -NewName "RenamedKey" -PassThru + $renamedKey = Rename-Item -Path $testKey -NewName "RenamedKey" -PassThru $existAfter = Test-Path $testKey $existBefore | Should -BeTrue $existAfter | Should -BeFalse @@ -260,13 +260,13 @@ Describe "Extended Registry Provider Tests" -Tags @("Feature", "RequireAdminOnWi } It "Verify Confirm can be bypassed" { - $result = New-ItemProperty -Path $testKey -Name $testPropertyName -Value $testPropertyValue -force -Confirm:$false + $result = New-ItemProperty -Path $testKey -Name $testPropertyName -Value $testPropertyValue -Force -Confirm:$false $result."$testPropertyName" | Should -Be $testPropertyValue $result.PSChildName | Should -BeExactly $testKey } It "Verify WhatIf" { - $result = New-ItemProperty -Path $testKey -Name $testPropertyName -Value $testPropertyValue -whatif + $result = New-ItemProperty -Path $testKey -Name $testPropertyName -Value $testPropertyValue -WhatIf $result | Should -BeNullOrEmpty } } 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 7ad443c9d1a..132b8e4580c 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-EventLog.Tests.ps1 @@ -16,19 +16,19 @@ Describe "New-EventLog cmdlet tests" -Tags @('CI', 'RequireAdminOnWindows') { if ($IsNotSkipped) { Remove-EventLog -LogName TestLog -ErrorAction Ignore {New-EventLog -LogName TestLog -Source TestSource -ErrorAction Stop} | Should -Not -Throw - {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop} | Should -Not -Throw + {Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop} | Should -Not -Throw } } #CmdLet is NYI - change to -Skip:($NonWinAdmin) when implemented It "should be able to Remove-EventLog -LogName -ComputerName " -Pending:($true) { { Remove-EventLog -LogName TestLog -ComputerName $env:COMPUTERNAME -ErrorAction Stop } | Should -Not -Throw - { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop } | Should -Throw -ErrorId "Microsoft.PowerShell.Commands.WriteEventLogCommand" + { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop } | Should -Throw -ErrorId "Microsoft.PowerShell.Commands.WriteEventLogCommand" { Get-EventLog -LogName TestLog -ErrorAction Stop } | Should -Throw -ErrorId "System.InvalidOperationException,Microsoft.PowerShell.Commands.GetEventLogCommand" } #CmdLet is NYI - change to -Skip:($NonWinAdmin) when implemented It "should be able to Remove-EventLog -Source -ComputerName " -Pending:($true) { {Remove-EventLog -Source TestSource -ComputerName $env:COMPUTERNAME -ErrorAction Stop} | Should -Not -Throw - { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventID 1 -ErrorAction Stop } | Should -Throw -ErrorId "Microsoft.PowerShell.Commands.WriteEventLogCommand" + { Write-EventLog -LogName TestLog -Source TestSource -Message "Test" -EventId 1 -ErrorAction Stop } | Should -Throw -ErrorId "Microsoft.PowerShell.Commands.WriteEventLogCommand" { Get-EventLog -LogName TestLog -ErrorAction Stop; } | Should -Throw -ErrorId "System.InvalidOperationException,Microsoft.PowerShell.Commands.GetEventLogCommand" } } 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 88ec3b89fc8..769a8a34003 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Remove-Item.Tests.ps1 @@ -75,9 +75,9 @@ Describe "Remove-Item" -Tags "CI" { # Delete the specific string Remove-Item (Join-Path -Path $testpath -ChildPath "*") -Include file*.txt # validate that the string under test was deleted, and the nonmatching strings still exist - Test-path (Join-Path -Path $testpath -ChildPath file1.txt) | Should -BeFalse - Test-path (Join-Path -Path $testpath -ChildPath file2.txt) | Should -BeFalse - Test-path (Join-Path -Path $testpath -ChildPath file3.txt) | Should -BeFalse + Test-Path (Join-Path -Path $testpath -ChildPath file1.txt) | Should -BeFalse + Test-Path (Join-Path -Path $testpath -ChildPath file2.txt) | Should -BeFalse + Test-Path (Join-Path -Path $testpath -ChildPath file3.txt) | Should -BeFalse Test-Path $testfilepath | Should -BeTrue # Delete the non-matching strings @@ -131,7 +131,7 @@ Describe "Remove-Item" -Tags "CI" { New-Item -Name $testfile -Path $testsubdirectory -ItemType "file" -Value "lorem ipsum" $complexDirectory = Join-Path -Path $testsubdirectory -ChildPath $testfile - test-path $complexDirectory | Should -BeTrue + Test-Path $complexDirectory | Should -BeTrue { Remove-Item $testdirectory -Recurse} | Should -Not -Throw 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 6eb63ed7583..0d60b7830e1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Rename-Item.Tests.ps1 @@ -2,10 +2,10 @@ # Licensed under the MIT License. Describe "Rename-Item tests" -Tag "CI" { BeforeAll { - Setup -f originalFile.txt -content "This is content" + Setup -f originalFile.txt -Content "This is content" $source = "$TESTDRIVE/originalFile.txt" $target = "$TESTDRIVE/ItemWhichHasBeenRenamed.txt" - Setup -f [orig-file].txt -content "This is not content" + Setup -f [orig-file].txt -Content "This is not content" $sourceSp = "$TestDrive/``[orig-file``].txt" $targetSpName = "ItemWhichHasBeen[Renamed].txt" $targetSp = "$TestDrive/ItemWhichHasBeen``[Renamed``].txt" @@ -14,8 +14,8 @@ Describe "Rename-Item tests" -Tag "CI" { } It "Rename-Item will rename a file" { Rename-Item $source $target - test-path $source | Should -BeFalse - test-path $target | Should -BeTrue + Test-Path $source | Should -BeFalse + Test-Path $target | Should -BeTrue "$target" | Should -FileContentMatchExactly "This is content" } It "Rename-Item will rename a file when path contains special char" { @@ -31,7 +31,7 @@ Describe "Rename-Item tests" -Tag "CI" { $oldSp = "$wdSp/$oldSpBName" $newSpName = "[renamed]file.txt" $newSp = "$wdSp/``[renamed``]file.txt" - In $wdSp -Execute { + In $wdSp -execute { $null = New-Item -Name $oldSpName -ItemType File -Value $content -Force Rename-Item -Path $oldSpBName $newSpName } @@ -46,7 +46,7 @@ Describe "Rename-Item tests" -Tag "CI" { $oldSp = "$wdSp/$oldSpBName" $newSpName = "[renamed]file2.txt" $newSp = "$wdSp/``[renamed``]file2.txt" - In $wdSp -Execute { + In $wdSp -execute { $null = New-Item -Name $oldSpName -ItemType File -Value $content -Force Rename-Item -LiteralPath $oldSpName $newSpName } 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 42e2b3a2902..8a2c050a90f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Restart-Computer.Tests.ps1 @@ -81,7 +81,7 @@ try } It "Should not support timeout on Unix" -Skip:($IsWindows) { - { Restart-Computer -timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "NamedParameterNotFound,Microsoft.PowerShell.Commands.RestartComputerCommand" + { Restart-Computer -Timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "NamedParameterNotFound,Microsoft.PowerShell.Commands.RestartComputerCommand" } It "Should not support Delay on Unix" -Skip:($IsWindows) { @@ -90,12 +90,12 @@ try It "Should not support timeout on localhost" -Skip:(!$IsWindows) { Set-TesthookResult -testhookName $restartTesthookResultName -value $defaultResultValue - { Restart-Computer -timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "RestartComputerInvalidParameter,Microsoft.PowerShell.Commands.RestartComputerCommand" + { Restart-Computer -Timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "RestartComputerInvalidParameter,Microsoft.PowerShell.Commands.RestartComputerCommand" } It "Should not support timeout on localhost" -Skip:(!$IsWindows) { Set-TesthookResult -testhookName $restartTesthookResultName -value $defaultResultValue - { Restart-Computer -timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "RestartComputerInvalidParameter,Microsoft.PowerShell.Commands.RestartComputerCommand" + { Restart-Computer -Timeout 3 -ErrorAction Stop } | Should -Throw -ErrorId "RestartComputerInvalidParameter,Microsoft.PowerShell.Commands.RestartComputerCommand" } } } 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 f0fe03a26d5..6e8f8bde083 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Content.Tests.ps1 @@ -60,7 +60,7 @@ Describe "Set-Content cmdlet tests" -Tags "CI" { It "should throw 'ParameterArgumentValidationErrorNullNotAllowed' when -Path is `$()" { { Set-Content -Path $() -Value "ShouldNotWorkBecausePathIsInvalid" -ErrorAction Stop } | Should -Throw -ErrorId "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetContentCommand" } - It "should throw 'PSNotSupportedException' when you Set-Content to an unsupported provider" -skip:$skipRegistry { + It "should throw 'PSNotSupportedException' when you Set-Content to an unsupported provider" -Skip:$skipRegistry { { Set-Content -Path HKLM:\\software\\microsoft -Value "ShouldNotWorkBecausePathIsUnsupported" -ErrorAction Stop } | Should -Throw -ErrorId "NotSupported,Microsoft.PowerShell.Commands.SetContentCommand" } #[BugId(BugDatabase.WindowsOutOfBandReleases, 9058182)] 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 d64b4fbae31..1232b0a2040 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Item.Tests.ps1 @@ -1,14 +1,14 @@ # Copyright (c) Microsoft Corporation. # 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 } }, - @{ Path = "function:SetItemTestCase"; Value = { 1 }; Validate = { SetItemTestCase | Should -Be 1 }; Reset = { remove-item function:SetItemTestCase } }, - @{ Path = "env:SetItemTestCase"; Value = { 1 }; Validate = { $env:SetItemTestCase | Should -Be 1 }; Reset = { remove-item env:SetItemTestCase } } + $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 } }, + @{ Path = "function:SetItemTestCase"; Value = { 1 }; Validate = { SetItemTestCase | Should -Be 1 }; Reset = { Remove-Item function:SetItemTestCase } }, + @{ Path = "env:SetItemTestCase"; Value = { 1 }; Validate = { $env:SetItemTestCase | Should -Be 1 }; Reset = { Remove-Item env:SetItemTestCase } } It "Set-Item should be able to handle " -TestCase $testCases { param ( $Path, $Value, $Validate, $Reset ) - Set-item -path $path -Value $value + Set-Item -Path $path -Value $value try { & $Validate } 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 c557df36608..1906b6d90c4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 @@ -80,14 +80,14 @@ Describe "Start-Process" -Tag "Feature","RequireAdminOnWindows" { It "Should handle stdout redirection without error" { $process = Start-Process ping -ArgumentList $pingParam -Wait -RedirectStandardOutput $tempFile @extraArgs - $dirEntry = get-childitem $tempFile + $dirEntry = Get-ChildItem $tempFile $dirEntry.Length | Should -BeGreaterThan 0 } # Marking this test 'pending' to unblock daily builds. Filed issue : https://github.com/PowerShell/PowerShell/issues/2396 It "Should handle stdin redirection without error" -Pending { $process = Start-Process sort -Wait -RedirectStandardOutput $tempFile -RedirectStandardInput $assetsFile @extraArgs - $dirEntry = get-childitem $tempFile + $dirEntry = Get-ChildItem $tempFile $dirEntry.Length | Should -BeGreaterThan 0 } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index 1bdbd7e69f6..27f4d41232d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -27,7 +27,7 @@ Describe "Test-Connection" -tags "CI" { $pingResults.Count | Should -Be 4 $result = $pingResults | - Where-Object Status -eq 'Success' | + Where-Object Status -EQ 'Success' | Select-Object -First 1 $result | Should -BeOfType Microsoft.PowerShell.Commands.TestConnectionCommand+PingStatus @@ -118,7 +118,7 @@ Describe "Test-Connection" -tags "CI" { # be a lack of or inconsistent support for IPv6 in CI environments. It "Allows us to Force IPv6" -Pending { $result = Test-Connection $targetName -IPv6 -Count 4 | - Where-Object Status -eq Success | + Where-Object Status -EQ Success | Select-Object -First 1 $result.Address | Should -BeExactly $targetAddressIPv6 @@ -127,7 +127,7 @@ Describe "Test-Connection" -tags "CI" { It 'can convert IPv6 addresses to IPv4 with -IPv4 parameter' -Pending { $result = Test-Connection '2001:4860:4860::8888' -IPv4 -Count 4 | - Where-Object Status -eq Success | + Where-Object Status -EQ Success | Select-Object -First 1 # Google's DNS can resolve to either address. $result.Address.IPAddressToString | Should -BeIn @('8.8.8.8', '8.8.4.4') @@ -136,7 +136,7 @@ Describe "Test-Connection" -tags "CI" { It 'can convert IPv4 addresses to IPv6 with -IPv6 parameter' -Pending { $result = Test-Connection '8.8.8.8' -IPv6 -Count 4 | - Where-Object Status -eq Success | + Where-Object Status -EQ Success | Select-Object -First 1 # Google's DNS can resolve to either address. $result.Address.IPAddressToString | Should -BeIn @('2001:4860:4860::8888', '2001:4860:4860::8844') 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 8a21ceb8199..edad763fe71 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Path.Tests.ps1 @@ -3,12 +3,12 @@ Describe "Test-Path" -Tags "CI" { BeforeAll { $testdirectory = $TestDrive - $testfilename = New-Item -path $testdirectory -Name testfile.txt -ItemType file -Value 1 -force + $testfilename = New-Item -Path $testdirectory -Name testfile.txt -ItemType file -Value 1 -Force # populate with additional files - New-Item -Path $testdirectory -Name datestfile -value 1 -ItemType file | Out-Null - New-Item -Path $testdirectory -Name gatestfile -value 1 -ItemType file | Out-Null - New-Item -Path $testdirectory -Name usr -value 1 -ItemType directory | Out-Null + New-Item -Path $testdirectory -Name datestfile -Value 1 -ItemType file | Out-Null + New-Item -Path $testdirectory -Name gatestfile -Value 1 -ItemType file | Out-Null + New-Item -Path $testdirectory -Name usr -Value 1 -ItemType directory | Out-Null $nonExistentDir = Join-Path -Path (Join-Path -Path $testdirectory -ChildPath usr) -ChildPath bin $nonExistentPath = Join-Path -Path (Join-Path -Path (Join-Path -Path $testdirectory -ChildPath usr) -ChildPath bin) -ChildPath error diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 index e3f4c78ddf4..43b1cae28df 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1 @@ -143,7 +143,7 @@ try { } AfterAll { if ($IsWindows) { - Set-TimeZone -ID $originalTimeZoneId + Set-TimeZone -Id $originalTimeZoneId } } @@ -172,7 +172,7 @@ try { } AfterAll { if ($IsWindows) { - Set-TimeZone -ID $originalTimeZoneId + Set-TimeZone -Id $originalTimeZoneId } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 index 423c0bfc4e8..1fe6113c92b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/UnixStat.Tests.ps1 @@ -29,7 +29,7 @@ Describe "UnixFileSystem additions" -Tag "CI" { It "The UnixStat property should be the correct type" { $expected = "System.Management.Automation.Platform+Unix+CommonStat" - $i = (get-item /).psobject.properties['UnixStat'].TypeNameOfValue + $i = (Get-Item /).psobject.properties['UnixStat'].TypeNameOfValue $i | Should -Be $expected } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 index f95198928e4..9baedbe7b12 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1 @@ -1,19 +1,19 @@ # Copyright (c) Microsoft Corporation. # 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 + It "Get-Acl returns an ACL object" -Pending:(!$IsWindows) { + $ACL = Get-Acl $TESTDRIVE $ACL | Should -BeOfType System.Security.AccessControl.DirectorySecurity } - It "Set-Acl can set the ACL of a directory" -pending { + It "Set-Acl can set the ACL of a directory" -Pending { Setup -d testdir $directory = "$TESTDRIVE/testdir" - $acl = get-acl $directory + $acl = Get-Acl $directory $accessRule = [System.Security.AccessControl.FileSystemAccessRule]::New("Everyone","FullControl","ContainerInherit,ObjectInherit","None","Allow") $acl.AddAccessRule($accessRule) { $acl | Set-Acl $directory } | Should -Not -Throw - $newacl = get-acl $directory + $newacl = Get-Acl $directory $newrule = $newacl.Access | Where-Object { $accessrule.FileSystemRights -eq $_.FileSystemRights -and $accessrule.AccessControlType -eq $_.AccessControlType -and $accessrule.IdentityReference -eq $_.IdentityReference } $newrule | Should -Not -BeNullOrEmpty } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 index 61d30f584a6..9ac4ceb17a5 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 @@ -44,7 +44,7 @@ Describe "Certificate Provider tests" -Tags "CI" { } Context "Get-Item tests" { - it "Should be able to get a certificate store, path: " -TestCases $testLocations { + It "Should be able to get a certificate store, path: " -TestCases $testLocations { param([string] $path) $expectedResolvedPath = Resolve-Path -LiteralPath $path $result = Get-Item -LiteralPath $path @@ -55,24 +55,24 @@ Describe "Certificate Provider tests" -Tags "CI" { $resolvedPath.ProviderPath.TrimStart('\') | Should -Be $expectedResolvedPath.ProviderPath.TrimStart('\') } } - it "Should return two items at the root of the provider" { + It "Should return two items at the root of the provider" { (Get-Item -Path cert:\*).Count | Should -Be 2 } - it "Should be able to get multiple items explictly" { - (get-item cert:\LocalMachine , cert:\CurrentUser).Count | Should -Be 2 + It "Should be able to get multiple items explictly" { + (Get-Item cert:\LocalMachine , cert:\CurrentUser).Count | Should -Be 2 } - it "Should return PathNotFound when getting a non-existant certificate store" { + It "Should return PathNotFound when getting a non-existant certificate store" { {Get-Item cert:\IDONTEXIST -ErrorAction Stop} | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand" } - it "Should return PathNotFound when getting a non-existant certificate" { + It "Should return PathNotFound when getting a non-existant certificate" { {Get-Item cert:\currentuser\my\IDONTEXIST -ErrorAction Stop} | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand" } } Context "Get-ChildItem tests"{ - it "should be able to get a container using a wildcard" { + It "should be able to get a container using a wildcard" { (Get-ChildItem Cert:\CurrentUser\M?).PSPath | Should -Be 'Microsoft.PowerShell.Security\Certificate::CurrentUser\My' } - it "Should return two items at the root of the provider" { + It "Should return two items at the root of the provider" { (Get-ChildItem -Path cert:\).Count | Should -Be 2 } } @@ -106,49 +106,49 @@ Describe "Certificate Provider tests" -Tags "Feature" { } Context "Get-Item tests" { - it "Should be able to get certifate by path: " -TestCases $currentUserMyLocations { + It "Should be able to get certifate by path: " -TestCases $currentUserMyLocations { param([string] $path) $expectedThumbprint = (Get-GoodCertificateObject).Thumbprint $leafPath = Join-Path -Path $path -ChildPath $expectedThumbprint - $cert = (Get-item -LiteralPath $leafPath) + $cert = (Get-Item -LiteralPath $leafPath) $cert | Should -Not -Be null $cert.Thumbprint | Should -Be $expectedThumbprint } - it "Should be able to get DnsNameList of certifate by path: " -TestCases $currentUserMyLocations { + It "Should be able to get DnsNameList of certifate by path: " -TestCases $currentUserMyLocations { param([string] $path) $expectedThumbprint = (Get-GoodCertificateObject).Thumbprint $expectedName = (Get-GoodCertificateObject).DnsNameList[0].Unicode $expectedEncodedName = (Get-GoodCertificateObject).DnsNameList[0].Punycode $leafPath = Join-Path -Path $path -ChildPath $expectedThumbprint - $cert = (Get-item -LiteralPath $leafPath) + $cert = (Get-Item -LiteralPath $leafPath) $cert | Should -Not -Be null $cert.DnsNameList | Should -Not -Be null $cert.DnsNameList.Count | Should -Be 1 $cert.DnsNameList[0].Unicode | Should -Be $expectedName $cert.DnsNameList[0].Punycode | Should -Be $expectedEncodedName } - it "Should be able to get DNSNameList of certifate by path: " -TestCases $currentUserMyLocations { + It "Should be able to get DNSNameList of certifate by path: " -TestCases $currentUserMyLocations { param([string] $path) $expectedThumbprint = (Get-GoodCertificateObject).Thumbprint $expectedOid = (Get-GoodCertificateObject).EnhancedKeyUsageList[0].ObjectId $leafPath = Join-Path -Path $path -ChildPath $expectedThumbprint - $cert = (Get-item -LiteralPath $leafPath) + $cert = (Get-Item -LiteralPath $leafPath) $cert | Should -Not -Be null $cert.EnhancedKeyUsageList | Should -Not -Be null $cert.EnhancedKeyUsageList.Count | Should -Be 1 $cert.EnhancedKeyUsageList[0].ObjectId.Length | Should -Not -Be 0 $cert.EnhancedKeyUsageList[0].ObjectId | Should -Be $expectedOid } - it "Should filter to codesign certificates" { - $allCerts = get-item cert:\CurrentUser\My\* - $codeSignCerts = get-item cert:\CurrentUser\My\* -CodeSigningCert + It "Should filter to codesign certificates" { + $allCerts = Get-Item cert:\CurrentUser\My\* + $codeSignCerts = Get-Item cert:\CurrentUser\My\* -CodeSigningCert $codeSignCerts | Should -Not -Be null $allCerts | Should -Not -Be null $nonCodeSignCertCount = $allCerts.Count - $codeSignCerts.Count $nonCodeSignCertCount | Should -Not -Be 0 } - it "Should be able to exclude by thumbprint" { - $allCerts = get-item cert:\CurrentUser\My\* + It "Should be able to exclude by thumbprint" { + $allCerts = Get-Item cert:\CurrentUser\My\* $testThumbprint = (Get-GoodCertificateObject).Thumbprint $allCertsExceptOne = (Get-Item "cert:\currentuser\my\*" -Exclude $testThumbprint) $allCerts | Should -Not -Be null @@ -158,9 +158,9 @@ Describe "Certificate Provider tests" -Tags "Feature" { } } Context "Get-ChildItem tests"{ - it "Should filter to codesign certificates" { - $allCerts = get-ChildItem cert:\CurrentUser\My - $codeSignCerts = get-ChildItem cert:\CurrentUser\My -CodeSigningCert + It "Should filter to codesign certificates" { + $allCerts = Get-ChildItem cert:\CurrentUser\My + $codeSignCerts = Get-ChildItem cert:\CurrentUser\My -CodeSigningCert $codeSignCerts | Should -Not -Be null $allCerts | Should -Not -Be null $nonCodeSignCertCount = $allCerts.Count - $codeSignCerts.Count diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 index 821ed628ec9..c75ff57035f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CmsMessage2.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. using namespace System.Security.Cryptography.X509Certificates diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 index f30ef57ce5e..5a73055d41a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/ExecutionPolicy.Tests.ps1 @@ -56,7 +56,7 @@ try { # Skip the test if Storage module is not available, return a pseudo result # ExecutionPolicy only works on windows - It "Test for Get-Help Get-Disk" -skip:(!(Test-Path (Join-Path -Path $PSHOME -ChildPath Modules\Storage\Storage.psd1)) -or $ShouldSkipTest) { + It "Test for Get-Help Get-Disk" -Skip:(!(Test-Path (Join-Path -Path $PSHOME -ChildPath Modules\Storage\Storage.psd1)) -or $ShouldSkipTest) { try { @@ -458,7 +458,7 @@ try { } } - set-content $filePath -Value $content + Set-Content $filePath -Value $content ## Valida File types and their corresponding int values are : ## @@ -476,7 +476,7 @@ try { [ZoneTransfer] ZoneId=$FileType "@ - Add-Content -Path $filePath -Value $alternateStreamContent -stream Zone.Identifier + Add-Content -Path $filePath -Value $alternateStreamContent -Stream Zone.Identifier } } @@ -1111,7 +1111,7 @@ ZoneId=$FileType BeforeAll { if ($IsNotSkipped) { - $originalPolicies = Get-ExecutionPolicy -list + $originalPolicies = Get-ExecutionPolicy -List } } @@ -1145,7 +1145,7 @@ ZoneId=$FileType BeforeAll { if ($IsNotSkipped) { - $originalPolicies = Get-ExecutionPolicy -list + $originalPolicies = Get-ExecutionPolicy -List } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 index 96672d72a55..2a99c225d22 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/FileCatalog.Tests.ps1 @@ -232,7 +232,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $catalogPath = "$env:TEMP\UserConfigProv\catalog.cat" try { - copy-item "$testDataPath\UserConfigProv" $env:temp -Recurse -ErrorAction SilentlyContinue + Copy-Item "$testDataPath\UserConfigProv" $env:temp -Recurse -ErrorAction SilentlyContinue Push-Location "$env:TEMP\UserConfigProv" # When -Path is not specified, it should use current directory $null = New-FileCatalog -CatalogFilePath $catalogPath -CatalogVersion 1.0 @@ -316,9 +316,9 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileAddedtoFolderBeforeValidation.cat" $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 2.0 - $null = copy-item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue + $null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue $null = New-Item $env:temp\UserConfigProv\DSCResources\NewFile.txt -ItemType File - Add-Content $env:temp\UserConfigProv\DSCResources\NewFile.txt -Value "More Data" -force + Add-Content $env:temp\UserConfigProv\DSCResources\NewFile.txt -Value "More Data" -Force $result = Test-FileCatalog -Path $env:temp\UserConfigProv -CatalogFilePath $script:catalogPath -Detailed $result.Status | Should -Be "ValidationFailed" @@ -336,8 +336,8 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $script:catalogPath = "$env:TEMP\TestCatalogWhenNewFileDeletedFromFolderBeforeValidation.cat" $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 - $null = copy-item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue - del $env:temp\UserConfigProv\DSCResources\UserConfigProviderModVersion1\UserConfigProviderModVersion1.psm1 -force -ErrorAction SilentlyContinue + $null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue + del $env:temp\UserConfigProv\DSCResources\UserConfigProviderModVersion1\UserConfigProviderModVersion1.psm1 -Force -ErrorAction SilentlyContinue $result = Test-FileCatalog -Path $env:temp\UserConfigProv -CatalogFilePath $script:catalogPath -Detailed $result.Status | Should -Be "ValidationFailed" @@ -355,7 +355,7 @@ Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" { $script:catalogPath = "$env:TEMP\TestCatalogWhenFileContentModifiedBeforeValidation.cat" $null = New-FileCatalog -Path $testDataPath\UserConfigProv\ -CatalogFilePath $script:catalogPath -CatalogVersion 1.0 - $null = copy-item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue + $null = Copy-Item $testDataPath\UserConfigProv $env:temp -Recurse -ErrorAction SilentlyContinue Add-Content $env:temp\UserConfigProv\DSCResources\UserConfigProviderModVersion1\UserConfigProviderModVersion1.psm1 -Value "More Data" -Force $result = Test-FileCatalog -Path $env:temp\UserConfigProv -CatalogFilePath $script:catalogPath -Detailed diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 index 2af8021d922..cb9d0ee70ed 100755 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/GetCredential.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Get-Credential Test" -tag "CI" { +Describe "Get-Credential Test" -Tag "CI" { BeforeAll { $th = New-TestHost $th.UI.StringForSecureString = "This is a test" @@ -75,7 +75,7 @@ Describe "Get-Credential Test" -tag "CI" { $netcred.Password | Should -Be "This is a test" $th.ui.Streams.Prompt[-1] | Should -Match "Credential:[^:]+:[^:]+" } - it "Get-Credential Joe" { + It "Get-Credential Joe" { $cred = $ps.AddScript("Get-Credential Joe").Invoke() | Select-Object -First 1 $cred | Should -BeOfType System.Management.Automation.PSCredential $netcred = $cred.GetNetworkCredential() @@ -83,7 +83,7 @@ Describe "Get-Credential Test" -tag "CI" { $netcred.Password | Should -Be "This is a test" $th.ui.Streams.Prompt[-1] | Should -Match "Credential:[^:]+:[^:]+" } - it "Get-Credential -Credential Joe" { + It "Get-Credential -Credential Joe" { $cred = $ps.AddScript("Get-Credential Joe").Invoke() | Select-Object -First 1 $cred | Should -BeOfType System.Management.Automation.PSCredential $netcred = $cred.GetNetworkCredential() @@ -91,7 +91,7 @@ Describe "Get-Credential Test" -tag "CI" { $netcred.Password | Should -Be "This is a test" $th.ui.Streams.Prompt[-1] | Should -Match "Credential:[^:]+:[^:]+" } - it "Get-Credential `$credential" { + It "Get-Credential `$credential" { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] $password = ConvertTo-SecureString -String "CredTest" -AsPlainText -Force $credential = [pscredential]::new("John", $password) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 index 92041033a8b..1a0f7e00954 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/SecureString.Tests.ps1 @@ -4,17 +4,17 @@ Describe "SecureString conversion tests" -Tags "CI" { BeforeAll { $string = "ABCD" $secureString = [System.Security.SecureString]::New() - $string.ToCharArray() | foreach-object { $securestring.AppendChar($_) } + $string.ToCharArray() | ForEach-Object { $securestring.AppendChar($_) } } It "using null arguments to ConvertFrom-SecureString produces an exception" { - { ConvertFrom-SecureString -secureString $null -key $null } | + { ConvertFrom-SecureString -SecureString $null -Key $null } | Should -Throw -ErrorId "ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromSecureStringCommand" } It "using a bad key produces an exception" { $badkey = [byte[]]@(1,2) - { ConvertFrom-SecureString -securestring $secureString -key $badkey } | + { ConvertFrom-SecureString -SecureString $secureString -Key $badkey } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ConvertFromSecureStringCommand" } 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 7ef77dafe46..fd85fef1552 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 @@ -37,7 +37,7 @@ function Set-TargetResource $text ) $path = "$env:SystemDrive\dscTestPath\hello1.txt" - New-Item -Path $path -Type File -force + New-Item -Path $path -Type File -Force Add-Content -Path $path -Value $text } 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 e4a5654204f..d2f6a9ac719 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 @@ -38,7 +38,7 @@ function Set-TargetResource ) $path = "$env:SystemDrive\dscTestPath\hello2.txt" - New-Item -Path $path -Type File -force + New-Item -Path $path -Type File -Force Add-Content -Path $path -Value $text } 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 74b7509d905..45987a71f76 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 @@ -38,7 +38,7 @@ function Set-TargetResource ) $path = "$env:SystemDrive\dscTestPath\hello3.txt" - New-Item -Path $path -Type File -force + New-Item -Path $path -Type File -Force Add-Content -Path $path -Value $text } 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 67c7b55327d..44a628ce5bb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Add-Member.Tests.ps1 @@ -24,7 +24,7 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { $memberTypesWhereV1CannotBeNull = "CodeMethod", "MemberSet", "PropertySet", "ScriptMethod", "NoteProperty" foreach ($memberType in $memberTypesWhereV1CannotBeNull) { - { Add-Member -InputObject a -memberType $memberType -Name Name -Value something -SecondValue somethingElse } | + { Add-Member -InputObject a -MemberType $memberType -Name Name -Value something -SecondValue somethingElse } | Should -Throw -ErrorId "Value2ShouldNotBeSpecified,Microsoft.PowerShell.Commands.AddMemberCommand" } } @@ -33,10 +33,10 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { $membersYouCannotAdd = "Method", "Property", "ParameterizedProperty" foreach ($member in $membersYouCannotAdd) { - { Add-Member -InputObject a -memberType $member -Name Name } | Should -Throw -ErrorId "CannotAddMemberType,Microsoft.PowerShell.Commands.AddMemberCommand" + { Add-Member -InputObject a -MemberType $member -Name Name } | Should -Throw -ErrorId "CannotAddMemberType,Microsoft.PowerShell.Commands.AddMemberCommand" } - { Add-Member -InputObject a -memberType AnythingElse -Name Name } | Should -Throw -ErrorId "CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.AddMemberCommand" + { Add-Member -InputObject a -MemberType AnythingElse -Name Name } | Should -Throw -ErrorId "CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.AddMemberCommand" } @@ -44,7 +44,7 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { $memberTypes = "CodeProperty", "ScriptProperty" foreach ($memberType in $memberTypes) { - { Add-Member -memberType $memberType -Name PropertyName -Value $null -SecondValue $null -InputObject a } | + { Add-Member -MemberType $memberType -Name PropertyName -Value $null -SecondValue $null -InputObject a } | Should -Throw -ErrorId "Value1AndValue2AreNotBothNull,Microsoft.PowerShell.Commands.AddMemberCommand" } @@ -56,13 +56,13 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { } It "Successful alias, no type" { - $results = Add-Member -InputObject a -MemberType AliasProperty -Name Cnt -Value Length -passthru + $results = Add-Member -InputObject a -MemberType AliasProperty -Name Cnt -Value Length -PassThru $results.Cnt | Should -BeOfType Int32 $results.Cnt | Should -Be 1 } It "Successful alias, with type" { - $results = add-member -InputObject a -MemberType AliasProperty -Name Cnt -Value Length -SecondValue String -passthru + $results = Add-Member -InputObject a -MemberType AliasProperty -Name Cnt -Value Length -SecondValue String -PassThru $results.Cnt | Should -BeOfType String $results.Cnt | Should -Be '1' } @@ -73,16 +73,16 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { } It "Empty Member Set Null Value1" { - $results = add-member -InputObject a -MemberType MemberSet -Name Name -Value $null -passthru + $results = Add-Member -InputObject a -MemberType MemberSet -Name Name -Value $null -PassThru $results.Length | Should -Be 1 $results.Name.a | Should -BeNullOrEmpty } It "Member Set With 1 Member" { - $members = new-object System.Collections.ObjectModel.Collection[System.Management.Automation.PSMemberInfo] - $n=new-object Management.Automation.PSNoteProperty a,1 + $members = New-Object System.Collections.ObjectModel.Collection[System.Management.Automation.PSMemberInfo] + $n=New-Object Management.Automation.PSNoteProperty a,1 $members.Add($n) - $r=Add-Member -InputObject a -MemberType MemberSet -Name Name -Value $members -passthru + $r=Add-Member -InputObject a -MemberType MemberSet -Name Name -Value $members -PassThru $r.Name.a | Should -Be '1' } @@ -108,8 +108,8 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { } It "Add ScriptProperty Success" { - set-alias ScriptPropertyTestAlias dir - $al=(get-alias ScriptPropertyTestAlias) + Set-Alias ScriptPropertyTestAlias dir + $al=(Get-Alias ScriptPropertyTestAlias) $al.Description="MyDescription" $al | Add-Member -MemberType ScriptProperty -Name NewDescription -Value {$this.Description} -SecondValue {$this.Description=$args[0]} $al.NewDescription | Should -BeExactly 'MyDescription' @@ -118,12 +118,12 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { } It "Add TypeName MemberSet Success" { - $a = 'string' | add-member -MemberType NoteProperty -Name TestNote -Value Any -TypeName MyType -passthru + $a = 'string' | Add-Member -MemberType NoteProperty -Name TestNote -Value Any -TypeName MyType -PassThru $a.PSTypeNames[0] | Should -Be MyType } It "Add TypeName Existing Name Success" { - $a = 'string' | add-member -TypeName System.Object -passthru + $a = 'string' | Add-Member -TypeName System.Object -PassThru $a.PSTypeNames[0] | Should -Be System.Object } @@ -134,43 +134,43 @@ Describe "Add-Member DRT Unit Tests" -Tags "CI" { } It "Add Multiple Note Members" { - $obj=new-object psobject + $obj=New-Object psobject $hash=@{Name='Name';TestInt=1;TestNull=$null} - add-member -InputObject $obj $hash + Add-Member -InputObject $obj $hash $obj.Name | Should -Be 'Name' $obj.TestInt | Should -Be 1 $obj.TestNull | Should -BeNullOrEmpty } It "Add Multiple Note With TypeName" { - $obj=new-object psobject + $obj=New-Object psobject $hash=@{Name='Name';TestInt=1;TestNull=$null} - $obj = add-member -InputObject $obj $hash -TypeName MyType -Passthru + $obj = Add-Member -InputObject $obj $hash -TypeName MyType -PassThru $obj.PSTypeNames[0] | Should -Be MyType } It "Add Multiple Members With Force" { - $obj=new-object psobject + $obj=New-Object psobject $hash=@{TestNote='hello'} $obj | Add-Member -MemberType NoteProperty -Name TestNote -Value 1 - $obj | add-member $hash -force + $obj | Add-Member $hash -Force $obj.TestNote | Should -Be 'hello' } It "Simplified Add-Member should support using 'Property' as the NoteProperty member name" { - $results = add-member -InputObject a property Any -passthru + $results = Add-Member -InputObject a property Any -PassThru $results.property | Should -BeExactly 'Any' - $results = add-member -InputObject a Method Any -passthru + $results = Add-Member -InputObject a Method Any -PassThru $results.Method | Should -BeExactly 'Any' - $results = add-member -InputObject a 23 Any -passthru + $results = Add-Member -InputObject a 23 Any -PassThru $results.23 | Should -BeExactly 'Any' - $results = add-member -InputObject a 8 np Any -passthru + $results = Add-Member -InputObject a 8 np Any -PassThru $results.np | Should -BeExactly 'Any' - $results = add-member -InputObject a 16 sp {1+1} -passthru + $results = Add-Member -InputObject a 16 sp {1+1} -PassThru $results.sp | Should -Be 2 } 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 3f8a521cb15..20f3b3f470e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Compare-Object.Tests.ps1 @@ -95,7 +95,7 @@ Describe "Compare-Object" -Tags "CI" { } It "Should be able to pass objects to pipeline using the passthru switch" { - { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -Passthru | Format-Wide } | Should -Not -Throw + { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -PassThru | Format-Wide } | Should -Not -Throw } It "Should be able to specify the property of two objects to compare" { @@ -106,15 +106,15 @@ Describe "Compare-Object" -Tags "CI" { } It "Should be able to specify the syncwindow without error" { - { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -syncWindow 5 } | Should -Not -Throw - { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -syncWindow 8 } | Should -Not -Throw + { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -SyncWindow 5 } | Should -Not -Throw + { Compare-Object -ReferenceObject $(Get-Content $file3) -DifferenceObject $(Get-Content $file4) -SyncWindow 8 } | Should -Not -Throw } It "Should have the expected output when changing the syncwindow" { $var1 = 1..15 $var2 = 15..1 - $actualOutput = Compare-Object -ReferenceObject $var1 -DifferenceObject $var2 -syncWindow 6 + $actualOutput = Compare-Object -ReferenceObject $var1 -DifferenceObject $var2 -SyncWindow 6 $actualOutput[0].InputObject | Should -Be 15 $actualOutput[1].InputObject | Should -Be 1 @@ -232,7 +232,7 @@ Describe "Compare-Object DRT basic functionality" -Tags "CI" { { foreach($passthru in $boolvalues) { - $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -Passthru:$passthru -DifferenceObject $empsDifference + $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -PassThru:$passthru -DifferenceObject $empsDifference if(!$excludeDifferent) { @@ -269,7 +269,7 @@ Describe "Compare-Object DRT basic functionality" -Tags "CI" { { foreach($passthru in $boolvalues) { - $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -Passthru:$passthru -DifferenceObject $empsDifference + $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -PassThru:$passthru -DifferenceObject $empsDifference if($recordEqual) { if(!$excludeDifferent) @@ -335,7 +335,7 @@ Describe "Compare-Object DRT basic functionality" -Tags "CI" { { foreach($passthru in $boolvalues) { - $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -Passthru:$passthru -DifferenceObject $empsDifference -SyncWindow:0 + $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -PassThru:$passthru -DifferenceObject $empsDifference -SyncWindow:0 if($recordEqual) { if(!$excludeDifferent) @@ -401,7 +401,7 @@ Describe "Compare-Object DRT basic functionality" -Tags "CI" { { foreach($passthru in $boolvalues) { - $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -Passthru:$passthru -DifferenceObject $empsDifference -SyncWindow:2 + $result = Compare-Object -ReferenceObject $empsReference -IncludeEqual:$recordEqual -ExcludeDifferent:$excludeDifferent -PassThru:$passthru -DifferenceObject $empsDifference -SyncWindow:2 if($recordEqual) { 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 5eea8505295..9e6c5d39420 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Html.Tests.ps1 @@ -120,7 +120,7 @@ After the object } It "Test ConvertTo-HTML meta"{ - $returnString = ($customObject | ConvertTo-HTML -Meta @{"author"="John Doe"}) -join $newLine + $returnString = ($customObject | ConvertTo-Html -Meta @{"author"="John Doe"}) -join $newLine $expectedValue = normalizeLineEnds @" @@ -141,12 +141,12 @@ After the object It "Test ConvertTo-HTML meta with invalid properties should throw warning" { $parms = @{"authors"="John Doe";"keywords"="PowerShell,PSv6"} # make this a string, rather than an array of string so match will behave - [string]$observedProperties = $customObject | ConvertTo-HTML -Meta $parms 3>&1 + [string]$observedProperties = $customObject | ConvertTo-Html -Meta $parms 3>&1 $observedProperties | Should -Match $parms["authors"] } It "Test ConvertTo-HTML charset"{ - $returnString = ($customObject | ConvertTo-HTML -Charset "utf-8") -join $newLine + $returnString = ($customObject | ConvertTo-Html -Charset "utf-8") -join $newLine $expectedValue = normalizeLineEnds @" @@ -165,17 +165,17 @@ After the object } It "Test ConvertTo-HTML transitional"{ - $returnString = $customObject | ConvertTo-HTML -Transitional | Select-Object -First 1 + $returnString = $customObject | ConvertTo-Html -Transitional | Select-Object -First 1 $returnString | Should -Be '' } It "Test ConvertTo-HTML supports scriptblock-based calculated properties: by hashtable" { - $returnString = ($customObject | ConvertTo-HTML @{ l = 'NewAge'; e = { $_.Age + 1 } }) -join $newLine + $returnString = ($customObject | ConvertTo-Html @{ l = 'NewAge'; e = { $_.Age + 1 } }) -join $newLine $returnString | Should -Match '\b43\b' } It "Test ConvertTo-HTML supports scriptblock-based calculated properties: directly" { - $returnString = ($customObject | ConvertTo-HTML { $_.Age + 1 }) -join $newLine + $returnString = ($customObject | ConvertTo-Html { $_.Age + 1 }) -join $newLine $returnString | Should -Match '\b43\b' } 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 b2c55aceeca..7f44a854438 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-Json.Tests.ps1 @@ -26,7 +26,7 @@ Describe 'ConvertTo-Json' -tags "CI" { $null = $ps.AddScript({ $obj = [PSCustomObject]@{P1 = ''; P2 = ''; P3 = ''; P4 = ''; P5 = ''; P6 = ''} $obj.P1 = $obj.P2 = $obj.P3 = $obj.P4 = $obj.P5 = $obj.P6 = $obj - 1..100 | Foreach-Object { $obj } | ConvertTo-Json -Depth 10 -Verbose + 1..100 | ForEach-Object { $obj } | ConvertTo-Json -Depth 10 -Verbose # the conversion is expected to take some time, this throw is in case it doesn't throw "Should not have thrown exception" }) 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 e37c5c2ab31..e58a227fbcf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertTo-SecureString.Tests.ps1 @@ -6,7 +6,7 @@ It "Should return System.Security.SecureString after converting plaintext variable"{ #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - $PesterTestConvert = (ConvertTo-SecureString "plaintextpester" -AsPlainText -force) + $PesterTestConvert = (ConvertTo-SecureString "plaintextpester" -AsPlainText -Force) $PesterTestConvert | Should -BeOfType securestring } 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 e75b09747a1..8aa28b00aef 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Debug-Runspace.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Debug-Runspace" -tag "CI" { +Describe "Debug-Runspace" -Tag "CI" { BeforeAll { $rs1 = [runspacefactory]::CreateRunspace() $rs1.Open() @@ -24,12 +24,12 @@ Describe "Debug-Runspace" -tag "CI" { It "Debugging a runspace should fail if the runspace is not open" { $rs2.Close() - { Debug-Runspace -runspace $rs2 -ErrorAction stop } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.DebugRunspaceCommand" + { Debug-Runspace -Runspace $rs2 -ErrorAction stop } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.DebugRunspaceCommand" } It "Debugging a runspace should fail if the runspace has no debugger" { $rs1.Debugger.SetDebugMode("None") - { Debug-Runspace -runspace $rs1 -ErrorAction stop } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.DebugRunspaceCommand" + { Debug-Runspace -Runspace $rs1 -ErrorAction stop } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.DebugRunspaceCommand" } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 index 18e84f096e2..93dea80837d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Eventing.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Event Subscriber Tests" -Tags "Feature" { # can't let this case to work It "Register an event with no action, trigger it and wait for it to be raised." -Pending:$true{ Get-EventSubscriber | Should -BeNullOrEmpty - $messageData = new-object psobject + $messageData = New-Object psobject $job = Start-Job { Start-Sleep -Seconds 5; 1..5 } $null = Register-ObjectEvent $job -EventName StateChanged -SourceIdentifier EventSIDTest -Action {} -MessageData $messageData - new-event EventSIDTest + New-Event EventSIDTest - wait-event EventSIDTest - $eventdata = get-event EventSIDTest + Wait-Event EventSIDTest + $eventdata = Get-Event EventSIDTest $eventdata.MessageData | Should -Be $messageData - remove-event EventSIDTest + Remove-Event EventSIDTest Unregister-Event EventSIDTest Get-EventSubscriber | Should -BeNullOrEmpty } It "Access a global variable from an event action." { Get-EventSubscriber | Should -BeNullOrEmpty - set-variable incomingGlobal -scope global -value globVarValue - $null = register-engineevent -SourceIdentifier foo -Action {set-variable -scope global -name aglobalvariable -value $incomingGlobal} - new-event foo - $getvar = get-variable aglobalvariable -scope global + Set-Variable incomingGlobal -Scope global -Value globVarValue + $null = Register-EngineEvent -SourceIdentifier foo -Action {Set-Variable -Scope global -Name aglobalvariable -Value $incomingGlobal} + New-Event foo + $getvar = Get-Variable aglobalvariable -Scope global $getvar.Name | Should -Be aglobalvariable $getvar.Value | Should -Be globVarValue Unregister-Event foo @@ -44,7 +44,7 @@ Describe "Event Subscriber Tests" -Tags "Feature" { try{ try{} finally{} } - catch{ Write-Host "Exception" -Nonewline } + catch{ Write-Host "Exception" -NoNewline } } } | Out-String 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 d28be6a3377..e242ee77492 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Alias.Tests.ps1 @@ -10,21 +10,21 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { $testAliases = "TestAliases" $fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases - remove-item alias:abcd* -force -ErrorAction SilentlyContinue - remove-item alias:ijkl* -force -ErrorAction SilentlyContinue - set-alias abcd01 efgh01 - set-alias abcd02 efgh02 - set-alias abcd03 efgh03 - set-alias abcd04 efgh04 - set-alias ijkl01 mnop01 - set-alias ijkl02 mnop02 - set-alias ijkl03 mnop03 - set-alias ijkl04 mnop04 + Remove-Item alias:abcd* -Force -ErrorAction SilentlyContinue + Remove-Item alias:ijkl* -Force -ErrorAction SilentlyContinue + Set-Alias abcd01 efgh01 + Set-Alias abcd02 efgh02 + Set-Alias abcd03 efgh03 + Set-Alias abcd04 efgh04 + Set-Alias ijkl01 mnop01 + Set-Alias ijkl02 mnop02 + Set-Alias ijkl03 mnop03 + Set-Alias ijkl04 mnop04 } AfterAll { - remove-item alias:abcd* -force -ErrorAction SilentlyContinue - remove-item alias:ijkl* -force -ErrorAction SilentlyContinue + Remove-Item alias:abcd* -Force -ErrorAction SilentlyContinue + Remove-Item alias:ijkl* -Force -ErrorAction SilentlyContinue } BeforeEach { @@ -50,27 +50,27 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { } It "Export-Alias with Invalid Scope will throw PSArgumentException" { - { Export-Alias $fulltestpath -scope foodbar } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ExportAliasCommand" + { Export-Alias $fulltestpath -Scope foodbar } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ExportAliasCommand" } It "Export-Alias for Default"{ - Export-Alias $fulltestpath abcd01 -passthru + Export-Alias $fulltestpath abcd01 -PassThru $fulltestpath | Should -FileContentMatchExactly '"abcd01","efgh01","","None"' } It "Export-Alias As CSV"{ - Export-Alias $fulltestpath abcd01 -As CSV -passthru + Export-Alias $fulltestpath abcd01 -As CSV -PassThru $fulltestpath | Should -FileContentMatchExactly '"abcd01","efgh01","","None"' } It "Export-Alias As CSV With Description"{ - Export-Alias $fulltestpath abcd01 -As CSV -description "My Aliases" -passthru + Export-Alias $fulltestpath abcd01 -As CSV -Description "My Aliases" -PassThru $fulltestpath | Should -FileContentMatchExactly '"abcd01","efgh01","","None"' $fulltestpath | Should -FileContentMatchExactly "My Aliases" } It "Export-Alias As CSV With Multiline Description"{ - Export-Alias $fulltestpath abcd01 -As CSV -description "My Aliases\nYour Aliases\nEveryones Aliases" -passthru + Export-Alias $fulltestpath abcd01 -As CSV -Description "My Aliases\nYour Aliases\nEveryones Aliases" -PassThru $fulltestpath | Should -FileContentMatchExactly '"abcd01","efgh01","","None"' $fulltestpath | Should -FileContentMatchExactly "My Aliases" $fulltestpath | Should -FileContentMatchExactly "Your Aliases" @@ -78,12 +78,12 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { } It "Export-Alias As Script"{ - Export-Alias $fulltestpath abcd01 -As Script -passthru + Export-Alias $fulltestpath abcd01 -As Script -PassThru $fulltestpath | Should -FileContentMatchExactly 'set-alias -Name:"abcd01" -Value:"efgh01" -Description:"" -Option:"None"' } It "Export-Alias As Script With Multiline Description"{ - Export-Alias $fulltestpath abcd01 -As Script -description "My Aliases\nYour Aliases\nEveryones Aliases" -passthru + Export-Alias $fulltestpath abcd01 -As Script -Description "My Aliases\nYour Aliases\nEveryones Aliases" -PassThru $fulltestpath | Should -FileContentMatchExactly 'set-alias -Name:"abcd01" -Value:"efgh01" -Description:"" -Option:"None"' $fulltestpath | Should -FileContentMatchExactly "My Aliases" $fulltestpath | Should -FileContentMatchExactly "Your Aliases" @@ -92,7 +92,7 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { It "Export-Alias for Force Test"{ Export-Alias $fulltestpath abcd01 - Export-Alias $fulltestpath abcd02 -force + Export-Alias $fulltestpath abcd02 -Force $fulltestpath | Should -Not -FileContentMatchExactly '"abcd01","efgh01","","None"' $fulltestpath | Should -FileContentMatchExactly '"abcd02","efgh02","","None"' } @@ -109,7 +109,7 @@ Describe "Export-Alias DRT Unit Tests" -Tags "CI" { } { Export-Alias $fulltestpath abcd02 } | Should -Throw -ErrorId "FileOpenFailure,Microsoft.PowerShell.Commands.ExportAliasCommand" - Export-Alias $fulltestpath abcd03 -force + Export-Alias $fulltestpath abcd03 -Force $fulltestpath | Should -Not -FileContentMatchExactly '"abcd01","efgh01","","None"' $fulltestpath | Should -Not -FileContentMatchExactly '"abcd02","efgh02","","None"' $fulltestpath | Should -FileContentMatchExactly '"abcd03","efgh03","","None"' 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 42b69c6fa14..c024f364c68 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Export-FormatData.Tests.ps1 @@ -14,7 +14,7 @@ Describe "Export-FormatData" -Tags "CI" { It "Can export all types" { try { - $fd | Export-FormatData -path $TESTDRIVE\allformat.ps1xml -IncludeScriptBlock + $fd | Export-FormatData -Path $TESTDRIVE\allformat.ps1xml -IncludeScriptBlock $sessionState = [System.Management.Automation.Runspaces.InitialSessionState]::CreateDefault() $sessionState.Formats.Clear() diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 index 83293e15e17..eadf67ae4c8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 @@ -223,7 +223,7 @@ Describe 'ForEach-Object -Parallel -AsJob Basic Tests' -Tags 'CI' { $Var2 = "Goodbye" $Var3 = 105 $Var4 = "One","Two","Three" - $job = 1..1 | Foreach-Object -AsJob -Parallel { + $job = 1..1 | ForEach-Object -AsJob -Parallel { Write-Output $using:Var1 Write-Output $using:Var2 Write-Output $using:Var3 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 75aece4546c..08a17f6356a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 @@ -14,7 +14,7 @@ Describe "Format-Custom" -Tags "CI" { Context "Check specific flags on Format-Custom" { It "Should be able to specify the depth in output" { - $getprocesspester = Get-FormatData | Format-Custom -depth 1 + $getprocesspester = Get-FormatData | Format-Custom -Depth 1 ($getprocesspester).Count | Should -BeGreaterThan 0 } 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 32a5acbe17a..2887e833314 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Table.Tests.ps1 @@ -20,8 +20,8 @@ Describe "Format-Table" -Tags "CI" { } It "Format-Table with not existing table with force should throw PipelineStoppedException"{ - $obj = New-Object -typename PSObject - $e = { $obj | Format-Table -view bar -force -ErrorAction Stop } | + $obj = New-Object -TypeName PSObject + $e = { $obj | Format-Table -View bar -Force -ErrorAction Stop } | Should -Throw -ErrorId "FormatViewNotFound,Microsoft.PowerShell.Commands.FormatTableCommand" -PassThru $e.CategoryInfo | Should -Match "PipelineStoppedException" } @@ -36,7 +36,7 @@ Describe "Format-Table" -Tags "CI" { It "Format-Table with Negative Count should work" { $FormatEnumerationLimit = -1 - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{1, 2}" } @@ -44,28 +44,28 @@ Describe "Format-Table" -Tags "CI" { # Pending on issue#888 It "Format-Table with Zero Count should work" -Pending { $FormatEnumerationLimit = 0 - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{...}" } It "Format-Table with Less Count should work" { $FormatEnumerationLimit = 1 - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{1...}" } It "Format-Table with More Count should work" { $FormatEnumerationLimit = 10 - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{1, 2}" } It "Format-Table with Equal Count should work" { $FormatEnumerationLimit = 2 - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{1, 2}" } @@ -73,7 +73,7 @@ Describe "Format-Table" -Tags "CI" { # Pending on issue#888 It "Format-Table with Bogus Count should throw Exception" -Pending { $FormatEnumerationLimit = "abc" - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result|Out-String $resultStr | Should -Match "test\s+{1, 2}" } @@ -82,7 +82,7 @@ Describe "Format-Table" -Tags "CI" { It "Format-Table with Var Deleted should throw Exception" -Pending { $FormatEnumerationLimit = 2 Remove-Variable FormatEnumerationLimit - $result = Format-Table -inputobject @{'test'= 1, 2} + $result = Format-Table -InputObject @{'test'= 1, 2} $resultStr = $result | Out-String $resultStr | Should -Match "test\s+{1, 2}" } @@ -112,7 +112,7 @@ Describe "Format-Table" -Tags "CI" { $IPs = New-Object System.Collections.ArrayList $IPs.Add($IP1) $IPs.Add($IP2) - $result = $IPs | Format-Table -Autosize | Out-String + $result = $IPs | Format-Table -AutoSize | Out-String $result | Should -Match "name size booleanValue" $result | Should -Match "---- ---- ------------" $result | Should -Match "Bob\s+1234\s+True" @@ -785,7 +785,7 @@ A Name B # Fill the console window with the string, so that it reaches its max width. # Check if the max width is equal to default value (120), to test test hook set. $testObject = @{ test = '1' * 200} - Format-table -inputobject $testObject | Out-String -Stream | ForEach-Object{$_.length} | Sort-Object -Bottom 1 | Should -Be 120 + Format-Table -InputObject $testObject | Out-String -Stream | ForEach-Object{$_.length} | Sort-Object -Bottom 1 | Should -Be 120 } finally { [system.management.automation.internal.internaltesthooks]::SetTestHook('SetConsoleWidthToZero', $false) 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 f1bf37acc2d..c81db9fa1f9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Wide.Tests.ps1 @@ -12,8 +12,8 @@ Describe "Format-Wide" -Tags "CI" { } It "Should be able to use the autosize switch" { - { $pathList | Format-Wide -Autosize } | Should -Not -Throw - { $pathList | Format-Wide -Autosize | Out-String } | Should -Not -Throw + { $pathList | Format-Wide -AutoSize } | Should -Not -Throw + { $pathList | Format-Wide -AutoSize | Out-String } | Should -Not -Throw } It "Should be able to take inputobject instead of pipe" { 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 e7e62f428b9..edccb912ca7 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Alias.Tests.ps1 @@ -80,17 +80,17 @@ Describe "Get-Alias DRT Unit Tests" -Tags "CI" { $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - Set-Alias -Name ABCD -Value "localfoo" -scope local - $result=Get-Alias -Name ABCD -scope local + Set-Alias -Name ABCD -Value "localfoo" -Scope local + $result=Get-Alias -Name ABCD -Scope local $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "localfoo" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - Set-Alias -Name ABCD -Value "globalfoo" -scope global - Set-Alias -Name ABCD -Value "scriptfoo" -scope "script" - Set-Alias -Name ABCD -Value "foo0" -scope "0" - Set-Alias -Name ABCD -Value "foo1" -scope "1" + Set-Alias -Name ABCD -Value "globalfoo" -Scope global + Set-Alias -Name ABCD -Value "scriptfoo" -Scope "script" + Set-Alias -Name ABCD -Value "foo0" -Scope "0" + Set-Alias -Name ABCD -Value "foo1" -Scope "1" $result=Get-Alias -Name ABCD $result.Name | Should -BeExactly "ABCD" @@ -98,31 +98,31 @@ Describe "Get-Alias DRT Unit Tests" -Tags "CI" { $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope local + $result=Get-Alias -Name ABCD -Scope local $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "foo0" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope global + $result=Get-Alias -Name ABCD -Scope global $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "globalfoo" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope "script" + $result=Get-Alias -Name ABCD -Scope "script" $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "scriptfoo" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope "0" + $result=Get-Alias -Name ABCD -Scope "0" $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "foo0" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope "1" + $result=Get-Alias -Name ABCD -Scope "1" $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "foo1" $result.Description | Should -BeNullOrEmpty @@ -139,7 +139,7 @@ Describe "Get-Alias DRT Unit Tests" -Tags "CI" { $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope "0" + $result=Get-Alias -Name ABCD -Scope "0" $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "foo" $result.Description | Should -BeNullOrEmpty diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 index 2238d83a385..2dbc01c38db 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Command.Tests.ps1 @@ -95,7 +95,7 @@ Describe "Get-Command Feature tests" -Tag Feature { } It "Non-existing cmdlets returns non-terminating error" { - { get-command g-adf -ErrorAction Stop } | Should -Throw -ErrorId "CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand" + { Get-Command g-adf -ErrorAction Stop } | Should -Throw -ErrorId "CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand" } It "No results if wildcard is used" { 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 0cdc794921b..c2f414fe949 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -16,21 +16,21 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } It "using -displayhint produces the correct output" { - $d = Get-date -Date:"Jan 1, 2020" -DisplayHint Date | Out-String + $d = Get-Date -Date:"Jan 1, 2020" -DisplayHint Date | Out-String $d.Trim() | Should -Be "Wednesday, January 1, 2020" } It "using -format produces the correct output" { - Get-date -Date:"Jan 1, 2020" -Format:"MMM-dd-yy" | Should -Be "Jan-01-20" + Get-Date -Date:"Jan 1, 2020" -Format:"MMM-dd-yy" | Should -Be "Jan-01-20" } It "using -AsUTC produces the correct output" { - (Get-date -Date:"2020-01-01T00:00:00").Kind | Should -Be Unspecified - (Get-date -Date:"2020-01-01T00:00:00" -AsUTC).Kind | Should -Be Utc + (Get-Date -Date:"2020-01-01T00:00:00").Kind | Should -Be Unspecified + (Get-Date -Date:"2020-01-01T00:00:00" -AsUTC).Kind | Should -Be Utc } It "using -uformat %s produces the correct output" { - $seconds = Get-date -Date:"Jan 1, 2020Z" -UFormat:"%s" + $seconds = Get-Date -Date:"Jan 1, 2020Z" -UFormat:"%s" $seconds | Should -Be "1577836800" if ($IsLinux) { @@ -44,15 +44,15 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } It "using -uformat 'ymdH' produces the correct output" { - Get-date -Date 0030-01-01T00:00:00 -uformat %y/%m/%d-%H | Should -Be "30/01/01-00" + Get-Date -Date 0030-01-01T00:00:00 -UFormat %y/%m/%d-%H | Should -Be "30/01/01-00" } It "using -uformat 'aAbBcCdDehHIkljmMpr' produces the correct output" { - Get-date -Date 1/1/0030 -uformat "%a%A%b%B%c%C%d%D%e%h%H%I%k%l%j%m%M%p%r" | Should -Be "TueTuesdayJanJanuaryTue 01 Jan 0030 00:00:0000101/01/30 1Jan0012 0120010100AM12:00:00 AM" + Get-Date -Date 1/1/0030 -UFormat "%a%A%b%B%c%C%d%D%e%h%H%I%k%l%j%m%M%p%r" | Should -Be "TueTuesdayJanJanuaryTue 01 Jan 0030 00:00:0000101/01/30 1Jan0012 0120010100AM12:00:00 AM" } It "using -uformat 'sStTuUVwWxXyYZ' produces the correct output" { - Get-date -Date 1/1/0030 -uformat %S%T%u%U%w%W%x%X%y%Y%% | Should -Be "0000:00:00202001/01/3000:00:00300030%" + Get-Date -Date 1/1/0030 -UFormat %S%T%u%U%w%W%x%X%y%Y%% | Should -Be "0000:00:00202001/01/3000:00:00300030%" } # The 'week of year' test cases is from https://en.wikipedia.org/wiki/ISO_week_date @@ -94,7 +94,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { @{date="2031-01-03"; week = "01"} ) { param($date, $week) - Get-date -Date $date -uformat %V | Should -BeExactly $week + Get-Date -Date $date -UFormat %V | Should -BeExactly $week } It "Passing '' to -uformat produces a descriptive error" -TestCases @( @@ -102,14 +102,14 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { @{ name = "empty string"; value = "" } ) { param($value) - { Get-date -Date 1/1/1970 -uformat $value -ErrorAction Stop } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetDateCommand" + { Get-Date -Date 1/1/1970 -UFormat $value -ErrorAction Stop } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.GetDateCommand" } It "Get-date works with pipeline input" { - $x = new-object System.Management.Automation.PSObject - $x | add-member NoteProperty Date ([DateTime]::Now) + $x = New-Object System.Management.Automation.PSObject + $x | Add-Member NoteProperty Date ([DateTime]::Now) $y = @($x,$x) - ($y | Get-date).Length | Should -Be 2 + ($y | Get-Date).Length | Should -Be 2 } It "the LastWriteTime alias works with pipeline input" { @@ -129,8 +129,8 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } - $result1 = get-childitem -path $pathString | get-date - $result2 = get-childitem -path $pathString | get-date + $result1 = Get-ChildItem -Path $pathString | Get-Date + $result2 = Get-ChildItem -Path $pathString | Get-Date $result1.Length | Should -Be 10 $result1.Length -eq $result2.Length | Should -BeTrue @@ -148,19 +148,19 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { Describe "Get-Date" -Tags "CI" { It "-Format FileDate works" { - Get-date -Date 0030-01-01T01:02:03.0004 -Format FileDate | Should -Be "00300101" + Get-Date -Date 0030-01-01T01:02:03.0004 -Format FileDate | Should -Be "00300101" } It "-Format FileDateTime works" { - Get-date -Date 0030-01-01T01:02:03.0004 -Format FileDateTime | Should -Be "00300101T0102030004" + Get-Date -Date 0030-01-01T01:02:03.0004 -Format FileDateTime | Should -Be "00300101T0102030004" } It "-Format FileDateTimeUniversal works" { - Get-date -Date 0030-01-01T01:02:03.0004z -Format FileDateTimeUniversal | Should -Be "00300101T0102030004Z" + Get-Date -Date 0030-01-01T01:02:03.0004z -Format FileDateTimeUniversal | Should -Be "00300101T0102030004Z" } It "-Format FileDateTimeUniversal works" { - Get-date -Date 0030-01-01T01:02:03.0004z -Format FileDateUniversal | Should -Be "00300101Z" + Get-Date -Date 0030-01-01T01:02:03.0004z -Format FileDateUniversal | Should -Be "00300101Z" } It "Should have colons when ToString method is used" { @@ -205,9 +205,9 @@ Describe "Get-Date" -Tags "CI" { Describe "Get-Date -UFormat tests" -Tags "CI" { BeforeAll { - $date1 = Get-date -Date "2030-4-5 1:2:3.09" - $date2 = Get-date -Date "2030-4-15 13:2:3" - $date3 = Get-date -Date "2030-4-15 21:2:3" + $date1 = Get-Date -Date "2030-4-5 1:2:3.09" + $date2 = Get-Date -Date "2030-4-15 13:2:3" + $date3 = Get-Date -Date "2030-4-15 21:2:3" # 5 come from $date1 - 2030-4-5 is Friday - 5th day (the enum starts with 0 - Sunday) $shortDay1 = [System.Globalization.CultureInfo]::CurrentCulture.DateTimeFormat.AbbreviatedDayNames[5] diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 index 00a2744b8c3..88c3d898cf9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Error.Tests.ps1 @@ -38,7 +38,7 @@ Describe 'Get-Error tests' -Tag CI { } try { - get-item (new-guid) -ErrorAction SilentlyContinue + Get-Item (New-Guid) -ErrorAction SilentlyContinue } catch { } 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 f59b33d1db3..f38fb77608d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Event.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Get-Event" -Tags "CI" { BeforeEach { - ( New-Event -SourceIdentifier PesterTestEvent -sender Windows.timer -messagedata "PesterTestMessage" ) + ( New-Event -SourceIdentifier PesterTestEvent -Sender Windows.timer -MessageData "PesterTestMessage" ) } AfterEach { 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 db0a76a85d6..7149b212ee0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 @@ -247,14 +247,14 @@ Describe "Get-Member DRT Unit Tests" -Tags "CI" { Context "Verify Get-Member with other parameters" { It 'works with View Parameter' { - $results = [xml]'some text' | Get-Member -view adapted - $results | Where-Object Name -eq a | Should -Not -BeNullOrEmpty - $results | Where-Object Name -eq CreateElement | Should -Not -BeNullOrEmpty - $results | Where-Object Name -eq CreateNode | Should -Not -BeNullOrEmpty + $results = [xml]'some text' | Get-Member -View adapted + $results | Where-Object Name -EQ a | Should -Not -BeNullOrEmpty + $results | Where-Object Name -EQ CreateElement | Should -Not -BeNullOrEmpty + $results | Where-Object Name -EQ CreateNode | Should -Not -BeNullOrEmpty } It 'Get hidden members' { - $results = 'abc' | Get-Member -force + $results = 'abc' | Get-Member -Force $hiddenMembers = "psbase", "psextended", "psadapted", "pstypenames", "psobject" foreach ($member in $hiddenMembers) { foreach ($result in $results) { @@ -267,7 +267,7 @@ Describe "Get-Member DRT Unit Tests" -Tags "CI" { } It 'Get Set Property Accessors On PsBase' { - $results = ('abc').psbase | Get-Member -force get_* + $results = ('abc').psbase | Get-Member -Force get_* $expectedMembers = "get_Chars", "get_Length" foreach ($member in $expectedMembers) { foreach ($result in $results) { 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 760db706f30..cd9fee41873 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Random.Tests.ps1 @@ -90,8 +90,8 @@ Describe "Get-Random DRT Unit Tests" -Tags "CI" { } It "Tests for setting the seed" { - $result1 = (get-random -SetSeed 123), (get-random) - $result2 = (get-random -SetSeed 123), (get-random) + $result1 = (Get-Random -SetSeed 123), (Get-Random) + $result2 = (Get-Random -SetSeed 123), (Get-Random) $result1 | Should -Be $result2 } } 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 dc240e7b0df..fe801e799d1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Variable.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Get-Variable DRT Unit Tests" -Tags "CI" { It "Get-Variable of existing variable Name with include and bogus exclude should work"{ Set-Variable newVar testing - $var1=get-variable -Name newVar -Include newVar -Exclude bogus + $var1=Get-Variable -Name newVar -Include newVar -Exclude bogus $var1.Name | Should -BeExactly "newVar" $var1.Value | Should -BeExactly "testing" } It "Get-Variable of existing variable Name with Description and Option should work"{ Set-Variable newVar testing -Option ReadOnly -Description "testing description" - $var1=get-variable -Name newVar + $var1=Get-Variable -Name newVar $var1.Name | Should -BeExactly "newVar" $var1.Value | Should -BeExactly "testing" $var1.Options | Should -BeExactly "ReadOnly" @@ -27,7 +27,7 @@ Describe "Get-Variable DRT Unit Tests" -Tags "CI" { Set-Variable abcaVar testing Set-Variable bcdaVar "another test" Set-Variable aVarfoo wow - $var1=get-variable -Name *aVar* -Scope local + $var1=Get-Variable -Name *aVar* -Scope local $var1.Count | Should -Be 3 $var1[0].Name | Should -BeExactly "abcaVar" $var1[0].Value | Should -BeExactly "testing" 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 c45bde77f10..fe221dc2660 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 @@ -7,8 +7,8 @@ Describe "Get-Verb" -Tags "CI" { } It "Should get a specific verb" { - @(Get-Verb -Verb Add).Count | Should -Be 1 - @(Get-Verb -Verb Add -Group Common).Count | Should -Be 1 + @(Get-Verb -verb Add).Count | Should -Be 1 + @(Get-Verb -verb Add -Group Common).Count | Should -Be 1 } It "Should get a specific group" { @@ -16,7 +16,7 @@ Describe "Get-Verb" -Tags "CI" { } It "Should not return duplicate Verbs with Verb paramater" { - $dups = Get-Verb -Verb Add,ad*,a* + $dups = Get-Verb -verb Add,ad*,a* $unique = $dups | Select-Object -Property * -Unique $dups.Count | Should -Be $unique.Count @@ -30,7 +30,7 @@ Describe "Get-Verb" -Tags "CI" { } It "Should filter using the Verb parameter" { - Get-Verb -Verb fakeVerbNeverExists | Should -BeNullOrEmpty + Get-Verb -verb fakeVerbNeverExists | Should -BeNullOrEmpty } It "Should not accept Groups that are not in the validate set" { @@ -59,7 +59,7 @@ Describe "Get-Verb" -Tags "CI" { } It "Should not have duplicate alias prefixes" { - $dupPrefixVerbs = ((Get-Verb | Group-Object -Property AliasPrefix | Where-Object Count -gt 1).Group).Verb -join ", " + $dupPrefixVerbs = ((Get-Verb | Group-Object -Property AliasPrefix | Where-Object Count -GT 1).Group).Verb -join ", " $dupPrefixVerbs | Should -BeNullOrEmpty } } 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 d330757da52..b1787bddad2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Group-Object.Tests.ps1 @@ -108,7 +108,7 @@ Describe "Group-Object" -Tags "CI" { It "Should be able to retrieve objects by key when using -AsHashTable without -AsString" { $testObject = [pscustomobject] @{a="one"; b=2}, [pscustomobject] @{a="two"; b=10} - $result = $testObject | Group-Object -AsHashtable -Property a + $result = $testObject | Group-Object -AsHashTable -Property a $result.one.b | Should -Be 2 $result["two"].b | Should -Be 10 } 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 6d1bf17ecc0..0b73e7be7aa 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Implicit.Remoting.Tests.ps1 @@ -151,7 +151,7 @@ try It "Verifies that get-help name for remote proxied commands matches the get-command name" { try { - $module = Import-PSSession $session -Name Select-Object -prefix My -AllowClobber + $module = Import-PSSession $session -Name Select-Object -Prefix My -AllowClobber $gcmOutPut = (Get-Command Select-MyObject ).Name $getHelpOutPut = (Get-Help Select-MyObject).Name @@ -227,7 +227,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command $session { function foo1{1; write-error 2; 3; write-error 4; 5; write-error 6} } + Invoke-Command $session { function foo1{1; Write-Error 2; 3; Write-Error 4; 5; Write-Error 6} } $module = Import-PSSession $session -CommandName foo1 -AllowClobber $icmErr = $($icmOut = Invoke-Command $session { foo1 }) 2>&1 @@ -259,8 +259,8 @@ try } It "Verifies proxied order = icm order (for mixed error and output results)" { - $icmOrder = Invoke-Command $session { foo1 } 2>&1 | out-string - $proxiedOrder = foo1 2>&1 | out-string + $icmOrder = Invoke-Command $session { foo1 } 2>&1 | Out-String + $proxiedOrder = foo1 2>&1 | Out-String $icmOrder | Should -Be $proxiedOrder } @@ -390,7 +390,7 @@ try Context "Proxy module should create a new session" { BeforeAll { if ($skipTest) { return } - $module = import-Module $file -PassThru -Force + $module = Import-Module $file -PassThru -Force $internalSession = & $module { $script:PSSession } } AfterAll { @@ -420,7 +420,7 @@ try BeforeAll { if ($skipTest) { return } $explicitSessionOption = New-PSSessionOption -Culture fr-FR -UICulture de-DE - $module = import-Module $file -PassThru -Force -ArgumentList $null, $explicitSessionOption + $module = Import-Module $file -PassThru -Force -ArgumentList $null, $explicitSessionOption $internalSession = & $module { $script:PSSession } } AfterAll { @@ -455,7 +455,7 @@ try if ($skipTest) { return } $newSession = New-RemoteSession - $module = import-Module $file -PassThru -Force -ArgumentList $newSession + $module = Import-Module $file -PassThru -Force -ArgumentList $newSession $internalSession = & $module { $script:PSSession } } AfterAll { @@ -554,7 +554,7 @@ try -"@ | set-content $tmpFile +"@ | Set-Content $tmpFile $tmpFile } @@ -593,7 +593,7 @@ try -"@ | set-content $tmpFile +"@ | Set-Content $tmpFile $tmpFile } @@ -613,7 +613,7 @@ try BeforeAll { if ($skipTest) { return } - $formattingScript = { new-object System.Management.Automation.Host.Size | ForEach-Object { $_.Width = 123; $_.Height = 456; $_ } | Out-String } + $formattingScript = { New-Object System.Management.Automation.Host.Size | ForEach-Object { $_.Width = 123; $_.Height = 456; $_ } | Out-String } $originalLocalFormatting = & $formattingScript # Original local and remote formatting should be equal (sanity check) @@ -692,7 +692,7 @@ try Invoke-Command -Session $session -Script { function foo { New-Object MyTest.Root "root" } } Invoke-Command -Session $session -Script { function bar { param([Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true)]$Son) $Son.Grandson.text } } - $module = import-pssession $session foo,bar -AllowClobber + $module = Import-PSSession $session foo,bar -AllowClobber } AfterAll { @@ -844,7 +844,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { [cmdletbinding(defaultparametersetname="string")] param( @@ -886,7 +886,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [string] @@ -927,7 +927,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [DateTime] @@ -946,7 +946,7 @@ try # Sanity checks. Invoke-Command $session {Get-Date | foo} | Should -BeExactly "Bound parameter: date" Invoke-Command $session {[ipaddress]::parse("127.0.0.1") | foo} | Should -BeExactly "Bound parameter: ipaddress" - Invoke-Command $session {[ipaddress]::parse("127.0.0.1") | foo -date (get-date)} | Should -BeExactly "Bound parameter: date ipaddress" + Invoke-Command $session {[ipaddress]::parse("127.0.0.1") | foo -date (Get-Date)} | Should -BeExactly "Bound parameter: date ipaddress" Invoke-Command $session {Get-Date | foo -ipaddress ([ipaddress]::parse("127.0.0.1"))} | Should -BeExactly "Bound parameter: date ipaddress" $module = Import-PSSession $session foo -AllowClobber @@ -978,7 +978,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [System.TimeSpan] @@ -1008,15 +1008,15 @@ try } It "Pipeline binding works by property name" { - (Get-Process -id $PID | foo) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" + (Get-Process -Id $PID | foo) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" } It "Pipeline binding works by property name" { - (Get-Process -id $PID | foo -Total 5) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" + (Get-Process -Id $PID | foo -Total 5) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" } It "Pipeline binding works by property name" { - (Get-Process -id $PID | foo -Priority normal) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" + (Get-Process -Id $PID | foo -Priority normal) | Should -BeExactly "Bound parameter: PriorityClass TotalProcessorTime" } } @@ -1024,7 +1024,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [string] @@ -1065,7 +1065,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [object] @@ -1121,7 +1121,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( [string] @@ -1187,7 +1187,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function foo { param( $firstArg, @@ -1268,7 +1268,7 @@ try BeforeAll { if ($skipTest) { return } - Invoke-Command -Session $session -ScriptBlock { + Invoke-Command -Session $session -Scriptblock { function MyInitializerFunction { param($x = $PID) $x } } @@ -1598,14 +1598,14 @@ try } It "'Completed' progress record should be present" { - ($powerShell.Streams.Progress | Select-Object -last 1).RecordType.ToString() | Should -BeExactly "Completed" + ($powerShell.Streams.Progress | Select-Object -Last 1).RecordType.ToString() | Should -BeExactly "Completed" } } Context "display of property-less objects (not sure if this test belongs here) (Windows 7: #248499)" { BeforeAll { if ($skipTest) { return } - $x = new-object random + $x = New-Object random $expected = $x.ToString() } @@ -1615,7 +1615,7 @@ try ($x | Out-String).Trim() | Should -Be $expected } It "Display of remote property-less objects" { - (Invoke-Command $session { Import-Module Microsoft.PowerShell.Utility; New-Object random } | out-string).Trim() | Should -Be $expected + (Invoke-Command $session { Import-Module Microsoft.PowerShell.Utility; New-Object random } | Out-String).Trim() | Should -Be $expected } } @@ -1642,7 +1642,7 @@ try It "Non-terminating error from remote end got duplicated locally" { try { Invoke-Command $session { $oldGetCommand = ${function:Get-Command} } - Invoke-Command $session { function Get-Command { write-error blah } } + Invoke-Command $session { function Get-Command { Write-Error blah } } $module = Import-PSSession -Session $session -ErrorAction SilentlyContinue -ErrorVariable expectedError -AllowClobber $expectedError | Should -Not -BeNullOrEmpty @@ -1923,7 +1923,7 @@ try $session = New-RemoteSession -Name Session102 $remotePid = Invoke-Command $session { $PID } - $module = Import-PSSession $session Get-Variable -prefix Remote -AllowClobber + $module = Import-PSSession $session Get-Variable -Prefix Remote -AllowClobber } AfterAll { 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 a5d73601b64..3d611cbb4d4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1 @@ -7,16 +7,16 @@ Describe "Import-Alias DRT Unit Tests" -Tags "CI" { BeforeEach { New-Item -Path $testAliasDirectory -ItemType Directory -Force - remove-item alias:abcd* -force -ErrorAction SilentlyContinue - remove-item alias:ijkl* -force -ErrorAction SilentlyContinue - set-alias abcd01 efgh01 - set-alias abcd02 efgh02 - set-alias abcd03 efgh03 - set-alias abcd04 efgh04 - set-alias ijkl01 mnop01 - set-alias ijkl02 mnop02 - set-alias ijkl03 mnop03 - set-alias ijkl04 mnop04 + Remove-Item alias:abcd* -Force -ErrorAction SilentlyContinue + Remove-Item alias:ijkl* -Force -ErrorAction SilentlyContinue + Set-Alias abcd01 efgh01 + Set-Alias abcd02 efgh02 + Set-Alias abcd03 efgh03 + Set-Alias abcd04 efgh04 + Set-Alias ijkl01 mnop01 + Set-Alias ijkl02 mnop02 + Set-Alias ijkl03 mnop03 + Set-Alias ijkl04 mnop04 } AfterEach { @@ -34,7 +34,7 @@ Describe "Import-Alias DRT Unit Tests" -Tags "CI" { It "Import-Alias Into Invalid Scope should throw PSArgumentException"{ { Export-Alias $fulltestpath abcd* } | Should -Not -Throw - { Import-Alias $fulltestpath -scope bogus } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ImportAliasCommand" + { Import-Alias $fulltestpath -Scope bogus } | Should -Throw -ErrorId "Argument,Microsoft.PowerShell.Commands.ImportAliasCommand" } It "Import-Alias From Exported Alias File Aliases Already Exist using force should not throw"{ 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 bc9a5eee646..45d30d9e9cf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ImportExportCSV.Delimiter.Tests.ps1 @@ -11,7 +11,7 @@ Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tag # With CORECLR the CurrentCulture.TextInfo.ListSeparator is not writable, so # we need to use an entirely new CultureInfo which we can modify $enCulture = [System.Globalization.CultureInfo]::new("en-us") - $d = get-date + $d = Get-Date $testCases = @( foreach($del in $delimiters) { @@ -37,23 +37,23 @@ Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tag else { [System.Globalization.CultureInfo]::CurrentCulture.TextInfo.ListSeparator = $defaultDelimiter } - remove-item -force -ErrorAction silentlycontinue TESTDRIVE:/file.csv + Remove-Item -Force -ErrorAction silentlycontinue TESTDRIVE:/file.csv } It "Disallow use of null delimiter" { - $d | export-csv TESTDRIVE:/file.csv - { import-csv -path TESTDRIVE:/file.csv -delimiter $null } | Should -Throw "Delimiter" + $d | Export-Csv TESTDRIVE:/file.csv + { Import-Csv -Path TESTDRIVE:/file.csv -Delimiter $null } | Should -Throw "Delimiter" } It "Disallow use of delimiter with useCulture parameter" { - $d | export-csv TESTDRIVE:/file.csv - { import-csv -path TESTDRIVE:/file.csv -useCulture "," } | Should -Throw "','" + $d | Export-Csv TESTDRIVE:/file.csv + { Import-Csv -Path TESTDRIVE:/file.csv -UseCulture "," } | Should -Throw "','" } It "Imports the same properties as exported" { $a = [pscustomobject]@{ a = 1; b = 2; c = 3 } - $a | export-Csv TESTDRIVE:/file.csv - $b = import-csv TESTDRIVE:/file.csv + $a | Export-Csv TESTDRIVE:/file.csv + $b = Import-Csv TESTDRIVE:/file.csv @($b.psobject.properties).count | Should -Be 3 $b.a | Should -Be $a.a $b.b | Should -Be $a.b @@ -61,26 +61,26 @@ Describe "Using delimiters with Export-CSV and Import-CSV behave correctly" -tag } # parameter generated tests - It 'Delimiter with CSV import will fail correctly when culture does not match' -testCases $testCases { + It 'Delimiter with CSV import will fail correctly when culture does not match' -TestCases $testCases { param ($delimiter, $Data, $ExpectedResult) set-Delimiter $delimiter - $Data | export-CSV TESTDRIVE:\File.csv -useCulture - $i = Import-CSV TESTDRIVE:\File.csv + $Data | Export-Csv TESTDRIVE:\File.csv -UseCulture + $i = Import-Csv TESTDRIVE:\File.csv $i.Ticks | Should -Not -Be $ExpectedResult } - It 'Delimiter with CSV import will succeed when culture matches export' -testCases $testCases { + It 'Delimiter with CSV import will succeed when culture matches export' -TestCases $testCases { param ($delimiter, $Data, $ExpectedResult) set-Delimiter $delimiter - $Data | export-CSV TESTDRIVE:\File.csv -useCulture - $i = Import-CSV TESTDRIVE:\File.csv -useCulture + $Data | Export-Csv TESTDRIVE:\File.csv -UseCulture + $i = Import-Csv TESTDRIVE:\File.csv -UseCulture $i.Ticks | Should -Be $ExpectedResult } - It 'Delimiter with CSV import will succeed when delimiter is used explicitly' -testCases $testCases { + It 'Delimiter with CSV import will succeed when delimiter is used explicitly' -TestCases $testCases { param ($delimiter, $Data, $ExpectedResult) - $Data | export-CSV TESTDRIVE:\File.csv -delimiter $delimiter - $i = Import-CSV TESTDRIVE:\File.csv -delimiter $delimiter + $Data | Export-Csv TESTDRIVE:\File.csv -Delimiter $delimiter + $i = Import-Csv TESTDRIVE:\File.csv -Delimiter $delimiter $i.Ticks | Should -Be $ExpectedResult } } 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 57812ca566c..cdb7a6b30eb 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1 @@ -5,7 +5,7 @@ Describe "Invoke-Expression" -Tags "CI" { Context "Should execute the invoked command validly" { It "Should return the echoed text" { - (Invoke-Expression -command "echo pestertest1") | Should -BeExactly "pestertest1" + (Invoke-Expression -Command "echo pestertest1") | Should -BeExactly "pestertest1" } It "Should return the echoed text from a script" { @@ -19,7 +19,7 @@ Describe "Invoke-Expression" -Tags "CI" { } Describe "Invoke-Expression DRT Unit Tests" -Tags "CI" { It "Invoke-Expression should work"{ - $result=invoke-expression -Command 2+2 + $result=Invoke-Expression -Command 2+2 $result | Should -Be 4 } } 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 c3e51bd5c7a..72ab978b69f 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 @@ -116,7 +116,7 @@ Describe "Invoke-Item basic tests" -Tags "Feature" { while (((Get-Date) - $startTime).TotalSeconds -lt 30 -and ($title -ne $expectedTitle)) { Start-Sleep -Milliseconds 100 - $title = Get-WindowsTitleMacOS -name TextEdit + $title = Get-WindowsTitleMacOS -Name TextEdit } $afterCount = Get-WindowCountMacOS -Name TextEdit $afterCount | Should -Be ($beforeCount + 1) -Because "There should be one more 'textEdit' windows open than when the tests started and there was $beforeCount" @@ -294,11 +294,11 @@ Describe "Invoke-Item tests on Windows" -Tags "CI","RequireAdminOnWindows" { } It "Should invoke a file without error on Windows full SKUs" -Skip:(-not $isFullWin) { - invoke-item $testfilepath + Invoke-Item $testfilepath # Waiting subprocess start and rename file { $startTime = [Datetime]::Now - while (-not (test-path $renamedtestfilepath)) + while (-not (Test-Path $renamedtestfilepath)) { Start-Sleep -Milliseconds 100 if (([Datetime]::Now - $startTime) -ge [timespan]"00:00:05") { throw "Timeout exception" } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 index 79fc6f2585e..fbb68273e52 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Join-String.Tests.ps1 @@ -116,7 +116,7 @@ Describe "Join-String" -Tags "CI" { It "Should tabcomplete InputObject properties" { $cmd = '[io.fileinfo]::new("c:\temp") | Join-String -Property ' - $res = tabexpansion2 $cmd $cmd.length + $res = TabExpansion2 $cmd $cmd.length $completionTexts = $res.CompletionMatches.CompletionText $Properties = [io.fileinfo]::new($PSScriptRoot).psobject.properties.Name foreach ($n in $Properties) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 index 13eb43608ab..acd3f095d8d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Json.Tests.ps1 @@ -50,7 +50,7 @@ Describe "Json Tests" -Tags "Feature" { # Test follow-up for bug WinBlue: 11484 - ConvertTo-Json can't handle terms with double quotes. - $notcompressed = ConvertTo-JSON @{ FirstName = 'Hello " World' } + $notcompressed = ConvertTo-Json @{ FirstName = 'Hello " World' } $compressed = ConvertTo-Json @{ FirstName = 'Hello " World' } -Compress $valueFromNotCompressedResult = ConvertFrom-Json -InputObject $notcompressed $valueFromCompressedResult = ConvertFrom-Json -InputObject $compressed @@ -62,11 +62,11 @@ Describe "Json Tests" -Tags "Feature" { # Test follow-up for bug Win8: 378368 Convertto-Json problems with Enum based on Int64. if ( $null -eq ("JsonEnumTest" -as "Type")) { - $enum1 = "TestEnum" + (get-random) - $enum2 = "TestEnum" + (get-random) - $enum3 = "TestEnum" + (get-random) + $enum1 = "TestEnum" + (Get-Random) + $enum2 = "TestEnum" + (Get-Random) + $enum3 = "TestEnum" + (Get-Random) - $jsontype = add-type -pass -TypeDef " + $jsontype = Add-Type -pass -TypeDef " public enum $enum1 : ulong { One = 1, Two = 2 }; public enum $enum2 : long { One = 1, Two = 2 }; public enum $enum3 : int { One = 1, Two = 2 }; @@ -76,7 +76,7 @@ Describe "Json Tests" -Tags "Feature" { public $enum3 TestEnum3 = ${enum3}.One; }" } - $op = [JsonEnumTest]::New() | convertto-json | convertfrom-json + $op = [JsonEnumTest]::New() | ConvertTo-Json | ConvertFrom-Json $op.TestEnum1 | Should -BeExactly "One" $op.TestEnum2 | Should -BeExactly "Two" $op.TestEnum3 | Should -Be 1 @@ -101,7 +101,7 @@ Describe "Json Tests" -Tags "Feature" { $response.d.Name.First | Should -Match "Joel" } - It "Convert to Json using PSObject" -pending:($IsCoreCLR) { + It "Convert to Json using PSObject" -Pending:($IsCoreCLR) { $response = ConvertFrom-Json '{"d":{"__type":"SimpleJsonObject","Name":{"First":"Joel","Last":"Wood"},"Greeting":"Hello"}}' @@ -140,7 +140,7 @@ Describe "Json Tests" -Tags "Feature" { $response2 = ConvertTo-Json -InputObject $response -Depth 1 $response2 | Should -Match $result2 - $arraylist = new-Object System.Collections.ArrayList + $arraylist = New-Object System.Collections.ArrayList [void]$arraylist.Add("one") [void]$arraylist.Add("two") [void]$arraylist.Add("three") @@ -161,7 +161,7 @@ Describe "Json Tests" -Tags "Feature" { $response2 | Should -Be $result3 } - It "Convert to Json using hashtable" -pending:($IsCoreCLR) { + It "Convert to Json using hashtable" -Pending:($IsCoreCLR) { $nameHash = @{First="Joe1";Last="Wood"} $dHash = @{Name=$nameHash; Greeting="Hello"} @@ -1237,7 +1237,7 @@ Describe "Validate Json serialization" -Tags "CI" { param ($testCase) if ( $TestCase.TestInput -eq "[char]::MinValue" ) { $pending = $true } else { $pending = $false } - It "Validate '$($testCase.TestInput) | ConvertTo-Json' and '$($testCase.TestInput) | ConvertTo-Json | ConvertFrom-Json'" -pending:$pending { + It "Validate '$($testCase.TestInput) | ConvertTo-Json' and '$($testCase.TestInput) | ConvertTo-Json | ConvertFrom-Json'" -Pending:$pending { # The test case input is executed via invoke-expression. Then, we use this value as an input to ConvertTo-Json, # and the result is saved into in the $result.ToJson variable. Lastly, this value is deserialized back using @@ -1292,7 +1292,7 @@ Describe "Validate Json serialization" -Tags "CI" { } } - It "Validate that CimClass Properties for win32_bios can be serialized using ConvertTo-Json and ConvertFrom-Json" -skip { + It "Validate that CimClass Properties for win32_bios can be serialized using ConvertTo-Json and ConvertFrom-Json" -Skip { $class = Get-CimClass win32_bios 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 ed3c69b9cb8..a51cf49a732 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Event.Tests.ps1 @@ -11,15 +11,15 @@ Describe "New-Event" -Tags "CI" { Context "Check New-Event can register an event"{ It "Should return PesterTestMessage as the MessageData" { - (New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage") + (New-Event -SourceIdentifier PesterTimer -Sender Windows.timer -MessageData "PesterTestMessage") (Get-Event -SourceIdentifier PesterTimer).MessageData | Should -BeExactly "PesterTestMessage" - Remove-Event -sourceidentifier PesterTimer + Remove-Event -SourceIdentifier PesterTimer } It "Should return Sender as Windows.timer" { - (New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage") + (New-Event -SourceIdentifier PesterTimer -Sender Windows.timer -MessageData "PesterTestMessage") (Get-Event -SourceIdentifier PesterTimer).Sender | Should -Be Windows.timer - Remove-Event -sourceIdentifier PesterTimer + Remove-Event -SourceIdentifier PesterTimer } } } 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 c163e49189c..adf154981c9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 @@ -126,7 +126,7 @@ Describe "New-Object DRT basic functionality" -Tags "CI" { } It "New-Object with TypeName and Property parameter should work"{ - $result = New-Object -TypeName PSObject -property @{foo=123} + $result = New-Object -TypeName PSObject -Property @{foo=123} $result.foo | Should -Be 123 } } @@ -154,7 +154,7 @@ try param($Name, $Property, $Type) $comObject = New-Object -ComObject $name $comObject.$Property | Should -Not -BeNullOrEmpty - $comObject.$Property | Should -Beoftype $Type + $comObject.$Property | Should -BeOfType $Type } It "Should fail with correct error when creating a COM object that dose not exist" { 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 77a6fc8910a..9a4490bd2b1 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/New-Variable.Tests.ps1 @@ -3,7 +3,7 @@ Describe "New-Variable DRT Unit Tests" -Tags "CI" { It "New-Variable variable with description should works"{ - New-Variable foo bar -description "my description" + New-Variable foo bar -Description "my description" $var1=Get-Variable -Name foo $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "bar" @@ -12,7 +12,7 @@ Describe "New-Variable DRT Unit Tests" -Tags "CI" { } It "New-Variable variable with option should works"{ - New-Variable foo bar -option Constant + New-Variable foo bar -Option Constant $var1=Get-Variable -Name foo $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "bar" @@ -36,7 +36,7 @@ Describe "New-Variable DRT Unit Tests" -Tags "CI" { } It "New-Variable ReadOnly variable twice should throw Exception"{ - New-Variable foo bogus -option ReadOnly + New-Variable foo bogus -Option ReadOnly $e = { New-Variable foo bar -Scope 1 -ErrorAction Stop } | Should -Throw -ErrorId "VariableAlreadyExists,Microsoft.PowerShell.Commands.NewVariableCommand" -PassThru @@ -122,7 +122,7 @@ Describe "New-Variable" -Tags "CI" { } It "Should default to none as the value for options" { - (new-variable -name var2 -value 4 -passthru).Options | Should -BeExactly "None" + (New-Variable -Name var2 -Value 4 -PassThru).Options | Should -BeExactly "None" } It "Should be able to set ReadOnly option" { @@ -197,38 +197,38 @@ Describe "New-Variable" -Tags "CI" { Context "Scope Tests" { BeforeAll { - if ( get-variable -scope global -name globalVar1 -ErrorAction SilentlyContinue ) + if ( Get-Variable -Scope global -Name globalVar1 -ErrorAction SilentlyContinue ) { - Remove-Variable -scope global -name globalVar1 + Remove-Variable -Scope global -Name globalVar1 } - if ( get-variable -scope script -name scriptvar -ErrorAction SilentlyContinue ) + if ( Get-Variable -Scope script -Name scriptvar -ErrorAction SilentlyContinue ) { - remove-variable -scope script -name scriptvar + Remove-Variable -Scope script -Name scriptvar } # no check for local scope variable as that scope is created with test invocation } AfterAll { - if ( get-variable -scope global -name globalVar1 ) + if ( Get-Variable -Scope global -Name globalVar1 ) { - Remove-Variable -scope global -name globalVar1 + Remove-Variable -Scope global -Name globalVar1 } - if ( get-variable -scope script -name scriptvar ) + if ( Get-Variable -Scope script -Name scriptvar ) { - remove-variable -scope script -name scriptvar + Remove-Variable -Scope script -Name scriptvar } } It "Should be able to create a global scope variable using the global switch" { - new-variable -Scope global -name globalvar1 -value 1 - get-variable -Scope global -name globalVar1 -ValueOnly | Should -Be 1 + New-Variable -Scope global -Name globalvar1 -Value 1 + Get-Variable -Scope global -Name globalVar1 -ValueOnly | Should -Be 1 } It "Should be able to create a local scope variable using the local switch" { - Get-Variable -scope local -name localvar -ValueOnly -ErrorAction silentlycontinue | Should -BeNullOrEmpty - New-Variable -Scope local -Name localVar -value 10 - get-variable -scope local -name localvar -ValueOnly | Should -Be 10 + Get-Variable -Scope local -Name localvar -ValueOnly -ErrorAction silentlycontinue | Should -BeNullOrEmpty + New-Variable -Scope local -Name localVar -Value 10 + Get-Variable -Scope local -Name localvar -ValueOnly | Should -Be 10 } It "Should be able to create a script scope variable using the script switch" { - new-variable -scope script -name scriptvar -value 100 - get-variable -scope script -name scriptvar -ValueOnly | Should -Be 100 + New-Variable -Scope script -Name scriptvar -Value 100 + Get-Variable -Scope script -Name scriptvar -ValueOnly | Should -Be 100 } } } 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 219c729e25a..912db06f78a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-File.Tests.ps1 @@ -11,8 +11,8 @@ 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 "outfileAppendTest.txt" - { 'This is first line.' | out-file $tempFile } | Should -Not -Throw - { 'This is second line.' | out-file -append $tempFile } | Should -Not -Throw + { 'This is first line.' | Out-File $tempFile } | Should -Not -Throw + { 'This is second line.' | Out-File -Append $tempFile } | Should -Not -Throw $tempFile | Should -FileContentMatch "first" $tempFile | Should -FileContentMatch "second" Remove-Item $tempFile -Force 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 fbe4e9b3814..07c0eeefe3b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Out-String.Tests.ps1 @@ -3,7 +3,7 @@ Describe "Out-String DRT Unit Tests" -Tags "CI" { It "check display of properties with names containing wildcard characters" { - $results = new-object psobject | add-member -passthru noteproperty 'name with square brackets: [0]' 'myvalue' | out-string + $results = New-Object psobject | Add-Member -PassThru noteproperty 'name with square brackets: [0]' 'myvalue' | Out-String $results.Length | Should -BeGreaterThan 1 $results | Should -BeOfType System.String $results.Contains("myvalue") | Should -BeTrue diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 index d4ece313b58..6d13be5005b 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1 @@ -15,19 +15,19 @@ Describe "Tests for the Import-PowerShellDataFile cmdlet" -Tags "CI" { It "Generates a good error on an insecure file" { - $path = Setup -f insecure.psd1 -content '@{ Foo = Get-Process }' -pass + $path = Setup -f insecure.psd1 -Content '@{ Foo = Get-Process }' -pass { Import-PowerShellDataFile $path -ErrorAction Stop } | Should -Throw -ErrorId "System.InvalidOperationException,Microsoft.PowerShell.Commands.ImportPowerShellDataFileCommand" } It "Generates a good error on a file that isn't a PowerShell Data File (missing the hashtable root)" { - $path = setup -f NotAPSDataFile -content '"Hello World"' -Pass + $path = Setup -f NotAPSDataFile -Content '"Hello World"' -Pass { Import-PowerShellDataFile $path -ErrorAction Stop } | Should -Throw -ErrorId "CouldNotParseAsPowerShellDataFileNoHashtableRoot,Microsoft.PowerShell.Commands.ImportPowerShellDataFileCommand" } It "Can parse a PowerShell Data File (detailed tests are in AST.SafeGetValue tests)" { - $path = Setup -F gooddatafile -content '@{ "Hello" = "World" }' -pass + $path = Setup -F gooddatafile -Content '@{ "Hello" = "World" }' -pass $result = Import-PowerShellDataFile $path -ErrorAction Stop $result.Hello | Should -BeExactly "World" } 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 f12fa8f2d78..0edc0fcd4f8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 @@ -1,6 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Read-Host Test" -tag "CI" { +Describe "Read-Host Test" -Tag "CI" { BeforeAll { $th = New-TestHost $rs = [runspacefactory]::Createrunspace($th) @@ -33,7 +33,7 @@ Describe "Read-Host Test" -tag "CI" { } It "Read-Host returns a secure string when using -AsSecureString parameter" { - $result = $ps.AddScript("Read-Host -AsSecureString").Invoke() | select-object -first 1 + $result = $ps.AddScript("Read-Host -AsSecureString").Invoke() | Select-Object -First 1 $result | Should -BeOfType SecureString [pscredential]::New("foo",$result).GetNetworkCredential().Password | Should -BeExactly TEST } 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 054b5a8961b..8916606d4f4 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Register-EngineEvent.Tests.ps1 @@ -5,7 +5,7 @@ Describe "Register-EngineEvent" -Tags "CI" { Context "Check return type of Register-EngineEvent" { It "Should return System.Management.Automation.PSEventJob as return type of Register-EngineEvent" { Register-EngineEvent -SourceIdentifier PesterTestRegister -Action {Write-Output registerengineevent} | Should -BeOfType System.Management.Automation.PSEventJob - Unregister-Event -sourceidentifier PesterTestRegister + Unregister-Event -SourceIdentifier PesterTestRegister } } } 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 11d402806b8..efca49cc56a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Remove-Event.Tests.ps1 @@ -3,22 +3,22 @@ Describe "Remove-Event" -Tags "CI" { BeforeEach { - New-Event -sourceidentifier PesterTimer -sender Windows.timer -messagedata "PesterTestMessage" + New-Event -SourceIdentifier PesterTimer -Sender Windows.timer -MessageData "PesterTestMessage" } AfterEach { - Remove-Event -sourceidentifier PesterTimer -ErrorAction SilentlyContinue + Remove-Event -SourceIdentifier PesterTimer -ErrorAction SilentlyContinue } Context "Check Remove-Event can validly remove events" { It "Should remove an event given a sourceidentifier" { - { Remove-Event -sourceidentifier PesterTimer } + { Remove-Event -SourceIdentifier PesterTimer } { Get-Event -ErrorAction SilentlyContinue | Should -Not FileMatchContent PesterTimer } } It "Should remove an event given an event identifier" { - { $events = Get-Event -sourceidentifier PesterTimer } + { $events = Get-Event -SourceIdentifier PesterTimer } { $events = $events.EventIdentifier } { Remove-Event -EventIdentifier $events } { $events = Get-Event -ErrorAction SilentlyContinue} @@ -26,13 +26,13 @@ Describe "Remove-Event" -Tags "CI" { } It "Should be able to remove an event given a pipe from Get-Event" { - { Get-Event -sourceidentifier PesterTimer | Remove-Event } + { Get-Event -SourceIdentifier PesterTimer | Remove-Event } { Get-Event -ErrorAction SilentlyContinue | Should -Not FileMatchContent "PesterTimer" } } It "Should NOT remove an event given the whatif flag" { - { Remove-Event -sourceidentifier PesterTimer -whatif } + { Remove-Event -SourceIdentifier PesterTimer -WhatIf } { $events = Get-Event } { $events.SourceIdentifier | Should -FileContentMatch "PesterTimer" } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 index 1b6e1ea05f5..ce7c5c92129 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/RunspaceCmdlets.Tests.ps1 @@ -7,24 +7,24 @@ Describe "Get-Runspace cmdlet tests" -Tag "CI" { $ExpectedId = $currentRunspace.Id } It "Get-Runspace should return the current runspace" { - $runspace = get-runspace |Sort-Object -property id | Select-Object -first 1 + $runspace = Get-Runspace |Sort-Object -Property id | Select-Object -First 1 $runspace.InstanceId | Should -Be $ExpectedInstanceId } It "Get-Runspace with runspace InstanceId should return the correct runspace" { - $runspace = get-runspace -instanceid $CurrentRunspace.InstanceId + $runspace = Get-Runspace -InstanceId $CurrentRunspace.InstanceId $runspace.InstanceId | Should -Be $ExpectedInstanceId } It "Get-Runspace with runspace name should return the correct runspace" { - $runspace = get-runspace -name $currentRunspace.Name + $runspace = Get-Runspace -Name $currentRunspace.Name $runspace.InstanceId | Should -Be $ExpectedInstanceId } It "Get-Runspace with runspace Id should return the correct runspace" { - $runspace = get-runspace -id $CurrentRunspace.Id + $runspace = Get-Runspace -Id $CurrentRunspace.Id $runspace.InstanceId | Should -Be $ExpectedInstanceId } Context "Multiple Runspaces" { BeforeAll { - $runspaceCount = @(get-runspace).count + $runspaceCount = @(Get-Runspace).count $r1 = [runspacefactory]::CreateRunspace() $r1.Open() $r2 = [runspacefactory]::CreateRunspace() @@ -34,7 +34,7 @@ Describe "Get-Runspace cmdlet tests" -Tag "CI" { $r2.Dispose() } It "Get-Runspace should return the new runspaces" { - $result = get-runspace + $result = Get-Runspace # if the ids don't match, we'll get null passed to should $result.id | Where-Object {$_ -eq $r1.id } | Should -Be $r1.id $result.id | Where-Object {$_ -eq $r2.id } | Should -Be $r2.id 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 0c623f7d443..4e060c516b0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1 @@ -15,7 +15,7 @@ Describe "Select-Object" -Tags "CI" { } It "Should treat input as a single object with the inputObject parameter" { - $result = $(Select-Object -inputObject $dirObject -last $TestLength).Length + $result = $(Select-Object -InputObject $dirObject -Last $TestLength).Length $expected = $dirObject.Length $result | Should -Be $expected @@ -131,13 +131,13 @@ Describe "Select-Object DRT basic functionality" -Tags "CI" { } It "Select-Object with empty script block property should throw"{ - $e = { "bar" | select-object -Prop {} -ErrorAction Stop } | + $e = { "bar" | Select-Object -Prop {} -ErrorAction Stop } | Should -Throw -ErrorId "EmptyScriptBlockAndNoName,Microsoft.PowerShell.Commands.SelectObjectCommand" -PassThru $e.CategoryInfo | Should -Match "PSArgumentException" } It "Select-Object with string property should work"{ - $result = "bar" | select-object -Prop foo | Measure-Object + $result = "bar" | Select-Object -Prop foo | Measure-Object $result.Count | Should -Be 1 } 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 56f5e76cf76..68c238abb78 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Select-String.Tests.ps1 @@ -17,30 +17,30 @@ Describe "Select-String" -Tags "CI" { $testinputtwo = "hello","Hello" } - it "Should be called without errors" { + It "Should be called without errors" { { $testinputone | Select-String -Pattern "hello" } | Should -Not -Throw } - it "Should return an array data type when multiple matches are found" { + It "Should return an array data type when multiple matches are found" { $result = $testinputtwo | Select-String -Pattern "hello" ,$result | Should -BeOfType System.Array } - it "Should return an object type when one match is found" { + It "Should return an object type when one match is found" { $result = $testinputtwo | Select-String -Pattern "hello" -CaseSensitive ,$result | Should -BeOfType System.Object } - it "Should return matchinfo type" { + It "Should return matchinfo type" { $result = $testinputtwo | Select-String -Pattern "hello" -CaseSensitive ,$result | Should -BeOfType Microsoft.PowerShell.Commands.MatchInfo } - it "Should be called without an error using ca for casesensitive " { + It "Should be called without an error using ca for casesensitive " { {$testinputone | Select-String -Pattern "hello" -ca } | Should -Not -Throw } - it "Should use the ca alias for casesensitive" { + It "Should use the ca alias for casesensitive" { $firstMatch = $testinputtwo | Select-String -Pattern "hello" -CaseSensitive $secondMatch = $testinputtwo | Select-String -Pattern "hello" -ca @@ -48,40 +48,40 @@ Describe "Select-String" -Tags "CI" { $equal | Should -BeTrue } - it "Should only return the case sensitive match when the casesensitive switch is used" { + It "Should only return the case sensitive match when the casesensitive switch is used" { $testinputtwo | Select-String -Pattern "hello" -CaseSensitive | Should -Be "hello" } - it "Should accept a collection of strings from the input object" { + It "Should accept a collection of strings from the input object" { { Select-String -InputObject "some stuff", "other stuff" -Pattern "other" } | Should -Not -Throw } - it "Should return system.object when the input object switch is used on a collection" { - $result = Select-String -InputObject "some stuff", "other stuff" -pattern "other" + It "Should return system.object when the input object switch is used on a collection" { + $result = Select-String -InputObject "some stuff", "other stuff" -Pattern "other" ,$result | Should -BeOfType System.Object } - it "Should return null or empty when the input object switch is used on a collection and the pattern does not exist" { + It "Should return null or empty when the input object switch is used on a collection and the pattern does not exist" { Select-String -InputObject "some stuff", "other stuff" -Pattern "neither" | Should -BeNullOrEmpty } - it "Should return a bool type when the quiet switch is used" { + It "Should return a bool type when the quiet switch is used" { ,($testinputtwo | Select-String -Quiet "hello" -CaseSensitive) | Should -BeOfType System.Boolean } - it "Should be true when select string returns a positive result when the quiet switch is used" { + It "Should be true when select string returns a positive result when the quiet switch is used" { ($testinputtwo | Select-String -Quiet "hello" -CaseSensitive) | Should -BeTrue } - it "Should be empty when select string does not return a result when the quiet switch is used" { + It "Should be empty when select string does not return a result when the quiet switch is used" { $testinputtwo | Select-String -Quiet "goodbye" | Should -BeNullOrEmpty } - it "Should return an array of non matching strings when the switch of NotMatch is used and the string do not match" { + It "Should return an array of non matching strings when the switch of NotMatch is used and the string do not match" { $testinputone | Select-String -Pattern "goodbye" -NotMatch | Should -BeExactly "hello", "Hello" } - it "Should output a string with the first match highlighted" { + It "Should output a string with the first match highlighted" { if ($Host.UI.SupportsVirtualTerminal -and !(Test-Path env:__SuppressAnsiEscapeSequences)) { $result = $testinputone | Select-String -Pattern "l" | Out-String @@ -94,7 +94,7 @@ Describe "Select-String" -Tags "CI" { } } - it "Should output a string with all matches highlighted when AllMatch is used" { + It "Should output a string with all matches highlighted when AllMatch is used" { if ($Host.UI.SupportsVirtualTerminal -and !(Test-Path env:__SuppressAnsiEscapeSequences)) { $result = $testinputone | Select-String -Pattern "l" -AllMatch | Out-String @@ -107,7 +107,7 @@ Describe "Select-String" -Tags "CI" { } } - it "Should output a string with the first match highlighted when SimpleMatch is used" { + It "Should output a string with the first match highlighted when SimpleMatch is used" { if ($Host.UI.SupportsVirtualTerminal -and !(Test-Path env:__SuppressAnsiEscapeSequences)) { $result = $testinputone | Select-String -Pattern "l" -SimpleMatch | Out-String @@ -120,12 +120,12 @@ Describe "Select-String" -Tags "CI" { } } - it "Should output a string without highlighting when NoEmphasis is used" { + It "Should output a string without highlighting when NoEmphasis is used" { $result = $testinputone | Select-String -Pattern "l" -NoEmphasis | Out-String $result | Should -Be "${nl}hello${nl}Hello${nl}${nl}" } - it "Should return an array of matching strings without virtual terminal sequences" { + It "Should return an array of matching strings without virtual terminal sequences" { $testinputone | Select-String -Pattern "l" | Should -Be "hello", "hello" } @@ -144,7 +144,7 @@ Describe "Select-String" -Tags "CI" { $testInputFile = Join-Path -Path $testDirectory -ChildPath testfile1.txt BeforeEach { - New-Item $testInputFile -Itemtype "file" -Force -Value "This is a text string, and another string${nl}This is the second line${nl}This is the third line${nl}This is the fourth line${nl}No matches" + New-Item $testInputFile -ItemType "file" -Force -Value "This is a text string, and another string${nl}This is the second line${nl}This is the third line${nl}This is the fourth line${nl}No matches" } AfterEach { 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 c7b385d8677..627b11481f0 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Alias.Tests.ps1 @@ -47,8 +47,8 @@ Describe "Set-Alias DRT Unit Tests" -Tags "CI" { $result.Options | Should -BeExactly "None" } It "Set-Alias Scope Valid"{ - Set-Alias -Name ABCD -Value "localfoo" -scope local -Force:$true - Set-Alias -Name ABCD -Value "foo1" -scope "1" -Force:$true + Set-Alias -Name ABCD -Value "localfoo" -Scope local -Force:$true + Set-Alias -Name ABCD -Value "foo1" -Scope "1" -Force:$true $result=Get-Alias -Name ABCD $result.Name | Should -BeExactly "ABCD" @@ -56,13 +56,13 @@ Describe "Set-Alias DRT Unit Tests" -Tags "CI" { $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope local + $result=Get-Alias -Name ABCD -Scope local $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "localfoo" $result.Description | Should -BeNullOrEmpty $result.Options | Should -BeExactly "None" - $result=Get-Alias -Name ABCD -scope "1" + $result=Get-Alias -Name ABCD -Scope "1" $result.Name | Should -BeExactly "ABCD" $result.Definition | Should -BeExactly "foo1" $result.Description | Should -BeNullOrEmpty @@ -77,11 +77,11 @@ Describe "Set-Alias" -Tags "CI" { Mock Get-Date { return "Friday, October 30, 2015 3:38:08 PM" } It "Should be able to set alias without error" { - { set-alias -Name gd -Value Get-Date } | Should -Not -Throw + { Set-Alias -Name gd -Value Get-Date } | Should -Not -Throw } It "Should be able to have the same output between set-alias and the output of the function being aliased" { - set-alias -Name gd -Value Get-Date + Set-Alias -Name gd -Value Get-Date gd | Should -Be $(Get-Date) } 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 84a16556e7b..21c84fe4770 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-PSBreakpoint.Tests.ps1 @@ -41,49 +41,49 @@ set-psbreakpoint -command foo It "Should be able to set psbreakpoints for -Line" { $brk = Set-PSBreakpoint -Line 13 -Script $scriptFileName $brk.Line | Should -Be 13 - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set psbreakpoints for -Line and -column" { - $brk = set-psbreakpoint -line 13 -column 1 -script $scriptFileName + $brk = Set-PSBreakpoint -Line 13 -Column 1 -Script $scriptFileName $brk.Line | Should -Be 13 $brk.Column | Should -Be 1 - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set psbreakpoints for -Line and -action" { - $brk = set-psbreakpoint -line 13 -action {{ break; }} -script $scriptFileName + $brk = Set-PSBreakpoint -Line 13 -Action {{ break; }} -Script $scriptFileName $brk.Line | Should -Be 13 $brk.Action | Should -Match "break" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set psbreakpoints for -Line, -column and -action" { - $brk = set-psbreakpoint -line 13 -column 1 -action {{ break; }} -script $scriptFileName + $brk = Set-PSBreakpoint -Line 13 -Column 1 -Action {{ break; }} -Script $scriptFileName $brk.Line | Should -Be 13 $brk.Column | Should -Be 1 $brk.Action | Should -Match "break" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "-script and -line can take multiple items" { - $brk = Set-PSBreakpoint -line 11,12,13 -column 1 -script $scriptFileName,$scriptFileName + $brk = Set-PSBreakpoint -Line 11,12,13 -Column 1 -Script $scriptFileName,$scriptFileName $brk.Line | Should -BeIn 11,12,13 $brk.Column | Should -BeIn 1 - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "-script and -line are positional" { $brk = Set-PSBreakpoint $scriptFileName 13 $brk.Line | Should -Be 13 - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "-script, -line and -column are positional" { $brk = Set-PSBreakpoint $scriptFileName 13 1 $brk.Line | Should -Be 13 $brk.Column | Should -Be 1 - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should throw Exception when missing mandatory parameter -line" -Pending { @@ -97,52 +97,52 @@ set-psbreakpoint -command foo } It "Should be able to set psbreakpoints for -command" { - $brk = set-psbreakpoint -command "write-host" + $brk = Set-PSBreakpoint -Command "write-host" $brk.Command | Should -BeExactly "write-host" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set psbreakpoints for -command, -script" { - $brk = set-psbreakpoint -command "write-host" -script $scriptFileName + $brk = Set-PSBreakpoint -Command "write-host" -Script $scriptFileName $brk.Command | Should -BeExactly "write-host" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set psbreakpoints for -command, -action and -script" { - $brk = set-psbreakpoint -command "write-host" -action {{ break; }} -script $scriptFileName + $brk = Set-PSBreakpoint -Command "write-host" -Action {{ break; }} -Script $scriptFileName $brk.Action | Should -Match "break" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "-Command can take multiple items" { - $brk = set-psbreakpoint -command write-host,Hello + $brk = Set-PSBreakpoint -Command write-host,Hello $brk.Command | Should -Be write-host,Hello - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "-Script is positional" { - $brk = set-psbreakpoint -command "Hello" $scriptFileName + $brk = Set-PSBreakpoint -Command "Hello" $scriptFileName $brk.Command | Should -BeExactly "Hello" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id - $brk = set-psbreakpoint $scriptFileName -command "Hello" + $brk = Set-PSBreakpoint $scriptFileName -Command "Hello" $brk.Command | Should -BeExactly "Hello" - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set breakpoints on functions" { - $brk = set-psbreakpoint -command Hello,Goodbye -script $scriptFileName + $brk = Set-PSBreakpoint -Command Hello,Goodbye -Script $scriptFileName $brk.Command | Should -Be Hello,Goodbye - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be throw Exception when Column number less than 1" { - { set-psbreakpoint -line 1 -column -1 -script $scriptFileName } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SetPSBreakpointCommand" + { Set-PSBreakpoint -Line 1 -Column -1 -Script $scriptFileName } | Should -Throw -ErrorId "ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SetPSBreakpointCommand" } It "Should be throw Exception when Line number less than 1" { $ErrorActionPreference = "Stop" - { set-psbreakpoint -line -1 -script $scriptFileName } | Should -Throw -ErrorId "SetPSBreakpoint:LineLessThanOne,Microsoft.PowerShell.Commands.SetPSBreakpointCommand" + { Set-PSBreakpoint -Line -1 -Script $scriptFileName } | Should -Throw -ErrorId "SetPSBreakpoint:LineLessThanOne,Microsoft.PowerShell.Commands.SetPSBreakpointCommand" $ErrorActionPreference = "SilentlyContinue" } @@ -187,7 +187,7 @@ Describe "Set-PSBreakpoint" -Tags "CI" { $lineNumber = 1 $brk = Set-PSBreakpoint -Line $lineNumber -Script $testScript $brk.Line | Should -Be $lineNumber - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should throw when a string is entered for a line number" { @@ -202,14 +202,14 @@ Describe "Set-PSBreakpoint" -Tags "CI" { $command = "theCommand" $brk = Set-PSBreakpoint -Command $command -Script $testScript $brk.Command | Should -Be $command - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } It "Should be able to set a psbreakpoint on a variable" { $var = "theVariable" $brk = Set-PSBreakpoint -Command $var -Script $testScript $brk.Command | Should -Be $var - Remove-PSBreakPoint -Id $brk.Id + Remove-PSBreakpoint -Id $brk.Id } # clean up after ourselves 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 ab207f9ff85..fe1b105ed04 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Set-Variable.Tests.ps1 @@ -24,21 +24,21 @@ Describe "Set-Variable DRT Unit Tests" -Tags "CI" { Set-Variable -Name foo -Value bar0 Set-Variable -Name foo -Value bar -Scope "1" - $var1=Get-Variable -Name foo -scope "1" + $var1=Get-Variable -Name foo -Scope "1" $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "bar" $var1.Options | Should -BeExactly "None" $var1.Description | Should -BeNullOrEmpty Set-Variable -Name foo -Value newValue -Scope "local" - $var1=Get-Variable -Name foo -scope "local" + $var1=Get-Variable -Name foo -Scope "local" $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "newValue" $var1.Options | Should -BeExactly "None" $var1.Description | Should -BeNullOrEmpty Set-Variable -Name foo -Value newValue2 -Scope "script" - $var1=Get-Variable -Name foo -scope "script" + $var1=Get-Variable -Name foo -Scope "script" $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "newValue2" $var1.Options | Should -BeExactly "None" @@ -126,7 +126,7 @@ Describe "Set-Variable DRT Unit Tests" -Tags "CI" { } It "Set-Variable of ReadOnly variable with private scope should work"{ - Set-Variable foo bar -Description "new description" -Option ReadOnly -scope "private" + Set-Variable foo bar -Description "new description" -Option ReadOnly -Scope "private" $var1=Get-Variable -Name foo $var1.Name | Should -BeExactly "foo" $var1.Value | Should -BeExactly "bar" 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 a58356f58ef..7b40334d233 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Sort-Object.Tests.ps1 @@ -103,12 +103,12 @@ Describe "Sort-Object DRT Unit Tests" -Tags "CI" { } It "Sort-Object with Non Existing And Null Script Property should work"{ - $n = new-object microsoft.powershell.commands.newobjectcommand - $d = new-object microsoft.powershell.commands.newobjectcommand + $n = New-Object microsoft.powershell.commands.newobjectcommand + $d = New-Object microsoft.powershell.commands.newobjectcommand $d.TypeName = 'Deetype' - $b = new-object microsoft.powershell.commands.newobjectcommand + $b = New-Object microsoft.powershell.commands.newobjectcommand $b.TypeName = 'btype' - $a = new-object microsoft.powershell.commands.newobjectcommand + $a = New-Object microsoft.powershell.commands.newobjectcommand $a.TypeName = 'atype' $results = $n, $d, $b, 'b', $a | Sort-Object -proper {$_.TypeName} $results.Count | Should -Be 5 @@ -119,13 +119,13 @@ Describe "Sort-Object DRT Unit Tests" -Tags "CI" { } It "Sort-Object with Non Existing And Null Property should work"{ - $n = new-object microsoft.powershell.commands.newobjectcommand + $n = New-Object microsoft.powershell.commands.newobjectcommand $n.TypeName = $null - $d = new-object microsoft.powershell.commands.newobjectcommand + $d = New-Object microsoft.powershell.commands.newobjectcommand $d.TypeName = 'Deetype' - $b = new-object microsoft.powershell.commands.newobjectcommand + $b = New-Object microsoft.powershell.commands.newobjectcommand $b.TypeName = 'btype' - $a = new-object microsoft.powershell.commands.newobjectcommand + $a = New-Object microsoft.powershell.commands.newobjectcommand $a.TypeName = 'atype' $results = $n, $d, $b, 'b', $a | Sort-Object -prop TypeName $results.Count | Should -Be 5 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 51b1354b934..01527be8435 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 @@ -8,7 +8,7 @@ Describe "Tee-Object" -Tags "CI" { It "Should return the output to the screen and to the variable" { $teefile = $testfile - Write-Output teeobjecttest1 | Tee-Object -variable teeresults + Write-Output teeobjecttest1 | Tee-Object -Variable teeresults $teeresults | Should -BeExactly "teeobjecttest1" Remove-Item $teefile -ErrorAction SilentlyContinue } 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 aca9a3a9eb9..cdccd0e9ed3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Trace-Command.Tests.ps1 @@ -54,7 +54,7 @@ Describe "Trace-Command" -tags "CI" { It "None options has no effect" { Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption None -FilePath $actualLogfile - Trace-Command -name * -Expression {Write-Output Foo} -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -FilePath $logfile Compare-Object (Get-Content $actualLogfile) (Get-Content $logfile) | Should -BeNullOrEmpty } @@ -87,7 +87,7 @@ Describe "Trace-Command" -tags "CI" { Context "Trace-Command tests for code coverage" { BeforeAll { - $filePath = join-path $TestDrive 'testtracefile.txt' + $filePath = Join-Path $TestDrive 'testtracefile.txt' } AfterEach { @@ -95,7 +95,7 @@ Describe "Trace-Command" -tags "CI" { } It "Get non-existing trace source" { - { '34E7F9FA-EBFB-4D21-A7D2-D7D102E2CC2F' | get-tracesource -ErrorAction Stop} | Should -Throw -ErrorId 'TraceSourceNotFound,Microsoft.PowerShell.Commands.GetTraceSourceCommand' + { '34E7F9FA-EBFB-4D21-A7D2-D7D102E2CC2F' | Get-TraceSource -ErrorAction Stop} | Should -Throw -ErrorId 'TraceSourceNotFound,Microsoft.PowerShell.Commands.GetTraceSourceCommand' } It "Set-TraceSource to file and RemoveFileListener wildcard" { @@ -115,7 +115,7 @@ Describe "Trace-Command" -tags "CI" { It "Trace-Command to readonly file" { $null = New-Item $filePath -Force - Set-ItemProperty $filePath -name IsReadOnly -value $true + Set-ItemProperty $filePath -Name IsReadOnly -Value $true Trace-Command -Name ParameterBinding -Command 'Get-PSDrive' -FilePath $filePath -Force Get-Content $filePath -Raw | Should -Match 'ParameterBinding Information' } 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 e328111f0ab..d3d172e662e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unblock-File.Tests.ps1 @@ -25,7 +25,7 @@ Describe "Unblock-File" -Tags "CI" { function Block-File { param($path) - Set-Content -Path $path -value 'test' + Set-Content -Path $path -Value 'test' xattr -w com.apple.quarantine '0081;5dd5c373;Microsoft Edge;1A9A933D-619A-4036-BAF3-17A7966A1BA8' $path } 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 8436c9b9814..d7cfa1f3204 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-FormatData.Tests.ps1 @@ -14,7 +14,7 @@ Describe "Update-FormatData" -Tags "CI" { It "Should validly load formatting data" { $path = Join-Path -Path $TestDrive -ChildPath "outputfile.ps1xml" - Get-FormatData -typename System.Diagnostics.Process | Export-FormatData -Path $path + Get-FormatData -TypeName System.Diagnostics.Process | Export-FormatData -Path $path $null = $ps.AddScript("Update-FormatData -prependPath $path") $ps.Invoke() $ps.HadErrors | Should -BeFalse 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 38f1516dae2..e2666ea6199 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Update-TypeData.Tests.ps1 @@ -291,7 +291,7 @@ Describe "Update-TypeData basic functionality" -Tags "CI" { } # this looks identical to the test directly above - It "Update-TypeData with ISS Type Table API Test Add And Remove TypeData should work" -pending { + It "Update-TypeData with ISS Type Table API Test Add And Remove TypeData should work" -Pending { try{ Update-TypeData -TypeName System.Object[] -MemberType NoteProperty -MemberName TestNote -Value "TestNote" Update-TypeData -TypeName System.Object[] -MemberType AliasProperty -MemberName TestAlias -Value "Length" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 index bcb3fc73781..093928ebac3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Wait-Debugger.Tests.ps1 @@ -22,7 +22,7 @@ Describe 'Tests for Wait-Debugger' -Tags "CI" { Test-Break } - $results = @(Test-Debugger -ScriptBlock $testScript) + $results = @(Test-Debugger -Scriptblock $testScript) } It 'Should show 1 debugger command was invoked' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index ce3720e49c5..9d73d398ef3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -299,7 +299,7 @@ function ExecuteRestMethod { throw "No verbose output was found" } } catch { - $result.Error = $_ | select-object * | Out-String + $result.Error = $_ | Select-Object * | Out-String } finally { $VerbosePreference = $verbosePreferenceSave if (Test-Path -Path $verboseFile) { @@ -1754,7 +1754,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { # Download the entire file to reference in tests $referenceFile = Join-Path $TestDrive "reference.txt" $resumeUri = Get-WebListenerUrl -Test 'Resume' - Invoke-WebRequest -uri $resumeUri -OutFile $referenceFile -ErrorAction Stop + Invoke-WebRequest -Uri $resumeUri -OutFile $referenceFile -ErrorAction Stop $referenceFileHash = Get-FileHash -Algorithm SHA256 -Path $referenceFile $referenceFileSize = Get-Item $referenceFile | Select-Object -ExpandProperty Length } @@ -1769,7 +1769,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { } It "Invoke-WebRequest -Resume Downloads the whole file when the file does not exist" { - $response = Invoke-WebRequest -uri $resumeUri -OutFile $outFile -Resume -PassThru + $response = Invoke-WebRequest -Uri $resumeUri -OutFile $outFile -Resume -PassThru $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -1786,7 +1786,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { 1..$largerFileSize | ForEach-Object { [Byte]$_ } | Set-Content -AsByteStream $outFile $largerFileSize = Get-Item $outFile | Select-Object -ExpandProperty Length - $response = Invoke-WebRequest -uri $resumeUri -OutFile $outFile -Resume -PassThru + $response = Invoke-WebRequest -Uri $resumeUri -OutFile $outFile -Resume -PassThru $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -1824,10 +1824,10 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { param($bytes, $statuscode) # Simulate partial download $uri = Get-WebListenerUrl -Test 'Resume' -TestValue "Bytes/$bytes" - $null = Invoke-WebRequest -uri $uri -OutFile $outFile + $null = Invoke-WebRequest -Uri $uri -OutFile $outFile Get-Item $outFile | Select-Object -ExpandProperty Length | Should -Be $bytes - $response = Invoke-WebRequest -uri $resumeUri -OutFile $outFile -Resume -PassThru + $response = Invoke-WebRequest -Uri $resumeUri -OutFile $outFile -Resume -PassThru $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -1841,10 +1841,10 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { It "Invoke-WebRequest -Resume assumes the file was successfully completed when the local and remote file are the same size." { # Download the entire file $uri = Get-WebListenerUrl -Test 'Resume' -TestValue 'NoResume' - $null = Invoke-WebRequest -uri $uri -OutFile $outFile + $null = Invoke-WebRequest -Uri $uri -OutFile $outFile $fileSize = Get-Item $outFile | Select-Object -ExpandProperty Length - $response = Invoke-WebRequest -uri $resumeUri -OutFile $outFile -Resume -PassThru + $response = Invoke-WebRequest -Uri $resumeUri -OutFile $outFile -Resume -PassThru $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -1923,7 +1923,7 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" { [TimeSpan] $timeSpan = Measure-Command { $response = Invoke-WebRequest -Uri $dosUri $script:content = $response.content - $response.Images | out-null + $response.Images | Out-Null } $script:content | Should -Not -BeNullOrEmpty @@ -2653,7 +2653,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { It "Verifies Invoke-RestMethod Certificate Authentication Successful with -Certificate" { $uri = Get-WebListenerUrl -Https -Test 'Cert' $certificate = Get-WebListenerClientCertificate - $result = Invoke-RestMethod -uri $uri -Certificate $certificate -SkipCertificateCheck + $result = Invoke-RestMethod -Uri $uri -Certificate $certificate -SkipCertificateCheck $result.Status | Should -Be 'OK' $result.Thumbprint | Should -Be $certificate.Thumbprint @@ -3278,7 +3278,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { # Download the entire file to reference in tests $referenceFile = Join-Path $TestDrive "reference.txt" $resumeUri = Get-WebListenerUrl -Test 'Resume' - Invoke-RestMethod -uri $resumeUri -OutFile $referenceFile -ErrorAction Stop + Invoke-RestMethod -Uri $resumeUri -OutFile $referenceFile -ErrorAction Stop $referenceFileHash = Get-FileHash -Algorithm SHA256 -Path $referenceFile $referenceFileSize = Get-Item $referenceFile | Select-Object -ExpandProperty Length } @@ -3296,7 +3296,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { # ensure the file does not exist Remove-Item -Force -ErrorAction 'SilentlyContinue' -Path $outFile - Invoke-RestMethod -uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume + Invoke-RestMethod -Uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -3312,7 +3312,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { 1..$largerFileSize | ForEach-Object { [Byte]$_ } | Set-Content -AsByteStream $outFile $largerFileSize = Get-Item $outFile | Select-Object -ExpandProperty Length - $response = Invoke-RestMethod -uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume + $response = Invoke-RestMethod -Uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -3329,7 +3329,7 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { $largerFileSize = Get-Item $outFile | Select-Object -ExpandProperty Length $uri = Get-WebListenerUrl -Test 'Resume' -TestValue 'NoResume' - $response = Invoke-RestMethod -uri $uri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume + $response = Invoke-RestMethod -Uri $uri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -3349,10 +3349,10 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { param($bytes) # Simulate partial download $uri = Get-WebListenerUrl -Test 'Resume' -TestValue "Bytes/$bytes" - $null = Invoke-RestMethod -uri $uri -OutFile $outFile + $null = Invoke-RestMethod -Uri $uri -OutFile $outFile Get-Item $outFile | Select-Object -ExpandProperty Length | Should -Be $bytes - $response = Invoke-RestMethod -uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume + $response = Invoke-RestMethod -Uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash @@ -3365,10 +3365,10 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" { It "Invoke-RestMethod -Resume assumes the file was successfully completed when the local and remote file are the same size." { # Download the entire file $uri = Get-WebListenerUrl -Test 'Resume' -TestValue 'NoResume' - $null = Invoke-RestMethod -uri $uri -OutFile $outFile + $null = Invoke-RestMethod -Uri $uri -OutFile $outFile $fileSize = Get-Item $outFile | Select-Object -ExpandProperty Length - $response = Invoke-RestMethod -uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume + $response = Invoke-RestMethod -Uri $resumeUri -OutFile $outFile -ResponseHeadersVariable 'Headers' -Resume $outFileHash = Get-FileHash -Algorithm SHA256 -Path $outFile $outFileHash.Hash | Should -BeExactly $referenceFileHash.Hash 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 4b15ed67c95..ce52a59285a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Error.Tests.ps1 @@ -69,7 +69,7 @@ Describe "Write-Error Tests" -Tags "CI" { } It "Should be works with all parameters" { - $e = write-error -Activity fooAct -Reason fooReason -TargetName fooTargetName -TargetType fooTargetType -Message fooMessage 2>&1 + $e = Write-Error -Activity fooAct -Reason fooReason -TargetName fooTargetName -TargetType fooTargetType -Message fooMessage 2>&1 $e.CategoryInfo.Activity | Should -Be 'fooAct' $e.CategoryInfo.Reason | Should -Be 'fooReason' $e.CategoryInfo.TargetName | Should -Be 'fooTargetName' @@ -91,7 +91,7 @@ Describe "Write-Error Tests" -Tags "CI" { It "Should output the error message to the `$error automatic variable" { $theError = "Error: Too many input values." - write-error -message $theError -category InvalidArgument -ErrorAction SilentlyContinue + Write-Error -Message $theError -Category InvalidArgument -ErrorAction SilentlyContinue [string]$error[0] | Should -Be $theError } 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 baa7e1c1c52..f346b61f079 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Write-Progress.Tests.ps1 @@ -6,20 +6,20 @@ Describe "Write-Progress DRT Unit Tests" -Tags "CI" { } It "Should be able to throw exception when running Write-Progress with bad percentage" { - { write-progress -activity 'myactivity' -status 'mystatus' -percent 101 } | + { Write-Progress -Activity 'myactivity' -Status 'mystatus' -percent 101 } | Should -Throw -ErrorId 'ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand' } It "Should be able to throw exception when running Write-Progress with bad parent id " { - { write-progress -activity 'myactivity' -status 'mystatus' -id 1 -parentid -2 } | + { Write-Progress -Activity 'myactivity' -Status 'mystatus' -Id 1 -ParentId -2 } | Should -Throw -ErrorId 'ParameterArgumentValidationError,Microsoft.PowerShell.Commands.WriteProgressCommand' } It "all mandatory params works" -Pending { - { write-progress -activity 'myactivity' -status 'mystatus' } | Should -Not -Throw + { Write-Progress -Activity 'myactivity' -Status 'mystatus' } | Should -Not -Throw } It "all params works" -Pending { - { write-progress -activity 'myactivity' -status 'mystatus' -id 1 -parentId 2 -completed:$false -current 'current' -sec 1 -percent 1 } | Should -Not -Throw + { Write-Progress -Activity 'myactivity' -Status 'mystatus' -Id 1 -ParentId 2 -Completed:$false -current 'current' -sec 1 -percent 1 } | 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 e640b93c324..7c61b448469 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/XMLCommand.Tests.ps1 @@ -32,7 +32,7 @@ Describe "XmlCommand DRT basic functionality Tests" -Tags "CI" { } AfterEach { - remove-item $testfile -Force -ErrorAction SilentlyContinue + Remove-Item $testfile -Force -ErrorAction SilentlyContinue } It "Import with CliXml directive should work" { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 index 05ea1ca27d1..45344ec2917 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 @@ -23,5 +23,5 @@ $a = $Day.d0, $Day.d1, $Day.d2, $Day.d3, $Day.d4, $Day.d5, $Day.d6 # Index into $a to get the name of the day. # Use string formatting to build a sentence. - "{0} {1}" -f $Day.messageDate, $a[(get-date -uformat %u)] | Out-Host + "{0} {1}" -f $Day.messageDate, $a[(Get-Date -UFormat %u)] | Out-Host diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 index 2d7439a1796..46b04594f99 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1 @@ -6,7 +6,7 @@ Describe "CliXml test" -Tags "CI" { $testFilePath = Join-Path "testdrive:\" "testCliXml" $subFilePath = Join-Path $testFilePath ".test" - if(test-path $testFilePath) + if(Test-Path $testFilePath) { Remove-Item $testFilePath -Force -Recurse } @@ -207,7 +207,7 @@ Describe "Deserializing corrupted Cim classes should not instantiate non-Cim typ } } - It "Verifies that importing the corrupted Cim class does not launch calc.exe" -skip:$skipNotWindows { + It "Verifies that importing the corrupted Cim class does not launch calc.exe" -Skip:$skipNotWindows { Import-Clixml -Path (Join-Path $PSScriptRoot "assets\CorruptedCim.clixml") diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 index 1ada3a7c020..300eb840c72 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/command.tests.ps1 @@ -4,28 +4,28 @@ Describe "Trace-Command" -tags "Feature" { Context "Listener options" { BeforeAll { - $logFile = setup -f traceCommandLog.txt -pass - $actualLogFile = setup -f actualTraceCommandLog.txt -pass + $logFile = Setup -f traceCommandLog.txt -pass + $actualLogFile = Setup -f actualTraceCommandLog.txt -pass } AfterEach { - if ( test-path $logfile ) { Remove-Item $logFile } - if ( test-path $actualLogFile ) { Remove-Item $actualLogFile } + if ( Test-Path $logfile ) { Remove-Item $logFile } + if ( Test-Path $actualLogFile ) { Remove-Item $actualLogFile } } - It "LogicalOperationStack works" -pending:($IsCoreCLR) { + It "LogicalOperationStack works" -Pending:($IsCoreCLR) { $keyword = "Trace_Command_ListenerOption_LogicalOperationStack_Foo" $stack = [System.Diagnostics.Trace]::CorrelationManager.LogicalOperationStack $stack.Push($keyword) - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption LogicalOperationStack -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption LogicalOperationStack -FilePath $logfile $log = Get-Content $logfile | Where-Object {$_ -like "*LogicalOperationStack=$keyword*"} $log.Count | Should -BeGreaterThan 0 } - It "Callstack works" -pending:($IsCoreCLR) { - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption Callstack -FilePath $logfile + It "Callstack works" -Pending:($IsCoreCLR) { + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption Callstack -FilePath $logfile $log = Get-Content $logfile | Where-Object {$_ -like "*Callstack= * System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)*"} $log.Count | Should -BeGreaterThan 0 } @@ -49,14 +49,14 @@ Describe "Trace-Command" -tags "Feature" { } It "None options has no effect" { - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption None -FilePath $actualLogfile - Trace-Command -name * -Expression {write-output Foo} -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption None -FilePath $actualLogfile + Trace-Command -Name * -Expression {Write-Output Foo} -FilePath $logfile Compare-Object (Get-Content $actualLogfile) (Get-Content $logfile) | Should -BeNullOrEmpty } It "ThreadID works" { - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption ThreadId -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption ThreadId -FilePath $logfile $log = Get-Content $logfile | Where-Object {$_ -like "*ThreadID=*"} $results = $log | ForEach-Object {$_.Split("=")[1]} @@ -64,7 +64,7 @@ Describe "Trace-Command" -tags "Feature" { } It "Timestamp creates logs in ascending order" { - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption Timestamp -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption Timestamp -FilePath $logfile $log = Get-Content $logfile | Where-Object {$_ -like "*Timestamp=*"} $results = $log | ForEach-Object {$_.Split("=")[1]} $sortedResults = $results | Sort-Object @@ -72,7 +72,7 @@ Describe "Trace-Command" -tags "Feature" { } It "ProcessId logs current process Id" { - Trace-Command -Name * -Expression {write-output Foo} -ListenerOption ProcessId -FilePath $logfile + Trace-Command -Name * -Expression {Write-Output Foo} -ListenerOption ProcessId -FilePath $logfile $log = Get-Content $logfile | Where-Object {$_ -like "*ProcessID=*"} $results = $log | ForEach-Object {$_.Split("=")[1]} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 index 4df2ebf3e9b..520631ccedf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/object.tests.ps1 @@ -35,13 +35,13 @@ Describe "Object cmdlets" -Tags "CI" { $firstValue = "9995788.71" $expectedFirstValue = $null $null = [System.Management.Automation.LanguagePrimitives]::TryConvertTo($firstValue, [double], [cultureinfo]::InvariantCulture, [ref] $expectedFirstValue) - $firstObject = new-object psobject + $firstObject = New-Object psobject $firstObject | Add-Member -NotePropertyName Header -NotePropertyValue $firstValue $secondValue = "15847577.7" $expectedSecondValue = $null $null = [System.Management.Automation.LanguagePrimitives]::TryConvertTo($secondValue, [double], [cultureinfo]::InvariantCulture, [ref] $expectedSecondValue) - $secondObject = new-object psobject + $secondObject = New-Object psobject $secondObject | Add-Member -NotePropertyName Header -NotePropertyValue $secondValue $testCases = @( @@ -85,17 +85,17 @@ Describe "Object cmdlets" -Tags "CI" { } It 'returns a GenericMeasureInfoObject' { - $gmi = 1,2,3 | measure-object -max -min + $gmi = 1,2,3 | Measure-Object -max -min $gmi | Should -BeOfType Microsoft.PowerShell.Commands.GenericMeasureInfo } It 'should return correct error for non-numeric input' { - $gmi = "abc",[Datetime]::Now | Measure-Object -sum -max -ErrorVariable err -ErrorAction silentlycontinue + $gmi = "abc",[Datetime]::Now | Measure-Object -Sum -max -ErrorVariable err -ErrorAction silentlycontinue $err | ForEach-Object { $_.FullyQualifiedErrorId | Should -Be 'NonNumericInputObject,Microsoft.PowerShell.Commands.MeasureObjectCommand' } } It 'should have the correct count' { - $gmi = "abc",[Datetime]::Now | Measure-Object -sum -max -ErrorVariable err -ErrorAction silentlycontinue + $gmi = "abc",[Datetime]::Now | Measure-Object -Sum -max -ErrorVariable err -ErrorAction silentlycontinue $gmi.Count | Should -Be 2 } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 index 2e27f285dd5..984e9d2cf4a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/string.tests.ps1 @@ -33,37 +33,37 @@ Describe "String cmdlets" -Tags "CI" { } It "Select-String does not throw on subdirectory (path without wildcard)" { - { select-string -Path $pathWithoutWildcard "noExists" -ErrorAction Stop } | Should -Not -Throw + { Select-String -Path $pathWithoutWildcard "noExists" -ErrorAction Stop } | Should -Not -Throw } It "Select-String does not throw on subdirectory (path with wildcard)" { - { select-string -Path $pathWithWildcard "noExists" -ErrorAction Stop } | Should -Not -Throw + { Select-String -Path $pathWithWildcard "noExists" -ErrorAction Stop } | Should -Not -Throw } It "LiteralPath with relative path" { - (select-string -LiteralPath (Get-Item -LiteralPath $fileName).Name "b").count | Should -Be 2 + (Select-String -LiteralPath (Get-Item -LiteralPath $fileName).Name "b").count | Should -Be 2 } It "LiteralPath with absolute path" { - (select-string -LiteralPath $fileName "b").count | Should -Be 2 + (Select-String -LiteralPath $fileName "b").count | Should -Be 2 } It "LiteralPath with dots in path" { - (select-string -LiteralPath $fileNameWithDots "b").count | Should -Be 2 + (Select-String -LiteralPath $fileNameWithDots "b").count | Should -Be 2 } - It "Network path" -skip:(!$IsWindows) { - (select-string -LiteralPath $fileNameAsNetworkPath "b").count | Should -Be 2 + It "Network path" -Skip:(!$IsWindows) { + (Select-String -LiteralPath $fileNameAsNetworkPath "b").count | Should -Be 2 } It "throws error for non filesystem providers" { $aaa = "aaaaaaaaaa" - select-string -literalPath variable:\aaa "a" -ErrorAction SilentlyContinue -ErrorVariable selectStringError + Select-String -LiteralPath variable:\aaa "a" -ErrorAction SilentlyContinue -ErrorVariable selectStringError $selectStringError.FullyQualifiedErrorId | Should -Be 'ProcessingFile,Microsoft.PowerShell.Commands.SelectStringCommand' } It "throws parameter binding exception for invalid context" { - { select-string It $PSScriptRoot -Context -1,-1 } | Should -Throw Context + { Select-String It $PSScriptRoot -Context -1,-1 } | Should -Throw Context } It "match object supports RelativePath method" { 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 0bd17c50611..d350c44d80c 100644 --- a/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.Powershell.Host/Start-Transcript.Tests.ps1 @@ -47,7 +47,7 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { } ## function ends here - $transcriptFilePath = join-path $TestDrive "transcriptdata.txt" + $transcriptFilePath = Join-Path $TestDrive "transcriptdata.txt" Remove-Item $transcriptFilePath -Force -ErrorAction SilentlyContinue } @@ -83,7 +83,7 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { } It "Should create Transcript file with 'OutputDirectory' parameter" { $script = "Start-Transcript -OutputDirectory $TestDrive" - $outputFilePath = join-path $TestDrive "PowerShell_transcript*" + $outputFilePath = Join-Path $TestDrive "PowerShell_transcript*" ValidateTranscription -scriptToExecute $script -outputFilePath $outputFilePath } It "Should Append Transcript data in existing file if 'Append' parameter is used with Path parameter" { @@ -102,7 +102,7 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" { } It "Should return an error if file path is invalid" { $fileName = (Get-Random).ToString() - $inputPath = join-path $TestDrive $fileName + $inputPath = Join-Path $TestDrive $fileName $null = New-Item -Path $inputPath -ItemType File -Force -ErrorAction SilentlyContinue $script = "Start-Transcript -OutputDirectory $inputPath" $expectedError = "CannotStartTranscription,Microsoft.PowerShell.Commands.StartTranscriptCommand" diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 index 596154cba5a..01620ee9eeb 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/MOF-Compilation.Tests.ps1 @@ -22,8 +22,8 @@ Describe "DSC MOF Compilation" -tags "CI" { Copy-Item $testResourceSchemaPath $baseSchemaPath -Recurse -Force $_modulePath = $env:PSModulePath - $powershellexe = (get-process -pid $PID).MainModule.FileName - $env:PSModulePath = join-path ([io.path]::GetDirectoryName($powershellexe)) Modules + $powershellexe = (Get-Process -pid $PID).MainModule.FileName + $env:PSModulePath = Join-Path ([io.path]::GetDirectoryName($powershellexe)) Modules } It "Should be able to compile a MOF from a basic configuration" -Skip:($IsMacOS -or $IsWindows -or $SkipAdditionalPlatforms) { diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 index 11f2413da05..c2fc8cf1e55 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/PSDesiredStateConfiguration.Tests.ps1 @@ -118,7 +118,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $Global:ProgressPreference = $origProgress } - it "should be able to get - " -TestCases $testCases { + It "should be able to get - " -TestCases $testCases { param($Name) if ($IsWindows) { @@ -141,7 +141,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } - it "should be able to get from - " -TestCases $testCases { + It "should be able to get from - " -TestCases $testCases { param($Name, $ModuleName, $PendingBecause) if ($IsLinux) { @@ -218,7 +218,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $Global:ProgressPreference = $origProgress } - it "should be able to get - " -TestCases $testCases { + It "should be able to get - " -TestCases $testCases { param($Name) if ($IsWindows) { @@ -247,7 +247,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } } - it "should be able to get from - " -TestCases $testCases { + It "should be able to get from - " -TestCases $testCases { param($Name, $ModuleName, $PendingBecause) if ($IsLinux) { @@ -271,7 +271,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } } - it "should throw when resource is not found" { + It "should throw when resource is not found" { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/17" { Get-DscResource -Name antoehusatnoheusntahoesnuthao -Module tanshoeusnthaosnetuhasntoheusnathoseun @@ -308,7 +308,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $global:ProgressPreference = $origProgress } - it "should be able to get class resource - from - " -TestCases $classTestCases { + It "should be able to get class resource - from - " -TestCases $classTestCases { param($Name, $ModuleName, $PendingBecause) if ($MissingLibmi) { @@ -330,7 +330,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } } - it "should be able to get class resource - - " -TestCases $classTestCases { + It "should be able to get class resource - - " -TestCases $classTestCases { param($Name, $ModuleName, $PendingBecause) if ($IsWindows) { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/19" @@ -397,7 +397,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $psGetModuleSpecification = @{ModuleName = $module.Name; ModuleVersion = $module.Version.ToString() } } - it "Set method should work" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Set method should work" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($MissingLibmi) { Set-ItResult -Pending -Because "Libmi not available for this platform" } @@ -414,10 +414,10 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } $result.RebootRequired | Should -BeFalse - $module = Get-module PsDscResources -ListAvailable + $module = Get-Module PsDscResources -ListAvailable $module | Should -Not -BeNullOrEmpty -Because "Resource should have installed module" } - it 'Set method should return RebootRequired= when $global:DSCMachineStatus = ' -Skip:(!(Test-IsInvokeDscResourceEnable)) -TestCases $dscMachineStatusCases { + It 'Set method should return RebootRequired= when $global:DSCMachineStatus = ' -Skip:(!(Test-IsInvokeDscResourceEnable)) -TestCases $dscMachineStatusCases { param( $value, $ExpectedResult @@ -434,7 +434,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $result.RebootRequired | Should -BeExactly $expectedResult } - it "Test method should return false" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Test method should return false" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($MissingLibmi) { Set-ItResult -Pending -Because "Libmi not available for this platform" } @@ -444,7 +444,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $result.InDesiredState | Should -BeFalse -Because "Test method return false" } - it "Test method should return true" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Test method should return true" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($MissingLibmi) { Set-ItResult -Pending -Because "Libmi not available for this platform" } @@ -453,18 +453,18 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $result | Should -BeTrue -Because "Test method return true" } - it "Test method should return true with moduleSpecification" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Test method should return true with moduleSpecification" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($MissingLibmi) { Set-ItResult -Pending -Because "Libmi not available for this platform" } - $module = get-module PsDscResources -ListAvailable + $module = Get-Module PsDscResources -ListAvailable $moduleSpecification = @{ModuleName = $module.Name; ModuleVersion = $module.Version.ToString() } $result = Invoke-DscResource -Name Script -ModuleName $moduleSpecification -Method Test -Property @{TestScript = { Write-Verbose 'test'; return $true }; GetScript = { return @{ } }; SetScript = { return } } $result | Should -BeTrue -Because "Test method return true" } - it "Invalid moduleSpecification" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Invalid moduleSpecification" -Skip:(!(Test-IsInvokeDscResourceEnable)) { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/17" $moduleSpecification = @{ModuleName = 'PsDscResources'; ModuleVersion = '99.99.99.993' } { @@ -473,7 +473,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { Should -Throw -ErrorId 'InvalidResourceSpecification,Invoke-DscResource' -ExpectedMessage 'Invalid Resource Name ''Script'' or module specification.' } - it "Resource with embedded resource not supported and a warning should be produced" { + It "Resource with embedded resource not supported and a warning should be produced" { Set-ItResult -Pending -Because "Test is unreliable in release automation." @@ -496,7 +496,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $warnings[0] | Should -Match 'embedded resources.*not support' } - it "Using PsDscRunAsCredential should say not supported" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Using PsDscRunAsCredential should say not supported" -Skip:(!(Test-IsInvokeDscResourceEnable)) { { Invoke-DscResource -Name Script -ModuleName PSDscResources -Method Set -Property @{TestScript = { Write-Output 'test'; return $false }; GetScript = { return @{ } }; SetScript = {return}; PsDscRunAsCredential='natoheu'} -ErrorAction Stop } | @@ -504,7 +504,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { } # waiting on Get-DscResource to be fixed - it "Invalid module name" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Invalid module name" -Skip:(!(Test-IsInvokeDscResourceEnable)) { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/17" { Invoke-DscResource -Name Script -ModuleName santoheusnaasonteuhsantoheu -Method Test -Property @{TestScript = { Write-Host 'test'; return $true }; GetScript = { return @{ } }; SetScript = { return } } -ErrorAction Stop @@ -512,7 +512,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { Should -Throw -ErrorId 'Microsoft.PowerShell.Commands.WriteErrorException,CheckResourceFound' } - it "Invalid resource name" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Invalid resource name" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($IsWindows) { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/17" } @@ -527,7 +527,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { Should -Throw -ErrorId 'Microsoft.PowerShell.Commands.WriteErrorException,CheckResourceFound' } - it "Get method should work" -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It "Get method should work" -Skip:(!(Test-IsInvokeDscResourceEnable)) { if ($IsLinux) { Set-ItResult -Pending -Because "https://github.com/PowerShell/PSDesiredStateConfiguration/issues/12 and https://github.com/PowerShell/PowerShellGet/pull/529" } @@ -568,7 +568,7 @@ Describe "Test PSDesiredStateConfiguration" -tags CI { $resolvedXmlPath = (Resolve-Path -Path $testXmlPath).ProviderPath } - it 'Set method should work' -Skip:(!(Test-IsInvokeDscResourceEnable)) { + It 'Set method should work' -Skip:(!(Test-IsInvokeDscResourceEnable)) { param( $value, $ExpectedResult diff --git a/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 b/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 index c0133a013a1..7b621578e4d 100644 --- a/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 +++ b/test/powershell/Modules/PSDesiredStateConfiguration/configuration.Tests.ps1 @@ -16,7 +16,7 @@ Describe "DSC MOF Compilation" -tags "CI" { Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShellGet/pull/529" } - Write-Verbose "DSC_HOME: ${env:DSC_HOME}" -verbose + Write-Verbose "DSC_HOME: ${env:DSC_HOME}" -Verbose [Scriptblock]::Create(@" configuration DSCTestConfig { diff --git a/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 b/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 index dc8e491d506..64fa8ba269f 100644 --- a/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 +++ b/test/powershell/Modules/PSDiagnostics/PSDiagnostics.Tests.ps1 @@ -20,7 +20,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { } Context "Test for Enable-PSTrace and Disable-PSTrace cmdlets." { - it "Should enable $LogType logs for Microsoft-Windows-PowerShell." { + It "Should enable $LogType logs for Microsoft-Windows-PowerShell." { [XML]$CurrentSetting = & wevtutil gl Microsoft-Windows-PowerShell/$LogType /f:xml if($CurrentSetting.Channel.Enabled -eq 'true'){ & wevtutil sl Microsoft-Windows-PowerShell/$LogType /e:false /q @@ -33,7 +33,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { $ExpectedOutput.Channel.enabled | Should -BeExactly 'true' } - it "Should disable $LogType logs for Microsoft-Windows-PowerShell." { + It "Should disable $LogType logs for Microsoft-Windows-PowerShell." { [XML]$CurrentState = & wevtutil gl Microsoft-Windows-PowerShell/$LogType /f:xml if($CurrentState.channel.enabled -eq 'false'){ & wevtutil sl Microsoft-Windows-PowerShell/$LogType /e:true /q @@ -47,7 +47,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { } Context "Test for Get-LogProperties cmdlet." { - it "Should return properties of $LogType logs for 'Microsoft-Windows-PowerShell'." { + It "Should return properties of $LogType logs for 'Microsoft-Windows-PowerShell'." { [XML]$ExpectedOutput = wevtutil gl Microsoft-Windows-PowerShell/$LogType /f:xml $LogProperty = Get-LogProperties -Name Microsoft-Windows-PowerShell/$LogType @@ -78,7 +78,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { } } - it "Should invert AutoBackup setting of $LogType logs for 'Microsoft-Windows-PowerShell'." { + It "Should invert AutoBackup setting of $LogType logs for 'Microsoft-Windows-PowerShell'." { $LogPropertyToSet.AutoBackup = -not $LogPropertyToSet.AutoBackup Set-LogProperties -LogDetails $LogPropertyToSet -Force @@ -86,7 +86,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" { (Get-LogProperties -Name Microsoft-Windows-PowerShell/$LogType).AutoBackup | Should -Be ([bool]::Parse($ExpectedOutput.Channel.Logging.AutoBackup)) } - it "Should throw exception for invalid LogName." { + It "Should throw exception for invalid LogName." { {Set-LogProperties -LogDetails 'Foo' -Force } | Should -Throw -ErrorId 'ParameterArgumentTransformationError' } } diff --git a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 index 022e7a69574..14880823fcf 100644 --- a/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 +++ b/test/powershell/Modules/PSReadLine/PSReadLine.Tests.ps1 @@ -22,39 +22,39 @@ Describe "PSReadLine" -tags "CI" { $module.Path | Should -Be (Join-Path -Path $PSHOME -ChildPath "Modules/PSReadLine/PSReadLine.psd1") } - It "Should use Emacs Bindings on Linux and macOS" -skip:$IsWindows { + It "Should use Emacs Bindings on Linux and macOS" -Skip:$IsWindows { (Get-PSReadLineOption).EditMode | Should -BeExactly 'Emacs' - (Get-PSReadlineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'BeginningOfLine' + (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'BeginningOfLine' } - It "Should use Windows Bindings on Windows" -skip:(-not $IsWindows) { + It "Should use Windows Bindings on Windows" -Skip:(-not $IsWindows) { (Get-PSReadLineOption).EditMode | Should -BeExactly 'Windows' - (Get-PSReadlineKeyHandler | Where-Object { $_.Key -eq "Ctrl+a" }).Function | Should -BeExactly 'SelectAll' + (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Ctrl+a" }).Function | Should -BeExactly 'SelectAll' } It "Should set the edit mode" { - Set-PSReadlineOption -EditMode Windows - (Get-PSReadlineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'SelectAll' + Set-PSReadLineOption -EditMode Windows + (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'SelectAll' - Set-PSReadlineOption -EditMode Emacs - (Get-PSReadlineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'BeginningOfLine' + Set-PSReadLineOption -EditMode Emacs + (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Ctrl+A" }).Function | Should -BeExactly 'BeginningOfLine' } It "Should allow custom bindings for plain keys" { - Set-PSReadlineKeyHandler -Key '"' -Function SelfInsert + Set-PSReadLineKeyHandler -Key '"' -Function SelfInsert (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq '"' }).Function | Should -BeExactly 'SelfInsert' } It "Should report Capitalized bindings correctly" { - Set-PSReadlineOption -EditMode Emacs + Set-PSReadLineOption -EditMode Emacs (Get-PSReadLineKeyHandler | Where-Object { $_.Key -ceq "Alt+b" }).Function | Should -BeExactly 'BackwardWord' (Get-PSReadLineKeyHandler | Where-Object { $_.Key -ceq "Alt+B" }).Function | Should -BeExactly 'SelectBackwardWord' } It "Should ignore case when using Function binding" { $lowerCaseFunctionName = "yank" - Set-PSReadlineKeyHandler "Ctrl+F24" -Function $lowerCaseFunctionName - (Get-PSReadlineKeyHandler | Where-Object { $_.Key -eq "Ctrl+F24"}).Function | Should -BeExactly "Yank" + Set-PSReadLineKeyHandler "Ctrl+F24" -Function $lowerCaseFunctionName + (Get-PSReadLineKeyHandler | Where-Object { $_.Key -eq "Ctrl+F24"}).Function | Should -BeExactly "Yank" } AfterAll { @@ -62,7 +62,7 @@ Describe "PSReadLine" -tags "CI" { if ($originalEditMode) { Import-Module PSReadLine - Set-PSReadlineOption -EditMode $originalEditMode + Set-PSReadLineOption -EditMode $originalEditMode } } } diff --git a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 index fb5f6941c81..ef0a1f17d5f 100644 --- a/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 +++ b/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1 @@ -19,7 +19,7 @@ $InternalSource = 'OneGetTestSource' Describe "PackageManagement Acceptance Test" -Tags "Feature" { BeforeAll{ - Register-PackageSource -Name Nugettest -provider NuGet -Location https://www.nuget.org/api/v2 -force + Register-PackageSource -Name Nugettest -provider NuGet -Location https://www.nuget.org/api/v2 -Force Register-PackageSource -Name $InternalSource -Location $InternalGallery -ProviderName 'PowerShellGet' -Trusted -ErrorAction SilentlyContinue $SavedProgressPreference = $ProgressPreference $ProgressPreference = "SilentlyContinue" @@ -37,37 +37,37 @@ Describe "PackageManagement Acceptance Test" -Tags "Feature" { } It "find-packageprovider PowerShellGet" { - $fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name + $fpp = (Find-PackageProvider -Name "PowerShellGet" -Force).name $fpp | Should -Contain "PowerShellGet" } It "install-packageprovider, Expect succeed" { - $ipp = (install-PackageProvider -name gistprovider -force -source $InternalSource -Scope CurrentUser).name + $ipp = (Install-PackageProvider -Name gistprovider -Force -Source $InternalSource -Scope CurrentUser).name $ipp | Should -Contain "gistprovider" } - it "Find-package" { - $f = Find-Package -ProviderName NuGet -Name jquery -source Nugettest + It "Find-package" { + $f = Find-Package -ProviderName NuGet -Name jquery -Source Nugettest $f.Name | Should -Contain "jquery" } - it "Install-package" { - $i = install-Package -ProviderName NuGet -Name jquery -force -source Nugettest -Scope CurrentUser + It "Install-package" { + $i = Install-Package -ProviderName NuGet -Name jquery -Force -Source Nugettest -Scope CurrentUser $i.Name | Should -Contain "jquery" } - it "Get-package" { + It "Get-package" { $g = Get-Package -ProviderName NuGet -Name jquery $g.Name | Should -Contain "jquery" } - it "save-package" { - $s = save-Package -ProviderName NuGet -Name jquery -path $TestDrive -force -source Nugettest + It "save-package" { + $s = Save-Package -ProviderName NuGet -Name jquery -Path $TestDrive -Force -Source Nugettest $s.Name | Should -Contain "jquery" } - it "uninstall-package" { - $u = uninstall-Package -ProviderName NuGet -Name jquery + It "uninstall-package" { + $u = Uninstall-Package -ProviderName NuGet -Name jquery $u.Name | Should -Contain "jquery" } } diff --git a/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 b/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 index 08fbb3f2d72..e191162614f 100644 --- a/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 +++ b/test/powershell/Modules/ThreadJob/ThreadJob.Tests.ps1 @@ -79,7 +79,7 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { } AfterEach { - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Remove-Job -Force + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Remove-Job -Force } It 'ThreadJob with ScriptBlock' { @@ -241,7 +241,7 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { try { # Start four thread jobs with ThrottleLimit set to two - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Remove-Job -Force + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Remove-Job -Force $job1 = Start-ThreadJob -ScriptBlock { Start-Sleep -Seconds 60 } -ThrottleLimit 2 $job2 = Start-ThreadJob -ScriptBlock { Start-Sleep -Seconds 60 } $job3 = Start-ThreadJob -ScriptBlock { Start-Sleep -Seconds 60 } @@ -255,10 +255,10 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { } finally { - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Remove-Job -Force + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Remove-Job -Force } - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Should -HaveCount 0 + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Should -HaveCount 0 } It 'ThreadJob Runspaces should be cleaned up at completion' { @@ -332,7 +332,7 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { It 'ThreadJob jobs should work with Receive-Job -AutoRemoveJob' { - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Remove-Job -Force + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Remove-Job -Force $job1 = Start-ThreadJob -ScriptBlock { 1..2 | ForEach-Object { Start-Sleep -Milliseconds 100; "Output $_" } } -ThrottleLimit 5 $job2 = Start-ThreadJob -ScriptBlock { 1..2 | ForEach-Object { Start-Sleep -Milliseconds 100; "Output $_" } } @@ -341,7 +341,7 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { $null = $job1,$job2,$job3,$job4 | Receive-Job -Wait -AutoRemoveJob - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Should -HaveCount 0 + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Should -HaveCount 0 } It 'ThreadJob jobs should run in FullLanguage mode by default' { @@ -354,7 +354,7 @@ Describe 'Basic ThreadJob Tests' -Tags 'CI' { Describe 'Job2 class API tests' -Tags 'CI' { AfterEach { - Get-Job | Where-Object PSJobTypeName -eq "ThreadJob" | Remove-Job -Force + Get-Job | Where-Object PSJobTypeName -EQ "ThreadJob" | Remove-Job -Force } It 'Verifies StopJob API' { diff --git a/test/powershell/Provider/AutomountVHDDrive.ps1 b/test/powershell/Provider/AutomountVHDDrive.ps1 index 66d73a86305..2da2c7dea87 100644 --- a/test/powershell/Provider/AutomountVHDDrive.ps1 +++ b/test/powershell/Provider/AutomountVHDDrive.ps1 @@ -6,15 +6,15 @@ param([switch]$useModule, [string]$VHDPath) function CreateVHD ($VHDPath, $Size) { - $drive = (New-VHD -path $vhdpath -SizeBytes $size -Dynamic | ` + $drive = (New-VHD -Path $vhdpath -SizeBytes $size -Dynamic | ` Mount-VHD -Passthru | ` - get-disk -number {$_.DiskNumber} | ` + Get-Disk -Number {$_.DiskNumber} | ` Initialize-Disk -PartitionStyle MBR -PassThru | ` New-Partition -UseMaximumSize -AssignDriveLetter:$false -MbrType IFS | ` - Format-Volume -Confirm:$false -FileSystem NTFS -force | ` - get-partition | ` + Format-Volume -Confirm:$false -FileSystem NTFS -Force | ` + Get-Partition | ` Add-PartitionAccessPath -AssignDriveLetter -PassThru | ` - get-volume).DriveLetter + Get-Volume).DriveLetter $drive } diff --git a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 index b2ac82fc2c1..c8e62b44402 100644 --- a/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 +++ b/test/powershell/Provider/Pester.AutomountedDrives.Tests.ps1 @@ -25,7 +25,7 @@ Describe "Test suite for validating automounted PowerShell drives" -Tags @('Feat try { $tmpVhdPath = Join-Path $TestDrive 'TestVHD.vhd' - New-VHD -path $tmpVhdPath -SizeBytes 5mb -Dynamic -ErrorAction Stop + New-VHD -Path $tmpVhdPath -SizeBytes 5mb -Dynamic -ErrorAction Stop Remove-Item $tmpVhdPath $VHDToolsNotFound = (Get-Module Hyper-V).PrivateData.ImplicitRemoting -eq $true Remove-Module Hyper-V diff --git a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 index 4fd5cf73f2a..3cf9fdada03 100644 --- a/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 +++ b/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 @@ -2,7 +2,7 @@ # Licensed under the MIT License. Describe "ProviderIntrinsics Tests" -tags "CI" { BeforeAll { - setup -d TestDir + Setup -d TestDir } It 'If a childitem exists, HasChild method returns $true' { $ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE") | Should -BeTrue diff --git a/test/powershell/SDK/Breakpoint.Tests.ps1 b/test/powershell/SDK/Breakpoint.Tests.ps1 index 4ac31c2fdaf..3b50335f56c 100644 --- a/test/powershell/SDK/Breakpoint.Tests.ps1 +++ b/test/powershell/SDK/Breakpoint.Tests.ps1 @@ -5,7 +5,7 @@ Describe 'Breakpoint SDK Unit Tests' -Tags 'CI' { BeforeAll { # Start a job; this will create a runspace in which we can manage breakpoints - $job = Start-Job -ScriptBlock { + $job = Start-Job -Scriptblock { Set-PSBreakpoint -Command Start-Sleep 1..240 | ForEach-Object { Start-Sleep -Milliseconds 250 diff --git a/test/powershell/SDK/PSDebugging.Tests.ps1 b/test/powershell/SDK/PSDebugging.Tests.ps1 index e3b600adae4..b480b4bf64a 100644 --- a/test/powershell/SDK/PSDebugging.Tests.ps1 +++ b/test/powershell/SDK/PSDebugging.Tests.ps1 @@ -183,7 +183,7 @@ Describe "PowerShell Command Debugging" -tags "CI" { } # Scripting\Debugging\RunspaceDebuggingTests.cs -Describe "Runspace Debugging API tests" -tag CI { +Describe "Runspace Debugging API tests" -Tag CI { Context "PSStandaloneMonitorRunspaceInfo tests" { BeforeAll { $runspace = [runspacefactory]::CreateRunspace() @@ -204,7 +204,7 @@ Describe "Runspace Debugging API tests" -tag CI { Should -Throw -ErrorId 'PSArgumentNullException' } - it "PSStandaloneMonitorRunspaceInfo properties should have proper values" { + It "PSStandaloneMonitorRunspaceInfo properties should have proper values" { $monitorInfo.Runspace.InstanceId | Should -Be $InstanceId $monitorInfo.RunspaceType | Should -BeExactly "Standalone" $monitorInfo.NestedDebugger | Should -BeNullOrEmpty diff --git a/test/powershell/engine/Api/BasicEngine.Tests.ps1 b/test/powershell/engine/Api/BasicEngine.Tests.ps1 index 553fb1108af..2a367987f28 100644 --- a/test/powershell/engine/Api/BasicEngine.Tests.ps1 +++ b/test/powershell/engine/Api/BasicEngine.Tests.ps1 @@ -19,7 +19,7 @@ Describe 'Basic engine APIs' -Tags "CI" { { [powershell]::Create([runspace]$null) } | Should -Throw -ErrorId 'PSArgumentNullException' } - It "can load the default snapin 'Microsoft.WSMan.Management'" -skip:(-not $IsWindows) { + It "can load the default snapin 'Microsoft.WSMan.Management'" -Skip:(-not $IsWindows) { $ps = [powershell]::Create() $ps.AddScript("Get-Command -Name Test-WSMan") > $null diff --git a/test/powershell/engine/Api/Serialization.Tests.ps1 b/test/powershell/engine/Api/Serialization.Tests.ps1 index ac2761bbc06..6b011ffc6ab 100644 --- a/test/powershell/engine/Api/Serialization.Tests.ps1 +++ b/test/powershell/engine/Api/Serialization.Tests.ps1 @@ -37,7 +37,7 @@ Describe "Serialization Tests" -tags "CI" { } It 'Test DateTime stamps serialize and deserialize work as expected.' { - $objs = [System.DateTime]::MaxValue, [System.DateTime]::MinValue, [System.DateTime]::Today, (new-object System.DateTime), (new-object System.DateTime 123456789) + $objs = [System.DateTime]::MaxValue, [System.DateTime]::MinValue, [System.DateTime]::Today, (New-Object System.DateTime), (New-Object System.DateTime 123456789) foreach($inputObject in $objs) { SerializeAndDeserialize($inputObject) | Should -Be $inputObject @@ -49,7 +49,7 @@ Describe "Serialization Tests" -tags "CI" { $uristrings = "http://www.microsoft.com","http://www.microsoft.com:8000","http://www.microsoft.com/index.html","http://www.microsoft.com/default.asp","http://www.microsoft.com/Hello%20World.htm" foreach($uristring in $uristrings) { - $inputObject = new-object System.Uri $uristring + $inputObject = New-Object System.Uri $uristring SerializeAndDeserialize($inputObject) | Should -Be $inputObject } } @@ -86,7 +86,7 @@ Describe "Serialization Tests" -tags "CI" { It 'Test SecureString serialize and deserialize work as expected.' { #[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Demo/doc/test secret.")] - $inputObject = Convertto-Securestring -String "PowerShellRocks!" -AsPlainText -Force + $inputObject = ConvertTo-SecureString -String "PowerShellRocks!" -AsPlainText -Force SerializeAndDeserialize($inputObject).Length | Should -Be $inputObject.Length } diff --git a/test/powershell/engine/Api/TypeInference.Tests.ps1 b/test/powershell/engine/Api/TypeInference.Tests.ps1 index 47e6dae5fbe..9ce41f54e29 100644 --- a/test/powershell/engine/Api/TypeInference.Tests.ps1 +++ b/test/powershell/engine/Api/TypeInference.Tests.ps1 @@ -399,21 +399,21 @@ Describe "Type inference Tests" -tags "CI" { } It 'Infers typeof Foreach-Object -Member when Member is Property' { - $ast = {Get-Process | Foreach-Object -Member FileVersion}.Ast + $ast = {Get-Process | ForEach-Object -Member FileVersion}.Ast $typeNames = [AstTypeInference]::InferTypeof($ast, [TypeInferenceRuntimePermissions]::AllowSafeEval) $typeNames.Count | Should -Be 1 $typeNames[0] | Should -Be 'System.String' } It 'Infers typeof Foreach-Object -Member when member is ScriptProperty' { - $ast = {Get-Process | Foreach-Object -Member Description}.Ast + $ast = {Get-Process | ForEach-Object -Member Description}.Ast $typeNames = [AstTypeInference]::InferTypeof($ast, [TypeInferenceRuntimePermissions]::AllowSafeEval) $typeNames.Count | Should -Be 1 $typeNames[0] | Should -Be 'System.String' } It 'Infers typeof Foreach-Object -Member when Member is Alias' { - $ast = {Get-Process | Foreach-Object -Member Handles}.Ast + $ast = {Get-Process | ForEach-Object -Member Handles}.Ast $typeNames = [AstTypeInference]::InferTypeof($ast, [TypeInferenceRuntimePermissions]::AllowSafeEval) $typeNames.Count | Should -Be 1 $typeNames[0] | Should -Be 'System.Int32' @@ -433,7 +433,7 @@ Describe "Type inference Tests" -tags "CI" { Update-TypeData -TypeName InferScriptPropLevel1 -MemberName TheValue -MemberType ScriptProperty -Value { return $this.Value } -Force Update-TypeData -TypeName InferScriptPropLevel2 -MemberName XVal -MemberType ScriptProperty -Value {return $this.X } -Force try { - $ast = {[InferScriptPropLevel2]::new() | Foreach-Object -MemberName XVal | ForEach-Object -MemberName TheValue}.Ast + $ast = {[InferScriptPropLevel2]::new() | ForEach-Object -MemberName XVal | ForEach-Object -MemberName TheValue}.Ast $typeNames = [AstTypeInference]::InferTypeof($ast, [TypeInferenceRuntimePermissions]::AllowSafeEval) $typeNames.Count | Should -Be 1 $typeNames[0] | Should -Be 'System.String' @@ -525,43 +525,43 @@ Describe "Type inference Tests" -tags "CI" { } It "Infers typeof Group-Object Group" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object | Foreach-Object Group }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object | ForEach-Object Group }.Ast) $res.Count | Should -Be 3 ($res.Name | Sort-Object)[1,2] -join ', ' | Should -Be "System.IO.DirectoryInfo, System.IO.FileInfo" } It "Infers typeof Group-Object Values" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object | Foreach-Object Values }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object | ForEach-Object Values }.Ast) $res.Count | Should -Be 3 ($res.Name | Sort-Object)[1,2] -join ', ' | Should -Be "System.IO.DirectoryInfo, System.IO.FileInfo" } It "Infers typeof Group-Object Group with Property" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name | Foreach-Object Group }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name | ForEach-Object Group }.Ast) $res.Count | Should -Be 3 ($res.Name | Sort-Object)[1,2] -join ', ' | Should -Be "System.IO.DirectoryInfo, System.IO.FileInfo" } It "Infers typeof Group-Object Values with Property" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name | Foreach-Object Values }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name | ForEach-Object Values }.Ast) $res.Count | Should -Be 2 $res.Name -join ', ' | Should -Be "System.String, System.Collections.ArrayList" } It "Infers typeof Group-Object Group with NoElement" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name -NoElement | Foreach-Object Group }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name -NoElement | ForEach-Object Group }.Ast) $res.Count | Should -Be 1 $res.Name | Should -BeLike "*Collection*PSObject*" } It "Infers typeof Group-Object Values with Properties" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name,CreationTime | Foreach-Object Values }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property Name,CreationTime | ForEach-Object Values }.Ast) $res.Count | Should -Be 3 ($res.Name | Sort-Object) -join ', ' | Should -Be "System.Collections.ArrayList, System.DateTime, System.String" } It "ignores Group-Object Group with Scriptblock" { - $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property {$_.Name} | Foreach-Object Values }.Ast) + $res = [AstTypeInference]::InferTypeOf( { Get-ChildItem | Group-Object -Property {$_.Name} | ForEach-Object Values }.Ast) $res.Count | Should -Be 1 $res.Name | Should -Be "System.Collections.ArrayList" } @@ -841,7 +841,7 @@ Describe "Type inference Tests" -tags "CI" { class X { [int] $Length } - Update-TypeData -Typename X -MemberType AliasProperty -MemberName AliasLength -Value Length -Force + Update-TypeData -TypeName X -MemberType AliasProperty -MemberName AliasLength -Value Length -Force $res = [AstTypeInference]::InferTypeOf( { [x]::new().AliasLength }.Ast) @@ -991,7 +991,7 @@ Describe "Type inference Tests" -tags "CI" { BeforeAll { $errors = $null $tokens = $null - $p = Resolve-path TestDrive:/ + $p = Resolve-Path TestDrive:/ } It 'Infers type of command parameter' { $ast = [Language.Parser]::ParseInput("Get-ChildItem -Path $p/foo.txt", [ref] $tokens, [ref] $errors) @@ -1032,7 +1032,7 @@ Describe "Type inference Tests" -tags "CI" { } It 'Infers type of variable $_ in hashtable in command parameter' { - $variableAst = {1..10 | Format-table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) + $variableAst = {1..10 | Format-Table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) $res = [AstTypeInference]::InferTypeOf( $variableAst) $res.Count | Should -Be 1 @@ -1040,7 +1040,7 @@ Describe "Type inference Tests" -tags "CI" { } It 'Infers type of variable $_ in hashtable from Array' { - $variableAst = { [int[]]::new(10) | Format-table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) + $variableAst = { [int[]]::new(10) | Format-Table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) $res = [AstTypeInference]::InferTypeOf( $variableAst) $res.Count | Should -Be 1 @@ -1048,7 +1048,7 @@ Describe "Type inference Tests" -tags "CI" { } It 'Infers type of variable $_ in hashtable from generic IEnumerable ' { - $variableAst = { [System.Collections.Generic.List[int]]::new() | Format-table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) + $variableAst = { [System.Collections.Generic.List[int]]::new() | Format-Table @{n = 'x'; ex = {$_}}}.ast.Find( {param($a) $a -is [System.Management.Automation.Language.VariableExpressionAst]}, $true) $res = [AstTypeInference]::InferTypeOf( $variableAst) $res.Count | Should -Be 1 diff --git a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 index 58fd53ad8b8..628ee7bcab1 100644 --- a/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 +++ b/test/powershell/engine/Basic/CommandDiscovery.Tests.ps1 @@ -4,8 +4,8 @@ Describe "Command Discovery tests" -Tags "CI" { BeforeAll { - setup -f testscript.ps1 -content "'This script should not run. Running from testscript.ps1'" - setup -f testscripp.ps1 -content "'This script should not run. Running from testscripp.ps1'" + Setup -f testscript.ps1 -Content "'This script should not run. Running from testscript.ps1'" + Setup -f testscripp.ps1 -Content "'This script should not run. Running from testscripp.ps1'" $TestCasesCommandNotFound = @( @{command = 'CommandThatDoesnotExist' ; testName = 'Non-existent command'} @@ -30,7 +30,7 @@ Describe "Command Discovery tests" -Tags "CI" { New-Item -Path "$TestDrive\\TestFunctionA\TestFunctionA.psm1" -Value "function TestFunctionA {}" | Out-Null $env:PSModulePath = "$TestDrive" + [System.IO.Path]::PathSeparator + "$TestDrive" - (Get-command 'TestFunctionA').count | Should -Be 1 + (Get-Command 'TestFunctionA').count | Should -Be 1 } finally { @@ -83,7 +83,7 @@ Describe "Command Discovery tests" -Tags "CI" { } It "Get- is prepended to commands" { - (& 'location').Path | Should -Be (get-location).Path + (& 'location').Path | Should -Be (Get-Location).Path } Context "Use literal path first when executing scripts" { @@ -94,17 +94,17 @@ Describe "Command Discovery tests" -Tags "CI" { $firstResult = "executing $firstFileName in root" $secondResult = "executing $secondFileName in root" $thirdResult = "executing $thirdFileName in root" - setup -f $firstFileName -content "'$firstResult'" - setup -f $secondFileName -content "'$secondResult'" - setup -f $thirdFileName -content "'$thirdResult'" + Setup -f $firstFileName -Content "'$firstResult'" + Setup -f $secondFileName -Content "'$secondResult'" + Setup -f $thirdFileName -Content "'$thirdResult'" $subFolder = 'subFolder' $firstFileInSubFolder = Join-Path $subFolder -ChildPath $firstFileName $secondFileInSubFolder = Join-Path $subFolder -ChildPath $secondFileName $thirdFileInSubFolder = Join-Path $subFolder -ChildPath $thirdFileName - setup -f $firstFileInSubFolder -content "'$firstResult'" - setup -f $secondFileInSubFolder -content "'$secondResult'" - setup -f $thirdFileInSubFolder -content "'$thirdResult'" + Setup -f $firstFileInSubFolder -Content "'$firstResult'" + Setup -f $secondFileInSubFolder -Content "'$secondResult'" + Setup -f $thirdFileInSubFolder -Content "'$thirdResult'" $secondFileSearchInSubfolder = (Join-Path -Path $subFolder -ChildPath '[t1].ps1') @@ -176,9 +176,9 @@ Describe "Command Discovery tests" -Tags "CI" { $firstResult = '[first script]' $secondResult = 'alt script' $thirdResult = 'bad script' - setup -f '[test1].ps1' -content "'$firstResult'" - setup -f '1.ps1' -content "'$secondResult'" - setup -f '2.ps1' -content "'$thirdResult'" + Setup -f '[test1].ps1' -Content "'$firstResult'" + Setup -f '1.ps1' -Content "'$secondResult'" + Setup -f '2.ps1' -Content "'$thirdResult'" $gcmWithWildcardCases = @( @{command = '.\?[tb]est1?.ps1'; expectedCommand = '[test1].ps1'; expectedCommandCount =1; name = '''.\?[tb]est1?.ps1'''} @@ -223,7 +223,7 @@ Describe "Command Discovery tests" -Tags "CI" { (Get-Command -Name "ping" -CommandType Application).Name | Should -Match $expectedName } - It 'Can discover a native command with extension on Windows' -skip:(-not $IsWindows) { + It 'Can discover a native command with extension on Windows' -Skip:(-not $IsWindows) { (Get-Command -Name "ping.exe" -CommandType Application).Name | Should -Match "ping.exe" } } diff --git a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 index fefb4b15aca..93af196b22c 100644 --- a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 +++ b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 @@ -531,7 +531,7 @@ Describe "Verify approved aliases list" -Tags "CI" { $currentCmdletList = & $getCommands $moduleList } - $commandList = $commandString | ConvertFrom-CSV -Delimiter "," + $commandList = $commandString | ConvertFrom-Csv -Delimiter "," $aliasFullList = $commandList | Where-Object { $_.Present -eq "True" -and $_.CommandType -eq "Alias" } } diff --git a/test/powershell/engine/Basic/Encoding.Tests.ps1 b/test/powershell/engine/Basic/Encoding.Tests.ps1 index 583deb89799..2569f8619be 100644 --- a/test/powershell/engine/Basic/Encoding.Tests.ps1 +++ b/test/powershell/engine/Basic/Encoding.Tests.ps1 @@ -45,7 +45,7 @@ Describe "File encoding tests" -Tag CI { } } - It " produces correct content ''" -Testcases $simpleTestCases { + It " produces correct content ''" -TestCases $simpleTestCases { param ( $Command, $parameters, $Expected, $Operator) & $command @parameters $bytes = Get-FileBytes $outputFile diff --git a/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 b/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 index 8c63c65dcd9..44080453e90 100644 --- a/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 +++ b/test/powershell/engine/Basic/GroupPolicySettings.Tests.ps1 @@ -29,8 +29,8 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { } AfterEach { - Remove-item $KeyRoot -Recurse -Force > $null - Remove-item $WinPSKeyRoot -Recurse -Force > $null + Remove-Item $KeyRoot -Recurse -Force > $null + Remove-Item $WinPSKeyRoot -Recurse -Force > $null } It 'Execution policy test' { @@ -82,7 +82,7 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { (Get-Module $ModuleToLog).LogPipelineExecutionDetails = $false # turn off logging Remove-ItemProperty -Path $KeyPath -Name EnableModuleLogging -Force # turn off GP setting - Remove-item $ModuleNamesKeyPath -Recurse -Force + Remove-Item $ModuleNamesKeyPath -Recurse -Force # usually event becomes visible in the log after ~500 ms # set timeout for 5 seconds Wait-UntilTrue -sb { Get-WinEvent -FilterHashtable @{ ProviderName="PowerShellCore"; Id = 4103 } -MaxEvents 5 | ? {$_.Message.Contains($RareCommand)} } -TimeoutInMilliseconds (5*1000) -IntervalInMilliseconds 100 | Should -BeTrue @@ -143,14 +143,14 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { { param([string]$KeyPath) - $OutputDirectory = Join-path $([System.IO.Path]::GetTempPath()) $(Get-Random) + $OutputDirectory = Join-Path $([System.IO.Path]::GetTempPath()) $(Get-Random) $null = New-Item -Type Directory -Path $OutputDirectory -Force Set-ItemProperty -Path $KeyPath -Name EnableTranscripting -Value 1 -Force Set-ItemProperty -Path $KeyPath -Name OutputDirectory -Value $OutputDirectory -Force Set-ItemProperty -Path $KeyPath -Name EnableInvocationHeader -Value 1 -Force - $number = get-random + $number = Get-Random $null = & "$PSHOME/pwsh" -NoProfile -NonInteractive -c "$number" Remove-ItemProperty -Path $KeyPath -Name OutputDirectory -Force @@ -182,7 +182,7 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { { param([string]$KeyPath) - $HelpPath = Join-path 'TestDrive:\' $(Get-Random) + $HelpPath = Join-Path 'TestDrive:\' $(Get-Random) $null = New-Item -Type Directory -Path $HelpPath -ErrorAction SilentlyContinue $ModuleName = 'Microsoft.PowerShell.Utility' Save-Help -Module $ModuleName -DestinationPath $HelpPath -Force @@ -213,8 +213,8 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { TestFeature -KeyPath $WinKeyPath - Remove-item $HKLM_KeyRoot -Recurse -Force - Remove-item $HKLM_WinPSKeyRoot -Recurse -Force + Remove-Item $HKLM_KeyRoot -Recurse -Force + Remove-Item $HKLM_WinPSKeyRoot -Recurse -Force } It 'Session configuration policy test' { @@ -223,7 +223,7 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows { param([string]$KeyPath) # set policy to use unique non-existing configuration session name - $SessionName = "TestSessionConfiguration-$(get-random)" + $SessionName = "TestSessionConfiguration-$(Get-Random)" Set-ItemProperty -Path $KeyPath -Name EnableConsoleSessionConfiguration -Value 1 -Force Set-ItemProperty -Path $KeyPath -Name ConsoleSessionConfigurationName -Value $SessionName -Force diff --git a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 index 50e947e3f14..00762c052ae 100644 --- a/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 +++ b/test/powershell/engine/Cdxml/Cdxml.Tests.ps1 @@ -75,16 +75,16 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { # now load the cdxml module if ( Get-Module CimTest ) { - Remove-Module -force CimTest + Remove-Module -Force CimTest } - Import-Module -force ${script:ModuleDir} + Import-Module -Force ${script:ModuleDir} } AfterAll { if ( $skipNotWindows ) { return } - if ( get-module CimTest ) { + if ( Get-Module CimTest ) { Remove-Module CimTest -Force } $null = MofComp.exe $deleteMof @@ -108,7 +108,7 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { It "The CimTest module should have the proper cmdlets" @ItSkipOrPending { $result = Get-Command -Module CimTest $result.Count | Should -Be 4 - ($result.Name | sort-object ) -join "," | Should -Be "Get-CimTest,New-CimTest,Remove-CimTest,Set-CimTest" + ($result.Name | Sort-Object ) -join "," | Should -Be "Get-CimTest,New-CimTest,Remove-CimTest,Set-CimTest" } } @@ -116,7 +116,7 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { It "The Get-CimTest cmdlet should return 4 objects" @ItSkipOrPending { $result = Get-CimTest $result.Count | Should -Be 4 - ($result.id |sort-object) -join "," | Should -Be "1,2,3,4" + ($result.id |Sort-Object) -join "," | Should -Be "1,2,3,4" } It "The Get-CimTest cmdlet should retrieve an object via id" @ItSkipOrPending { @@ -126,9 +126,9 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { } It "The Get-CimTest cmdlet should retrieve an object by piped id" @ItSkipOrPending { - $result = 1,2,4 | foreach-object { [pscustomobject]@{ id = $_ } } | Get-CimTest + $result = 1,2,4 | ForEach-Object { [pscustomobject]@{ id = $_ } } | Get-CimTest @($result).Count | Should -Be 3 - ( $result.id | sort-object ) -join "," | Should -Be "1,2,4" + ( $result.id | Sort-Object ) -join "," | Should -Be "1,2,4" } It "The Get-CimTest cmdlet should retrieve an object by datetime" @ItSkipOrPending { @@ -148,20 +148,20 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { # wait up to 10 seconds, then the test will fail # we need to wait long enough, but not too long # the time can be adjusted - $null = Wait-Job -Job $job -timeout 10 + $null = Wait-Job -Job $job -Timeout 10 $result = $job | Receive-Job $result.Count | Should -Be 4 - ( $result.id | sort-object ) -join "," | Should -Be "1,2,3,4" + ( $result.id | Sort-Object ) -join "," | Should -Be "1,2,3,4" } finally { if ( $job ) { - $job | Remove-Job -force + $job | Remove-Job -Force } } } It "Should be possible to invoke a method on an object returned by Get-CimTest" @ItSkipOrPending { - $result = Get-CimTest | Select-Object -first 1 + $result = Get-CimTest | Select-Object -First 1 $result.GetCimSessionInstanceId() | Should -BeOfType guid } } @@ -169,7 +169,7 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { Context "Remove-CimTest cmdlet" { BeforeEach { Get-CimTest | Remove-CimTest - 1..4 | Foreach-Object { New-CimInstance -namespace root/default -class PSCore_Test1 -property @{ + 1..4 | ForEach-Object { New-CimInstance -Namespace root/default -class PSCore_Test1 -Property @{ id = "$_" field1 = "field $_" field2 = 10 * $_ @@ -181,14 +181,14 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { Remove-CimTest -id 1 $result = Get-CimTest $result.Count | Should -Be 3 - ($result.id |sort-object) -join "," | Should -Be "2,3,4" + ($result.id |Sort-Object) -join "," | Should -Be "2,3,4" } It "The Remove-CimTest cmdlet should remove piped objects" @ItSkipOrPending { Get-CimTest -id 2 | Remove-CimTest $result = Get-CimTest @($result).Count | Should -Be 3 - ($result.id |sort-object) -join "," | Should -Be "1,3,4" + ($result.id |Sort-Object) -join "," | Should -Be "1,3,4" } It "The Remove-CimTest cmdlet should work as a job" @ItSkipOrPending { @@ -201,11 +201,11 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { $null = Wait-Job -Job $job -Timeout 10 $result = Get-CimTest @($result).Count | Should -Be 3 - ($result.id |sort-object) -join "," | Should -Be "1,2,4" + ($result.id |Sort-Object) -join "," | Should -Be "1,2,4" } finally { if ( $job ) { - $job | Remove-Job -force + $job | Remove-Job -Force } } } @@ -219,7 +219,7 @@ Describe "Cdxml cmdlets are supported" -Tag CI,RequireAdminOnWindows { field2 = 0 } New-CimTest @instanceArgs - $result = Get-CimInstance -namespace root/default -class PSCore_Test1 | Where-Object {$_.id -eq "telephone"} + $result = Get-CimInstance -Namespace root/default -class PSCore_Test1 | Where-Object {$_.id -eq "telephone"} $result.field2 | Should -Be 0 $result.field1 | Should -Be $instanceArgs.field1 } diff --git a/test/powershell/engine/ETS/Adapter.Tests.ps1 b/test/powershell/engine/ETS/Adapter.Tests.ps1 index e543b430796..7876dd778a6 100644 --- a/test/powershell/engine/ETS/Adapter.Tests.ps1 +++ b/test/powershell/engine/ETS/Adapter.Tests.ps1 @@ -21,7 +21,7 @@ Describe "Adapter Tests" -tags "CI" { $testmethod = [TestCodeMethodClass].GetMethod("TestCodeMethod") $psmemberset | Add-Member -MemberType CodeMethod -Name TestCodeMethod -Value $testmethod - $document = new-object System.Xml.XmlDocument + $document = New-Object System.Xml.XmlDocument $document.LoadXml("Pride And Prejudice19.95") $doc = $document.DocumentElement } diff --git a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 index d6eb95d4354..7e383b6f198 100644 --- a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 +++ b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 @@ -20,7 +20,7 @@ try { if ( ! $IsWindows ) { return } - $p = get-ciminstance win32_process |Select-object -first 1 + $p = Get-CimInstance win32_process |Select-Object -First 1 $indexOf_namespaceQualified_Win32Process = getIndex $p.PSTypeNames "*root?cimv2?Win32_Process" $indexOf_namespaceQualified_CimProcess = getIndex $p.PSTypeNames "*root?cimv2?CIM_Process" @@ -36,7 +36,7 @@ try { $PSDefaultParameterValues.Remove("it:pending") } - It "Namespace-qualified Win32_Process is present" -skip:(!$IsWindows) { + It "Namespace-qualified Win32_Process is present" -Skip:(!$IsWindows) { $indexOf_namespaceQualified_Win32Process | Should -Not -Be (-1) } It "Namespace-qualified CIM_Process is present" { @@ -49,7 +49,7 @@ try { $indexOf_namespaceQualified_CimManagedSystemElement | Should -Not -Be (-1) } - It "Classname of Win32_Process is present" -skip:(!$IsWindows) { + It "Classname of Win32_Process is present" -Skip:(!$IsWindows) { $indexOf_className_Win32Process | Should -Not -Be (-1) } It "Classname of CIM_Process is present" { @@ -62,7 +62,7 @@ try { $indexOf_className_CimManagedSystemElement | Should -Not -Be (-1) } - It "Win32_Process comes after CIM_Process (namespace qualified)" -skip:(!$IsWindows) { + It "Win32_Process comes after CIM_Process (namespace qualified)" -Skip:(!$IsWindows) { $indexOf_namespaceQualified_Win32Process | Should -BeLessThan $indexOf_namespaceQualified_CimProcess } It "CIM_Process comes after CIM_LogicalElement (namespace qualified)" { @@ -72,7 +72,7 @@ try { $indexOf_namespaceQualified_CimLogicalElement | Should -BeLessThan $indexOf_namespaceQualified_CimManagedSystemElement } - It "Win32_Process comes after CIM_Process (classname only)" -skip:(!$IsWindows) { + It "Win32_Process comes after CIM_Process (classname only)" -Skip:(!$IsWindows) { $indexOf_className_Win32Process | Should -BeLessThan $indexOf_className_CimProcess } It "CIM_Process comes after CIM_LogicalElement (classname only)" { @@ -82,7 +82,7 @@ try { $indexOf_className_CimLogicalElement | Should -BeLessThan $indexOf_className_CimManagedSystemElement } - It "Namespace qualified PSTypenames comes after class-only PSTypeNames" -skip:(!$IsWindows) { + It "Namespace qualified PSTypenames comes after class-only PSTypeNames" -Skip:(!$IsWindows) { $indexOf_namespaceQualified_CimManagedSystemElement | Should -BeLessThan $indexOf_className_Win32Process } } diff --git a/test/powershell/engine/ETS/TypeTable.Tests.ps1 b/test/powershell/engine/ETS/TypeTable.Tests.ps1 index 19c1b1eb9b7..37e8f08686d 100644 --- a/test/powershell/engine/ETS/TypeTable.Tests.ps1 +++ b/test/powershell/engine/ETS/TypeTable.Tests.ps1 @@ -30,7 +30,7 @@ Describe "Built-in type information tests" -Tag "CI" { } It "Should have expected member info for 'System.Diagnostics.ProcessModule'" { - $typeData = $types | Where-Object TypeName -eq "System.Diagnostics.ProcessModule" + $typeData = $types | Where-Object TypeName -EQ "System.Diagnostics.ProcessModule" $typeData | Should -Not -BeNullOrEmpty $typeData.Members.Count | Should -BeExactly 6 @@ -86,7 +86,7 @@ Describe "Built-in type information tests" -Tag "CI" { } It "Should have expected member info for 'System.Management.Automation.ParameterSetMetadata'" { - $typeData = $types | Where-Object TypeName -eq "System.Management.Automation.ParameterSetMetadata" + $typeData = $types | Where-Object TypeName -EQ "System.Management.Automation.ParameterSetMetadata" $typeData | Should -Not -BeNullOrEmpty $typeData.Members.Count | Should -BeExactly 1 @@ -112,7 +112,7 @@ Describe "Built-in type information tests" -Tag "CI" { } It "Should have expected member info for 'System.Management.Automation.JobStateEventArgs'" { - $typeData = $types | Where-Object TypeName -eq "System.Management.Automation.JobStateEventArgs" + $typeData = $types | Where-Object TypeName -EQ "System.Management.Automation.JobStateEventArgs" $typeData | Should -Not -BeNullOrEmpty $typeData.Members.Count | Should -BeExactly 0 diff --git a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 index dfb5ec41adb..b230ce59f68 100644 --- a/test/powershell/engine/Formatting/ErrorView.Tests.ps1 +++ b/test/powershell/engine/Formatting/ErrorView.Tests.ps1 @@ -49,7 +49,7 @@ Describe 'Tests for $ErrorView' -Tag CI { } It "Remote errors show up correctly" { - Start-Job -ScriptBlock { get-item (new-guid) } | Wait-Job | Receive-Job -ErrorVariable e -ErrorAction SilentlyContinue + Start-Job -ScriptBlock { Get-Item (New-Guid) } | Wait-Job | Receive-Job -ErrorVariable e -ErrorAction SilentlyContinue ($e | Out-String).Trim().Count | Should -Be 1 } @@ -59,7 +59,7 @@ Describe 'Tests for $ErrorView' -Tag CI { } It "Function shows up correctly" { - function test-myerror { [cmdletbinding()] param() write-error 'myError' } + function test-myerror { [cmdletbinding()] param() Write-Error 'myError' } $e = & "$PSHOME/pwsh" -noprofile -command 'function test-myerror { [cmdletbinding()] param() write-error "myError" }; test-myerror -ErrorAction SilentlyContinue; $error[0] | Out-String' [string]::Join('', $e).Trim() | Should -BeLike "*test-myerror:*myError*" # wildcard due to VT100 diff --git a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 index f4ad51af3c1..69922140347 100644 --- a/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1 @@ -89,8 +89,8 @@ Describe 'Get-Help -Online opens the default web browser and navigates to the cm } } - It "Get-Help get-process -online" -skip:$skipTest { - { Get-Help get-process -online } | Should -Not -Throw + It "Get-Help get-process -online" -Skip:$skipTest { + { Get-Help get-process -Online } | Should -Not -Throw } } @@ -98,7 +98,7 @@ Describe 'Get-Help -Online is not supported on Nano Server and IoT' -Tags "CI" { $skipTest = -not ([System.Management.Automation.Platform]::IsIoT -or [System.Management.Automation.Platform]::IsNanoServer) - It "Get-help -online throws InvalidOperation." -skip:$skipTest { + It "Get-help -online throws InvalidOperation." -Skip:$skipTest { { Get-Help Get-Help -Online } | Should -Throw -ErrorId "InvalidOperation,Microsoft.PowerShell.Commands.GetHelpCommand" } } diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index 0875bdcc407..80d6a46b709 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -60,7 +60,7 @@ Describe "Validate that the Help function can Run in strict mode" -Tags @('CI') $help = & { # run in nested scope to keep strict mode from affecting other tests Set-StrictMode -Version 3.0 - Help + help } # the help function renders the help content as text so just verify that there is content $help | Should -Not -BeNullOrEmpty @@ -91,7 +91,7 @@ Describe "Validate that get-help works for CurrentUserScope" -Tags @('CI') { It "Validate -Description and -Examples sections in help content. Run 'Get-help -name " -TestCases $testCases { param($cmdletName) - $help = get-help -name $cmdletName + $help = Get-Help -Name $cmdletName $help.Description | Out-String | Should -Match $cmdletName $help.Examples | Out-String | Should -Match $cmdletName } @@ -135,7 +135,7 @@ Describe "Validate that get-help works for AllUsers Scope" -Tags @('Feature', 'R It "Validate -Description and -Examples sections in help content. Run 'Get-help -name " -TestCases $testCases -Skip:(!(Test-CanWriteToPsHome)) { param($cmdletName) - $help = get-help -name $cmdletName + $help = Get-Help -Name $cmdletName $help.Description | Out-String | Should -Match $cmdletName $help.Examples | Out-String | Should -Match $cmdletName } diff --git a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 index 61086667bcb..f6707147324 100644 --- a/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 @@ -347,7 +347,7 @@ Describe "Validate Update-Help from the Web for one PowerShell module." -Tags @( $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "CI" -Scope 'AllUsers' + RunUpdateHelpTests -Tag "CI" -Scope 'AllUsers' } Describe "Validate Update-Help from the Web for one PowerShell module for user scope." -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -359,7 +359,7 @@ Describe "Validate Update-Help from the Web for one PowerShell module for user s $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "CI" -Scope 'CurrentUser' + RunUpdateHelpTests -Tag "CI" -Scope 'CurrentUser' } Describe "Validate Update-Help from the Web for all PowerShell modules." -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -371,7 +371,7 @@ Describe "Validate Update-Help from the Web for all PowerShell modules." -Tags @ $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "Feature" -Scope 'AllUsers' + RunUpdateHelpTests -Tag "Feature" -Scope 'AllUsers' } Describe "Validate Update-Help from the Web for all PowerShell modules for user scope." -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -383,7 +383,7 @@ Describe "Validate Update-Help from the Web for all PowerShell modules for user $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "Feature" -Scope 'CurrentUser' + RunUpdateHelpTests -Tag "Feature" -Scope 'CurrentUser' } Describe "Validate Update-Help -SourcePath for one PowerShell module." -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -395,7 +395,7 @@ Describe "Validate Update-Help -SourcePath for one PowerShell module." -Tags @(' $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "CI" -useSourcePath -Scope 'AllUsers' + RunUpdateHelpTests -Tag "CI" -useSourcePath -Scope 'AllUsers' } Describe "Validate Update-Help -SourcePath for one PowerShell module for user scope." -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -407,7 +407,7 @@ Describe "Validate Update-Help -SourcePath for one PowerShell module for user sc $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "CI" -useSourcePath -Scope 'CurrentUser' + RunUpdateHelpTests -Tag "CI" -useSourcePath -Scope 'CurrentUser' } Describe "Validate Update-Help -SourcePath for all PowerShell modules." -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -419,7 +419,7 @@ Describe "Validate Update-Help -SourcePath for all PowerShell modules." -Tags @( $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "Feature" -useSourcePath -Scope 'AllUsers' + RunUpdateHelpTests -Tag "Feature" -useSourcePath -Scope 'AllUsers' } Describe "Validate Update-Help -SourcePath for all PowerShell modules for user scope." -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { @@ -431,7 +431,7 @@ Describe "Validate Update-Help -SourcePath for all PowerShell modules for user s $ProgressPreference = $SavedProgressPreference } - RunUpdateHelpTests -tag "Feature" -useSourcePath -Scope 'CurrentUser' + RunUpdateHelpTests -Tag "Feature" -useSourcePath -Scope 'CurrentUser' } Describe "Validate 'Save-Help -DestinationPath for one PowerShell modules." -Tags @('CI', 'RequireAdminOnWindows') { @@ -442,7 +442,7 @@ Describe "Validate 'Save-Help -DestinationPath for one PowerShell modules." -Tag AfterAll { $ProgressPreference = $SavedProgressPreference } - RunSaveHelpTests -tag "CI" + RunSaveHelpTests -Tag "CI" } Describe "Validate 'Save-Help -DestinationPath for all PowerShell modules." -Tags @('Feature', 'RequireAdminOnWindows') { @@ -453,5 +453,5 @@ Describe "Validate 'Save-Help -DestinationPath for all PowerShell modules." -Tag AfterAll { $ProgressPreference = $SavedProgressPreference } - RunSaveHelpTests -tag "Feature" + RunSaveHelpTests -Tag "Feature" } diff --git a/test/powershell/engine/Job/Jobs.Tests.ps1 b/test/powershell/engine/Job/Jobs.Tests.ps1 index 7200c6ad45b..61765b3f9bd 100644 --- a/test/powershell/engine/Job/Jobs.Tests.ps1 +++ b/test/powershell/engine/Job/Jobs.Tests.ps1 @@ -6,7 +6,7 @@ Describe 'Basic Job Tests' -Tags 'Feature' { # Make sure we do not have any jobs running Get-Job | Remove-Job -Force $timeBeforeStartedJob = Get-Date - $startedJob = Start-Job -Name 'StartedJob' -ScriptBlock { 1 + 1 } | Wait-Job + $startedJob = Start-Job -Name 'StartedJob' -Scriptblock { 1 + 1 } | Wait-Job $timeAfterStartedJob = Get-Date function script:ValidateJobInfo($job, $state, $hasMoreData, $command) @@ -114,7 +114,7 @@ Describe 'Basic Job Tests' -Tags 'Feature' { It "Create job with native command" { try { - $nativeJob = Start-job { & "$PSHOME/pwsh" -c 1+1 } + $nativeJob = Start-Job { & "$PSHOME/pwsh" -c 1+1 } $nativeJob | Wait-Job $nativeJob.State | Should -BeExactly "Completed" $nativeJob.HasMoreData | Should -BeTrue @@ -315,7 +315,7 @@ Describe 'Basic Job Tests' -Tags 'Feature' { BeforeEach { # 20 seconds is chosen to be large, so that the job is in running state when Stop-Job is called. - $jobToStop = Start-Job -ScriptBlock { + $jobToStop = Start-Job -Scriptblock { 1..80 | ForEach-Object { Write-Output $_ Start-Sleep -Milliseconds 250 diff --git a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 index 1e406e620bd..2b84e75f902 100644 --- a/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 +++ b/test/powershell/engine/Module/TestModuleManifest.Tests.ps1 @@ -160,7 +160,7 @@ Describe "Tests for circular references in required modules" -tags "CI" { $ModuleVersion = '3.0' $GUID = New-Guid - New-ModuleManifest ((join-path $moduleDir.Name $moduleDir.Name) + ".psd1") -RequiredModules $RequiredModulesSpecs -ModuleVersion $ModuleVersion -Guid $GUID + New-ModuleManifest ((Join-Path $moduleDir.Name $moduleDir.Name) + ".psd1") -RequiredModules $RequiredModulesSpecs -ModuleVersion $ModuleVersion -Guid $GUID $lastItem = @{ ModuleName = $moduleDir.Name} if ($AddVersion) {$lastItem += @{ ModuleVersion = $ModuleVersion}} @@ -185,7 +185,7 @@ Describe "Tests for circular references in required modules" -tags "CI" { $RequiredModulesSpecs = $lastItem.ModuleName } - New-ModuleManifest ((join-path $firstModuleName $firstModuleName) + ".psd1") -RequiredModules $RequiredModulesSpecs -ModuleVersion $firstModuleVersion -Guid $firstModuleGuid + New-ModuleManifest ((Join-Path $firstModuleName $firstModuleName) + ".psd1") -RequiredModules $RequiredModulesSpecs -ModuleVersion $firstModuleVersion -Guid $firstModuleGuid } } @@ -250,7 +250,7 @@ Describe "Test-ModuleManifest Performance bug followup" -tags "CI" { It "Test-ModuleManifest should not load unnessary modules" -Skip:(!(Test-CanWriteToPsHome)) { - $job = start-job -name "job1" -ScriptBlock {test-modulemanifest "$using:PSHomeModulesPath\ModuleWithDependencies2\2.0\ModuleWithDependencies2.psd1" -verbose} | Wait-Job + $job = Start-Job -Name "job1" -ScriptBlock {Test-ModuleManifest "$using:PSHomeModulesPath\ModuleWithDependencies2\2.0\ModuleWithDependencies2.psd1" -Verbose} | Wait-Job $verbose = $job.ChildJobs[0].Verbose.ReadAll() # Before the fix, all modules under $PSHOME will be imported and will be far more than 15 verbose messages. However, we cannot fix the number in case verbose message may vary. diff --git a/test/powershell/engine/Remoting/PSSession.Tests.ps1 b/test/powershell/engine/Remoting/PSSession.Tests.ps1 index 547c54f40f2..e985ff6ab36 100644 --- a/test/powershell/engine/Remoting/PSSession.Tests.ps1 +++ b/test/powershell/engine/Remoting/PSSession.Tests.ps1 @@ -60,12 +60,12 @@ Describe "SkipCACheck and SkipCNCheck PSSession options are required for New-PSS }, @{ Name = 'Verifies expected error when SkipCACheck option is missing' - ScriptBlock = { New-PSSession -cn localhost -Credential $cred -Authentication Basic -UseSSl -SessionOption $soSkipCN } + ScriptBlock = { New-PSSession -cn localhost -Credential $cred -Authentication Basic -UseSSL -SessionOption $soSkipCN } ExpectedErrorCode = 825 }, @{ Name = 'Verifies expected error when SkipCNCheck option is missing' - ScriptBlock = { New-PSSession -cn localhost -Credential $cred -Authentication Basic -UseSSl -SessionOption $soSkipCA } + ScriptBlock = { New-PSSession -cn localhost -Credential $cred -Authentication Basic -UseSSL -SessionOption $soSkipCA } ExpectedErrorCode = 825 } ) diff --git a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 index 46fc2045d19..e48eaecb526 100644 --- a/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 +++ b/test/powershell/engine/Remoting/RemoteSession.Basic.Tests.ps1 @@ -21,7 +21,7 @@ Describe "New-PSSession basic test" -Tag @("CI") { } Describe "Basic Auth over HTTP not allowed on Unix" -Tag @("CI") { - It "New-PSSession should throw when specifying Basic Auth over HTTP on Unix" -skip:($IsWindows) { + It "New-PSSession should throw when specifying Basic Auth over HTTP on Unix" -Skip:($IsWindows) { $platformInfo = Get-PlatformInfo if ( ($platformInfo.Platform -match "alpine|raspbian") -or @@ -42,7 +42,7 @@ Describe "Basic Auth over HTTP not allowed on Unix" -Tag @("CI") { $err.Exception.ErrorCode | Should -Be 801 } - It "New-PSSession should NOT throw a ConnectFailed exception when specifying Basic Auth over HTTPS on Unix" -skip:($IsWindows) { + It "New-PSSession should NOT throw a ConnectFailed exception when specifying Basic Auth over HTTPS on Unix" -Skip:($IsWindows) { $platformInfo = Get-PlatformInfo if ( ($platformInfo.Platform -match "alpine|raspbian") -or diff --git a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 index a0caab97309..1568d284d0f 100644 --- a/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 +++ b/test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 @@ -11,7 +11,7 @@ Describe "SSHTransport switch parameter value" -Tags 'Feature' { $TestCasesSSHTransport = @( @{scriptBlock = {New-PSSession -HostName localhost -UserName UserA -SSHTransport:$false}; testName = 'New-PSSession SSHTransport parameter cannot have false value'} @{scriptBlock = {Enter-PSSession -HostName localhost -UserName UserA -SSHTransport:$false}; testName = 'Enter-PSSession SSHTransport parameter cannot have false value'} - @{scriptBlock = {Invoke-Command -ScriptBlock {"Hello"} -HostName localhost -UserName UserA -SSHTransport:$false}; testName = 'Invoke-Command SSHTransport parameter cannot have false value'} + @{scriptBlock = {Invoke-Command -Scriptblock {"Hello"} -HostName localhost -UserName UserA -SSHTransport:$false}; testName = 'Invoke-Command SSHTransport parameter cannot have false value'} ) } diff --git a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 index 2093a1dd65c..e75deca194d 100644 --- a/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/CimCmdletsResources.Tests.ps1 @@ -10,7 +10,7 @@ $excludeList = @() # load the module since it isn't there by default if ( $IsWindows ) { - import-module CimCmdlets + Import-Module CimCmdlets } # run the tests diff --git a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 index 529dde227fa..fbef98e7da5 100644 --- a/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/SecurityResources.Tests.ps1 @@ -8,7 +8,7 @@ $assemblyName = "Microsoft.PowerShell.Security" # entries in the csproj for the assembly $excludeList = @("SecurityMshSnapinResources.resx") # load the module since it isn't there by default -import-module Microsoft.PowerShell.Security +Import-Module Microsoft.PowerShell.Security # run the tests Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList diff --git a/test/powershell/engine/ResourceValidation/TestRunner.ps1 b/test/powershell/engine/ResourceValidation/TestRunner.ps1 index 881cb43f804..926b5156068 100644 --- a/test/powershell/engine/ResourceValidation/TestRunner.ps1 +++ b/test/powershell/engine/ResourceValidation/TestRunner.ps1 @@ -35,7 +35,7 @@ function Test-ResourceStrings # # This is the reason why this is not a general module for use. There is # no other way to run these tests - Describe "Resources strings in $AssemblyName (was -ResGen used with Start-PSBuild)" -tag Feature { + Describe "Resources strings in $AssemblyName (was -ResGen used with Start-PSBuild)" -Tag Feature { function NormalizeLineEnd { diff --git a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 index e1ac58f1842..e8b3074610a 100644 --- a/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/UtilityResources.Tests.ps1 @@ -15,6 +15,6 @@ $excludeList = "CoreMshSnapinResources.resx", "ConvertStringResources.resx", "FlashExtractStrings.resx", "ImmutableStrings.resx" -import-module Microsoft.Powershell.Utility +Import-Module Microsoft.Powershell.Utility # run the tests Test-ResourceStrings -AssemblyName $AssemblyName -ExcludeList $excludeList diff --git a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 index a0b2a9d31b4..9edcb004169 100644 --- a/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/WSManResources.Tests.ps1 @@ -9,7 +9,7 @@ $assemblyName = "Microsoft.WSMan.Management" $excludeList = @() # load the module since it isn't there by default if ( $IsWindows ) { - import-module Microsoft.WSMan.Management + Import-Module Microsoft.WSMan.Management } # run the tests diff --git a/test/shebang/script.ps1 b/test/shebang/script.ps1 index d5e772d0b63..4fccccddade 100755 --- a/test/shebang/script.ps1 +++ b/test/shebang/script.ps1 @@ -1,5 +1,5 @@ #!/usr/bin/env powershell -get-process -get-module +Get-Process +Get-Module diff --git a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 index ec3792908c8..282ee317816 100644 --- a/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 +++ b/test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1 @@ -178,21 +178,21 @@ try { Remove-Item $CoverageZipFilePath -Force } - Invoke-WebRequest -uri $codeCoverageZip -outfile "$outputBaseFolder\PSCodeCoverage.zip" + Invoke-WebRequest -Uri $codeCoverageZip -OutFile "$outputBaseFolder\PSCodeCoverage.zip" $TestsZipFilePath = "$outputBaseFolder\tests.zip" if(Test-Path $TestsZipFilePath) { Remove-Item $TestsZipFilePath -Force } - Invoke-WebRequest -uri $testContentZip -outfile $TestsZipFilePath + Invoke-WebRequest -Uri $testContentZip -OutFile $TestsZipFilePath $OpenCoverZipFilePath = "$outputBaseFolder\OpenCover.zip" if(Test-Path $OpenCoverZipFilePath) { Remove-Item $OpenCoverZipFilePath -Force } - Invoke-WebRequest -uri $openCoverZip -outfile $OpenCoverZipFilePath + Invoke-WebRequest -Uri $openCoverZip -OutFile $OpenCoverZipFilePath Write-LogPassThru -Message "Downloads complete. Starting expansion" @@ -200,19 +200,19 @@ try { Remove-Item -Force -Recurse $psBinPath } - Expand-Archive -path $CoverageZipFilePath -destinationpath "$psBinPath" -Force + Expand-Archive -Path $CoverageZipFilePath -DestinationPath "$psBinPath" -Force if(Test-Path $testRootPath) { Remove-Item -Force -Recurse $testRootPath } - Expand-Archive -path $TestsZipFilePath -destinationpath $testRootPath -Force + Expand-Archive -Path $TestsZipFilePath -DestinationPath $testRootPath -Force if(Test-Path $openCoverPath) { Remove-Item -Force -Recurse $openCoverPath } - Expand-Archive -path $OpenCoverZipFilePath -destinationpath $openCoverPath -Force + Expand-Archive -Path $OpenCoverZipFilePath -DestinationPath $openCoverPath -Force Write-LogPassThru -Message "Expansion complete." if(Test-Path $elevatedLogs) @@ -318,12 +318,12 @@ try } catch { ("ERROR: " + $_.ScriptStackTrace) | Write-LogPassThru - $_ 2>&1 | out-string -Stream | %{ "ERROR: $_" } | Write-LogPassThru + $_ 2>&1 | Out-String -Stream | %{ "ERROR: $_" } | Write-LogPassThru } if(Test-Path $outputLog) { - Write-LogPassThru -Message (get-childitem $outputLog).FullName + Write-LogPassThru -Message (Get-ChildItem $outputLog).FullName } Write-LogPassThru -Message "Test run done." diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index fd7c9d16d48..8a13eef02b9 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -42,7 +42,7 @@ function Test-IsElevated # on Windows we can determine whether we're executing in an # elevated context $identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() - $windowsPrincipal = new-object 'Security.Principal.WindowsPrincipal' $identity + $windowsPrincipal = New-Object 'Security.Principal.WindowsPrincipal' $identity if ($windowsPrincipal.IsInRole("Administrators") -eq 1) { $IsElevated = $true @@ -209,7 +209,7 @@ function Send-VstsLogFile { $Path ) - $logFolder = Join-Path -path $PWD -ChildPath 'logfile' + $logFolder = Join-Path -Path $PWD -ChildPath 'logfile' if(!(Test-Path -Path $logFolder)) { $null = New-Item -Path $logFolder -ItemType Directory @@ -222,13 +222,13 @@ function Send-VstsLogFile { if($Contents) { $logFile = Join-Path -Path $logFolder -ChildPath ([System.Io.Path]::GetRandomFileName() + "-$LogName.txt") - $name = Split-Path -leaf -Path $logFile + $name = Split-Path -Leaf -Path $logFile - $Contents | out-file -path $logFile -Encoding ascii + $Contents | Out-File -path $logFile -Encoding ascii } else { - $name = Split-Path -leaf -Path $path + $name = Split-Path -Leaf -Path $path $logFile = Join-Path -Path $logFolder -ChildPath ([System.Io.Path]::GetRandomFileName() + '-' + $name) Copy-Item -Path $Path -Destination $logFile } diff --git a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 index dd52fdb59e2..02a66d4928f 100755 --- a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 +++ b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 @@ -310,7 +310,7 @@ function New-TestHost } if ( ! ("TestHost.TestHost" -as "type" )) { - $t = add-Type -pass $definition -ref $references + $t = Add-Type -pass $definition -ref $references } [TestHost.TestHost]::New() diff --git a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 index 05692b09250..5460b16b8ae 100644 --- a/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 +++ b/test/tools/Modules/HelpersSecurity/HelpersSecurity.psm1 @@ -50,7 +50,7 @@ if ($IsWindows) if (-not (Get-Command Invoke-LanguageModeTestingSupportCmdlet -ErrorAction Ignore)) { $moduleName = Get-RandomFileName - $moduleDirectory = join-path $TestDrive\Modules $moduleName + $moduleDirectory = Join-Path $TestDrive\Modules $moduleName if (-not (Test-Path $moduleDirectory)) { $null = New-Item -ItemType Directory $moduleDirectory -Force diff --git a/test/tools/Modules/HttpListener/HttpListener.psm1 b/test/tools/Modules/HttpListener/HttpListener.psm1 index adadc7425f3..3df69760d54 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psm1 +++ b/test/tools/Modules/HttpListener/HttpListener.psm1 @@ -319,7 +319,7 @@ Function Start-HTTPListener { } catch { - $errormsg = $_ | convertto-json + $errormsg = $_ | ConvertTo-Json Write-Error $errormsg } finally diff --git a/test/tools/Modules/PSSysLog/PSSysLog.psm1 b/test/tools/Modules/PSSysLog/PSSysLog.psm1 index dbd0bac5568..78819ec3db9 100644 --- a/test/tools/Modules/PSSysLog/PSSysLog.psm1 +++ b/test/tools/Modules/PSSysLog/PSSysLog.psm1 @@ -615,7 +615,7 @@ function Get-PSSysLog else { [string] $filter = [string]::Format(" {0}[", $id) - Get-Content @contentParms -filter {$_.Contains($filter)} | ConvertFrom-SysLog -Id $Id -After $After | Select-Object -First $maxItems + Get-Content @contentParms -Filter {$_.Contains($filter)} | ConvertFrom-SysLog -Id $Id -After $After | Select-Object -First $maxItems } } @@ -811,7 +811,7 @@ function Get-PSOsLog { [string] $filter = [string]::Format("com.microsoft.powershell.{0}: (", $id) Write-Warning "this code path `Get-PSOsLog -TotalCount` should not be used if the message field is needed!" - Get-Content @contentParms -filter {$_.Contains($filter)} | Where-Object {![string]::IsNullOrEmpty($_)} | ConvertFrom-OsLog -Id $Id -After $After | Select-Object -First $maxItems + Get-Content @contentParms -Filter {$_.Contains($filter)} | Where-Object {![string]::IsNullOrEmpty($_)} | ConvertFrom-OsLog -Id $Id -After $After | Select-Object -First $maxItems } } @@ -1009,7 +1009,7 @@ function Get-OsLogPersistence # Not configured # Expecting a format like the following: # Mode for 'com.microsoft.powershell' PERSIST_DEFAULT - $result = new-object PSObject -Property @{ + $result = New-Object PSObject -Property @{ Level = 'DEFAULT' Persist = $parts[$parts.Length- 1] Enabled = $false @@ -1019,7 +1019,7 @@ function Get-OsLogPersistence { # Expecting a format like the following: # Mode for 'com.microsoft.powershell' INFO PERSIST_INFO - $result = new-object PSObject -Property @{ + $result = New-Object PSObject -Property @{ Level = $parts[$parts.Length - 2] Persist = $parts[$parts.Length -1] Enabled = $true @@ -1077,7 +1077,7 @@ function Wait-PSWinEvent $recordsToReturn = @() -        foreach ($thisRecord in (get-winevent -FilterHashtable $filterHashtable -Oldest 2> $null)) +        foreach ($thisRecord in (Get-WinEvent -FilterHashtable $filterHashtable -Oldest 2> $null))         { if($PSCmdlet.ParameterSetName -eq "ByPropertyName") { diff --git a/test/tools/Modules/WebListener/WebListener.psm1 b/test/tools/Modules/WebListener/WebListener.psm1 index 5d95707b50d..6122a7a8a4b 100644 --- a/test/tools/Modules/WebListener/WebListener.psm1 +++ b/test/tools/Modules/WebListener/WebListener.psm1 @@ -120,7 +120,7 @@ function Start-WebListener } $initTimeoutSeconds = 15 - $appExe = (get-command WebListener).Path + $appExe = (Get-Command WebListener).Path $serverPfx = 'ServerCert.pfx' $serverPfxPassword = New-RandomHexString $clientPfx = 'ClientCert.pfx' @@ -134,7 +134,7 @@ function Start-WebListener New-ClientCertificate -CertificatePath $Script:ClientPfxPath -Password $Script:ClientPfxPassword $Job = Start-Job { - $path = Split-Path -parent (get-command WebListener).Path -Verbose + $path = Split-Path -Parent (Get-Command WebListener).Path -Verbose Push-Location $path -Verbose 'appEXE: {0}' -f $using:appExe 'serverPfxPath: {0}' -f $using:serverPfxPath diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index 748e0d1b853..eef32740b2b 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -129,8 +129,8 @@ function Format-FileCoverage PROCESS { $file = $CoverageData.Path $filepath = $file -replace "$oldBase","${newBase}" - if ( test-path $filepath ) { - $content = get-content $filepath + if ( Test-Path $filepath ) { + $content = Get-Content $filepath for($i = 0; $i -lt $content.length; $i++ ) { if ( $CoverageData.Hit -contains ($i+1)) { $sign = "+" @@ -142,9 +142,9 @@ function Format-FileCoverage $sign = " " } $outputline = "{0:0000} {1} {2}" -f ($i+1),$sign,$content[$i] - if ( $sign -eq "+" ) { write-host -fore green $outputline } - elseif ( $sign -eq "-" ) { write-host -fore red $outputline } - else { write-host -fore white $outputline } + if ( $sign -eq "+" ) { Write-Host -fore green $outputline } + elseif ( $sign -eq "-" ) { Write-Host -fore red $outputline } + else { Write-Host -fore white $outputline } } } else { @@ -158,7 +158,7 @@ function Get-FileCoverageData([xml]$CoverageData) $result = [Collections.Generic.Dictionary[string,FileCoverage]]::new() $count = 0 Write-Progress "collecting files" - $filehash = $CoverageData.SelectNodes(".//File") | Foreach-Object { $h = @{} } { $h[$_.uid] = $_.fullpath } { $h } + $filehash = $CoverageData.SelectNodes(".//File") | ForEach-Object { $h = @{} } { $h[$_.uid] = $_.fullpath } { $h } Write-Progress "collecting sequence points" $nodes = $CoverageData.SelectNodes(".//SequencePoint") $ncount = $nodes.count @@ -209,7 +209,7 @@ function Get-FileCoverageData([xml]$CoverageData) function Get-CodeCoverageChange($r1, $r2, [string[]]$ClassName) { $h = @{} - $Deltas = new-object "System.Collections.ArrayList" + $Deltas = New-Object "System.Collections.ArrayList" if ( $ClassName ) { foreach ( $Class in $ClassName ) { @@ -272,7 +272,7 @@ function Get-AssemblyCoverageChange($r1, $r2) $r2 = @{ AssemblyName = $r1.AssemblyName ; Branch = 0 ; Sequence = 0 } } - if ( compare-object $r1.assemblyname $r2.assemblyname ) { throw "different assemblies" } + if ( Compare-Object $r1.assemblyname $r2.assemblyname ) { throw "different assemblies" } $AssemblyCoverageChange = [pscustomobject] @{ AssemblyName = $r1.AssemblyName @@ -287,7 +287,7 @@ function Get-AssemblyCoverageChange($r1, $r2) function Get-CoverageData($xmlPath) { - [xml]$CoverageXml = get-content -readcount 0 $xmlPath + [xml]$CoverageXml = Get-Content -ReadCount 0 $xmlPath if ( $null -eq $CoverageXml.CoverageSession ) { throw "CoverageSession data not found" } $assemblies = New-Object System.Collections.ArrayList @@ -425,7 +425,7 @@ function Expand-ZipArchive([string] $Path, [string] $DestinationPath) function Get-CodeCoverage { param ( [string]$CoverageXmlFile = "$HOME/Documents/OpenCover.xml" ) - $xmlPath = (get-item $CoverageXmlFile).Fullname + $xmlPath = (Get-Item $CoverageXmlFile).Fullname (Get-CoverageData -xmlPath $xmlPath) } @@ -500,10 +500,10 @@ function Compare-CodeCoverage if ( $PSCmdlet.ParameterSetName -eq "file" ) { - [string]$xmlPath1 = (get-item $Run1File).Fullname + [string]$xmlPath1 = (Get-Item $Run1File).Fullname $Run1 = (Get-CoverageData -xmlPath $xmlPath1) - [string]$xmlPath2 = (get-item $Run1File).Fullname + [string]$xmlPath2 = (Get-Item $Run1File).Fullname $Run2 = (Get-CoverageData -xmlPath $xmlPath2) } @@ -527,10 +527,10 @@ function Compare-FileCoverage ) # create a couple of hashtables where the key is the path # so we can compare file coverage - $reference = $ReferenceCoverage.GetFileCoverage($FileName) | Foreach-Object { $h = @{} } { $h[$_.path] = $_ } {$h} - $difference = $differenceCoverage.GetFileCoverage($FileName) | Foreach-Object { $h = @{}}{ $h[$_.path] = $_ }{$h } + $reference = $ReferenceCoverage.GetFileCoverage($FileName) | ForEach-Object { $h = @{} } { $h[$_.path] = $_ } {$h} + $difference = $differenceCoverage.GetFileCoverage($FileName) | ForEach-Object { $h = @{}}{ $h[$_.path] = $_ }{$h } # based on the paths, create objects which show the difference between the two runs - $reference.Keys | Sort-Object | Foreach-Object { + $reference.Keys | Sort-Object | ForEach-Object { $referenceObject = $reference[$_] $differenceObject = $difference[$_] if ( $differenceObject ) @@ -569,22 +569,22 @@ function Install-OpenCover $filename = "opencover.${version}.zip" $tempPath = "$env:TEMP/$Filename" $packageUrl = "https://github.com/OpenCover/opencover/releases/download/${version}/${filename}" - if ( test-path $tempPath ) + if ( Test-Path $tempPath ) { if ( $force ) { - remove-item -force $tempPath + Remove-Item -Force $tempPath } else { throw "Package already exists at $tempPath, not continuing. Use -force to re-install" } } - if ( test-path "$TargetDirectory/OpenCover" ) + if ( Test-Path "$TargetDirectory/OpenCover" ) { if ( $force ) { - remove-item -recurse -force "$TargetDirectory/OpenCover" + Remove-Item -Recurse -Force "$TargetDirectory/OpenCover" } else { @@ -593,20 +593,20 @@ function Install-OpenCover } Invoke-WebRequest -Uri $packageUrl -OutFile "$tempPath" - if ( ! (test-path $tempPath) ) + if ( ! (Test-Path $tempPath) ) { throw "Download failed: $packageUrl" } ## We add ErrorAction as we do not have this module on PS v4 and below. Calling import-module will throw an error otherwise. - import-module Microsoft.PowerShell.Archive -ErrorAction SilentlyContinue + Import-Module Microsoft.PowerShell.Archive -ErrorAction SilentlyContinue if ($null -ne (Get-Command Expand-Archive -ErrorAction Ignore)) { Expand-Archive -Path $tempPath -DestinationPath "$TargetDirectory/OpenCover" } else { Expand-ZipArchive -Path $tempPath -DestinationPath "$TargetDirectory/OpenCover" } - Remove-Item -force $tempPath + Remove-Item -Force $tempPath } <# @@ -647,7 +647,7 @@ function Invoke-OpenCover $OpenCoverBin = "$OpenCoverPath\opencover.console.exe" - if ( ! (test-path $OpenCoverBin)) + if ( ! (Test-Path $OpenCoverBin)) { # see if it's somewhere else in the path $openCoverBin = (Get-Command -Name 'opencover.console' -ErrorAction Ignore).Source @@ -658,7 +658,7 @@ function Invoke-OpenCover # check to be sure that pwsh.exe is present $target = "${PowerShellExeDirectory}\pwsh.exe" - if ( ! (test-path $target) ) + if ( ! (Test-Path $target) ) { throw "$target does not exist, use 'Start-PSBuild -configuration CodeCoverage'" } @@ -704,7 +704,7 @@ function Invoke-OpenCover # Write the command line to a file and then invoke file. # '&' invoke caused issues with cmdline parameters for opencover.console.exe $elevatedFile = "$env:temp\elevated.ps1" - "$OpenCoverBin $cmdlineElevated" | Out-File -FilePath $elevatedFile -force + "$OpenCoverBin $cmdlineElevated" | Out-File -FilePath $elevatedFile -Force powershell.exe -file $elevatedFile # invoke OpenCover unelevated and poll for completion @@ -738,8 +738,8 @@ function Invoke-OpenCover } finally { - Remove-Item $elevatedFile -force -ErrorAction SilentlyContinue - Remove-Item $unelevatedFile -force -ErrorAction SilentlyContinue + Remove-Item $elevatedFile -Force -ErrorAction SilentlyContinue + Remove-Item $unelevatedFile -Force -ErrorAction SilentlyContinue } } } diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 index b49d1c47e43..dd1b168d91c 100644 --- a/tools/UpdateDotnetRuntime.ps1 +++ b/tools/UpdateDotnetRuntime.ps1 @@ -81,7 +81,7 @@ function Update-PackageVersion { $versionPattern = (Get-Content "$PSScriptRoot/../DotnetRuntimeMetadata.json" | ConvertFrom-Json).sdk.packageVersionPattern $packages.GetEnumerator() | ForEach-Object { - $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPreReleaseVersions -Source 'dotnet5' + $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPrereleaseVersions -Source 'dotnet5' foreach ($v in $_.Value) { $version = $v.Version @@ -109,7 +109,7 @@ function Update-PackageVersion { .DESCRIPTION Update package versions to the latest as per the pattern mentioned in DotnetRuntimeMetadata.json #> function Update-CsprojFile([string] $path, $values) { - $fileContent = Get-Content $path -raw + $fileContent = Get-Content $path -Raw $updated = $false foreach ($v in $values) { @@ -141,7 +141,7 @@ if(-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue)) { $nugetFeed = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet5' } | Select-Object -ExpandProperty Value Register-PackageSource -Name 'dotnet5' -Location $nugetFeed -ProviderName NuGet - Write-Verbose -Message "Register new package source 'dotnet5'" -verbose + Write-Verbose -Message "Register new package source 'dotnet5'" -Verbose } ## Install latest version from the channel diff --git a/tools/WindowsCI.psm1 b/tools/WindowsCI.psm1 index fd96d1eb0bb..37b866cebd0 100644 --- a/tools/WindowsCI.psm1 +++ b/tools/WindowsCI.psm1 @@ -30,8 +30,8 @@ function New-LocalUser ) $LocalComputer = [ADSI] "WinNT://$env:computername"; $user = $LocalComputer.Create('user', $username); - $user.SetPassword($password) | out-null; - $user.SetInfo() | out-null; + $user.SetPassword($password) | Out-Null; + $user.SetInfo() | Out-Null; } <# @@ -43,7 +43,7 @@ function ConvertTo-NtAccount [Parameter(Mandatory=$true)] [string] $sid ) - (new-object System.Security.Principal.SecurityIdentifier($sid)).translate([System.Security.Principal.NTAccount]).Value + (New-Object System.Security.Principal.SecurityIdentifier($sid)).translate([System.Security.Principal.NTAccount]).Value } <# diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 047753805b8..5e4ee9ec174 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -17,12 +17,12 @@ if(Test-Path $dotNetPath) # import build into the global scope so it can be used by packaging Import-Module (Join-Path $repoRoot 'build.psm1') -Scope Global -Import-Module (Join-Path $repoRoot 'tools\packaging') -scope Global +Import-Module (Join-Path $repoRoot 'tools\packaging') -Scope Global # import the windows specific functcion only in Windows PowerShell or on Windows if($PSVersionTable.PSEdition -eq 'Desktop' -or $IsWindows) { - Import-Module (Join-Path $PSScriptRoot 'WindowsCI.psm1') -scope Global + Import-Module (Join-Path $PSScriptRoot 'WindowsCI.psm1') -Scope Global } # tests if we should run a daily build @@ -104,7 +104,7 @@ function Invoke-CIBuild $options = (Get-PSOptions) - $path = split-path -path $options.Output + $path = Split-Path -Path $options.Output $psOptionsPath = (Join-Path -Path $PSScriptRoot -ChildPath '../psoptions.json') $buildZipPath = (Join-Path -Path $PSScriptRoot -ChildPath '../build.zip') @@ -129,7 +129,7 @@ function Invoke-CIInstall { if ($env:BUILD_REASON -eq 'Schedule') { - Write-Host "##vso[build.updatebuildnumber]Daily-$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhss"))" + Write-Host "##vso[build.updatebuildnumber]Daily-$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((Get-Date).ToString("yyyyMMddhhss"))" } } @@ -145,7 +145,7 @@ function Invoke-CIInstall # Account $userName = 'ciRemote' - New-LocalUser -username $userName -password $password + New-LocalUser -username $userName -Password $password Add-UserToGroup -username $userName -groupSid $script:administratorsGroupSID # Provide credentials globally for remote tests. @@ -192,7 +192,7 @@ function Invoke-CIxUnit throw "CoreCLR pwsh.exe was not built" } - $xUnitTestResultsFile = Join-Path -Path $PWD -childpath "xUnitTestResults.xml" + $xUnitTestResultsFile = Join-Path -Path $PWD -ChildPath "xUnitTestResults.xml" Start-PSxUnit -xUnitTestResultsFile $xUnitTestResultsFile Push-Artifact -Path $xUnitTestResultsFile -name xunit @@ -414,7 +414,7 @@ function Compress-CoverageArtifacts $null = $artifacts.Add($zipOpenCoverPath) $zipCodeCoveragePath = Join-Path $PWD "CodeCoverage.zip" - Write-Verbose "Zipping ${CodeCoverageOutput} into $zipCodeCoveragePath" -verbose + Write-Verbose "Zipping ${CodeCoverageOutput} into $zipCodeCoveragePath" -Verbose [System.IO.Compression.ZipFile]::CreateFromDirectory($CodeCoverageOutput, $zipCodeCoveragePath) $null = $artifacts.Add($zipCodeCoveragePath) diff --git a/tools/install-powershell.ps1 b/tools/install-powershell.ps1 index a560e83eb41..4a8c47daf0e 100644 --- a/tools/install-powershell.ps1 +++ b/tools/install-powershell.ps1 @@ -224,7 +224,7 @@ Function Add-PathTToSettings { # $key is null here if it the user was unable to get ReadWriteSubTree access. if ($null -eq $Key) { - throw (new-object -typeName 'System.Security.SecurityException' -ArgumentList "Unable to access the target registry") + throw (New-Object -TypeName 'System.Security.SecurityException' -ArgumentList "Unable to access the target registry") } # Get current unexpanded value diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1e7fa61430a..3faacf27467 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -620,7 +620,7 @@ function New-PSBuildZip [string]$VstsVariableName ) - $name = split-path -Path $BuildPath -Leaf + $name = Split-Path -Path $BuildPath -Leaf $zipLocationPath = Join-Path -Path $DestinationFolder -ChildPath "$name-signed.zip" Compress-Archive -Path $BuildPath\* -DestinationPath $zipLocationPath if ($VstsVariableName) @@ -647,11 +647,11 @@ function Update-PSSignedBuildFolder # Replace unsigned binaries with signed $signedFilesFilter = Join-Path -Path $SignedFilesPath -ChildPath '*' - Get-ChildItem -path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | Foreach-Object -Process { + Get-ChildItem -Path $signedFilesFilter -Recurse -File | Select-Object -ExpandProperty FullName | ForEach-Object -Process { $relativePath = $_.ToLowerInvariant().Replace($SignedFilesPath.ToLowerInvariant(),'') $destination = Join-Path -Path $BuildPath -ChildPath $relativePath Write-Log "replacing $destination with $_" - Copy-Item -Path $_ -Destination $destination -force + Copy-Item -Path $_ -Destination $destination -Force } } @@ -665,11 +665,11 @@ function Expand-PSSignedBuild [Switch]$SkipPwshExeCheck ) - $psModulePath = Split-Path -path $PSScriptRoot + $psModulePath = Split-Path -Path $PSScriptRoot # Expand signed build - $buildPath = Join-Path -path $psModulePath -childpath 'ExpandedBuild' - $null = New-Item -path $buildPath -itemtype Directory -force - Expand-Archive -path $BuildZip -destinationpath $buildPath -Force + $buildPath = Join-Path -Path $psModulePath -ChildPath 'ExpandedBuild' + $null = New-Item -Path $buildPath -ItemType Directory -Force + Expand-Archive -Path $BuildZip -DestinationPath $buildPath -Force # Remove the zip file that contains only those files from the parent folder of 'publish'. # That zip file is used for compliance scan. Remove-Item -Path (Join-Path -Path $buildPath -ChildPath '*.zip') -Recurse @@ -955,10 +955,10 @@ function New-UnixPackage { } } if ($AfterScriptInfo.AfterInstallScript) { - Remove-Item -erroraction 'silentlycontinue' $AfterScriptInfo.AfterInstallScript -Force + Remove-Item -ErrorAction 'silentlycontinue' $AfterScriptInfo.AfterInstallScript -Force } if ($AfterScriptInfo.AfterRemoveScript) { - Remove-Item -erroraction 'silentlycontinue' $AfterScriptInfo.AfterRemoveScript -Force + Remove-Item -ErrorAction 'silentlycontinue' $AfterScriptInfo.AfterRemoveScript -Force } Remove-Item -Path $ManGzipInfo.GzipFile -Force -ErrorAction SilentlyContinue } @@ -997,7 +997,7 @@ Function New-LinkInfo $linkTarget ) - $linkDir = Join-Path -path '/tmp' -ChildPath ([System.IO.Path]::GetRandomFileName()) + $linkDir = Join-Path -Path '/tmp' -ChildPath ([System.IO.Path]::GetRandomFileName()) $null = New-Item -ItemType Directory -Path $linkDir $linkSource = Join-Path -Path $linkDir -ChildPath 'pwsh' @@ -1027,19 +1027,19 @@ function New-MacOsDistributionPackage throw 'New-MacOsDistributionPackage is only supported on macOS!' } - $packageName = Split-Path -leaf -Path $FpmPackage + $packageName = Split-Path -Leaf -Path $FpmPackage # Create a temp directory to store the needed files $tempDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName()) New-Item -ItemType Directory -Path $tempDir -Force > $null - $resourcesDir = Join-Path -path $tempDir -childPath 'resources' + $resourcesDir = Join-Path -Path $tempDir -ChildPath 'resources' New-Item -ItemType Directory -Path $resourcesDir -Force > $null #Copy background file to temp directory $backgroundFile = "$RepoRoot/assets/macDialog.png" Copy-Item -Path $backgroundFile -Destination $resourcesDir # Move the current package to the temp directory - $tempPackagePath = Join-Path -path $tempDir -ChildPath $packageName + $tempPackagePath = Join-Path -Path $tempDir -ChildPath $packageName Move-Item -Path $FpmPackage -Destination $tempPackagePath -Force # Add the OS information to the macOS package file name. @@ -1080,7 +1080,7 @@ function New-MacOsDistributionPackage finally { Pop-Location - Remove-item -Path $tempDir -Recurse -Force + Remove-Item -Path $tempDir -Recurse -Force } return (Get-Item $newPackagePath) @@ -1431,7 +1431,7 @@ function New-ManGzip { $prodName = if ($IsLTS) { 'pwsh-lts' } else { 'pwsh-preview' } $newRonnFile = $RonnFile -replace 'pwsh', $prodName - Copy-Item -Path $RonnFile -Destination $newRonnFile -force + Copy-Item -Path $RonnFile -Destination $newRonnFile -Force $RonnFile = $newRonnFile } @@ -1443,7 +1443,7 @@ function New-ManGzip if ($IsPreview.IsPresent) { - Remove-item $RonnFile + Remove-Item $RonnFile } # gzip in assets directory @@ -1642,7 +1642,7 @@ function New-ZipPackage $staging = "$PSScriptRoot/staging" New-StagingFolder -StagingPath $staging -PackageSourcePath $PackageSourcePath - Get-ChildItem $staging -Filter *.pdb -recurse | Remove-Item -Force + Get-ChildItem $staging -Filter *.pdb -Recurse | Remove-Item -Force Compress-Archive -Path $staging\* -DestinationPath $zipLocationPath } @@ -2077,7 +2077,7 @@ function Get-ProjectPackageInformation ) $csproj = "$RepoRoot\src\$ProjectName\$ProjectName.csproj" - [xml] $csprojXml = (Get-content -Raw -Path $csproj) + [xml] $csprojXml = (Get-Content -Raw -Path $csproj) # get the package references $packages=$csprojXml.Project.ItemGroup.PackageReference @@ -2560,7 +2560,7 @@ function New-NugetContentPackage # Setup staging directory so we don't change the original source directory $stagingRoot = New-SubFolder -Path $PSScriptRoot -ChildPath 'nugetStaging' -Clean - $contentFolder = Join-Path -path $stagingRoot -ChildPath 'content' + $contentFolder = Join-Path -Path $stagingRoot -ChildPath 'content' if ($PSCmdlet.ShouldProcess("Create staging folder")) { New-StagingFolder -StagingPath $contentFolder -PackageSourcePath $PackageSourcePath } @@ -2579,7 +2579,7 @@ function New-NugetContentPackage Write-Log "Running dotnet $arguments" Write-Log "Use -verbose to see output..." - Start-NativeExecution -sb {dotnet $arguments} | Foreach-Object {Write-Verbose $_} + Start-NativeExecution -sb {dotnet $arguments} | ForEach-Object {Write-Verbose $_} $nupkgFile = "${nugetFolder}\${nuspecPackageName}-${packageRuntime}.${nugetSemanticVersion}.nupkg" if (Test-Path $nupkgFile) @@ -2991,7 +2991,7 @@ function New-MSIPackage $staging = "$PSScriptRoot/staging" New-StagingFolder -StagingPath $staging -PackageSourcePath $ProductSourcePath - Get-ChildItem $staging -Filter *.pdb -recurse | Remove-Item -Force + Get-ChildItem $staging -Filter *.pdb -Recurse | Remove-Item -Force New-Item $assetsInSourcePath -type directory -Force | Write-Verbose @@ -3383,7 +3383,7 @@ function Test-FileWxs { $newXmlFileName = Join-Path -Path $env:TEMP -ChildPath ([System.io.path]::GetRandomFileName() + '.wxs') $newFilesAssetXml.Save($newXmlFileName) - $newXml = Get-Content -raw $newXmlFileName + $newXml = Get-Content -Raw $newXmlFileName $newXml = $newXml -replace 'amd64', '$(var.FileArchitecture)' $newXml = $newXml -replace 'x86', '$(var.FileArchitecture)' $newXml | Out-File -FilePath $newXmlFileName -Encoding ascii diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index c8bff8d6684..9ace6f720aa 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -61,7 +61,7 @@ function BuildPackages { $buildParams.Add("Runtime", 'alpine-x64') } else { # make the artifact name unique - $projectAssetsZipName = "linuxProjectAssets-$((get-date).Ticks)-symbols.zip" + $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" $buildParams.Add("Crossgen", $true) } @@ -106,10 +106,10 @@ foreach ($linuxPackage in $linuxPackages) { $filePath = $linuxPackage.FullName Write-Verbose "Copying $filePath to $destination" -Verbose - Copy-Item -Path $filePath -Destination $destination -force + Copy-Item -Path $filePath -Destination $destination -Force } -Write-Verbose "Exporting project.assets files ..." -verbose +Write-Verbose "Exporting project.assets files ..." -Verbose $projectAssetsCounter = 1 $projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets' @@ -120,7 +120,7 @@ Get-ChildItem $location\project.assets.json -Recurse | ForEach-Object { $itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $subfolder New-Item -Path $itemDestination -ItemType Directory -Force $file = $_.FullName - Write-Verbose "Copying $file to $itemDestination" -verbose + Write-Verbose "Copying $file to $itemDestination" -Verbose Copy-Item -Path $file -Destination "$itemDestination\" -Force $projectAssetsCounter++ } diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 3c6672f5241..e90e4220ffc 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -70,15 +70,15 @@ try{ Import-Module "$location\tools\packaging" -Force $env:platform = $null - Write-Verbose "Sync'ing Tags..." -verbose + Write-Verbose "Sync'ing Tags..." -Verbose Sync-PSTags -AddRemoteIfMissing - Write-Verbose "Bootstrapping powershell build..." -verbose + Write-Verbose "Bootstrapping powershell build..." -Verbose Start-PSBootstrap -Force -Package if ($PSCmdlet.ParameterSetName -eq 'packageSigned') { - Write-Verbose "Expanding signed build..." -verbose + Write-Verbose "Expanding signed build..." -Verbose if($Runtime -like 'fxdependent*') { Expand-PSSignedBuild -BuildZip $BuildZip -SkipPwshExeCheck @@ -92,7 +92,7 @@ try{ } else { - Write-Verbose "Starting powershell build for RID: $Runtime and ReleaseTag: $ReleaseTag ..." -verbose + Write-Verbose "Starting powershell build for RID: $Runtime and ReleaseTag: $ReleaseTag ..." -Verbose $buildParams = @{'CrossGen'= $Runtime -notmatch "arm" -and $Runtime -notlike "fxdependent*"} if($Symbols.IsPresent) @@ -122,7 +122,7 @@ try{ if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notmatch 'arm' -and $Runtime -notlike 'fxdependent*') { - Write-Verbose "Starting powershell packaging(msi)..." -verbose + Write-Verbose "Starting powershell packaging(msi)..." -Verbose Start-PSPackage @pspackageParams @releaseTagParam } @@ -130,7 +130,7 @@ try{ { $pspackageParams['Type']='msix' $pspackageParams['WindowsRuntime']=$Runtime - Write-Verbose "Starting powershell packaging(msix)..." -verbose + Write-Verbose "Starting powershell packaging(msix)..." -Verbose Start-PSPackage @pspackageParams @releaseTagParam } @@ -138,20 +138,20 @@ try{ { if (!$Symbols.IsPresent) { $pspackageParams['Type'] = 'zip-pdb' - Write-Verbose "Starting powershell symbols packaging(zip)..." -verbose + Write-Verbose "Starting powershell symbols packaging(zip)..." -Verbose Start-PSPackage @pspackageParams @releaseTagParam } $pspackageParams['Type']='zip' $pspackageParams['IncludeSymbols']=$Symbols.IsPresent - Write-Verbose "Starting powershell packaging(zip)..." -verbose + Write-Verbose "Starting powershell packaging(zip)..." -Verbose Start-PSPackage @pspackageParams @releaseTagParam - Write-Verbose "Exporting packages ..." -verbose + Write-Verbose "Exporting packages ..." -Verbose Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb,$location\*.msix | ForEach-Object { $file = $_.FullName - Write-Verbose "Copying $file to $destination" -verbose + Write-Verbose "Copying $file to $destination" -Verbose Copy-Item -Path $file -Destination "$destination\" -Force } } @@ -164,13 +164,13 @@ try{ ## Copy the fxdependent Zip package to destination. Get-ChildItem $location\PowerShell-*.zip | ForEach-Object { $file = $_.FullName - Write-Verbose "Copying $file to $destination" -verbose + Write-Verbose "Copying $file to $destination" -Verbose Copy-Item -Path $file -Destination "$destination\" -Force } } else { - Write-Verbose "Exporting project.assets files ..." -verbose + Write-Verbose "Exporting project.assets files ..." -Verbose $projectAssetsCounter = 1 $projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets' @@ -181,7 +181,7 @@ try{ $itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $subfolder New-Item -Path $itemDestination -ItemType Directory -Force $file = $_.FullName - Write-Verbose "Copying $file to $itemDestination" -verbose + Write-Verbose "Copying $file to $itemDestination" -Verbose Copy-Item -Path $file -Destination "$itemDestination\" -Force $projectAssetsCounter++ } @@ -193,7 +193,7 @@ try{ } finally { - Write-Verbose "Beginning build clean-up..." -verbose + Write-Verbose "Beginning build clean-up..." -Verbose if ($Wait.IsPresent) { $path = Join-Path $PSScriptRoot -ChildPath 'delete-to-continue.txt' diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 index 73c428dce2d..311fed7e169 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/dockerInstall.psm1 @@ -24,7 +24,7 @@ function Install-ChocolateyPackage $Version ) - if(-not(Get-Command -name Choco -ErrorAction SilentlyContinue)) + if(-not(Get-Command -Name Choco -ErrorAction SilentlyContinue)) { Write-Verbose "Installing Chocolatey provider..." -Verbose Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression @@ -42,25 +42,25 @@ function Install-ChocolateyPackage { Write-Verbose "Verifing $Executable is in path..." -Verbose $exeSource = $null - $exeSource = Get-ChildItem -path "$env:ProgramFiles\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName + $exeSource = Get-ChildItem -Path "$env:ProgramFiles\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName if(!$exeSource) { Write-Verbose "Falling back to x86 program files..." -Verbose - $exeSource = Get-ChildItem -path "${env:ProgramFiles(x86)}\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName + $exeSource = Get-ChildItem -Path "${env:ProgramFiles(x86)}\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName } # Don't search the chocolatey program data until more official locations have been searched if(!$exeSource) { Write-Verbose "Falling back to chocolatey..." -Verbose - $exeSource = Get-ChildItem -path "$env:ProgramData\chocolatey\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName + $exeSource = Get-ChildItem -Path "$env:ProgramData\chocolatey\$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName } # all obvious locations are exhausted, use brute force and search from the root of the filesystem if(!$exeSource) { Write-Verbose "Falling back to the root of the drive..." -Verbose - $exeSource = Get-ChildItem -path "/$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName + $exeSource = Get-ChildItem -Path "/$Executable" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName } if(!$exeSource) @@ -110,6 +110,6 @@ function Remove-Folder Write-Verbose "Cleaning up $Folder..." -Verbose $filter = Join-Path -Path $Folder -ChildPath * [int]$measuredCleanupMB = (Get-ChildItem $filter -Recurse | Measure-Object -Property Length -Sum).Sum / 1MB - Remove-Item -recurse -force $filter -ErrorAction SilentlyContinue + Remove-Item -Recurse -Force $filter -ErrorAction SilentlyContinue Write-Verbose "Cleaned up $measuredCleanupMB MB from $Folder" -Verbose } diff --git a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 index 043e6b65174..d0aeac9da54 100644 --- a/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 +++ b/tools/releaseBuild/azureDevOps/AzArtifactFeed/SyncGalleryToAzArtifacts.psm1 @@ -146,7 +146,7 @@ Function SortPackage { End { $versions = $allPackages.Version | - Foreach-Object { ($_ -split '-')[0] } | + ForEach-Object { ($_ -split '-')[0] } | Select-Object -Unique | Sort-Object -Descending -Property Version diff --git a/tools/releaseBuild/generatePackgeSigning.ps1 b/tools/releaseBuild/generatePackgeSigning.ps1 index 34f9ed74bc7..a217280c44e 100644 --- a/tools/releaseBuild/generatePackgeSigning.ps1 +++ b/tools/releaseBuild/generatePackgeSigning.ps1 @@ -65,7 +65,7 @@ function New-FileElement } } -[xml]$signingXml = get-content (Join-Path -Path $PSScriptRoot -ChildPath 'packagesigning.xml') +[xml]$signingXml = Get-Content (Join-Path -Path $PSScriptRoot -ChildPath 'packagesigning.xml') $job = $signingXml.SignConfigXML.job foreach($file in $AuthenticodeDualFiles) diff --git a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 index 50fd12b7a8e..ab2fc924d0e 100644 --- a/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 +++ b/tools/releaseBuild/macOS/PowerShellPackageVsts.ps1 @@ -82,11 +82,11 @@ if ($Build.IsPresent) { $macPackages = Get-ChildItem "$repoRoot/powershell*" -Include *.pkg, *.tar.gz foreach ($macPackage in $macPackages) { $filePath = $macPackage.FullName - $name = split-path -Leaf -Path $filePath + $name = Split-Path -Leaf -Path $filePath $extension = (Split-Path -Extension -Path $filePath).Replace('.', '') Write-Verbose "Copying $filePath to $destination" -Verbose Write-Host "##vso[artifact.upload containerfolder=results;artifactname=results]$filePath" Write-Host "##vso[task.setvariable variable=Package-$extension]$filePath" - Copy-Item -Path $filePath -Destination $destination -force + Copy-Item -Path $filePath -Destination $destination -Force } } diff --git a/tools/releaseBuild/setReleaseTag.ps1 b/tools/releaseBuild/setReleaseTag.ps1 index 97ea8ddb86c..35266c8c3df 100644 --- a/tools/releaseBuild/setReleaseTag.ps1 +++ b/tools/releaseBuild/setReleaseTag.ps1 @@ -65,7 +65,7 @@ if($ReleaseTag -eq 'fromBranch' -or !$ReleaseTag) # Branch is named release- if($Branch -match '^.*(release[-/])') { - Write-verbose "release branch:" -verbose + Write-Verbose "release branch:" -Verbose $releaseTag = $Branch -replace '^.*(release[-/])' $vstsCommandString = "vso[task.setvariable variable=$Variable]$releaseTag" Write-Verbose -Message "setting $Variable to $releaseTag" -Verbose @@ -79,16 +79,16 @@ if($ReleaseTag -eq 'fromBranch' -or !$ReleaseTag) elseif($branchOnly -eq 'master' -or $branchOnly -like '*dailytest*') { $isDaily = $true - Write-verbose "daily build" -verbose + Write-Verbose "daily build" -Verbose $metaDataJsonPath = Join-Path $PSScriptRoot -ChildPath '..\metadata.json' - $metadata = Get-content $metaDataJsonPath | ConvertFrom-Json + $metadata = Get-Content $metaDataJsonPath | ConvertFrom-Json $versionPart = $metadata.PreviewReleaseTag if($versionPart -match '-.*$') { $versionPart = $versionPart -replace '-.*$' } - $releaseTag = "$versionPart-daily.$((get-date).ToString('yyyyMMdd'))" + $releaseTag = "$versionPart-daily.$((Get-Date).ToString('yyyyMMdd'))" $vstsCommandString = "vso[task.setvariable variable=$Variable]$releaseTag" Write-Verbose -Message "setting $Variable to $releaseTag" -Verbose Write-Host -Object "##$vstsCommandString" @@ -100,11 +100,11 @@ if($ReleaseTag -eq 'fromBranch' -or !$ReleaseTag) } else { - Write-verbose "non-release branch" -verbose + Write-Verbose "non-release branch" -Verbose # Branch is named # Get version from metadata and append - $metaDataJsonPath = Join-Path $PSScriptRoot -ChildPath '..\metadata.json' - $metadata = Get-content $metaDataJsonPath | ConvertFrom-Json + $metadata = Get-Content $metaDataJsonPath | ConvertFrom-Json $versionPart = $metadata.PreviewReleaseTag if($versionPart -match '-.*$') { diff --git a/tools/releaseBuild/vstsbuild.ps1 b/tools/releaseBuild/vstsbuild.ps1 index bef8a491104..4e7c4086b01 100644 --- a/tools/releaseBuild/vstsbuild.ps1 +++ b/tools/releaseBuild/vstsbuild.ps1 @@ -21,7 +21,7 @@ DynamicParam { # Add a dynamic parameter '-Name' which specifies the name of the build to run # Get the names of the builds. - $buildJsonPath = (Join-Path -path $PSScriptRoot -ChildPath 'build.json') + $buildJsonPath = (Join-Path -Path $PSScriptRoot -ChildPath 'build.json') $build = Get-Content -Path $buildJsonPath | ConvertFrom-Json $names = @($build.Windows.Name) foreach($name in $build.Linux.Name) @@ -55,8 +55,8 @@ End { # If specified, Add package file to container if ($BuildPath) { - Import-Module (Join-Path -path $PSScriptRoot -childpath '..\..\build.psm1') - Import-Module (Join-Path -path $PSScriptRoot -childpath '..\packaging') + Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\..\build.psm1') + Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '..\packaging') # Use temp as destination if not running in VSTS $destFolder = $env:temp @@ -87,7 +87,7 @@ End { throw "Git is required to proceed. Install from 'https://git-scm.com/download/win'" } - Write-Verbose "cloning -b $psReleaseBranch --quiet https://github.com/$psReleaseFork/PSRelease.git" -verbose + Write-Verbose "cloning -b $psReleaseBranch --quiet https://github.com/$psReleaseFork/PSRelease.git" -Verbose & $gitBinFullPath clone -b $psReleaseBranch --quiet https://github.com/$psReleaseFork/PSRelease.git $location Push-Location -Path $PWD.Path diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index b31cfaaf2c2..e7d2386a47c 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -412,7 +412,7 @@ function Get-NewOfficalPackage { param( [String] - $Path = (Join-path -Path $PSScriptRoot -ChildPath '..\src'), + $Path = (Join-Path -Path $PSScriptRoot -ChildPath '..\src'), [Switch] $IncludeAll ) @@ -424,7 +424,7 @@ function Get-NewOfficalPackage $file = $_ # parse the csproj - [xml] $csprojXml = (Get-content -Raw -Path $_) + [xml] $csprojXml = (Get-Content -Raw -Path $_) # get the package references $packages=$csprojXml.Project.ItemGroup.PackageReference @@ -438,7 +438,7 @@ function Get-NewOfficalPackage if ($name) { # Get the current package from nuget - $versions = find-package -Name $name -Source https://nuget.org/api/v2/ -ErrorAction SilentlyContinue -AllVersions | + $versions = Find-Package -Name $name -Source https://nuget.org/api/v2/ -ErrorAction SilentlyContinue -AllVersions | Add-Member -Type ScriptProperty -Name Published -Value { $this.Metadata['published']} -PassThru | Where-Object { Test-IncludePackageVersion -NewVersion $_.Version -Version $package.version} @@ -602,25 +602,25 @@ function Update-PsVersionInCode $NextReleaseTag, [String] - $Path = (Join-path -Path $PSScriptRoot -ChildPath '..') + $Path = (Join-Path -Path $PSScriptRoot -ChildPath '..') ) $metaDataPath = (Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json') - $metaData = Get-Content -Path $metaDataPath | convertfrom-json + $metaData = Get-Content -Path $metaDataPath | ConvertFrom-Json $currentTag = $metaData.StableReleaseTag $currentVersion = $currentTag -replace '^v' $newVersion = $NewReleaseTag -replace '^v' $metaData.NextReleaseTag = $NextReleaseTag - Set-Content -path $metaDataPath -Encoding ascii -Force -Value ($metaData | convertto-json) + Set-Content -Path $metaDataPath -Encoding ascii -Force -Value ($metaData | ConvertTo-Json) Get-ChildItem -Path $Path -Recurse -File | Where-Object {$_.Extension -notin '.icns','.svg' -and $_.NAME -ne 'CHANGELOG.md' -and $_.DirectoryName -notmatch '[\\/]docs|demos[\\/]'} | Where-Object {$_ | Select-String -SimpleMatch $currentVersion -List} | - Foreach-Object { + ForEach-Object { $content = Get-Content -Path $_.FullName -Raw -ReadCount 0 $newContent = $content.Replace($currentVersion,$newVersion) - Set-Content -path $_.FullName -Encoding ascii -Force -Value $newContent -NoNewline + Set-Content -Path $_.FullName -Encoding ascii -Force -Value $newContent -NoNewline } } diff --git a/tools/windows/Reset-PWSHSystemPath.ps1 b/tools/windows/Reset-PWSHSystemPath.ps1 index 5a8a7d764e0..7a6a6d9e451 100644 --- a/tools/windows/Reset-PWSHSystemPath.ps1 +++ b/tools/windows/Reset-PWSHSystemPath.ps1 @@ -53,13 +53,13 @@ ForEach ($PathScopeItem in $PathScope) { $AssembledNewPath = $NewPath = '' #From the current path scope. retrieve the array of paths that match the pathspec of PowerShell (to use as a filter) - $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | Where { $_ -ilike "*\Program Files\Powershell\6*"}) + $pathstoremove = @([Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';') | where { $_ -ilike "*\Program Files\Powershell\6*"}) If (!$RemoveAllOccurences) { #If we are not removing all occurances of PowerShell paths, then remove the highest sorted path from the filter - $pathstoremove = @($pathstoremove | sort-object | Select-Object -skiplast 1) + $pathstoremove = @($pathstoremove | Sort-Object | Select-Object -SkipLast 1) } - Write-Verbose "Reset-PWSHSystemPath: Found $($pathstoremove.count) paths to remove from $PathScopeItem path scope: $($Pathstoremove -join ', ' | out-string)" + Write-Verbose "Reset-PWSHSystemPath: Found $($pathstoremove.count) paths to remove from $PathScopeItem path scope: $($Pathstoremove -join ', ' | Out-String)" If ($pathstoremove.count -gt 0) { foreach ($Path in [Environment]::GetEnvironmentVariable("PATH","$PathScopeItem").split(';')) From 440e02e3674f53c64f1c452a45eabd2b97e276e7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 9 May 2020 22:06:21 +0500 Subject: [PATCH 167/275] Bump NJsonSchema from 10.1.14 to 10.1.15 (#12608) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.14 to 10.1.15. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 34a3cf3a1df..f5a59291c55 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From b003b56e7bcf75d89a7e4ee526ca439fa703ff92 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Mon, 11 May 2020 20:57:31 +0200 Subject: [PATCH 168/275] Annotate `Assert` methods for better code analysis (#12618) --- src/System.Management.Automation/utils/assert.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/System.Management.Automation/utils/assert.cs b/src/System.Management.Automation/utils/assert.cs index 8fe3bc786b2..921ed42c0f3 100644 --- a/src/System.Management.Automation/utils/assert.cs +++ b/src/System.Management.Automation/utils/assert.cs @@ -11,6 +11,7 @@ #define DEBUG using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Text; namespace System.Management.Automation @@ -126,6 +127,7 @@ internal static void Assert( #if RESHARPER_ATTRIBUTES [JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)] #endif + [DoesNotReturnIf(false)] bool condition, string whyThisShouldNeverHappen) { @@ -159,6 +161,7 @@ internal static void #if RESHARPER_ATTRIBUTES [JetBrains.Annotations.AssertionCondition(JetBrains.Annotations.AssertionConditionType.IS_TRUE)] #endif + [DoesNotReturnIf(false)] bool condition, string whyThisShouldNeverHappen, string detailMessage) { From 2cbcd6c4fae474cd959c9bad4c5b7f9c3695c4f0 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 11 May 2020 14:59:22 -0400 Subject: [PATCH 169/275] Remove unused code (#12610) --- .../networktest/New-DockerTestBuild.ps1 | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 test/docker/networktest/New-DockerTestBuild.ps1 diff --git a/test/docker/networktest/New-DockerTestBuild.ps1 b/test/docker/networktest/New-DockerTestBuild.ps1 deleted file mode 100644 index b7347bd5dc8..00000000000 --- a/test/docker/networktest/New-DockerTestBuild.ps1 +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -param ( [switch]$Force, [switch]$UseExistingMsi ) - -$script:Constants = @{ - AccountName = 'PowerShell' - ProjectName = 'powershell-f975h' - TestImageName = "remotetestimage" - MsiName = "PSCore.msi" - Token = "" # in this particular use we don't need a token -} - -############ -### MAIN ### -############ - -#### DOCKER OPS ##### -# is docker installed? -$dockerExe = Get-Command docker -ea silentlycontinue -if ( $dockerExe.name -ne "docker.exe" ) { - throw "Cannot find docker, is it installed?" -} -# Check to see if we already have an image, and if so -# delete it if -Force was used, otherwise throw and exit -$TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) -{ - if ( $Force ) - { - docker rmi $Constants.TestImageName - } - else - { - throw ("{0} already exists, use '-Force' to remove" -f $Constants.TestImageName) - } -} -# check again - there could be some permission problems -$TestImage = docker images $Constants.TestImageName --format '{{.Repository}}' -if ( $TestImage -eq $Constants.TestImageName) -{ - throw ("'{0}' still exists, giving up" -f $Constants.TestImageName) -} - -#### MSI CHECKS #### -# check to see if the MSI is present -$MsiExists = Test-Path $Constants.MsiName -$msg = "{0} exists, use -Force to remove or -UseExistingMsi to use" -f $Constants.MsiName -if ( $MsiExists -and ! ($force -or $useExistingMsi)) -{ - throw $msg -} - -# remove the msi -if ( $MsiExists -and $Force -and ! $UseExistingMsi ) -{ - Remove-Item -Force $Constants.MsiName - $MsiExists = $false -} - -# a couple of checks before downloading or using the existing one -# if the msi exists and -UseExistingMsi is present, we'll use the -# one we found -if ( ! $MsiExists -and $UseExistingMsi ) -{ - throw ("{0} does not exist" -f $Constants.MsiName) -} -elseif ( $MsiExists -and ! $UseExistingMsi ) -{ - throw $msg -} - -# last check before bulding the image -if ( ! (Test-Path $Constants.MsiName) ) -{ - throw ("{0} does not exist, giving up" -f $Constants.MsiName) -} - -# collect the builds and select the last one -Docker build --tag $Constants.TestImageName . From 1bf5cc93175840fc22ee708c69a87fe704f77702 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 11 May 2020 13:17:43 -0700 Subject: [PATCH 170/275] Copy the `CommandInfo` property in `Command.Clone()` (#12301) --- .../engine/hostifaces/Command.cs | 1 + .../powershell/engine/Api/PSCommand.Tests.ps1 | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 test/powershell/engine/Api/PSCommand.Tests.ps1 diff --git a/src/System.Management.Automation/engine/hostifaces/Command.cs b/src/System.Management.Automation/engine/hostifaces/Command.cs index a31f0087b36..08f323d809a 100644 --- a/src/System.Management.Automation/engine/hostifaces/Command.cs +++ b/src/System.Management.Automation/engine/hostifaces/Command.cs @@ -109,6 +109,7 @@ internal Command(Command command) MergeToResult = command.MergeToResult; _mergeUnclaimedPreviousCommandResults = command._mergeUnclaimedPreviousCommandResults; IsEndOfStatement = command.IsEndOfStatement; + CommandInfo = command.CommandInfo; foreach (CommandParameter param in command.Parameters) { diff --git a/test/powershell/engine/Api/PSCommand.Tests.ps1 b/test/powershell/engine/Api/PSCommand.Tests.ps1 new file mode 100644 index 00000000000..9609db963e7 --- /dev/null +++ b/test/powershell/engine/Api/PSCommand.Tests.ps1 @@ -0,0 +1,71 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +Describe "PSCommand API tests" -Tag "CI" { + BeforeAll { + $shell = [PowerShell]::Create() + } + + AfterAll { + $shell.Dispose() + } + + BeforeEach { + $psCommand = [System.Management.Automation.PSCommand]::new() + } + + AfterEach { + $shell.Commands.Clear() + } + + Context "AddCommand method on PSCommand" { + It "Can add a command by name and parameter to a PSCommand" { + $null = $psCommand.AddCommand("Write-Output").AddParameter("InputObject", 5) + $shell.Commands = $psCommand + $result = $shell.Invoke() + $result | Should -Be 5 + } + + It "Can add a command by Command object and parameter to a PSCommand" { + $command = [System.Management.Automation.Runspaces.Command]::new("Get-Date") + $null = $psCommand.AddCommand($command) + $shell.Commands = $psCommand + $result = $shell.Invoke() + $result | Should -BeOfType System.DateTime + } + } + + Context "Cloning PSCommands" { + It "The clone method successfully copies commands" { + $null = $psCommand.AddCommand("Write-Output").AddParameter("InputObject", 5) + + $newCommand = $psCommand.Clone() + + $newCommand.Commands | Should -Not -BeNullOrEmpty + $newCommand.Commands[0].CommandText | Should -Be "Write-Output" + $newCommand.Commands[0].Parameters | Should -Not -BeNullOrEmpty + $newCommand.Commands[0].Parameters[0].Name | Should -Be "InputObject" + $newCommand.Commands[0].Parameters[0].Value | Should -Be 5 + } + + It "clones properly when using the setter on the PowerShell type" { + try { + $otherShell = [powershell]::Create('CurrentRunspace') + + # We manually create a CmdletInfo here (with an unresolable command) to verify that CmdletInfo's are cloned. + $cmdlet = [System.Management.Automation.CmdletInfo]::new('un-resolvable', [Microsoft.PowerShell.Commands.OutStringCommand]) + $null = $otherShell.AddCommand($cmdlet).AddParameter("InputObject", 'test') + + # Setter for "Commands" calls PSCommand.Clone() + $shell.Commands = $otherShell.Commands + + $result = $shell.Invoke() + $result | Should -Be "test +" + } + finally { + $otherShell.Dispose() + } + } + } +} From 013839cee1bc7a538744bcb98cfc8844915c6361 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Tue, 12 May 2020 20:31:58 +0200 Subject: [PATCH 171/275] ParameterBinderBase: Fixing incorrect index in format string (#12630) --- src/System.Management.Automation/engine/ParameterBinderBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index c2f2a45d057..e50395003fe 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -1798,7 +1798,7 @@ private object EncodeCollection( if (coerceElementTypeIfNeeded) { bindingTracer.WriteLine( - "Coercing scalar arg value to type {1}", + "Coercing scalar arg value to type {0}", collectionElementType); // Coerce the scalar type into the collection From 6583d501b5a9a45ef4ff47cb634b71b1abd8f54a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 12 May 2020 14:26:22 -0700 Subject: [PATCH 172/275] Fix a test failure (#12636) --- test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 index 6cdb521d782..b8b1cc607a5 100644 --- a/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 +++ b/test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1 @@ -1249,7 +1249,7 @@ dir -Recurse ` $res = TabExpansion2 -inputScript $inputStr -cursorColumn $inputStr.Length $res.CompletionMatches.Count | Should -BeGreaterThan 0 - $res.CompletionMatches[0].CompletionText | Should -BeExactly $expected + $res.CompletionMatches[0].CompletionText | Should -Be $expected } } From e74fc33b5fbec346a83bb5a9138f8c9e9a82da3b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 12 May 2020 15:11:10 -0700 Subject: [PATCH 173/275] Add link to lifecyle doc to distribution request template (#12638) --- .github/ISSUE_TEMPLATE/Distribution_Request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Distribution_Request.md b/.github/ISSUE_TEMPLATE/Distribution_Request.md index 63a503f440f..e8baabb0d19 100644 --- a/.github/ISSUE_TEMPLATE/Distribution_Request.md +++ b/.github/ISSUE_TEMPLATE/Distribution_Request.md @@ -26,5 +26,5 @@ assignees: '' - [ ] Docker image created - [ ] Docker image published - [ ] Distribution tested -- [ ] Lifecycle updated +- [ ] [Lifecycle](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/docs-conceptual/PowerShell-Support-Lifecycle.md) updated - [ ] Documentation Updated From 7bc2617fe3c87f4734446f41586bc008a33c83cb Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Tue, 12 May 2020 19:31:37 -0400 Subject: [PATCH 174/275] Fix string parameter binding for `BigInteger` numeric literals (#11634) --- .../engine/LanguagePrimitives.cs | 9 +++- .../engine/parser/Compiler.cs | 4 +- .../engine/runtime/ScriptBlockToPowerShell.cs | 4 +- .../Parser/ParameterBinding.Tests.ps1 | 41 +++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 54a9d568455..50b2e7950f7 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -14,6 +14,7 @@ using System.Management.Automation.Internal; using System.Management.Automation.Language; using System.Management.Automation.Runspaces; +using System.Numerics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; @@ -3307,6 +3308,11 @@ private static string ConvertNumericToString(object valueToConvert, return sgl.ToString(SinglePrecision, numberFormat); } + if (valueToConvert is BigInteger b) + { + return b.ToString(numberFormat); + } + return (string)Convert.ChangeType(valueToConvert, resultType, CultureInfo.InvariantCulture.NumberFormat); } catch (Exception e) @@ -4380,7 +4386,8 @@ internal static ConversionRank GetConversionRank(Type fromType, Type toType) typeof(Int16), typeof(Int32), typeof(Int64), typeof(UInt16), typeof(UInt32), typeof(UInt64), typeof(sbyte), typeof(byte), - typeof(Single), typeof(double), typeof(decimal) + typeof(Single), typeof(double), typeof(decimal), + typeof(BigInteger) }; private static Type[] s_integerTypes = new Type[] { diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 229aa3a5887..ac40050d4ab 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -4171,7 +4171,9 @@ public object VisitCommand(CommandAst commandAst) private Expression GetCommandArgumentExpression(CommandElementAst element) { var constElement = element as ConstantExpressionAst; - if (constElement != null && LanguagePrimitives.IsNumeric(LanguagePrimitives.GetTypeCode(constElement.StaticType))) + if (constElement != null + && (LanguagePrimitives.IsNumeric(LanguagePrimitives.GetTypeCode(constElement.StaticType)) + || constElement.StaticType == typeof(System.Numerics.BigInteger))) { var commandArgumentText = constElement.Extent.Text; if (!commandArgumentText.Equals(constElement.Value.ToString(), StringComparison.Ordinal)) diff --git a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs index 66b5f63da82..e2409eba626 100644 --- a/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs +++ b/src/System.Management.Automation/engine/runtime/ScriptBlockToPowerShell.cs @@ -643,7 +643,9 @@ private void ConvertCommand(CommandAst commandAst, bool isTrustedInput) { var constantExprAst = ast as ConstantExpressionAst; object argument; - if (constantExprAst != null && LanguagePrimitives.IsNumeric(LanguagePrimitives.GetTypeCode(constantExprAst.StaticType))) + if (constantExprAst != null + && (LanguagePrimitives.IsNumeric(LanguagePrimitives.GetTypeCode(constantExprAst.StaticType)) + || constantExprAst.StaticType == typeof(System.Numerics.BigInteger))) { var commandArgumentText = constantExprAst.Extent.Text; argument = constantExprAst.Value; diff --git a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 index a480997271f..7fd26912ead 100644 --- a/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 +++ b/test/powershell/Language/Parser/ParameterBinding.Tests.ps1 @@ -425,3 +425,44 @@ Describe "Custom type conversion in parameter binding" -Tags 'Feature' { } } } + +Describe 'Roundtrippable Conversions for Bare-string Numeric Literals passed to [string] Parameters' -Tags CI { + + BeforeAll { + $TestValues = @( + @{ Argument = "34uy" } + @{ Argument = "48y" } + @{ Argument = "8s" } + @{ Argument = "49us" } + @{ Argument = "26" } + @{ Argument = "28u" } + @{ Argument = "24l" } + @{ Argument = "32ul" } + @{ Argument = "20d" } + @{ Argument = "6n" } + ) + + function Test-SimpleStringValue([string] $Value) { $Value } + function Test-AdvancedStringValue { + [CmdletBinding()] + param( + [string] + $Value + ) + + $Value + } + } + + It 'should correctly convert back to string in simple functions' -TestCases $TestValues { + param($Argument) + + Invoke-Expression "Test-SimpleStringValue -Value $Argument" | Should -BeExactly $Argument + } + + It 'should correctly convert back to string in advanced functions' -TestCases $TestValues { + param($Argument) + + Invoke-Expression "Test-AdvancedStringValue -Value $Argument" | Should -BeExactly $Argument + } +} From 98b95e77ea1bc2b7c436a569cd877d801bb94c5e Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 13 May 2020 04:45:26 +0100 Subject: [PATCH 175/275] Replace Unicode nbsp with space in source (#12576) ``` -replace [char]0xA0, [char]0x20 ``` --- .../Debugging/DebuggerScriptTests.Tests.ps1 | 4 ++-- test/tools/Modules/PSSysLog/PSSysLog.psm1 | 16 ++++++++-------- test/tools/OpenCover/OpenCover.psm1 | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 index f574fba5790..1cf588427cc 100644 --- a/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 +++ b/test/powershell/Language/Scripting/Debugging/DebuggerScriptTests.Tests.ps1 @@ -214,8 +214,8 @@ Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" { 1..3 | ForEach-Object { $_ } | sort-object | get-unique' - $a = New-Object -ComObject Scripting.FileSystemObject - $f = $a.GetFile($scriptPath1) + $a = New-Object -ComObject Scripting.FileSystemObject + $f = $a.GetFile($scriptPath1) $scriptPath2 = $f.ShortPath $breakpoints = Set-PSBreakpoint $scriptPath2 1,2,3 -Action { continue } diff --git a/test/tools/Modules/PSSysLog/PSSysLog.psm1 b/test/tools/Modules/PSSysLog/PSSysLog.psm1 index 78819ec3db9..660e98226b2 100644 --- a/test/tools/Modules/PSSysLog/PSSysLog.psm1 +++ b/test/tools/Modules/PSSysLog/PSSysLog.psm1 @@ -1068,17 +1068,17 @@ function Wait-PSWinEvent $All ) -    $startTime = [DateTime]::Now + $startTime = [DateTime]::Now $lastFoundCount = 0; -    do -    { -        Start-Sleep -Seconds $pause + do + { + Start-Sleep -Seconds $pause $recordsToReturn = @() -        foreach ($thisRecord in (Get-WinEvent -FilterHashtable $filterHashtable -Oldest 2> $null)) -        { + foreach ($thisRecord in (Get-WinEvent -FilterHashtable $filterHashtable -Oldest 2> $null)) + { if($PSCmdlet.ParameterSetName -eq "ByPropertyName") { if ($thisRecord."$propertyName" -like "*$propertyValue*") @@ -1108,7 +1108,7 @@ function Wait-PSWinEvent } } } -        } + } if($recordsToReturn.Count -gt 0) { @@ -1119,7 +1119,7 @@ function Wait-PSWinEvent $lastFoundCount = $recordsToReturn.Count } -    } while (([DateTime]::Now - $startTime).TotalSeconds -lt $timeout) + } while (([DateTime]::Now - $startTime).TotalSeconds -lt $timeout) } #endregion eventlog support diff --git a/test/tools/OpenCover/OpenCover.psm1 b/test/tools/OpenCover/OpenCover.psm1 index eef32740b2b..45d5c682a19 100644 --- a/test/tools/OpenCover/OpenCover.psm1 +++ b/test/tools/OpenCover/OpenCover.psm1 @@ -31,7 +31,7 @@ function Get-ClassCoverageData([xml.xmlelement]$element) $classes = [system.collections.arraylist]::new() foreach ( $class in $element.classes.class ) { - # skip classes with names like <>f__AnonymousType6`4 + # skip classes with names like <>f__AnonymousType6`4 if ( $class.fullname -match "<>" ) { continue } $name = $class.fullname $branch = $class.summary.branchcoverage From 935f84ee1dedc8921fd1b9a0acee03a727a9c8a4 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 13 May 2020 08:17:37 -0700 Subject: [PATCH 176/275] Update build to use the new .NET SDK `5.0.100-preview.4.20258.7` (#12637) --- assets/files.wxs | 6 +++--- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index c87c85a486b..29ff69ec5d1 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3098,8 +3098,8 @@ - - + + @@ -4098,8 +4098,8 @@ - + diff --git a/global.json b/global.json index 0cc5aa5256d..26ded6964c0 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.4.20229.10" + "version": "5.0.100-preview.4.20258.7" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index d120f5bec65..a2f57e8a79b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index f5a59291c55..af0c1656ec7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index e82741bf417..c3422a7f0a9 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index a0ffd4408bc..085e2229fd4 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 65e3a8d2c1a..61dbd6a742d 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 1b5d1f1795c..3bd6e0d07c8 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 49ffb7c5e60..f25da4e1618 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 957fc422ee7..43added706f 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 15eb091df9e..a7006bb8da5 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 1f1534643c3..65fb08d96fe 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 42248a072f806586a262eb2821ac81cf8ed62d09 Mon Sep 17 00:00:00 2001 From: "Joel Sallow (/u/ta11ow)" <32407840+vexx32@users.noreply.github.com> Date: Thu, 14 May 2020 04:04:00 -0400 Subject: [PATCH 177/275] :bug: UnixComputer - null tolerance for tests (#12651) --- .../commands/management/ComputerUnix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs index a5e1ed331cb..023fc1d0501 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ComputerUnix.cs @@ -105,7 +105,7 @@ public class CommandLineCmdletBase : PSCmdlet, IDisposable /// public void Dispose() { - _process.Dispose(); + _process?.Dispose(); } #endregion "IDisposable Members" From 22e4f193499b737bcc8fb796e2b6708e7d6c3846 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 14 May 2020 17:47:51 +0100 Subject: [PATCH 178/275] Remove markdown unused definitions (#12656) --- README.md | 9 --------- docs/community/governance.md | 1 - docs/learning-powershell/README.md | 7 ++----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6648f2322c0..643f1ddb471 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,6 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7 -[in-ubuntu14]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1404 [in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1604 [in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1804 [in-deb9]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#debian-9 @@ -172,14 +171,6 @@ If you have any problems building, please consult the developer [FAQ][]. [FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md -[az-windows-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-windows?branchName=master -[az-windows-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=19 -[az-linux-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-linux?branchName=master -[az-linux-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=17 -[az-macos-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-macos?branchName=master -[az-macos-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=14 -[az-spell-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-static-analysis?branchName=master -[az-spell-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=22 [windows-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build/latest?definitionId=32 [linux-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=23 [macos-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=24 diff --git a/docs/community/governance.md b/docs/community/governance.md index 4d7307b675b..4261b618b1a 100644 --- a/docs/community/governance.md +++ b/docs/community/governance.md @@ -133,7 +133,6 @@ See our [Pull Request Process][pull-request-process] [RFC-repo]: https://github.com/PowerShell/PowerShell-RFC [pester]: ../testing-guidelines/WritingPesterTests.md -[ci-system]: ../testing-guidelines/testing-guidelines.md#ci-system [breaking-changes]: ../dev-process/breaking-change-contract.md [issue-process]: ../maintainers/issue-management.md [pull-request-process]: ../../.github/CONTRIBUTING.md#lifecycle-of-a-pull-request diff --git a/docs/learning-powershell/README.md b/docs/learning-powershell/README.md index dcf202ba82c..f1032c06d31 100644 --- a/docs/learning-powershell/README.md +++ b/docs/learning-powershell/README.md @@ -24,8 +24,9 @@ At the end of this exercise, you should be able to launch the PowerShell session You can launch PowerShell console by pressing Windows key, typing PowerShell, and clicking on Windows PowerShell. However if you want to try out the latest PowerShell, follow the [PowerShell on Windows][inst-win]. -- Alternatively you can get the PowerShell by [building it](../../README.md#building-powershell) +- Alternatively you can get the PowerShell by [building it][build-powershell] +[build-powershell]:../../README.md#building-the-repository [inst-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6 [inst-win]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 [inst-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6 @@ -57,10 +58,7 @@ Click on the link below to learn more about debugging: - [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode?view=powershell-6#debugging-with-visual-studio-code) - [PowerShell Command-line Debugging][cli-debugging] -[use-vscode-editor]:./using-vscode.md#editing-with-vs-code [cli-debugging]:./debugging-from-commandline.md -[get-powershell]:../../README.md#get-powershell -[build-powershell]:../../README.md#building-the-repository ### PowerShell Testing @@ -121,7 +119,6 @@ Note that all bash commands should continue working on PowerShell session. [getstarted-with-powershell]: https://channel9.msdn.com/Series/GetStartedPowerShell3 [why-learn-powershell]: https://blogs.technet.microsoft.com/heyscriptingguy/2014/10/18/weekend-scripter-why-learn-powershell/ -[Using Windows PowerShell for Administration]: https://docs.microsoft.com/powershell/scripting/samples/sample-scripts-for-administration?view=powershell-6 [ebook-from-Idera]:https://www.idera.com/resourcecentral/whitepapers/powershell-ebook [channel9-learn-powershell]: https://channel9.msdn.com/Search?term=powershell#ch9Search [idera-learn-powershell]: https://community.idera.com/database-tools/powershell/video_library/ From 3c07aad4bc062f4fc192853461d5bc3e304795b5 Mon Sep 17 00:00:00 2001 From: "Mathias R. Jessen" Date: Thu, 14 May 2020 19:24:28 +0200 Subject: [PATCH 179/275] Fix path handling bug in `PSTask` (#12554) --- .../engine/hostifaces/PSTask.cs | 7 ++++++- .../Foreach-Object-Parallel.Tests.ps1 | 21 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index 0c63c2a0b76..fe42bd55d24 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -447,7 +447,12 @@ public void Start(Runspace runspace) try { Runspace.DefaultRunspace = runspace; - runspace.ExecutionContext.SessionState.Internal.SetLocation(_currentLocationPath); + var context = new CmdletProviderContext(runspace.ExecutionContext) + { + // _currentLocationPath denotes the current path as-is, and should not be attempted expanded. + SuppressWildcardExpansion = true + }; + runspace.ExecutionContext.SessionState.Internal.SetLocation(_currentLocationPath, context); } catch (DriveNotFoundException) { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 index eadf67ae4c8..484454e3a85 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Foreach-Object-Parallel.Tests.ps1 @@ -105,6 +105,27 @@ Describe 'ForEach-Object -Parallel Basic Tests' -Tags 'CI' { $parallelScriptLocation.Path | Should -BeExactly $PWD.Path } + It 'Verifies that the current working directory can have wildcards in its name' { + $oldLocation = Get-Location + + $wildcardName = New-Item -Path 'TestDrive:\' -Name '[' -ItemType Directory + Set-Location -LiteralPath $wildcardName.FullName + try + { + { 1..1 | ForEach-Object -Parallel { $PWD } } | Should -Not -Throw + + $wildcardPathResult = 1..1 | ForEach-Object -Parallel { $PWD } + $wildcardPathResult.Path | Should -BeExactly $PWD.Path + } + finally + { + Set-Location -Path $oldLocation + if ($drive -is [System.IO.DirectoryInfo]) { + $drive | Remove-Item -Force + } + } + } + It 'Verifies no terminating error if current working drive is not found' { $oldLocation = Get-Location try From 8e928898648d0842cf7d368a458e85d747201da5 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 14 May 2020 16:06:03 -0700 Subject: [PATCH 180/275] Merge 7.0.1 change log (#12669) --- CHANGELOG/7.0.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG/7.0.md b/CHANGELOG/7.0.md index 2712bcfd4d2..380a258becc 100644 --- a/CHANGELOG/7.0.md +++ b/CHANGELOG/7.0.md @@ -1,5 +1,47 @@ # 7.0 Changelog +## [7.0.1] - 2020-05-14 + +### Engine Updates and Fixes + +- Discover assemblies loaded by `Assembly.Load(byte[])` and `Assembly.LoadFile` (#12203) +- Allow case insensitive paths for determining `PSModulePath` (#12192) + +### General Cmdlet Updates and Fixes + +- Add `null` check for Windows PowerShell install path (#12296) +- Fix Null Reference error in CSV commands (#12281) (Thanks @iSazonov!) +- Fix `WinCompat` module loading to treat Core edition modules higher priority (#12269) +- Fix `` detection regex in web cmdlets (#12099) (Thanks @vexx32!) +- Miscellaneous minor updates to `WinCompat` (#11980) +- Fix `ConciseView` where error message is wider than window width and doesn't have whitespace (#11880, #11746) +- Make `Test-Connection` always use the default synchronization context for sending ping requests (#11517) + +### Tests + +- Fix CIM tab complete test failure (#12636) + +### Build and Packaging Improvements + +
+ + +Move to .NET Core 3.1.202 SDK and update packages. + + +
    +
  • Use dotnet core 3.1.202 (Internal 11551)
  • +
  • Bump PowerShellGet from 2.2.3 to 2.2.4 (#12342)
  • +
  • Move to standard internal pool for building (#12119)
  • +
  • Bump NJsonSchema from 10.1.5 to 10.1.7 (#12050)
  • +
+ +
+ +### Documentation and Help Content + +- Remove the version number of PowerShell from `LICENSE` (#12019) + ## [7.0.0] - 2020-03-04 ### General Cmdlet Updates and Fixes @@ -957,6 +999,7 @@ - Update docs for `6.2.0-rc.1` release (#9022) - Update release template (#8996) +[7.0.1]: https://github.com/PowerShell/PowerShell/compare/v7.0.0...v7.0.1 [7.0.0]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.3...v7.0.0 [7.0.0-rc.3]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.2...v7.0.0-rc.3 [7.0.0-rc.2]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-rc.1...v7.0.0-rc.2 From 8bd96e03a9d8f34bf99171de407abf5263d17901 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 14 May 2020 16:06:23 -0700 Subject: [PATCH 181/275] Update `README.md` and `metadata.json` for next release (#12668) --- README.md | 50 ++++++++++++++++++++++----------------------- tools/metadata.json | 8 ++++---- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 643f1ddb471..17c04598364 100644 --- a/README.md +++ b/README.md @@ -60,31 +60,31 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu | Windows (arm) **Experimental** | [32-bit][rl-winarm]/[64-bit][rl-winarm64] | [32-bit][pv-winarm]/[64-bit][pv-winarm64] | [Instructions][in-arm] | | Raspbian (Stretch) **Experimental** | [32-bit][rl-arm32]/[64-bit][rl-arm64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | -[lts-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.ubuntu.18.04_amd64.deb -[lts-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.ubuntu.16.04_amd64.deb -[lts-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.debian.9_amd64.deb -[lts-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts_7.0.0-1.debian.10_amd64.deb -[lts-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-1.rhel.7.x86_64.rpm -[lts-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-1.centos.8.x86_64.rpm -[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-osx-x64.pkg - -[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x64.msi -[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x86.msi -[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.ubuntu.18.04_amd64.deb -[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.ubuntu.16.04_amd64.deb -[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.debian.9_amd64.deb -[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell_7.0.0-1.debian.10_amd64.deb -[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-1.rhel.7.x86_64.rpm -[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-1.centos.8.x86_64.rpm -[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-osx-x64.pkg -[rl-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-arm32.zip -[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-arm64.zip -[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x86.zip -[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/PowerShell-7.0.0-win-x64.zip -[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-osx-x64.tar.gz -[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-x64.tar.gz -[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm32.tar.gz -[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-linux-arm64.tar.gz +[lts-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.ubuntu.18.04_amd64.deb +[lts-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.ubuntu.16.04_amd64.deb +[lts-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.debian.9_amd64.deb +[lts-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.debian.10_amd64.deb +[lts-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts-7.0.1-1.rhel.7.x86_64.rpm +[lts-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts-7.0.1-1.centos.8.x86_64.rpm +[lts-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts-7.0.1-osx-x64.pkg + +[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x64.msi +[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x86.msi +[rl-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell_7.0.1-1.ubuntu.18.04_amd64.deb +[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell_7.0.1-1.ubuntu.16.04_amd64.deb +[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell_7.0.1-1.debian.9_amd64.deb +[rl-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell_7.0.1-1.debian.10_amd64.deb +[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-1.rhel.7.x86_64.rpm +[rl-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-1.centos.8.x86_64.rpm +[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-osx-x64.pkg +[rl-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-arm32.zip +[rl-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-arm64.zip +[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x86.zip +[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/PowerShell-7.0.1-win-x64.zip +[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-osx-x64.tar.gz +[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-linux-x64.tar.gz +[rl-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-linux-arm32.tar.gz +[rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell [pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x64.msi diff --git a/tools/metadata.json b/tools/metadata.json index 009102bbd4b..7d1597219d4 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { - "StableReleaseTag": "v7.0.0", + "StableReleaseTag": "v7.0.1", "PreviewReleaseTag": "v7.1.0-preview.2", - "ServicingReleaseTag": "v6.2.4", - "ReleaseTag": "v7.0.0", - "LTSReleaseTag" : ["v7.0.0"], + "ServicingReleaseTag": "v6.2.5", + "ReleaseTag": "v7.0.1", + "LTSReleaseTag" : ["v7.0.1"], "NextReleaseTag": "v7.1.0-preview.3", "LTSRelease": false } From fe4934ef401dfc20831977e9dec601d4a3e46663 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 14 May 2020 16:52:55 -0700 Subject: [PATCH 182/275] Update change log for `6.2.5` release (#12670) --- CHANGELOG/6.2.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG/6.2.md b/CHANGELOG/6.2.md index 74a33e3c311..23f3e4e3518 100644 --- a/CHANGELOG/6.2.md +++ b/CHANGELOG/6.2.md @@ -1,5 +1,22 @@ # 6.2 Changelog +## [6.2.5] - 2020-05-14 + +### Build and Packaging Improvements + +
+ +
    +
  • Port back the code for new changelog format.
  • +
  • Work around FPM issue with a specific version on macOS
  • +
  • Update the combined package build to release the daily builds (#10449)
  • +
  • Refactor packaging pipeline (#11852)
  • +
  • Bump .NET SDK version to the version 2.1.18
  • +
  • Move to standard internal pool for building (#12119)
  • +
+ +
+ ## [6.2.4] - 2020-01-27 ### General Cmdlet Updates and Fixes @@ -794,6 +811,7 @@ - Update `CONTRIBUTION.md` about adding an empty line after the copyright header (#7706) (Thanks @iSazonov!) - Update docs about .NET Core version `2.0` to be about version `2.x` (#7467) (Thanks @bergmeister!) +[6.2.5]: https://github.com/PowerShell/PowerShell/compare/v6.2.4...v6.2.5 [6.2.4]: https://github.com/PowerShell/PowerShell/compare/v6.2.3...v6.2.4 [6.2.3]: https://github.com/PowerShell/PowerShell/compare/v6.2.2...v6.2.3 [6.2.2]: https://github.com/PowerShell/PowerShell/compare/v6.2.1...v6.2.2 From fde00de77f48f4bd2eede46dc3ed4a812da0c2d6 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 15 May 2020 04:29:43 +0100 Subject: [PATCH 183/275] Update docs.microsoft.com links (#12653) # PR Summary * remove explicit en-us from links * remove view parameter ## PR Context follow-up #7013 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [ ] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .github/ISSUE_TEMPLATE/Bug_Report.md | 2 +- .github/SUPPORT.md | 4 +-- ADOPTERS.md | 2 +- CHANGELOG/6.0.md | 2 +- README.md | 32 +++++++++---------- demos/DSC/readme.md | 2 +- docs/FAQ.md | 2 +- docs/building/linux.md | 2 +- .../command-line-simple-example.md | 2 +- docs/learning-powershell/README.md | 12 +++---- .../debugging-from-commandline.md | 4 +-- .../commands/utility/Get-Error.cs | 2 +- .../host/msh/ConsoleHost.cs | 2 +- .../namespaces/FileSystemProvider.cs | 2 +- .../assets/localized.ps1 | 2 +- .../Modules/HelpersCommon/HelpersCommon.psm1 | 2 +- .../Modules/HttpListener/HttpListener.psm1 | 2 +- 17 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.md b/.github/ISSUE_TEMPLATE/Bug_Report.md index 5b188e071ae..871519ca921 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.md +++ b/.github/ISSUE_TEMPLATE/Bug_Report.md @@ -16,7 +16,7 @@ This repository is **ONLY** for PowerShell Core 6 and PowerShell 7+ issues. - Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases) - Search the existing issues. - Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md). -- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6). +- Refer to the [known issues](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6). --> diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 655b55c65c5..a34d36186ed 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -5,9 +5,9 @@ If you do not see your problem captured, please file a [new issue][] and follow Also make sure to see the [Official Support Policy][]. If you know how to fix the issue, feel free to send a pull request our way. (The [Contribution Guides][] apply to that pull request, you may want to give it a read!) -[Official Support Policy]: https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle?view=powershell-6 +[Official Support Policy]: https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle [FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md [Contribution Guides]: https://github.com/PowerShell/PowerShell/tree/master/.github/CONTRIBUTING.md -[known issues]: https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6 +[known issues]: https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6 [GitHub issues]: https://github.com/PowerShell/PowerShell/issues [new issue]: https://github.com/PowerShell/PowerShell/issues/new/choose diff --git a/ADOPTERS.md b/ADOPTERS.md index 50e82219727..2a815ed1bb4 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -17,7 +17,7 @@ This is a list of adopters of using PowerShell in production or in their product More information about Azure Cloud Shell is available at [Azure Cloud Shell Overview.](https://docs.microsoft.com/azure/cloud-shell/overview) * [Azure Functions - PowerShell](https://github.com/Azure/azure-functions-powershell-worker) is a serverless compute service to execute PowerShell scripts in the cloud without worrying about managing resources. In addition, Azure Functions provides client tools such as [`Az.Functions`](https://www.powershellgallery.com/packages/Az.Functions), a cross-platform PowerShell module to manage function apps and service plans in the cloud. - For more information about Functions, please visit [functions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview). + For more information about Functions, please visit [functions overview](https://docs.microsoft.com/azure/azure-functions/functions-overview). * [PowerShell Universal Dashboard](https://ironmansoftware.com/powershell-universal-dashboard) is a cross-platform web framework for PowerShell. It provides the ability to create robust, interactive websites, REST APIs, and Electron-based desktop apps with PowerShell script. More information about PowerShell Universal Dashboard is available at the [PowerShell Universal Dashboard Docs](https://docs.universaldashboard.io). diff --git a/CHANGELOG/6.0.md b/CHANGELOG/6.0.md index 61a20553ab0..b5993b5be30 100644 --- a/CHANGELOG/6.0.md +++ b/CHANGELOG/6.0.md @@ -736,7 +736,7 @@ For more information on this, we invite you to read [this blog post explaining P - Once the pipeline is running as a job, all of the standard `*-Job` cmdlets can be used to manage the job. - Variables (ignoring process-specific variables) used in the pipeline are automatically copied to the job so `Copy-Item $foo $bar &` just works. - The job is also run in the current directory instead of the user's home directory. -- For more information about PowerShell jobs, see [about_Jobs](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_jobs?view=powershell-6). +- For more information about PowerShell jobs, see [about_Jobs](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_jobs). ### Engine updates and fixes diff --git a/README.md b/README.md index 17c04598364..dc9f64330ad 100644 --- a/README.md +++ b/README.md @@ -106,23 +106,23 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview -[in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7 -[in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1604 -[in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#ubuntu-1804 -[in-deb9]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#debian-9 -[in-centos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#centos-7 -[in-rhel7]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#red-hat-enterprise-linux-rhel-7 -[in-opensuse]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#opensuse -[in-fedora]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#fedora -[in-archlinux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#arch-linux -[in-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7 +[in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows +[in-ubuntu16]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1604 +[in-ubuntu18]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#ubuntu-1804 +[in-deb9]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#debian-9 +[in-centos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#centos-7 +[in-rhel7]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#red-hat-enterprise-linux-rhel-7 +[in-opensuse]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#opensuse +[in-fedora]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#fedora +[in-archlinux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#arch-linux +[in-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos [in-docker]: https://github.com/PowerShell/PowerShell-Docker -[in-kali]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#kali -[in-windows-zip]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-7#zip -[in-tar-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#binary-archives -[in-tar-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7#binary-archives -[in-raspbian]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7#raspbian -[in-arm]: https://docs.microsoft.com/powershell/scripting/install/powershell-core-on-arm?view=powershell-7 +[in-kali]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#kali +[in-windows-zip]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows#zip +[in-tar-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives +[in-tar-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos#binary-archives +[in-raspbian]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#raspbian +[in-arm]: https://docs.microsoft.com/powershell/scripting/install/powershell-core-on-arm [corefx-win]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#windows [corefx-linux]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux [corefx-macos]:https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#macos diff --git a/demos/DSC/readme.md b/demos/DSC/readme.md index 8b134473eb4..0ce83fb3efa 100644 --- a/demos/DSC/readme.md +++ b/demos/DSC/readme.md @@ -1,6 +1,6 @@ # DSC MOF Compilation Demo -[PowerShell Desired State Configuration](https://docs.microsoft.com/powershell/scripting/dsc/overview/overview?view=powershell-6) is a declarative configuration platform for Windows and Linux. +[PowerShell Desired State Configuration](https://docs.microsoft.com/powershell/scripting/dsc/overview/overview) is a declarative configuration platform for Windows and Linux. DSC configurations can be authored in PowerShell and compiled into the resultant MOF document. This demo shows use of PowerShell to author a DSC configuration to set the configuration of an Apache web server. PowerShell scripting is used to assess distribution and version-specific properties, diff --git a/docs/FAQ.md b/docs/FAQ.md index e24c05728c0..2de12360485 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -3,7 +3,7 @@ ## Where can I learn PowerShell's syntax? [SS64.com](https://ss64.com/ps/syntax.html) is a good resource. -[Microsoft Docs](https://docs.microsoft.com/powershell/scripting/overview?view=powershell-6) is another excellent resource. +[Microsoft Docs](https://docs.microsoft.com/powershell/scripting/overview) is another excellent resource. ## What are the best practices and style? diff --git a/docs/building/linux.md b/docs/building/linux.md index 2d25af84bb2..5feef641676 100644 --- a/docs/building/linux.md +++ b/docs/building/linux.md @@ -24,7 +24,7 @@ and [CMake][] to build the native components. Installing the toolchain is as easy as running `Start-PSBootstrap` in PowerShell. Of course, this requires a self-hosted copy of PowerShell on Linux. -Fortunately, this is as easy as [downloading and installing the package](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6#binary-archives). +Fortunately, this is as easy as [downloading and installing the package](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux#binary-archives). The `./tools/install-powershell.sh` script will also install the PowerShell package. In Bash: diff --git a/docs/cmdlet-example/command-line-simple-example.md b/docs/cmdlet-example/command-line-simple-example.md index 1af04f4f261..ae4693a10d7 100644 --- a/docs/cmdlet-example/command-line-simple-example.md +++ b/docs/cmdlet-example/command-line-simple-example.md @@ -220,7 +220,7 @@ and macOS as well as Windows using the .NET Core 2.x SDK command-line tools. For more information on .NET Standard, check out the [documentation][net-std-docs] and the [.NET Standard YouTube channel][net-std-chan]. -[dotnet-cli]: https://docs.microsoft.com/dotnet/core/tools/?tabs=netcore2x +[dotnet-cli]: https://docs.microsoft.com/dotnet/core/tools/ [net-core-sdk]: https://www.microsoft.com/net/download/core [net-std-docs]: https://docs.microsoft.com/dotnet/standard/net-standard [net-std-chan]: https://www.youtube.com/playlist?list=PLRAdsfhKI4OWx321A_pr-7HhRNk7wOLLY diff --git a/docs/learning-powershell/README.md b/docs/learning-powershell/README.md index f1032c06d31..30dd84cafdf 100644 --- a/docs/learning-powershell/README.md +++ b/docs/learning-powershell/README.md @@ -27,9 +27,9 @@ At the end of this exercise, you should be able to launch the PowerShell session - Alternatively you can get the PowerShell by [building it][build-powershell] [build-powershell]:../../README.md#building-the-repository -[inst-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6 -[inst-win]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 -[inst-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-6 +[inst-linux]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux +[inst-win]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows +[inst-macos]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-macos ## Getting Started with PowerShell @@ -48,14 +48,14 @@ You can use your favorite editor to write scripts. We use Visual Studio Code (VS Code) which works on Windows, Linux, and macOS. Click on the following link to create your first PowerShell script. -- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode?view=powershell-6) +- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode) ### PowerShell Debugger Debugging can help you find bugs and fix problems in your PowerShell scripts. Click on the link below to learn more about debugging: -- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode?view=powershell-6#debugging-with-visual-studio-code) +- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode#debugging-with-visual-studio-code) - [PowerShell Command-line Debugging][cli-debugging] [cli-debugging]:./debugging-from-commandline.md @@ -124,4 +124,4 @@ Note that all bash commands should continue working on PowerShell session. [idera-learn-powershell]: https://community.idera.com/database-tools/powershell/video_library/ [quick-reference]: https://www.powershellmagazine.com/2014/04/24/windows-powershell-4-0-and-other-quick-reference-guides/ [script-guy-how-to]:https://blogs.technet.microsoft.com/tommypatterson/2015/09/04/ed-wilsons-powershell5-videos-now-on-channel9-2/ -[basic-cookbooks]:https://docs.microsoft.com/powershell/scripting/samples/sample-scripts-for-administration?view=powershell-6 +[basic-cookbooks]:https://docs.microsoft.com/powershell/scripting/samples/sample-scripts-for-administration diff --git a/docs/learning-powershell/debugging-from-commandline.md b/docs/learning-powershell/debugging-from-commandline.md index cceb8e922a6..489f79c5dbc 100644 --- a/docs/learning-powershell/debugging-from-commandline.md +++ b/docs/learning-powershell/debugging-from-commandline.md @@ -1,6 +1,6 @@ # Debugging in PowerShell Command-line -As we know, we can debug PowerShell code via GUI tools like [Visual Studio Code](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode?view=powershell-6#debugging-with-visual-studio-code). In addition, we can +As we know, we can debug PowerShell code via GUI tools like [Visual Studio Code](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode#debugging-with-visual-studio-code). In addition, we can directly perform debugging within the PowerShell command-line session by using the PowerShell debugger cmdlets. This document demonstrates how to use the cmdlets for the PowerShell command-line debugging. We will cover the following topics: setting a debug breakpoint on a line of code and on a variable. @@ -169,5 +169,5 @@ Now you know the basics of the PowerShell debugging from PowerShell command-line ## More Reading -- [about_Debuggers](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_debuggers?view=powershell-6) +- [about_Debuggers](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_debuggers) - [PowerShell Debugging](https://blogs.technet.microsoft.com/heyscriptingguy/tag/debugging/) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs index e7fa686c389..7c2fdbe0c14 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-Error.cs @@ -12,7 +12,7 @@ namespace Microsoft.PowerShell.Commands /// Class for Get-Error implementation. /// [Cmdlet(VerbsCommon.Get, "Error", - HelpUri = "https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-error?view=powershell-7&WT.mc_id=ps-gethelp", + HelpUri = "https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/get-error", DefaultParameterSetName = NewestParameterSetName)] [OutputType("System.Management.Automation.ErrorRecord#PSExtendedError", "System.Exception#PSExtendedError")] public sealed class GetErrorCommand : PSCmdlet diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index eaa0d3d43d9..43b3a866096 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -1580,7 +1580,7 @@ private bool IsScreenReaderActive() if (Platform.IsWindowsDesktop) { // Note: this API can detect if a third-party screen reader is active, such as NVDA, but not the in-box Windows Narrator. - // Quoted from https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa about the + // Quoted from https://docs.microsoft.com/windows/win32/api/winuser/nf-winuser-systemparametersinfoa about the // accessibility parameter 'SPI_GETSCREENREADER': // "Narrator, the screen reader that is included with Windows, does not set the SPI_SETSCREENREADER or SPI_GETSCREENREADER flags." bool enabled = false; diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 23706ab1e05..3c35e1bab60 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -8164,7 +8164,7 @@ internal static bool IsReparsePointWithTarget(FileSystemInfo fileInfo) var data = new WIN32_FIND_DATA(); using (var handle = FindFirstFileEx(fileInfo.FullName, FINDEX_INFO_LEVELS.FindExInfoBasic, ref data, FINDEX_SEARCH_OPS.FindExSearchNameMatch, IntPtr.Zero, 0)) { - // The name surrogate bit 0x20000000 is defined in https://docs.microsoft.com/en-us/windows/win32/fileio/reparse-point-tags + // The name surrogate bit 0x20000000 is defined in https://docs.microsoft.com/windows/win32/fileio/reparse-point-tags // Name surrogates (0x20000000) are reparse points that point to other named entities local to the filesystem // (like symlinks and mount points). // In the case of OneDrive, they are not name surrogates and would be safe to recurse into. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 index 45344ec2917..6e38f7d037a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/localized.ps1 @@ -1,4 +1,4 @@ -# Sample code from https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization?view=powershell-6&viewFallbackFrom=powershell-Microsoft.PowerShell.Core +# Sample code from https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_script_internationalization $Day = DATA { # culture="en-US" diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index 8a13eef02b9..0071f16fcdc 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -355,7 +355,7 @@ function New-ComplexPassword $password = [string]::Empty # Windows password complexity rule requires minimum 8 characters and using at least 3 of the # buckets above, so we just pick one from each bucket twice. - # https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements + # https://docs.microsoft.com/windows/security/threat-protection/security-policy-settings/password-must-meet-complexity-requirements 1..2 | ForEach-Object { $Password += $numbers[(Get-Random $numbers.Length)] + $lowercase[(Get-Random $lowercase.Length)] + $uppercase[(Get-Random $uppercase.Length)] + $symbols[(Get-Random $symbols.Length)] diff --git a/test/tools/Modules/HttpListener/HttpListener.psm1 b/test/tools/Modules/HttpListener/HttpListener.psm1 index 3df69760d54..5bec597cf32 100644 --- a/test/tools/Modules/HttpListener/HttpListener.psm1 +++ b/test/tools/Modules/HttpListener/HttpListener.psm1 @@ -173,7 +173,7 @@ Function Start-HTTPListener { Example: test=redirectex&type=Moved&multiredirect=true - See also https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode?view=netcore-2.1 + See also https://docs.microsoft.com/dotnet/api/system.net.httpstatuscode #> "redirect" { From 2c49a6a5601beafbeea5bac345d89859e56a2eb6 Mon Sep 17 00:00:00 2001 From: Sergey Vasin Date: Fri, 15 May 2020 21:19:54 +0300 Subject: [PATCH 184/275] Remove duplicate tests from `Measure-Object.Tests.ps1` (#12683) --- .../Measure-Object.Tests.ps1 | 215 +----------------- 1 file changed, 1 insertion(+), 214 deletions(-) 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 afc35f0fdbb..ea96741de3a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 @@ -358,117 +358,13 @@ Describe "Measure-Object DRT basic functionality" -Tags "CI" { } } } - - It "Measure-Object with ScriptBlock properties should work" { - $result = 1..10 | Measure-Object -Sum -Average -Minimum -Maximum -Property {$_ * 10} - $result.Count | Should -Be 10 - $result.Average | Should -Be 55 - $result.Sum | Should -Be 550 - $result.Minimum | Should -Be 10 - $result.Maximum | Should -Be 100 - $result.Property | Should -Be '$_ * 10' - } - - It "Measure-Object with ScriptBlock properties should work with -word" { - $result = "a,b,c" | Measure-Object -Word {$_ -split ','} - $result.Words | Should -Be 3 - } - - It "Measure-Object ScriptBlock properties should be able to transform input" { - $map = @{ one = 1; two = 2; three = 3 } - $result = "one", "two", "three" | Measure-Object -Sum {$map[$_]} - $result.Sum | Should -Be 6 - } - - It "Measure-Object should handle hashtables as objects" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum fo* - $result.Sum | Should -Be 14 - } - - It "Measure-Object should handle hashtables as objects with ScriptBlock properties" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum {$_.foo * 10 } - $result.Sum | Should -Be 140 - } - - # - # Since PSPropertyExtression is now a public type, this function is used to test its - # operation as a parameter on a PowerShell function, independent of Measure-Object - # - function Test-PSPropertyExpression { - [CmdletBinding()] - param ( - [Parameter(Mandatory,Position=0)] - [PSPropertyExpression] - $pe, - [Parameter(ValueFromPipeline)] - $InputObject - ) - begin { $sum = 0} - process { $sum += $pe.GetValues($InputObject).result } - end { $sum } - } - - It "Test-PropertyExpression function with a wildcard property expression should sum numbers" { - $result = (1..10).ForEach{@{value = $_}} | Test-PSPropertyExpression val* - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should sum numbers" { - $result = 1..10 | Test-PSPropertyExpression {$_} - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should be able to transform input" { - # Count the number of 'e's in the words. - $result = "one", "two", "three", "four", "five" | Test-PSPropertyExpression {($_.ToCharArray() -match 'e').Count} - $result | Should -Be 4 - } - It "Measure-Object with multiple lines should work"{ - $result = "123`n4" | Measure-Object -Line - $result.Lines | Should -Be 2 - } - - It "Measure-Object with ScriptBlock properties should work" { - $result = 1..10 | Measure-Object -Sum -Average -Minimum -Maximum -Property {$_ * 10} - $result.Count | Should -Be 10 - $result.Average | Should -Be 55 - $result.Sum | Should -Be 550 - $result.Minimum | Should -Be 10 - $result.Maximum | Should -Be 100 - $result.Property | Should -Be '$_ * 10' - } - - It "Measure-Object with ScriptBlock properties should work with -word" { - $result = "a,b,c", "d,e" | Measure-Object -Word {$_ -split ','} - $result.Words | Should -Be 5 - } - - It "Measure-Object ScriptBlock properties should be able to transform input" { - $map = @{ one = 1; two = 2; three = 3 } - $result = "one", "two", "three" | Measure-Object -Sum {$map[$_]} - $result.Sum | Should -Be 6 - } - - It "Measure-Object should handle hashtables as objects" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum fo* - $result.Sum | Should -Be 14 - } - - It "Measure-Object should handle hashtables as objects with ScriptBlock properties" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum {$_.foo * 10 } - $result.Sum | Should -Be 140 - } } # Since PSPropertyExpression is now a public type, it can be tested # directly, independent of the Measure-Object cmdlet Describe "Directly test the PSPropertyExpression type" -Tags "CI" { # this function is used to test the use of PSPropertyExpression - # as a parameter in script, + # as a parameter in script function Test-PSPropertyExpression { [CmdletBinding()] param ( @@ -537,112 +433,3 @@ Describe "Directly test the PSPropertyExpression type" -Tags "CI" { $result.Sum | Should -Be 140 } } - -# Since PSPropertyExpression is now a public type, it can be tested -# directly, independent of the Measure-Object cmdlet -Describe "Directly test the PSPropertyExpression type" -Tags "CI" { - # this function is used to test the use of PSPropertyExpression - # as a parameter in script, - function Test-PSPropertyExpression { - [CmdletBinding()] - param ( - [Parameter(Mandatory,Position=0)] - [PSPropertyExpression] - $pe, - [Parameter(ValueFromPipeline)] - $InputObject - ) - begin { $sum = 0} - process { $sum += $pe.GetValues($InputObject).result } - end { $sum } - } - - It "Test-PropertyExpression function with a wildcard property expression should sum numbers" { - $result = (1..10).ForEach{@{value = $_}} | Test-PSPropertyExpression val* - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should sum numbers" { - $result = 1..10 | Test-PSPropertyExpression {$_} - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should be able to transform input" { - # Count the number of 'e's in the words. - $result = "one", "two", "three", "four", "five" | Test-PSPropertyExpression {($_.ToCharArray() -match 'e').Count} - $result | Should -Be 4 - } - It "Measure-Object with multiple lines should work"{ - $result = "123`n4" | Measure-Object -Line - $result.Lines | Should -Be 2 - } - - It "Measure-Object with ScriptBlock properties should work" { - $result = 1..10 | Measure-Object -Sum -Average -Minimum -Maximum -Property {$_ * 10} - $result.Count | Should -Be 10 - $result.Average | Should -Be 55 - $result.Sum | Should -Be 550 - $result.Minimum | Should -Be 10 - $result.Maximum | Should -Be 100 - $result.Property | Should -Be '$_ * 10' - } - - It "Measure-Object with ScriptBlock properties should work with -word" { - $result = "a,b,c", "d,e" | Measure-Object -Word {$_ -split ','} - $result.Words | Should -Be 5 - } - - It "Measure-Object ScriptBlock properties should be able to transform input" { - $map = @{ one = 1; two = 2; three = 3 } - $result = "one", "two", "three" | Measure-Object -Sum {$map[$_]} - $result.Sum | Should -Be 6 - } - - It "Measure-Object should handle hashtables as objects" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum fo* - $result.Sum | Should -Be 14 - } - - It "Measure-Object should handle hashtables as objects with ScriptBlock properties" { - $htables = @{foo = 1}, @{foo = 3}, @{foo = 10} - $result = $htables | Measure-Object -Sum {$_.foo * 10 } - $result.Sum | Should -Be 140 - } -} - -# Since PSPropertyExpression is now a public type, it can be tested -# directly, independent of the Measure-Object cmdlet -Describe "Directly test the PSPropertyExpression type" -Tags "CI" { - # this function is used to test the use of PSPropertyExpression - # as a parameter in script, - function Test-PSPropertyExpression { - [CmdletBinding()] - param ( - [Parameter(Mandatory,Position=0)] - [PSPropertyExpression] - $pe, - [Parameter(ValueFromPipeline)] - $InputObject - ) - begin { $sum = 0} - process { $sum += $pe.GetValues($InputObject).result } - end { $sum } - } - - It "Test-PropertyExpression function with a wildcard property expression should sum numbers" { - $result = (1..10).ForEach{@{value = $_}} | Test-PSPropertyExpression val* - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should sum numbers" { - $result = 1..10 | Test-PSPropertyExpression {$_} - $result | Should -Be 55 - } - - It "Test-PropertyExpression function with a scriptblock property expression should be able to transform input" { - # Count the number of 'e's in the words. - $result = "one", "two", "three", "four", "five" | Test-PSPropertyExpression {($_.ToCharArray() -match 'e').Count} - $result | Should -Be 4 - } -} From 0695dde098f1fbfc07ac548d54dff3b17fd47416 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 15 May 2020 12:52:39 -0700 Subject: [PATCH 185/275] Disable uploading Symbols package (#12687) --- .../azureDevOps/templates/upload.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/releaseBuild/azureDevOps/templates/upload.yml b/tools/releaseBuild/azureDevOps/templates/upload.yml index b16fabaac57..6316ddf6169 100644 --- a/tools/releaseBuild/azureDevOps/templates/upload.yml +++ b/tools/releaseBuild/azureDevOps/templates/upload.yml @@ -37,15 +37,16 @@ steps: ContainerName: '$(AzureVersion)' condition: succeeded() -- task: AzureFileCopy@3 - displayName: 'upload pbd zip to Azure - ${{ parameters.architecture }}' - inputs: - SourcePath: '$(System.ArtifactsDirectory)\signed\PowerShell-Symbols-${{ parameters.version }}-win-${{ parameters.architecture }}.zip' - azureSubscription: '$(AzureFileCopySubscription)' - Destination: AzureBlob - storage: '$(StorageAccount)' - ContainerName: '$(AzureVersion)' - condition: and(succeeded(), eq('${{ parameters.pdb }}', 'yes')) +# Disable upload task as the symbols package is not currently used and we want to avoid publishing this in releases +#- task: AzureFileCopy@3 +# displayName: 'upload pbd zip to Azure - ${{ parameters.architecture }}' +# inputs: +# SourcePath: '$(System.ArtifactsDirectory)\signed\PowerShell-Symbols-${{ parameters.version }}-win-${{ parameters.architecture }}.zip' +# azureSubscription: '$(AzureFileCopySubscription)' +# Destination: AzureBlob +# storage: '$(StorageAccount)' +# ContainerName: '$(AzureVersion)' +# condition: and(succeeded(), eq('${{ parameters.pdb }}', 'yes')) - template: upload-final-results.yml parameters: From 270eabc6c4960abf2b2b426e14408396a1238b71 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sat, 16 May 2020 21:35:16 +0500 Subject: [PATCH 186/275] Bump NJsonSchema from 10.1.15 to 10.1.16 (#12685) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.15 to 10.1.16. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index af0c1656ec7..80a65c2032f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 3dfd95a09ff666dd6f4ba909f84e3dc7bd9b86a2 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Sat, 16 May 2020 09:36:15 -0700 Subject: [PATCH 187/275] Ensure null-coalescing LHS is evaluated only once (#12667) --- .../engine/parser/Compiler.cs | 24 +++++++++++-------- .../Operators/NullConditional.Tests.ps1 | 12 ++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index ac40050d4ab..776691a68f0 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -982,19 +982,23 @@ private static Expression Coalesce(Expression left, Expression right) { return left; } - else if (leftType == typeof(AutomationNull)) - { - return right; - } else { - Expression lhs = left.Cast(typeof(object)); - Expression rhs = right.Cast(typeof(object)); + ParameterExpression lhsStoreVar = Expression.Variable(typeof(object)); + var blockParameters = new ParameterExpression[] { lhsStoreVar }; + var blockStatements = new Expression[] + { + Expression.Assign(lhsStoreVar, left.Cast(typeof(object))), + Expression.Condition( + Expression.Call(CachedReflectionInfo.LanguagePrimitives_IsNull, lhsStoreVar), + right.Cast(typeof(object)), + lhsStoreVar), + }; - return Expression.Condition( - Expression.Call(CachedReflectionInfo.LanguagePrimitives_IsNull, lhs), - rhs, - lhs); + return Expression.Block( + typeof(object), + blockParameters, + blockStatements); } } diff --git a/test/powershell/Language/Operators/NullConditional.Tests.ps1 b/test/powershell/Language/Operators/NullConditional.Tests.ps1 index b24bb87d352..5c2c65e4ad9 100644 --- a/test/powershell/Language/Operators/NullConditional.Tests.ps1 +++ b/test/powershell/Language/Operators/NullConditional.Tests.ps1 @@ -172,6 +172,18 @@ Describe 'NullCoalesceOperations' -Tags 'CI' { It 'Lhs is $?' { {$???$false} | Should -BeTrue } + + It 'Should only evaluate LHS once when it IS null' { + $testState = [pscustomobject]@{ Value = 0 } + (& { [void]$testState.Value++ }) ?? 'Nothing' | Should -BeExactly 'Nothing' + $testState.Value | Should -Be 1 + } + + It 'Should only evaluate LHS once when it is NOT null' { + $testState = [pscustomobject]@{ Value = 0 } + (& { 'Test'; [void]$testState.Value++ }) ?? 'Nothing' | Should -BeExactly 'Test' + $testState.Value | Should -Be 1 + } } Context 'Null Coalesce ?? operator precedence' { From 4523ea3af45ed979ba4b834387d6b44cc3455502 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Sat, 16 May 2020 13:49:05 -0700 Subject: [PATCH 188/275] Update Distribution_Request.md --- .github/ISSUE_TEMPLATE/Distribution_Request.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/Distribution_Request.md b/.github/ISSUE_TEMPLATE/Distribution_Request.md index e8baabb0d19..44e8c3c22f9 100644 --- a/.github/ISSUE_TEMPLATE/Distribution_Request.md +++ b/.github/ISSUE_TEMPLATE/Distribution_Request.md @@ -11,6 +11,11 @@ assignees: '' - Name of the Distribution: - Version of the Distribution: +- Pakcage Types + - [ ] Deb + - [ ] RPM + - [ ] Tar.gz + - Snap - Please file issue in https://github.com/powershell/powershell-snap. This issues type is unrelated to snap packages with a distribution neutral. - Processor Architecture (One per request): - [ ] **Required** - An issues has been filed to create a Docker image in https://github.com/powershell/powershell-docker - The following is a requirement for supporting a distribution **without exception.** From 056b9d7ca39b471ecfe575bb5af329a1239dc242 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 17 May 2020 23:07:06 +0100 Subject: [PATCH 189/275] Formatting: remove duplicate semicolons (#12666) --- .../GetEventCommand.cs | 2 +- .../commands/utility/UnblockFile.cs | 2 +- src/Microsoft.WSMan.Management/ConfigProvider.cs | 2 +- .../DscSupport/CimDSCParser.cs | 2 +- .../FormatAndOutput/common/FormatViewManager.cs | 2 +- .../FormatAndOutput/common/Utilities/MshObjectUtil.cs | 2 +- .../engine/ComInterop/ComInvokeBinder.cs | 2 +- .../engine/remoting/commands/DebugJob.cs | 2 +- .../engine/remoting/common/RunspaceConnectionInfo.cs | 2 +- .../engine/remoting/server/ServerRunspacePoolDriver.cs | 8 ++++---- .../help/UpdatableHelpInfo.cs | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs index 41829598482..b9208804caa 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs @@ -592,7 +592,7 @@ private void ProcessGetProvider() } logQuery.Session = eventLogSession; - logQuery.ReverseDirection = !_oldest; ; + logQuery.ReverseDirection = !_oldest; ReadEvents(logQuery); } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs index afd4a649c95..fad330212ed 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UnblockFile.cs @@ -188,7 +188,7 @@ private bool IsValidFileForUnblocking(string resolvedpath) } else { - isValidUnblockableFile = true; ; + isValidUnblockableFile = true; } } diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 414b70c8403..3738af380f5 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -3336,7 +3336,7 @@ private string SetSchemaPath(string uri) /// private string NormalizePath(string path, string host) { - string uri = string.Empty; ; + string uri = string.Empty; if (path.StartsWith(host, StringComparison.OrdinalIgnoreCase)) { if (path.EndsWith(WSManStringLiterals.DefaultPathSeparator.ToString(), StringComparison.OrdinalIgnoreCase)) diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index db7f2c8eba1..c5fd73bf5b1 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -2413,7 +2413,7 @@ private static bool GetResourceMethodsLineNumber(TypeDefinitionAst typeDefinitio const string setMethodName = "Set"; const string testMethodName = "Test"; - methodsLinePosition = new Dictionary(); ; + methodsLinePosition = new Dictionary(); foreach (var member in typeDefinitionAst.Members) { var functionMemberAst = member as FunctionMemberAst; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs index 40ca2e18a80..3ad2c418db7 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewManager.cs @@ -344,7 +344,7 @@ private static void ProcessUnknownViewName(TerminatingErrorContext errorContext, unKnowViewFormatStringBuilder.Append(StringUtil.Format(FormatAndOut_format_xxx.NonExistingViewNameError, formatTypeName, so.BaseObject.GetType())); } - msg = unKnowViewFormatStringBuilder.ToString(); ; + msg = unKnowViewFormatStringBuilder.ToString(); } ErrorRecord errorRecord = new ErrorRecord( diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs index c6ee8059a9c..c890599cb1e 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshObjectUtil.cs @@ -173,7 +173,7 @@ private static string GetObjectName(object x, PSPropertyExpressionFactory expres PSPropertyExpressionResult r = PSObjectHelper.GetDisplayName(PSObjectHelper.AsPSObject(x), expressionFactory); if ((r != null) && (r.Exception == null)) { - objName = PSObjectHelper.AsPSObject(r.Result).ToString(); ; + objName = PSObjectHelper.AsPSObject(r.Result).ToString(); } else { diff --git a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs index 26186e16c46..f35f3976f0a 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs @@ -545,7 +545,7 @@ private Expression MakeIDispatchInvokeTarget() exprs.Add(System.Management.Automation.Language.ExpressionCache.AutomationNullConstant); } - return Expression.Block(vars, exprs); ; + return Expression.Block(vars, exprs); } /// diff --git a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs index 5a73ec9e38d..979912619f2 100644 --- a/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/DebugJob.cs @@ -222,7 +222,7 @@ protected override void StopProcessing() private bool CheckForDebuggableJob() { // Check passed in job object. - bool debuggableJobFound = GetJobDebuggable(_job); ; + bool debuggableJobFound = GetJobDebuggable(_job); if (!debuggableJobFound) { diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 3e4af990bd0..8736f49050f 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -2661,7 +2661,7 @@ private static SafePipeHandle CreateNamedPipe( byte[] securityDescBuffer = new byte[securityDesc.BinaryLength]; securityDesc.GetBinaryForm(securityDescBuffer, 0); securityDescHandle = GCHandle.Alloc(securityDescBuffer, GCHandleType.Pinned); - securityAttributes = NamedPipeNative.GetSecurityAttributes(securityDescHandle.Value, true); ; + securityAttributes = NamedPipeNative.GetSecurityAttributes(securityDescHandle.Value, true); } // Create async named pipe. diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index 8aff9264d0b..36bbfb4bc08 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -2625,15 +2625,15 @@ private void ExitDebugMode(DebuggerResumeAction resumeAction) private void SubscribeWrappedDebugger(Debugger wrappedDebugger) { - wrappedDebugger.DebuggerStop += HandleDebuggerStop; ; - wrappedDebugger.BreakpointUpdated += HandleBreakpointUpdated; ; + wrappedDebugger.DebuggerStop += HandleDebuggerStop; + wrappedDebugger.BreakpointUpdated += HandleBreakpointUpdated; wrappedDebugger.NestedDebuggingCancelledEvent += HandleNestedDebuggingCancelEvent; } private void UnsubscribeWrappedDebugger(Debugger wrappedDebugger) { - wrappedDebugger.DebuggerStop -= HandleDebuggerStop; ; - wrappedDebugger.BreakpointUpdated -= HandleBreakpointUpdated; ; + wrappedDebugger.DebuggerStop -= HandleDebuggerStop; + wrappedDebugger.BreakpointUpdated -= HandleBreakpointUpdated; wrappedDebugger.NestedDebuggingCancelledEvent -= HandleNestedDebuggingCancelEvent; } diff --git a/src/System.Management.Automation/help/UpdatableHelpInfo.cs b/src/System.Management.Automation/help/UpdatableHelpInfo.cs index cb5b1b959f8..46026529df6 100644 --- a/src/System.Management.Automation/help/UpdatableHelpInfo.cs +++ b/src/System.Management.Automation/help/UpdatableHelpInfo.cs @@ -93,7 +93,7 @@ internal bool IsNewerVersion(UpdatableHelpInfo helpInfo, CultureInfo culture) return true; } - return v1 > v2; ; + return v1 > v2; } /// From 838569919b18125186dc774bda0c64cb542691c4 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Mon, 18 May 2020 00:46:15 +0100 Subject: [PATCH 190/275] minor update to Distribution_Request.md (#12705) --- .github/ISSUE_TEMPLATE/Distribution_Request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Distribution_Request.md b/.github/ISSUE_TEMPLATE/Distribution_Request.md index 44e8c3c22f9..fee19c92b71 100644 --- a/.github/ISSUE_TEMPLATE/Distribution_Request.md +++ b/.github/ISSUE_TEMPLATE/Distribution_Request.md @@ -11,7 +11,7 @@ assignees: '' - Name of the Distribution: - Version of the Distribution: -- Pakcage Types +- Package Types - [ ] Deb - [ ] RPM - [ ] Tar.gz From e5bd233f830e6c683cb847a2f6fe5a0fc5f7b52f Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 18 May 2020 17:25:17 +0100 Subject: [PATCH 191/275] Update required Visual Studio version in build docs (#12628) # PR Summary * Update build docs to specify Visual Studio 2019 16.6 Preview 2 as a requirement, due to the of `net5.0` TFM. * Remove dependancy on "Common Tools for Visual C++" as there is no longer C++ code in the repository. ## PR Context Visual Studio 2019 >= 16.6 Preview 2 is required since #12486. see also: #12514 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- docs/building/windows-core.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 5e9aa73cf09..0e67e38a4e6 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -18,8 +18,7 @@ This guide assumes that you have recursively cloned the PowerShell repository an ### Visual Studio -You will need to install an edition of Visual Studio 2015 (Community, Enterprise, or Professional) with the optional feature 'Common Tools for Visual C++' installed. -The free Community edition of Visual Studio 2015 can be downloaded [here](https://www.visualstudio.com/visual-studio-community-vs/). +This repository requires at least Visual Studio 2019 16.6 Preview 2. The free Community edition of Visual Studio can be downloaded from [Microsoft](https://visualstudio.microsoft.com/downloads/). ### Visual Studio Code From 01d37887121f5cba743573c40f9d1827adc25a98 Mon Sep 17 00:00:00 2001 From: Andrew Menagarishvili Date: Mon, 18 May 2020 23:36:18 +0000 Subject: [PATCH 192/275] Merged PR 11571: Change log for v7-1-0-preview-3 and a missing preview-2 change log Preview-3 change log was generated by `Get-ChangeLog -LastReleaseTag 'v7.1.0-preview.2' -ThisReleaseTag 'v7.1.0-preview.3'` Preview-2 change log was copy-pasted from Gihub's `tags/v7.1.0-preview.2` --- .spelling | 181 +++++++++++++++++++++++++------------ CHANGELOG/preview.md | 209 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 331 insertions(+), 59 deletions(-) diff --git a/.spelling b/.spelling index 7e4944447eb..9edd5d327f6 100644 --- a/.spelling +++ b/.spelling @@ -3,9 +3,11 @@ # global dictionary is at the start, file overrides afterwards # one word per line, to define a file override use ' - filename' # where filename is relative to this configuration file +-title 0-powershell-crossplatform 0xfeeddeadbeef 100ms +1redone 2.x 2ae5d07 32-bit @@ -14,13 +16,16 @@ about_ about_debuggers about_jobs acl +adamdriscoll add-localgroupmember add-ons adelton adhoc aditya adityapatwardhan +ADOPTERS.md aiello +alepauly alexandair alexjordan6 alpha.10 @@ -36,8 +41,10 @@ alpha.7 alpha.8 alpha.9 alternatestream +alvarodelvalle amd64 andschwa +anmenaga api apis appimage @@ -51,6 +58,7 @@ asp.net assemblyloadcontext authenticodesignature azdevops +AzFileCopy azurerm.netcore.preview azurerm.profile.netcore.preview azurerm.resources.netcore.preview @@ -71,8 +79,10 @@ bgelens Bhaal22 bjh7242 bool +bpayette breakpoint brianbunke +britishben brucepay bugfix build.json @@ -84,8 +94,8 @@ cdxml celsius CentOS changelog -changelogs changelog.md +changelogs changeset changesets channel9 @@ -93,6 +103,7 @@ charset checkbox checksum childitem +ChrisLGardner cimsession cimsupport classlib @@ -108,6 +119,7 @@ codebase codecov.io codecoverage.zip codefactor +CodeFormatter codeowner codepage commanddiscovery @@ -149,23 +161,32 @@ csharp csmacnz csphysicallyinstalledmemory ctrl +CurrentCulture +DamirAinullin darquewarrior darwinjs +DateTime daxian-dbw dayofweek dchristian3188 ddwr debughandler dee-see +dependabot deps deserialization deserialize +deserialized +deserializing dest dest.txt dev devblackops +devcontainer deviceguard +devlead devops +Dictionary.TryAdd diddledan disable-localuser disable-psbreakpoint @@ -183,8 +204,9 @@ dlwyatt dockerbasedbuild dockerfile dockerfiles -dongbo +doctordns don'ts +dongbo dotcover dotnet dotnetcore @@ -194,6 +216,9 @@ dropdown e.g. ebook ebooks +ece-jacob-scott +EditorConfig +edyoung enable-localuser enable-psbreakpoint enable-pstrace @@ -201,13 +226,16 @@ enable-pswsmancombinedtrace enable-runspacedebug enable-wsmantrace encodings +endian enter-pshostprocess enter-pssession enum enums +Environment.NewLine ergo3114 errorrecord etl +eugenesmlv excludeversion exe executables @@ -221,6 +249,8 @@ export-formatdata export-modulemember failurecode failurecount +fbehrens +felixfbecker ffeldhaus filecatalog filename @@ -235,9 +265,11 @@ folderName foreach formatfileloading formatviewbinding +Francisco-Gamino frontload fullclr functionprovider +fxdependent gabrielsroka gamified gc.regions.xml @@ -250,6 +282,7 @@ get-ciminstance get-computerinfo get-cronjob get-eventsubscriber +Get-ExperimentalFeature get-filehash get-formatdata get-installedmodule @@ -262,7 +295,6 @@ get-localuser get-logproperties get-packageprovider get-packagesource -getparentprocess get-psbreakpoint get-pscallstack get-pshostprocessinfo @@ -274,11 +306,14 @@ get-pssession get-pssessioncapability get-runspacedebug get-systemdjournal -gettype get-typedata get-uiculture get-winevent get-wsmaninstance +GetExceptionForHR +getparentprocess +gettype +Geweldig gitcommitid github githug @@ -305,6 +340,7 @@ httpbin.org httpbin's https hubuk +hvitved i.e. idera ifdef'ed @@ -335,12 +371,15 @@ iscoreclr isnot itemtype itpro +jackdcasey jameswtruher Jawz84 jazzdelightsme jeffbi +jellyfrog jen joandrsn +joeltankam joeyaiello jokajak joshuacooper @@ -355,9 +394,11 @@ kanjibates kasper3 katacoda kevinmarquette +kevinoid keyfileparameter keyhandler khansen00 +kiazhi kirkmunro kittholland korygill @@ -367,36 +408,48 @@ kwiknick kwkam kylesferrazza labelling +LabhanshAgrawal lastwritetime launch.json ldspits lee303 +Leonhardt libpsl libpsl-native libunwind8 linux locationglobber +lockdown loopback lossless louistio LucaFilipozzi +lukexjeremy +lupino3 lynda.com lzybkr +M1kep mababio macos macports maertendmsft mahawar +Markdig.Signed markekraus marktiedemann +Marusyk mcbobke md meir017 memberresolution +Menagarishvili messageanalyzer metadata +metadata.json miaromero microsoft +Microsoft.ApplicationInsights +Microsoft.CodeAnalysis.CSharp microsoft.com microsoft.management.infrastructure.cimcmdlets microsoft.management.infrastructure.native @@ -417,15 +470,18 @@ microsoft.powershell.security microsoft.powershell.utility microsoft.wsman.management microsoft.wsman.runtime +mikeTWC1984 mirichmo +mjanko5 mkdir mklement0 +MohiTheFish move-itemproperty +ms-psrp msbuild msftrncs mshsnapinloadunload msi -ms-psrp multiline multipart mv @@ -437,12 +493,15 @@ namespace nano nanoserver nativeexecution +net5.0 +netcoreapp5.0 netip.ps1. netstandard.dll new-apachevhost new-ciminstance new-cimsessionoption new-cronjob +New-DockerTestBuild new-guid new-itemproperty new-localgroup @@ -459,6 +518,9 @@ new-timespan new-winevent new-wsmaninstance new-wsmansessionoption +NextTurn +NJsonSchema +NoMoreFood non-22 non-cim non-https @@ -466,8 +528,9 @@ non-r2 noresume notcontains nuget -nugetfeed +nuget.config nuget.exe +nugetfeed numberbytes nupkg oauth @@ -477,6 +540,7 @@ omi omnisharp OneDrive oneget.org +OneScripter opencover opencover.zip openssh @@ -485,15 +549,19 @@ opensuse oss p1 packagemanagement +PackageVersion +parameshbabu parameterbinderbase parameterbindercontroller parameterbinding +ParseError.ToString pathresolution patochun patwardhan paulhigin pawamoy payette +perf perfview perfview.exe petseral @@ -505,9 +573,12 @@ pougetat powerbi powercode powershell +powershell-unix powershell.6 powershell.com +PowerShell.Common.props powershell.core.instrumentation +powershell.exe powershell.org powershellcore powershellgallery @@ -515,17 +586,16 @@ powershellget powershellmagazine.com powershellninja powershellproperties -powershell-unix ppadmavilasom pre-build pre-compiled pre-generated pre-installed -prepend -preprocessor pre-release pre-releases pre-requisites +prepend +preprocessor preview.1 preview.2 preview.3 @@ -533,6 +603,8 @@ preview.4 preview.5 preview.6 preview.7 +preview.4.20258.7 +preview.4.20229.10 preview1-24530-04 preview7 productversion @@ -549,6 +621,7 @@ psdrive psdriveinfo pseudoparameterbinder psgallery +PSGalleryModules psm1 psobject psobjects @@ -561,12 +634,15 @@ pssnapinloadunload pssnapins psversion psversiontable +PSWindowsPowerShellCompatibility +PublishReadyToRun pvs-studio pwd pwrshplughin.dll pwsh qmfrederik raghav710 +RandomNoun7 raspbian rc rc.1 @@ -577,6 +653,7 @@ rc3-24011 readme readme.md readonly +ReadyToRun rebase rebasing receive-pssession @@ -609,7 +686,9 @@ remove-wsmaninstance rename-itemproperty rename-localgroup rename-localuser +renehernandez reparse +replicaJunction repo reportgenerator resgen @@ -621,12 +700,13 @@ resx richardszalay Rin rkeithhill +rkitover robo210 ronn rpalo runspace -runspaces runspaceinit +runspaces runtime runtimes sample-dotnet1 @@ -634,6 +714,7 @@ sample-dotnet2 sarithsutha savehelp sazonov +sba923 schvartzman schwartzmeyer scriptblock @@ -647,7 +728,6 @@ sessionstate sessionstatecontainer sessionstateitem set-ciminstance -sethvs set-itemproperty set-localgroup set-localuser @@ -661,9 +741,13 @@ set-psrepository set-strictmode set-wsmaninstance set-wsmanquickconfig +sethvs +setversionvariables +ShaydeNofziger shellexecute shouldbeerrorid showcommandinfo +silijon simonwahlin singleline smes @@ -675,16 +759,21 @@ source.txt spongemike2 src ss64.com +st0le stackoverflow stanzilla start-codecoveragerun stdin stevel-msft +stevend811 stknohg strawgate streamdescribecifeaturescenariodescribecontextitcontextcontextbeforeallafterallbeforeeachaftereachshould +StrictMode +string.split stringbuilder stuntguy3000 +StyleCop submodule submodules sudo @@ -696,48 +785,55 @@ symlink symlinks syscall syslog +System.IO.Packaging system.manage system.management.automation systemd +SytzeAndr tabcompletion tadas tandasat +TargetFramework +test-modulemanifest +test-pssessionconfigurationfile +test-scriptfileinfo test.ps1 test.txt. test1.txt test2.txt testcase testdrive -test-modulemanifest -test-pssessionconfigurationfile tests.zip -test-scriptfileinfo tgz theflyingcorpse thenewstellw thezim +ThomasNieto threadjob throttlelimit throw-testcasesitmockdescribe +ThrowExceptionForHR timcurwick timestamp timothywlewis --title tobias +tokenizer.cs tokenizing tomconte +tommymaynard toolchain toolset tracesource travisez13 travisty truher +tylerleonhardt typecataloggen typeconversion typegen typematch -ThomasNieto ubuntu +un-versioned unicode unregister-event unregister-packagesource @@ -745,7 +841,7 @@ unregister-psrepository unregister-pssessionconfiguration unregistering untracked -un-versioned +unvalidated update-formatdata update-modulemanifest update-scriptfileinfo @@ -754,8 +850,8 @@ uri urls userdata uservoice -utf8 utf-8 +utf8 utf8nobom utils utils.cs @@ -768,6 +864,7 @@ v0.6.0 v141 v3 v4 +v5 v5.0 v6 v6.0. @@ -778,17 +875,22 @@ v6.0.4 v6.0.5 v6.1.0 v6.1.1 +v6.1.2 v6.2.0 v6.2.1 v6.2.2 v6.2.3 v6.2.4 +v7.0.0 validatenotnullorempty versioned versioning +vexx32 visualstudio +vmsilvamolina vorobev vors +vpondala vscode vstsbuild.ps1 walkthrough @@ -823,46 +925,12 @@ x86 xpath xtqqczze xunit +Xunit.SkippableFact yaml +yashrajbharti +yml youtube zackjknight -vexx32 -perf -britishben -felixfbecker -vpondala -dependabot -jellyfrog -1redone -tommymaynard -vmsilvamolina -fbehrens -lockdown -lukexjeremy -deserializing -kiazhi -v6.1.2 -Menagarishvili -anmenaga -fxdependent -sba923 -replicaJunction -lupino3 -hvitved -unvalidated -Geweldig -mjanko5 -v7.0.0 -renehernandez -ece-jacob-scott -st0le -MohiTheFish -CodeFormatter -StyleCop -SytzeAndr -yashrajbharti -Leonhardt -tylerleonhardt - CHANGELOG.md aavdberg asrosent @@ -982,3 +1050,6 @@ wpaProfile - CHANGELOG/preview.md ThomasNieto spongemike2 +davidseibel +HumanEquivalentUnit +jcotton42 diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index ded6245de3f..8cde784ef43 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,5 +1,203 @@ # Current preview release +## [7.1.0-preview.3] - 2020-05-14 + +### Breaking Changes + +- Fix string parameter binding for `BigInteger` numeric literals (#11634) (Thanks @vexx32!) + +### Engine Updates and Fixes + +- Set correct `PSProvider` full name at module load time (#11813) (Thanks @iSazonov!) + +### Experimental Features + +- Support passing `PSPath` to native commands (#12386) + +### General Cmdlet Updates and Fixes + +- Fix incorrect index in format string in ParameterBinderBase (#12630) (Thanks @powercode!) +- Copy the `CommandInfo` property in `Command.Clone()` (#12301) (Thanks @TylerLeonhardt!) +- Apply `-IncludeEqual` in `Compare-Object` when `-ExcludeDifferent` is specified (#12317) (Thanks @davidseibel!) +- Change `Get-FileHash` to close file handles before writing output (#12474) (Thanks @HumanEquivalentUnit!) +- Fix inconsistent exception message in `-replace` operator (#12388) (Thanks @jackdcasey!) + +### Code Cleanup + +
+ + + +

We thank the following contributors!

+

@xtqqczze, @RDIL, @powercode, @xtqqczze, @xtqqczze

+ +
+ +
    +
  • Replace Unicode non-breaking space character with space (#12576) (Thanks @xtqqczze!)
  • +
  • Remove unused New-DockerTestBuild.ps1 (#12610) (Thanks @RDIL!)
  • +
  • Annotate Assert methods for better code analysis (#12618) (Thanks @powercode!)
  • +
  • Use correct casing for cmdlet names and parameters in *.ps1 files throughout the codebase (#12584) (Thanks @xtqqczze!)
  • +
  • Document why PackageVersion is used in PowerShell.Common.props (#12523) (Thanks @xtqqczze!)
  • +
+ +
+ +### Tools + +- Update `@PoshChan` config to include `SSH` (#12526) (Thanks @vexx32!) +- Update log message in `Start-PSBootstrap` (#12573) (Thanks @xtqqczze!) +- Add the `.NET SDK` installation path to the current process path in `tools/UpdateDotnetRuntime.ps1` (#12525) + +### Tests + +- Make CIM tab completion test case insensitive (#12636) +- Mark ping tests as Pending due to stability issues in macOS (#12504) + +### Build and Packaging Improvements + +
+ + + +

We thank the following contributors!

+

@jcotton42, @iSazonov, @iSazonov, @iSazonov

+ +
+ +
    +
  • Update build to use the new .NET SDK 5.0.100-preview.4.20258.7 (#12637)
  • +
  • Bump NJsonSchema from 10.1.14 to 10.1.15 (#12608)
  • +
  • Bump NJsonSchema from 10.1.13 to 10.1.14 (#12598)
  • +
  • Bump NJsonSchema from 10.1.12 to 10.1.13 (#12583)
  • +
  • Update the build to sign any unsigned files as 3rd party Dlls (#12581)
  • +
  • Update .NET SDK to 5.0.100-preview.4.20229.10 (#12538)
  • +
  • Add ability to Install-Dotnet to specify directory (#12469)
  • +
  • Allow / in relative paths for using module (#7424) (#12492) (Thanks @jcotton42!)
  • +
  • Update dotnet metadata for next channel for automated updates (#12502)
  • +
  • Bump .NET to 5.0.0-preview.4 (#12507)
  • +
  • Bump Microsoft.ApplicationInsights from 2.13.1 to 2.14.0 (#12479)
  • +
  • Bump PackageManagement from 1.4.6 to 1.4.7 in /src/Modules (#12506)
  • +
  • Bump Xunit.SkippableFact from 1.3.12 to 1.4.8 (#12480)
  • +
  • Fix quotes to allow variable expansion (#12512)
  • +
  • Use new TargetFramework as net5.0 in packaging scripts (#12503) (Thanks @iSazonov!)
  • +
  • Use new value for TargetFramework as net5.0 instead of netcoreapp5.0 (#12486) (Thanks @iSazonov!)
  • +
  • Disable PublishReadyToRun for framework dependent packages (#12450)
  • +
  • Add dependabot rules to ignore updates from .NET (#12466)
  • +
  • Update README.md and metadata.json for upcoming release (#12441)
  • +
  • Turn on ReadyToRun (#12361) (Thanks @iSazonov!)
  • +
  • Add summary to compressed sections of change log (#12429)
  • +
+ +
+ +### Documentation and Help Content + +- Add link to life cycle doc to distribution request template (#12638) +- Update TFM reference in build docs (#12514) (Thanks @xtqqczze!) +- Fix broken link for blogs in documents (#12471) + +## [7.1.0-preview.2] - 2020-04-23 + +### Breaking Changes + +- On Windows, `Start-Process` creates a process environment with + all the environment variables from current session, + using `-UseNewEnvironment` creates a new default process environment (#10830) (Thanks @iSazonov!) +- Do not wrap return result to `PSObject` when converting ScriptBlock to delegate (#10619) + +### Engine Updates and Fixes + +- Allow case insensitive paths for determining `PSModulePath` (#12192) +- Add PowerShell version 7.0 to compatible version list (#12184) +- Discover assemblies loaded by `Assembly.Load(byte[])` and `Assembly.LoadFile` (#12203) + +### General Cmdlet Updates and Fixes + +- Fix `WinCompat` module loading to treat PowerShell 7 modules with higher priority (#12269) +- Implement `ForEach-Object -Parallel` runspace reuse (#12122) +- Fix `Get-Service` to not modify collection while enumerating it (#11851) (Thanks @NextTurn!) +- Clean up the IPC named pipe on PowerShell exit (#12187) +- Fix `` detection regex in web cmdlets (#12099) (Thanks @vexx32!) +- Allow shorter signed hex literals with appropriate type suffixes (#11844) (Thanks @vexx32!) +- Update `UseNewEnvironment` parameter behavior of `Start-Process` cmdlet on Windows (#10830) (Thanks @iSazonov!) +- Add `-Shuffle` switch to `Get-Random` command (#11093) (Thanks @eugenesmlv!) +- Make `GetWindowsPowerShellModulePath` compatible with multiple PS installations (#12280) +- Fix `Start-Job` to work on systems that don't have Windows PowerShell registered as default shell (#12296) +- Specifying an alias and `-Syntax` to `Get-Command` returns the aliased commands syntax (#10784) (Thanks @ChrisLGardner!) +- Make CSV cmdlets work when using `-AsNeeded` and there is an incomplete row (#12281) (Thanks @iSazonov!) +- In local invocations, do not require `-PowerShellVersion 5.1` for `Get-FormatData` in order to see all format data. (#11270) (Thanks @mklement0!) +- Added Support For Big Endian `UTF-32` (#11947) (Thanks @NoMoreFood!) +- Fix possible race that leaks PowerShell object dispose in `ForEach-Object -Parallel` (#12227) +- Add `-FromUnixTime` to `Get-Date` to allow Unix time input (#12179) (Thanks @jackdcasey!) +- Change default progress foreground and background colors to provide improved contrast (#11455) (Thanks @rkeithhill!) +- Fix `foreach -parallel` when current drive is not available (#12197) +- Do not wrap return result to `PSObject` when converting `ScriptBlock` to `delegate` (#10619) +- Don't write DNS resolution errors on `Test-Connection -Quiet` (#12204) (Thanks @vexx32!) +- Use dedicated threads to read the redirected output and error streams from the child process for out-of-proc jobs (#11713) + +### Code Cleanup + +
+ + + +

We thank the following contributors!

+

@ShaydeNofziger, @RDIL

+ +
+ +
    +
  • Fix erroneous comment in tokenizer.cs (#12206) (Thanks @ShaydeNofziger!)
  • +
  • Fix terms checker issues (#12189)
  • +
  • Update copyright notice to latest guidance (#12190)
  • +
  • CodeFactor cleanup (#12251) (Thanks @RDIL!)
  • +
+ +
+ +### Tools + +- Update .NET dependency update script to include test `csproj` files (#12372) +- Scripts to update to .NET prerelease version (#12284) + +### Tests + +- Pin major Pester version to 4 to prevent breaking changes caused by upcoming release of v5 (#12262) (Thanks @bergmeister!) + +### Build and Packaging Improvements + +
+ + + +

We thank the following contributors!

+

@rkitover, @bergmeister

+ +
+ +
    +
  • Add the nuget.config from root to the temporary build folder (#12394)
  • +
  • Bump System.IO.Packaging (#12365)
  • +
  • Bump Markdig.Signed from 0.18.3 to 0.20.0 (#12379)
  • +
  • Bump to .NET 5 Preview 3 pre-release (#12353)
  • +
  • Bump PowerShellGet from 2.2.3 to 2.2.4 (#12342)
  • +
  • Linux: Initial support for Gentoo installations. (#11429) (Thanks @rkitover!)
  • +
  • Upgrade to .NET 5 Preview 2 (#12250) (Thanks @bergmeister!)
  • +
  • Fix the Sync PSGalleryModules to Artifacts build (#12277)
  • +
  • Bump PSReadLine from 2.0.0 to 2.0.1 (#12243)
  • +
  • Bump NJsonSchema from 10.1.11 to 10.1.12 (#12230)
  • +
  • Update change log generation script to support collapsible sections (#12214)
  • +
+ +
+ +### Documentation and Help Content + +- Add documentation for `WebResponseObject` and `BasicHtmlWebResponseObject` properties (#11876) (Thanks @kevinoid!) +- Add Windows 10 IoT Core reference in `Adopters.md` (#12266) (Thanks @parameshbabu!) +- Update `README.md` and `metadata.json` for `7.1.0-preview.1` (#12211) + ## 7.1.0-preview.1 - 2020-03-26 ### Breaking Changes @@ -22,7 +220,7 @@ - Use asynchronous streams in `Invoke-RestMethod` (#11095) (Thanks @iSazonov!) - Address UTF-8 Detection In `Get-Content -Tail` (#11899) (Thanks @NoMoreFood!) - Handle the `IOException` in `Get-FileHash` (#11944) (Thanks @iSazonov!) -- Change 'PowerShell Core' to 'PowerShell' in a resource string (#11928) (Thanks @alexandair!) +- Change `PowerShell Core` to `PowerShell` in a resource string (#11928) (Thanks @alexandair!) - Bring back `MainWindowTitle` in `PSHostProcessInfo` (#11885) (Thanks @iSazonov!) - Miscellaneous minor updates to Windows Compatibility (#11980) - Fix `ConciseView` to split `PositionMessage` using `[Environment]::NewLine` (#12010) @@ -41,7 +239,7 @@ - Update `PSPath` in `certificate_format_ps1.xml` (#11603) (Thanks @xtqqczze!) - Change regular expression to match relation-types without quotes in Link header (#11711) (Thanks @Marusyk!) - Fix error message during symbolic link deletion (#11331) -- Add custom 'Selected.*' type to `PSCustomObject` in `Select-Object` only once (#11548) (Thanks @iSazonov!) +- Add custom `Selected.*` type to `PSCustomObject` in `Select-Object` only once (#11548) (Thanks @iSazonov!) - Add `-AsUTC` to the `Get-Date` cmdlet (#11611) - Fix grouping behavior with Boolean values in `Format-Hex` (#11587) (Thanks @vexx32!) - Make `Test-Connection` always use the default synchronization context for sending ping requests (#11517) @@ -71,7 +269,7 @@
  • Fix Typo in Get-ComputerInfo cmdlet description (#11321) (Thanks @doctordns!)
  • Fix typo in description for Get-ExperimentalFeature PSWindowsPowerShellCompatibility (#11282) (Thanks @alvarodelvalle!)
  • Cleanups in command discovery (#10815) (Thanks @iSazonov!)
  • -
  • Review currentculture (#11044) (Thanks @iSazonov!)
  • +
  • Review CurrentCulture (#11044) (Thanks @iSazonov!)
  • @@ -146,7 +344,7 @@ - Update `Adopters.md` to include info on Azure Pipelines and GitHub Actions (#11888) (Thanks @alepauly!) - Add information about how Amazon AWS uses PowerShell. (#11365) (Thanks @bpayette!) - Add link to .NET CLI version in build documentation (#11725) (Thanks @joeltankam!) -- Added info about DeploymentScripts in ADOPTERS.md (#11703) +- Added info about `DeploymentScripts` in `ADOPTERS.md` (#11703) - Update `CHANGELOG.md` for `6.2.4` release (#11699) - Update `README.md` and `metadata.json` for next release (#11597) - Update the breaking change definition (#11516) @@ -159,3 +357,6 @@ - Update `Readme.md` for `preview.6` release (#11108) - Update `SUPPORT.md` (#11101) (Thanks @mklement0!) - Update `README.md` (#11100) (Thanks @mklement0!) + +[7.1.0-preview.2]: https://github.com/PowerShell/PowerShell/compare/v7.1.0-preview.1...v7.1.0-preview.2 +[7.1.0-preview.3]: https://github.com/PowerShell/PowerShell/compare/v7.1.0-preview.2...v7.1.0-preview.3 From a7ce7883ceb2e4251babdcd8ec372eb283f31948 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 18 May 2020 21:16:11 -0700 Subject: [PATCH 193/275] Added missing changelog for v7.1.0-preview.2 (#12665) --- .spelling | 166 +++++++++++++++++++++++++++++-------------- CHANGELOG/preview.md | 111 +++++++++++++++++++++++++++-- 2 files changed, 218 insertions(+), 59 deletions(-) diff --git a/.spelling b/.spelling index 7e4944447eb..19894f81a68 100644 --- a/.spelling +++ b/.spelling @@ -3,9 +3,11 @@ # global dictionary is at the start, file overrides afterwards # one word per line, to define a file override use ' - filename' # where filename is relative to this configuration file +-title 0-powershell-crossplatform 0xfeeddeadbeef 100ms +1redone 2.x 2ae5d07 32-bit @@ -14,13 +16,16 @@ about_ about_debuggers about_jobs acl +adamdriscoll add-localgroupmember add-ons adelton adhoc aditya adityapatwardhan +ADOPTERS.md aiello +alepauly alexandair alexjordan6 alpha.10 @@ -36,8 +41,10 @@ alpha.7 alpha.8 alpha.9 alternatestream +alvarodelvalle amd64 andschwa +anmenaga api apis appimage @@ -51,6 +58,7 @@ asp.net assemblyloadcontext authenticodesignature azdevops +AzFileCopy azurerm.netcore.preview azurerm.profile.netcore.preview azurerm.resources.netcore.preview @@ -71,8 +79,10 @@ bgelens Bhaal22 bjh7242 bool +bpayette breakpoint brianbunke +britishben brucepay bugfix build.json @@ -84,8 +94,8 @@ cdxml celsius CentOS changelog -changelogs changelog.md +changelogs changeset changesets channel9 @@ -93,6 +103,7 @@ charset checkbox checksum childitem +ChrisLGardner cimsession cimsupport classlib @@ -108,6 +119,7 @@ codebase codecov.io codecoverage.zip codefactor +CodeFormatter codeowner codepage commanddiscovery @@ -149,23 +161,32 @@ csharp csmacnz csphysicallyinstalledmemory ctrl +CurrentCulture +DamirAinullin darquewarrior darwinjs +DateTime daxian-dbw dayofweek dchristian3188 ddwr debughandler dee-see +dependabot deps deserialization deserialize +deserialized +deserializing dest dest.txt dev devblackops +devcontainer deviceguard +devlead devops +Dictionary.TryAdd diddledan disable-localuser disable-psbreakpoint @@ -183,8 +204,9 @@ dlwyatt dockerbasedbuild dockerfile dockerfiles -dongbo +doctordns don'ts +dongbo dotcover dotnet dotnetcore @@ -194,6 +216,9 @@ dropdown e.g. ebook ebooks +ece-jacob-scott +EditorConfig +edyoung enable-localuser enable-psbreakpoint enable-pstrace @@ -201,13 +226,16 @@ enable-pswsmancombinedtrace enable-runspacedebug enable-wsmantrace encodings +endian enter-pshostprocess enter-pssession enum enums +Environment.NewLine ergo3114 errorrecord etl +eugenesmlv excludeversion exe executables @@ -221,6 +249,8 @@ export-formatdata export-modulemember failurecode failurecount +fbehrens +felixfbecker ffeldhaus filecatalog filename @@ -235,9 +265,11 @@ folderName foreach formatfileloading formatviewbinding +Francisco-Gamino frontload fullclr functionprovider +fxdependent gabrielsroka gamified gc.regions.xml @@ -250,6 +282,7 @@ get-ciminstance get-computerinfo get-cronjob get-eventsubscriber +Get-ExperimentalFeature get-filehash get-formatdata get-installedmodule @@ -262,7 +295,6 @@ get-localuser get-logproperties get-packageprovider get-packagesource -getparentprocess get-psbreakpoint get-pscallstack get-pshostprocessinfo @@ -274,11 +306,14 @@ get-pssession get-pssessioncapability get-runspacedebug get-systemdjournal -gettype get-typedata get-uiculture get-winevent get-wsmaninstance +GetExceptionForHR +getparentprocess +gettype +Geweldig gitcommitid github githug @@ -305,6 +340,7 @@ httpbin.org httpbin's https hubuk +hvitved i.e. idera ifdef'ed @@ -335,12 +371,15 @@ iscoreclr isnot itemtype itpro +jackdcasey jameswtruher Jawz84 jazzdelightsme jeffbi +jellyfrog jen joandrsn +joeltankam joeyaiello jokajak joshuacooper @@ -355,9 +394,11 @@ kanjibates kasper3 katacoda kevinmarquette +kevinoid keyfileparameter keyhandler khansen00 +kiazhi kirkmunro kittholland korygill @@ -367,36 +408,47 @@ kwiknick kwkam kylesferrazza labelling +LabhanshAgrawal lastwritetime launch.json ldspits lee303 +Leonhardt libpsl libpsl-native libunwind8 linux locationglobber +lockdown loopback lossless louistio LucaFilipozzi +lukexjeremy +lupino3 lynda.com lzybkr +M1kep mababio macos macports maertendmsft mahawar +Markdig.Signed markekraus marktiedemann +Marusyk mcbobke md meir017 memberresolution +Menagarishvili messageanalyzer metadata +metadata.json miaromero microsoft +Microsoft.CodeAnalysis.CSharp microsoft.com microsoft.management.infrastructure.cimcmdlets microsoft.management.infrastructure.native @@ -417,15 +469,18 @@ microsoft.powershell.security microsoft.powershell.utility microsoft.wsman.management microsoft.wsman.runtime +mikeTWC1984 mirichmo +mjanko5 mkdir mklement0 +MohiTheFish move-itemproperty +ms-psrp msbuild msftrncs mshsnapinloadunload msi -ms-psrp multiline multipart mv @@ -459,6 +514,9 @@ new-timespan new-winevent new-wsmaninstance new-wsmansessionoption +NextTurn +NJsonSchema +NoMoreFood non-22 non-cim non-https @@ -466,8 +524,9 @@ non-r2 noresume notcontains nuget -nugetfeed +nuget.config nuget.exe +nugetfeed numberbytes nupkg oauth @@ -477,6 +536,7 @@ omi omnisharp OneDrive oneget.org +OneScripter opencover opencover.zip openssh @@ -485,15 +545,18 @@ opensuse oss p1 packagemanagement +parameshbabu parameterbinderbase parameterbindercontroller parameterbinding +ParseError.ToString pathresolution patochun patwardhan paulhigin pawamoy payette +perf perfview perfview.exe petseral @@ -505,9 +568,11 @@ pougetat powerbi powercode powershell +powershell-unix powershell.6 powershell.com powershell.core.instrumentation +powershell.exe powershell.org powershellcore powershellgallery @@ -515,17 +580,16 @@ powershellget powershellmagazine.com powershellninja powershellproperties -powershell-unix ppadmavilasom pre-build pre-compiled pre-generated pre-installed -prepend -preprocessor pre-release pre-releases pre-requisites +prepend +preprocessor preview.1 preview.2 preview.3 @@ -549,6 +613,7 @@ psdrive psdriveinfo pseudoparameterbinder psgallery +PSGalleryModules psm1 psobject psobjects @@ -561,12 +626,14 @@ pssnapinloadunload pssnapins psversion psversiontable +PSWindowsPowerShellCompatibility pvs-studio pwd pwrshplughin.dll pwsh qmfrederik raghav710 +RandomNoun7 raspbian rc rc.1 @@ -609,7 +676,9 @@ remove-wsmaninstance rename-itemproperty rename-localgroup rename-localuser +renehernandez reparse +replicaJunction repo reportgenerator resgen @@ -621,12 +690,13 @@ resx richardszalay Rin rkeithhill +rkitover robo210 ronn rpalo runspace -runspaces runspaceinit +runspaces runtime runtimes sample-dotnet1 @@ -634,6 +704,7 @@ sample-dotnet2 sarithsutha savehelp sazonov +sba923 schvartzman schwartzmeyer scriptblock @@ -647,7 +718,6 @@ sessionstate sessionstatecontainer sessionstateitem set-ciminstance -sethvs set-itemproperty set-localgroup set-localuser @@ -661,9 +731,13 @@ set-psrepository set-strictmode set-wsmaninstance set-wsmanquickconfig +sethvs +setversionvariables +ShaydeNofziger shellexecute shouldbeerrorid showcommandinfo +silijon simonwahlin singleline smes @@ -675,16 +749,21 @@ source.txt spongemike2 src ss64.com +st0le stackoverflow stanzilla start-codecoveragerun stdin stevel-msft +stevend811 stknohg strawgate streamdescribecifeaturescenariodescribecontextitcontextcontextbeforeallafterallbeforeeachaftereachshould +StrictMode +string.split stringbuilder stuntguy3000 +StyleCop submodule submodules sudo @@ -696,48 +775,54 @@ symlink symlinks syscall syslog +System.IO.Packaging system.manage system.management.automation systemd +SytzeAndr tabcompletion tadas tandasat +test-modulemanifest +test-pssessionconfigurationfile +test-scriptfileinfo test.ps1 test.txt. test1.txt test2.txt testcase testdrive -test-modulemanifest -test-pssessionconfigurationfile tests.zip -test-scriptfileinfo tgz theflyingcorpse thenewstellw thezim +ThomasNieto threadjob throttlelimit throw-testcasesitmockdescribe +ThrowExceptionForHR timcurwick timestamp timothywlewis --title tobias +tokenizer.cs tokenizing tomconte +tommymaynard toolchain toolset tracesource travisez13 travisty truher +tylerleonhardt typecataloggen typeconversion typegen typematch -ThomasNieto ubuntu +un-versioned unicode unregister-event unregister-packagesource @@ -745,7 +830,7 @@ unregister-psrepository unregister-pssessionconfiguration unregistering untracked -un-versioned +unvalidated update-formatdata update-modulemanifest update-scriptfileinfo @@ -754,8 +839,8 @@ uri urls userdata uservoice -utf8 utf-8 +utf8 utf8nobom utils utils.cs @@ -768,6 +853,7 @@ v0.6.0 v141 v3 v4 +v5 v5.0 v6 v6.0. @@ -778,17 +864,22 @@ v6.0.4 v6.0.5 v6.1.0 v6.1.1 +v6.1.2 v6.2.0 v6.2.1 v6.2.2 v6.2.3 v6.2.4 +v7.0.0 validatenotnullorempty versioned versioning +vexx32 visualstudio +vmsilvamolina vorobev vors +vpondala vscode vstsbuild.ps1 walkthrough @@ -824,45 +915,10 @@ xpath xtqqczze xunit yaml +yashrajbharti +yml youtube zackjknight -vexx32 -perf -britishben -felixfbecker -vpondala -dependabot -jellyfrog -1redone -tommymaynard -vmsilvamolina -fbehrens -lockdown -lukexjeremy -deserializing -kiazhi -v6.1.2 -Menagarishvili -anmenaga -fxdependent -sba923 -replicaJunction -lupino3 -hvitved -unvalidated -Geweldig -mjanko5 -v7.0.0 -renehernandez -ece-jacob-scott -st0le -MohiTheFish -CodeFormatter -StyleCop -SytzeAndr -yashrajbharti -Leonhardt -tylerleonhardt - CHANGELOG.md aavdberg asrosent diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index ded6245de3f..5356cf05f63 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -1,5 +1,106 @@ # Current preview release +## [7.1.0-preview.2] - 2020-04-23 + +### Breaking Changes + +- On Windows, `Start-Process` creates a process environment with + all the environment variables from current session, + using `-UseNewEnvironment` creates a new default process environment (#10830) (Thanks @iSazonov!) +- Do not wrap return result to `PSObject` when converting ScriptBlock to delegate (#10619) + +### Engine Updates and Fixes + +- Allow case insensitive paths for determining `PSModulePath` (#12192) +- Add PowerShell version 7.0 to compatible version list (#12184) +- Discover assemblies loaded by `Assembly.Load(byte[])` and `Assembly.LoadFile` (#12203) + +### General Cmdlet Updates and Fixes + +- Fix `WinCompat` module loading to treat PowerShell 7 modules with higher priority (#12269) +- Implement `ForEach-Object -Parallel` runspace reuse (#12122) +- Fix `Get-Service` to not modify collection while enumerating it (#11851) (Thanks @NextTurn!) +- Clean up the IPC named pipe on PowerShell exit (#12187) +- Fix `` detection regex in web cmdlets (#12099) (Thanks @vexx32!) +- Allow shorter signed hex literals with appropriate type suffixes (#11844) (Thanks @vexx32!) +- Update `UseNewEnvironment` parameter behavior of `Start-Process` cmdlet on Windows (#10830) (Thanks @iSazonov!) +- Add `-Shuffle` switch to `Get-Random` command (#11093) (Thanks @eugenesmlv!) +- Make `GetWindowsPowerShellModulePath` compatible with multiple PS installations (#12280) +- Fix `Start-Job` to work on systems that don't have Windows PowerShell registered as default shell (#12296) +- Specifying an alias and `-Syntax` to `Get-Command` returns the aliased commands syntax (#10784) (Thanks @ChrisLGardner!) +- Make CSV cmdlets work when using `-AsNeeded` and there is an incomplete row (#12281) (Thanks @iSazonov!) +- In local invocations, do not require `-PowerShellVersion 5.1` for `Get-FormatData` in order to see all format data. (#11270) (Thanks @mklement0!) +- Added Support For Big Endian `UTF-32` (#11947) (Thanks @NoMoreFood!) +- Fix possible race that leaks PowerShell object dispose in `ForEach-Object -Parallel` (#12227) +- Add `-FromUnixTime` to `Get-Date` to allow Unix time input (#12179) (Thanks @jackdcasey!) +- Change default progress foreground and background colors to provide improved contrast (#11455) (Thanks @rkeithhill!) +- Fix `foreach -parallel` when current drive is not available (#12197) +- Do not wrap return result to `PSObject` when converting `ScriptBlock` to `delegate` (#10619) +- Don't write DNS resolution errors on `Test-Connection -Quiet` (#12204) (Thanks @vexx32!) +- Use dedicated threads to read the redirected output and error streams from the child process for out-of-proc jobs (#11713) + +### Code Cleanup + +
    + + + +

    We thank the following contributors!

    +

    @ShaydeNofziger, @RDIL

    + +
    + +
      +
    • Fix erroneous comment in tokenizer.cs (#12206) (Thanks @ShaydeNofziger!)
    • +
    • Fix terms checker issues (#12189)
    • +
    • Update copyright notice to latest guidance (#12190)
    • +
    • CodeFactor cleanup (#12251) (Thanks @RDIL!)
    • +
    + +
    + +### Tools + +- Update .NET dependency update script to include test `csproj` files (#12372) +- Scripts to update to .NET prerelease version (#12284) + +### Tests + +- Pin major Pester version to 4 to prevent breaking changes caused by upcoming release of v5 (#12262) (Thanks @bergmeister!) + +### Build and Packaging Improvements + +
    + + + +

    We thank the following contributors!

    +

    @rkitover, @bergmeister

    + +
    + +
      +
    • Add the nuget.config from root to the temporary build folder (#12394)
    • +
    • Bump System.IO.Packaging (#12365)
    • +
    • Bump Markdig.Signed from 0.18.3 to 0.20.0 (#12379)
    • +
    • Bump to .NET 5 Preview 3 pre-release (#12353)
    • +
    • Bump PowerShellGet from 2.2.3 to 2.2.4 (#12342)
    • +
    • Linux: Initial support for Gentoo installations. (#11429) (Thanks @rkitover!)
    • +
    • Upgrade to .NET 5 Preview 2 (#12250) (Thanks @bergmeister!)
    • +
    • Fix the Sync PSGalleryModules to Artifacts build (#12277)
    • +
    • Bump PSReadLine from 2.0.0 to 2.0.1 (#12243)
    • +
    • Bump NJsonSchema from 10.1.11 to 10.1.12 (#12230)
    • +
    • Update change log generation script to support collapsible sections (#12214)
    • +
    + +
    + +### Documentation and Help Content + +- Add documentation for `WebResponseObject` and `BasicHtmlWebResponseObject` properties (#11876) (Thanks @kevinoid!) +- Add Windows 10 IoT Core reference in `Adopters.md` (#12266) (Thanks @parameshbabu!) +- Update `README.md` and `metadata.json` for `7.1.0-preview.1` (#12211) + ## 7.1.0-preview.1 - 2020-03-26 ### Breaking Changes @@ -22,7 +123,7 @@ - Use asynchronous streams in `Invoke-RestMethod` (#11095) (Thanks @iSazonov!) - Address UTF-8 Detection In `Get-Content -Tail` (#11899) (Thanks @NoMoreFood!) - Handle the `IOException` in `Get-FileHash` (#11944) (Thanks @iSazonov!) -- Change 'PowerShell Core' to 'PowerShell' in a resource string (#11928) (Thanks @alexandair!) +- Change `PowerShell Core` to `PowerShell` in a resource string (#11928) (Thanks @alexandair!) - Bring back `MainWindowTitle` in `PSHostProcessInfo` (#11885) (Thanks @iSazonov!) - Miscellaneous minor updates to Windows Compatibility (#11980) - Fix `ConciseView` to split `PositionMessage` using `[Environment]::NewLine` (#12010) @@ -41,7 +142,7 @@ - Update `PSPath` in `certificate_format_ps1.xml` (#11603) (Thanks @xtqqczze!) - Change regular expression to match relation-types without quotes in Link header (#11711) (Thanks @Marusyk!) - Fix error message during symbolic link deletion (#11331) -- Add custom 'Selected.*' type to `PSCustomObject` in `Select-Object` only once (#11548) (Thanks @iSazonov!) +- Add custom `Selected.*` type to `PSCustomObject` in `Select-Object` only once (#11548) (Thanks @iSazonov!) - Add `-AsUTC` to the `Get-Date` cmdlet (#11611) - Fix grouping behavior with Boolean values in `Format-Hex` (#11587) (Thanks @vexx32!) - Make `Test-Connection` always use the default synchronization context for sending ping requests (#11517) @@ -71,7 +172,7 @@
  • Fix Typo in Get-ComputerInfo cmdlet description (#11321) (Thanks @doctordns!)
  • Fix typo in description for Get-ExperimentalFeature PSWindowsPowerShellCompatibility (#11282) (Thanks @alvarodelvalle!)
  • Cleanups in command discovery (#10815) (Thanks @iSazonov!)
  • -
  • Review currentculture (#11044) (Thanks @iSazonov!)
  • +
  • Review CurrentCulture (#11044) (Thanks @iSazonov!)
  • @@ -146,7 +247,7 @@ - Update `Adopters.md` to include info on Azure Pipelines and GitHub Actions (#11888) (Thanks @alepauly!) - Add information about how Amazon AWS uses PowerShell. (#11365) (Thanks @bpayette!) - Add link to .NET CLI version in build documentation (#11725) (Thanks @joeltankam!) -- Added info about DeploymentScripts in ADOPTERS.md (#11703) +- Added info about `DeploymentScripts` in `ADOPTERS.md` (#11703) - Update `CHANGELOG.md` for `6.2.4` release (#11699) - Update `README.md` and `metadata.json` for next release (#11597) - Update the breaking change definition (#11516) @@ -159,3 +260,5 @@ - Update `Readme.md` for `preview.6` release (#11108) - Update `SUPPORT.md` (#11101) (Thanks @mklement0!) - Update `README.md` (#11100) (Thanks @mklement0!) + +[7.1.0-preview.2]: https://github.com/PowerShell/PowerShell/compare/v7.1.0-preview.1...v7.1.0-preview.2 From 240a8f7f1babbd3e88247fe04a66c3a2c8fb090e Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Tue, 19 May 2020 13:47:07 +0200 Subject: [PATCH 194/275] NRE in CommandSearcher.GetNextCmdlet (#12659) # PR Summary Fixes a NullReferenceException when searching for malformed cmdlet names ## PR Context In GetNextCmdlet, there is a check ```csharp if (!useAbbreviationExpansion && PSSnapinQualifiedCommandName == null) { return null; } ``` i.e. the null check is only done if useAbbreviationExpansion is false. Later on we reference PSSnapinQualifiedCommandName in anyway and get an NRE. ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../engine/CommandSearcher.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index 093a2fbe993..aafdadf924d 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -1010,10 +1010,12 @@ private CmdletInfo GetNextCmdlet() return null; } - WildcardPattern cmdletMatcher = - WildcardPattern.Get( - PSSnapinQualifiedCommandName.ShortName, - WildcardOptions.IgnoreCase); + string moduleName = PSSnapinQualifiedCommandName?.PSSnapInName; + + var cmdletShortName = PSSnapinQualifiedCommandName?.ShortName; + WildcardPattern cmdletMatcher = cmdletShortName != null + ? WildcardPattern.Get(cmdletShortName, WildcardOptions.IgnoreCase) + : null; SessionStateInternal ss = _context.EngineSessionState; @@ -1021,13 +1023,12 @@ private CmdletInfo GetNextCmdlet() { foreach (CmdletInfo cmdlet in cmdletList) { - if (cmdletMatcher.IsMatch(cmdlet.Name) || + if (cmdletMatcher != null && + cmdletMatcher.IsMatch(cmdlet.Name) || (_commandResolutionOptions.HasFlag(SearchResolutionOptions.FuzzyMatch) && - FuzzyMatcher.IsFuzzyMatch(cmdlet.Name, _commandName))) + FuzzyMatcher.IsFuzzyMatch(cmdlet.Name, _commandName))) { - if (string.IsNullOrEmpty(PSSnapinQualifiedCommandName.PSSnapInName) || - (PSSnapinQualifiedCommandName.PSSnapInName.Equals( - cmdlet.ModuleName, StringComparison.OrdinalIgnoreCase))) + if (string.IsNullOrEmpty(moduleName) || moduleName.Equals(cmdlet.ModuleName, StringComparison.OrdinalIgnoreCase)) { // If PSSnapin is specified, make sure they match matchingCmdletInfo.Add(cmdlet); From 79a483be34cfc057c151dcb419603e5f4104d414 Mon Sep 17 00:00:00 2001 From: Sergey Vasin Date: Tue, 19 May 2020 17:49:18 +0300 Subject: [PATCH 195/275] Fix comments in Mshexpression.cs (#12711) # PR Summary Fix comments in Mshexpression.cs ## PR Context Fix summary comments for ResolveNames methods in Mshexpression.cs. ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../FormatAndOutput/common/Utilities/Mshexpression.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs index dd9f18a2502..37408c2e76d 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs @@ -110,7 +110,7 @@ public override string ToString() } /// - /// Resolve the names matched by this the expression. + /// Resolve the names matched by the expression. /// /// The object to apply the expression against. public List ResolveNames(PSObject target) @@ -133,7 +133,7 @@ public bool HasWildCardCharacters } /// - /// Resolve the names matched by this the expression. + /// Resolve the names matched by the expression. /// /// The object to apply the expression against. /// If the matched properties are property sets, expand them. From cdd13a60de5990d85b95c1239be6e627ab53d290 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 19 May 2020 17:17:32 +0100 Subject: [PATCH 196/275] Add link to Github compare in changelog (#12713) # PR Summary Add link to Github compare in `CHANGELOG\preview.md` ## PR Context follow-up #11652 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- CHANGELOG/preview.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG/preview.md b/CHANGELOG/preview.md index 5356cf05f63..866e9090491 100644 --- a/CHANGELOG/preview.md +++ b/CHANGELOG/preview.md @@ -101,7 +101,7 @@ - Add Windows 10 IoT Core reference in `Adopters.md` (#12266) (Thanks @parameshbabu!) - Update `README.md` and `metadata.json` for `7.1.0-preview.1` (#12211) -## 7.1.0-preview.1 - 2020-03-26 +## [7.1.0-preview.1] - 2020-03-26 ### Breaking Changes @@ -262,3 +262,4 @@ - Update `README.md` (#11100) (Thanks @mklement0!) [7.1.0-preview.2]: https://github.com/PowerShell/PowerShell/compare/v7.1.0-preview.1...v7.1.0-preview.2 +[7.1.0-preview.1]: https://github.com/PowerShell/PowerShell/compare/v7.0.0-preview.6...v7.1.0-preview.1 From d4e338ce6ab633faf2b7716b06a33d3c502023f2 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Tue, 19 May 2020 11:10:43 -0700 Subject: [PATCH 197/275] Update `README.md` removing experimental status of `Arm` builds, but `Win-Arm64` is still preview for Stable release. (#12707) --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dc9f64330ad..580e8cf008a 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ You can download and install a PowerShell package for any of the following platf You can also download the PowerShell binary archives for Windows, macOS and Linux. -| Platform | Downloads (stable) | Downloads (preview) | How to Install | -| ------------------------------------| ------------------------------------------------ | ------------------------------------------------| -----------------------------------------------| -| Windows | [32-bit][rl-winx86-zip]/[64-bit][rl-winx64-zip] | [32-bit][pv-winx86-zip]/[64-bit][pv-winx64-zip] | [Instructions][in-windows-zip] | -| macOS | [64-bit][rl-macos-tar] | [64-bit][pv-macos-tar] | [Instructions][in-tar-macos] | -| Linux | [64-bit][rl-linux-tar] | [64-bit][pv-linux-tar] | [Instructions][in-tar-linux] | -| Windows (arm) **Experimental** | [32-bit][rl-winarm]/[64-bit][rl-winarm64] | [32-bit][pv-winarm]/[64-bit][pv-winarm64] | [Instructions][in-arm] | -| Raspbian (Stretch) **Experimental** | [32-bit][rl-arm32]/[64-bit][rl-arm64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | +| Platform | Downloads (stable) | Downloads (preview) | How to Install | +| ---------------| --------------------------------------------------- | ------------------------------------------------| -----------------------------------------------| +| Windows | [32-bit][rl-winx86-zip]/[64-bit][rl-winx64-zip] | [32-bit][pv-winx86-zip]/[64-bit][pv-winx64-zip] | [Instructions][in-windows-zip] | +| macOS | [64-bit][rl-macos-tar] | [64-bit][pv-macos-tar] | [Instructions][in-tar-macos] | +| Linux | [64-bit][rl-linux-tar] | [64-bit][pv-linux-tar] | [Instructions][in-tar-linux] | +| Windows (Arm) | [32-bit][rl-winarm]/[64-bit][rl-winarm64] (preview) | [32-bit][pv-winarm]/[64-bit][pv-winarm64] | [Instructions][in-arm] | +| Raspbian (Arm) | [32-bit][rl-arm32]/[64-bit][rl-arm64] | [32-bit][pv-arm32]/[64-bit][pv-arm64] | [Instructions][in-raspbian] | [lts-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.ubuntu.18.04_amd64.deb [lts-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-lts_7.0.1-1.ubuntu.16.04_amd64.deb From 310ffe0b95435614d828f9538fa5b07dd7478da0 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 19 May 2020 11:22:28 -0700 Subject: [PATCH 198/275] Update `README` and `metadata` files for next release (#12717) --- DotnetRuntimeMetadata.json | 6 +++--- README.md | 34 +++++++++++++++++----------------- tools/metadata.json | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json index d5afbda85f1..0751df40250 100644 --- a/DotnetRuntimeMetadata.json +++ b/DotnetRuntimeMetadata.json @@ -1,7 +1,7 @@ { "sdk": { - "channel": "release/5.0.1xx-preview4", - "packageVersionPattern": "5.0.0-preview.4", - "nextChannel": "net5/preview4" + "channel": "release/5.0.1xx-preview5", + "packageVersionPattern": "5.0.0-preview.5", + "nextChannel": "net5/preview5" } } diff --git a/README.md b/README.md index 580e8cf008a..70a5425bc80 100644 --- a/README.md +++ b/README.md @@ -87,23 +87,23 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu [rl-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.0.1/powershell-7.0.1-linux-arm64.tar.gz [rl-snap]: https://snapcraft.io/powershell -[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x64.msi -[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x86.msi -[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.ubuntu.18.04_amd64.deb -[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.ubuntu.16.04_amd64.deb -[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.debian.9_amd64.deb -[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview_7.1.0-preview.2-1.debian.10_amd64.deb -[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview-7.1.0_preview.2-1.rhel.7.x86_64.rpm -[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-preview-7.1.0_preview.2-1.centos.8.x86_64.rpm -[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-osx-x64.pkg -[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-arm32.zip -[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-arm64.zip -[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x86.zip -[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/PowerShell-7.1.0-preview.2-win-x64.zip -[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-osx-x64.tar.gz -[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-x64.tar.gz -[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-arm32.tar.gz -[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.2/powershell-7.1.0-preview.2-linux-arm64.tar.gz +[pv-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-x64.msi +[pv-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-x86.msi +[pv-ubuntu18]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview_7.1.0-preview.3-1.ubuntu.18.04_amd64.deb +[pv-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview_7.1.0-preview.3-1.ubuntu.16.04_amd64.deb +[pv-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview_7.1.0-preview.3-1.debian.9_amd64.deb +[pv-debian10]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview_7.1.0-preview.3-1.debian.10_amd64.deb +[pv-centos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview-7.1.0_preview.3-1.rhel.7.x86_64.rpm +[pv-centos8]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-preview-7.1.0_preview.3-1.centos.8.x86_64.rpm +[pv-macos]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-7.1.0-preview.3-osx-x64.pkg +[pv-winarm]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-arm32.zip +[pv-winarm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-arm64.zip +[pv-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-x86.zip +[pv-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/PowerShell-7.1.0-preview.3-win-x64.zip +[pv-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-7.1.0-preview.3-osx-x64.tar.gz +[pv-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-7.1.0-preview.3-linux-x64.tar.gz +[pv-arm32]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-7.1.0-preview.3-linux-arm32.tar.gz +[pv-arm64]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.0-preview.3/powershell-7.1.0-preview.3-linux-arm64.tar.gz [pv-snap]: https://snapcraft.io/powershell-preview [in-windows]: https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-windows diff --git a/tools/metadata.json b/tools/metadata.json index 7d1597219d4..36662f66773 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,9 +1,9 @@ { "StableReleaseTag": "v7.0.1", - "PreviewReleaseTag": "v7.1.0-preview.2", + "PreviewReleaseTag": "v7.1.0-preview.3", "ServicingReleaseTag": "v6.2.5", "ReleaseTag": "v7.0.1", "LTSReleaseTag" : ["v7.0.1"], - "NextReleaseTag": "v7.1.0-preview.3", + "NextReleaseTag": "v7.1.0-preview.4", "LTSRelease": false } From 9212aac0fa020b657454ef4f9ff2fdd6fc6d759c Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 19 May 2020 19:57:52 +0100 Subject: [PATCH 199/275] Use nameof operator (#12716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # PR Summary Using *Roslynator Command Line Tool version 0.1.0.4* * Fix RCS1015: * `"argument"` → `nameof(argument)` * `enum.ToString()` → `nameof(enum)` [RCS1015.log](https://github.com/PowerShell/PowerShell/files/4646102/RCS1015.log) ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../cmdletization/SessionBasedWrapper.cs | 6 +- .../cmdletization/cim/CimJobException.cs | 4 +- .../cmdletization/cim/cimConverter.cs | 6 +- .../cimSupport/cmdletization/cim/cimQuery.cs | 4 +- .../cmdletization/cim/cimWrapper.cs | 2 +- .../commands/management/CIMHelper.cs | 4 +- .../commands/management/Computer.cs | 4 +- .../commands/management/ContentCommandBase.cs | 4 +- .../commands/management/Process.cs | 2 +- .../commands/management/Service.cs | 6 +- .../commands/management/SetContentCommand.cs | 2 +- .../commands/utility/AddType.cs | 2 +- .../commands/utility/CustomSerialization.cs | 4 +- .../EnableDisableRunspaceDebugCommand.cs | 2 +- .../OutGridView/OutWindowProxy.cs | 10 +- .../commands/utility/GetRandomCommand.cs | 4 +- .../utility/ImplicitRemotingCommands.cs | 68 ++++---- .../commands/utility/Select-Object.cs | 2 +- .../ShowCommand/ShowCommandCommandInfo.cs | 4 +- .../ShowCommand/ShowCommandModuleInfo.cs | 4 +- .../ShowCommand/ShowCommandParameterInfo.cs | 4 +- .../ShowCommandParameterSetInfo.cs | 4 +- .../ShowCommand/ShowCommandParameterType.cs | 4 +- .../commands/utility/UtilityCommon.cs | 6 +- .../Common/InvokeRestMethodCommand.Common.cs | 4 +- .../Common/WebRequestPSCmdlet.Common.cs | 30 ++-- .../Common/WebResponseObject.Common.cs | 2 +- .../InvokeWebRequestCommand.CoreClr.cs | 2 +- .../utility/WebCmdlet/CoreCLR/WebProxy.cs | 4 +- .../utility/trace/MshHostTraceListener.cs | 2 +- .../utility/trace/TraceExpressionCommand.cs | 4 +- .../WindowsTaskbarJumpList/PropVariant.cs | 2 +- .../host/msh/ConsoleControl.cs | 2 +- .../host/msh/ConsoleHost.cs | 2 +- .../host/msh/ConsoleHostRawUserInterface.cs | 24 +-- .../msh/ConsoleHostUserInterfacePrompt.cs | 6 +- ...ConsoleHostUserInterfacePromptForChoice.cs | 10 +- .../host/msh/ProgressPane.cs | 2 +- .../DotNetCode/Eventing/EventDescriptor.cs | 8 +- .../DotNetCode/Eventing/EventProvider.cs | 6 +- .../Eventing/EventProviderTraceListener.cs | 2 +- .../VT100EscapeSequences.cs | 2 +- .../security/AclCommands.cs | 22 +-- .../security/CertificateProvider.cs | 6 +- .../security/SignatureCommands.cs | 2 +- .../CurrentConfigurations.cs | 18 +-- src/Microsoft.WSMan.Management/WsManHelper.cs | 6 +- .../CoreCLR/CorePsAssemblyLoadContext.cs | 4 +- .../DscSupport/CimDSCParser.cs | 22 +-- .../FormatAndOutput/common/BaseCommand.cs | 2 +- .../common/BaseFormattingCommandParameters.cs | 4 +- .../common/BaseOutputtingCommand.cs | 2 +- .../common/DisplayDatabase/FormatTable.cs | 10 +- .../DisplayDatabase/displayDescriptionData.cs | 20 +-- .../displayDescriptionData_Complex.cs | 4 +- .../displayDescriptionData_List.cs | 8 +- .../displayDescriptionData_Table.cs | 8 +- .../displayDescriptionData_Wide.cs | 10 +- .../common/DisplayDatabase/typeDataManager.cs | 4 +- .../DisplayDatabase/typeDataXmlLoader.cs | 20 +-- .../typeDataXmlLoader_Views.cs | 4 +- .../common/FormatViewGenerator_Complex.cs | 4 +- .../common/FormattingObjectsDeserializer.cs | 12 +- .../FormatAndOutput/common/ILineOutput.cs | 6 +- .../common/Utilities/MshParameter.cs | 2 +- .../Utilities/MshParameterAssociation.cs | 2 +- .../common/Utilities/Mshexpression.cs | 4 +- .../out-console/ConsoleLineOutput.cs | 6 +- .../cmdletization/MethodInvocationInfo.cs | 4 +- .../cmdletization/ObjectModelWrapper.cs | 8 +- .../other/ciminstancetypeadapter.cs | 14 +- .../engine/ApplicationInfo.cs | 4 +- .../ChildrenCmdletProviderInterfaces.cs | 4 +- .../engine/CmdletFamilyProviderInterfaces.cs | 4 +- .../engine/CmdletInfo.cs | 10 +- .../engine/CmdletParameterBinderController.cs | 20 +-- .../engine/CodeMethods.cs | 4 +- .../engine/CommandBase.cs | 2 +- .../CommandCompletion/CommandCompletion.cs | 32 ++-- .../CommandCompletion/CompletionCompleters.cs | 2 +- .../CommandCompletion/CompletionResult.cs | 8 +- .../CommandCompletion/ExtensibleCompletion.cs | 8 +- .../PseudoParameterBinder.cs | 22 +-- .../engine/CommandDiscovery.cs | 8 +- .../engine/CommandInfo.cs | 8 +- .../engine/CommandMetadata.cs | 12 +- .../engine/CommandProcessor.cs | 2 +- .../engine/CommandProcessorBase.cs | 6 +- .../engine/CommonCommandParameters.cs | 2 +- .../engine/CompiledCommandParameter.cs | 6 +- .../engine/ContentCmdletProviderInterfaces.cs | 4 +- .../engine/CoreAdapter.cs | 4 +- .../engine/Credential.cs | 2 +- .../engine/DataStoreAdapter.cs | 18 +-- .../engine/DataStoreAdapterProvider.cs | 8 +- .../engine/DefaultCommandRuntime.cs | 2 +- .../engine/DriveInterfaces.cs | 2 +- .../engine/EngineIntrinsics.cs | 2 +- .../engine/ErrorPackage.cs | 2 +- .../engine/EventManager.cs | 14 +- .../ExperimentalFeature.cs | 2 +- .../engine/ExtendedTypeSystemException.cs | 2 +- .../engine/ExternalScriptInfo.cs | 4 +- .../engine/FunctionInfo.cs | 2 +- .../engine/GetCommandCommand.cs | 2 +- .../engine/ItemCmdletProviderInterfaces.cs | 4 +- .../engine/LanguagePrimitives.cs | 14 +- .../engine/MergedCommandParameterMetadata.cs | 4 +- .../engine/Modules/ModuleCmdletBase.cs | 2 +- .../engine/Modules/PSModuleInfo.cs | 4 +- .../engine/Modules/RemoteDiscoveryHelper.cs | 2 +- .../engine/MshCmdlet.cs | 16 +- .../engine/MshCommandRuntime.cs | 8 +- .../engine/MshMemberInfo.cs | 106 ++++++------- .../engine/MshObject.cs | 10 +- .../engine/MshObjectTypeDescriptor.cs | 6 +- .../engine/NativeCommandProcessor.cs | 2 +- .../engine/PSClassInfo.cs | 2 +- .../engine/ParameterBinderBase.cs | 10 +- .../engine/ParameterBinderController.cs | 2 +- .../engine/ParameterInfo.cs | 2 +- .../engine/ParameterSetInfo.cs | 4 +- .../engine/ParameterSetSpecificMetadata.cs | 2 +- .../engine/PathInterfaces.cs | 2 +- .../engine/ProgressRecord.cs | 12 +- .../PropertyCmdletProviderInterfaces.cs | 4 +- .../engine/ProviderInterfaces.cs | 2 +- .../engine/ProxyCommand.cs | 2 +- .../engine/PseudoParameterBinder.cs | 2 +- .../engine/PseudoParameters.cs | 4 +- .../engine/ScopedItemSearcher.cs | 4 +- .../engine/ScriptInfo.cs | 2 +- ...urityDescriptorCmdletProviderInterfaces.cs | 4 +- .../engine/SessionState.cs | 2 +- .../engine/SessionStateAliasAPIs.cs | 14 +- .../engine/SessionStateCmdletAPIs.cs | 4 +- .../engine/SessionStateContainer.cs | 62 ++++---- .../engine/SessionStateContent.cs | 18 +-- .../engine/SessionStateDriveAPIs.cs | 20 +-- .../engine/SessionStateDynamicProperty.cs | 72 ++++----- .../engine/SessionStateFunctionAPIs.cs | 16 +- .../engine/SessionStateItem.cs | 24 +-- .../engine/SessionStateLocationAPIs.cs | 14 +- .../engine/SessionStateNavigation.cs | 30 ++-- .../engine/SessionStateProperty.cs | 22 +-- .../engine/SessionStateProviderAPIs.cs | 38 ++--- .../engine/SessionStatePublic.cs | 6 +- .../engine/SessionStateScope.cs | 6 +- ...SessionStateSecurityDescriptorInterface.cs | 22 +-- .../engine/SessionStateUtils.cs | 2 +- .../engine/SessionStateVariableAPIs.cs | 32 ++-- .../engine/ShellVariable.cs | 2 +- .../engine/ThirdPartyAdapter.cs | 2 +- .../engine/TypeMetadata.cs | 14 +- .../engine/TypeTable.cs | 34 ++-- .../engine/UserFeedbackParameters.cs | 4 +- .../engine/VariableAttributeCollection.cs | 2 +- .../engine/VariableInterfaces.cs | 2 +- .../engine/VariablePath.cs | 2 +- .../engine/cmdlet.cs | 10 +- .../engine/debugger/debugger.cs | 40 ++--- .../engine/hostifaces/AsyncResult.cs | 2 +- .../engine/hostifaces/ChoiceDescription.cs | 6 +- .../engine/hostifaces/Command.cs | 16 +- .../engine/hostifaces/Connection.cs | 6 +- .../engine/hostifaces/ConnectionBase.cs | 16 +- .../engine/hostifaces/ConnectionFactory.cs | 12 +- .../engine/hostifaces/FieldDescription.cs | 10 +- .../engine/hostifaces/History.cs | 14 +- .../engine/hostifaces/HostUtilities.cs | 4 +- .../hostifaces/InternalHostUserInterface.cs | 14 +- .../engine/hostifaces/ListModifier.cs | 10 +- .../engine/hostifaces/LocalConnection.cs | 2 +- .../engine/hostifaces/LocalPipeline.cs | 2 +- .../hostifaces/MshHostRawUserInterface.cs | 16 +- .../engine/hostifaces/PSCommand.cs | 8 +- .../engine/hostifaces/PSDataCollection.cs | 16 +- .../engine/hostifaces/PSTask.cs | 2 +- .../engine/hostifaces/Parameter.cs | 10 +- .../engine/hostifaces/Pipeline.cs | 2 +- .../engine/hostifaces/PowerShell.cs | 28 ++-- .../engine/hostifaces/RunspacePoolInternal.cs | 30 ++-- .../engine/hostifaces/pipelinebase.cs | 4 +- .../engine/lang/interface/PSParser.cs | 4 +- .../engine/lang/parserutils.cs | 2 +- .../engine/parser/Compiler.cs | 2 +- .../engine/parser/SafeValues.cs | 2 +- .../engine/parser/ast.cs | 150 +++++++++--------- .../engine/parser/tokenizer.cs | 8 +- .../engine/pipeline.cs | 8 +- .../engine/regex.cs | 4 +- .../remoting/client/ClientMethodExecutor.cs | 2 +- .../engine/remoting/client/Job.cs | 12 +- .../engine/remoting/client/Job2.cs | 4 +- .../engine/remoting/client/JobManager.cs | 10 +- .../remoting/client/JobSourceAdapter.cs | 2 +- .../client/RemoteRunspacePoolInternal.cs | 8 +- .../remoting/client/RemotingErrorRecord.cs | 4 +- .../engine/remoting/client/ThrottlingJob.cs | 8 +- .../remoting/client/clientremotesession.cs | 6 +- ...clientremotesessionprotocolstatemachine.cs | 4 +- .../engine/remoting/client/remotepipeline.cs | 2 +- .../engine/remoting/client/remoterunspace.cs | 16 +- .../client/remotingprotocolimplementation.cs | 12 +- .../remoting/commands/InvokeCommandCommand.cs | 2 +- .../remoting/commands/PSRemotingCmdlet.cs | 26 +-- .../remoting/commands/PopRunspaceCommand.cs | 2 +- .../remoting/commands/PushRunspaceCommand.cs | 20 +-- .../remoting/commands/newrunspacecommand.cs | 12 +- .../remoting/commands/remotingcommandutil.cs | 8 +- .../common/RemoteSessionHyperVSocket.cs | 2 +- .../remoting/common/RemoteSessionNamedPipe.cs | 22 +-- .../remoting/common/RunspaceConnectionInfo.cs | 20 +-- .../common/WireDataFormat/EncodeAndDecode.cs | 52 +++--- .../engine/remoting/common/misc.cs | 6 +- .../remoting/common/remotingexceptions.cs | 8 +- .../fanin/InitialSessionStateProvider.cs | 16 +- .../fanin/OutOfProcTransportManager.cs | 22 +-- .../server/OutOfProcServerMediator.cs | 4 +- .../ServerRemoteHostRawUserInterface.cs | 4 +- .../server/ServerRemotingProtocol2.cs | 4 +- .../server/ServerRunspacePoolDriver.cs | 6 +- .../remoting/server/serverremotesession.cs | 8 +- .../server/serverremotesessionstatemachine.cs | 48 +++--- .../serverremotingprotocolimplementation.cs | 2 +- .../engine/runtime/CompiledScriptBlock.cs | 2 +- .../engine/runtime/Operations/MiscOps.cs | 4 +- .../engine/runtime/Operations/StringOps.cs | 2 +- .../engine/serialization.cs | 32 ++-- .../help/CommandHelpProvider.cs | 2 +- .../help/HelpCategoryInvalidException.cs | 2 +- .../help/HelpNotFoundException.cs | 2 +- .../help/ProviderHelpProvider.cs | 2 +- .../logging/MshLog.cs | 34 ++-- .../namespaces/AliasProvider.cs | 2 +- .../namespaces/CoreCommandContext.cs | 14 +- .../namespaces/FileSystemContentStream.cs | 6 +- .../namespaces/FileSystemProvider.cs | 82 +++++----- .../namespaces/FileSystemSecurity.cs | 10 +- .../namespaces/FunctionProvider.cs | 2 +- .../namespaces/LocationGlobber.cs | 2 +- .../namespaces/NavigationProviderBase.cs | 8 +- .../namespaces/ProviderBase.cs | 18 +-- .../ProviderDeclarationAttribute.cs | 4 +- .../namespaces/RegistryProvider.cs | 68 ++++---- .../namespaces/RegistrySecurity.cs | 12 +- .../namespaces/SessionStateProviderBase.cs | 26 +-- .../namespaces/StackInfo.cs | 4 +- .../security/Authenticode.cs | 8 +- .../security/CredentialParameter.cs | 2 +- .../security/SecureStringHelper.cs | 6 +- .../security/SecurityManager.cs | 2 +- .../singleshell/config/MshSnapinInfo.cs | 40 ++--- .../config/MshSnapinLoadException.cs | 2 +- .../utils/CommandDiscoveryExceptions.cs | 8 +- .../utils/ExecutionExceptions.cs | 14 +- .../utils/MshArgumentException.cs | 2 +- .../utils/MshArgumentNullException.cs | 2 +- .../utils/MshArgumentOutOfRangeException.cs | 2 +- .../utils/MshInvalidOperationException.cs | 2 +- .../utils/MshNotImplementedException.cs | 2 +- .../utils/MshNotSupportedException.cs | 2 +- .../utils/MshObjectDisposedException.cs | 2 +- .../utils/MshTraceSource.cs | 28 ++-- .../utils/ObjectReader.cs | 6 +- .../utils/ObjectStream.cs | 8 +- .../utils/ObjectWriter.cs | 2 +- .../utils/ParameterBinderExceptions.cs | 16 +- .../utils/ParserException.cs | 4 +- .../utils/PowerShellExecutionHelper.cs | 2 +- .../utils/PsUtils.cs | 12 +- .../utils/ResourceManagerCache.cs | 12 +- .../utils/RuntimeException.cs | 2 +- .../utils/SessionStateExceptions.cs | 4 +- .../utils/StructuredTraceSource.cs | 2 +- .../utils/tracing/EtwActivity.cs | 24 +-- .../EtwActivityReverterMethodInvoker.cs | 2 +- .../utils/tracing/EtwEventCorrelator.cs | 2 +- 278 files changed, 1429 insertions(+), 1429 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs index 0c03623110b..9ad44f3a07f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/SessionBasedWrapper.cs @@ -581,8 +581,8 @@ private TSession GetImpliedSession() /// true if successful method invocations should emit downstream the being operated on. public override void ProcessRecord(TObjectInstance objectInstance, MethodInvocationInfo methodInvocationInfo, bool passThru) { - if (objectInstance == null) throw new ArgumentNullException("objectInstance"); - if (methodInvocationInfo == null) throw new ArgumentNullException("methodInvocationInfo"); + if (objectInstance == null) throw new ArgumentNullException(nameof(objectInstance)); + if (methodInvocationInfo == null) throw new ArgumentNullException(nameof(methodInvocationInfo)); foreach (TSession sessionForJob in this.GetSessionsToActAgainst(objectInstance)) { @@ -607,7 +607,7 @@ public override void ProcessRecord(TObjectInstance objectInstance, MethodInvocat /// Method invocation details. public override void ProcessRecord(MethodInvocationInfo methodInvocationInfo) { - if (methodInvocationInfo == null) throw new ArgumentNullException("methodInvocationInfo"); + if (methodInvocationInfo == null) throw new ArgumentNullException(nameof(methodInvocationInfo)); foreach (TSession sessionForJob in this.GetSessionsToActAgainst(methodInvocationInfo)) { 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 b9a1d210823..092103d6fe7 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/CimJobException.cs @@ -56,7 +56,7 @@ protected CimJobException( { if (info == null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } _errorRecord = (ErrorRecord)info.GetValue("errorRecord", typeof(ErrorRecord)); @@ -71,7 +71,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } base.GetObjectData(info, context); 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 58a9f02338b..033b8813534 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs @@ -52,12 +52,12 @@ private unsafe void Copy(char* source, int offset, int charsToCopy) { if ((offset < 0) || (offset >= _string.Length)) { - throw new ArgumentOutOfRangeException("offset"); + throw new ArgumentOutOfRangeException(nameof(offset)); } if (offset + charsToCopy > _string.Length) { - throw new ArgumentOutOfRangeException("charsToCopy"); + throw new ArgumentOutOfRangeException(nameof(charsToCopy)); } fixed (char* target = _string) @@ -352,7 +352,7 @@ internal static object ConvertFromDotNetToCim(object dotNetObject) /// The only kind of exception this method can throw. internal static object ConvertFromCimToDotNet(object cimObject, Type expectedDotNetType) { - if (expectedDotNetType == null) { throw new ArgumentNullException("expectedDotNetType"); } + if (expectedDotNetType == null) { throw new ArgumentNullException(nameof(expectedDotNetType)); } if (cimObject == null) { 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 ba727baaef4..551b2149e41 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimQuery.cs @@ -316,12 +316,12 @@ public override void AddQueryOption(string optionName, object optionValue) { if (string.IsNullOrEmpty(optionName)) { - throw new ArgumentNullException("optionName"); + throw new ArgumentNullException(nameof(optionName)); } if (optionValue == null) { - throw new ArgumentNullException("optionValue"); + throw new ArgumentNullException(nameof(optionValue)); } this.queryOptions[optionName] = optionValue; 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 acd432037fb..d78c8d631e9 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs @@ -175,7 +175,7 @@ internal override StartableJob CreateQueryJob(CimSession session, QueryBuilder b CimQuery query = baseQuery as CimQuery; if (query == null) { - throw new ArgumentNullException("baseQuery"); + throw new ArgumentNullException(nameof(baseQuery)); } TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, isStaticCmdlet: false); diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs index edf1249638f..559af13127b 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/CIMHelper.cs @@ -80,7 +80,7 @@ internal static string WqlQueryAll(string from) internal static T GetFirst(CimSession session, string nameSpace, string wmiClassName) where T : class, new() { if (string.IsNullOrEmpty(wmiClassName)) - throw new ArgumentException("String argument may not be null or empty", "wmiClassName"); + throw new ArgumentException("String argument may not be null or empty", nameof(wmiClassName)); try { @@ -133,7 +133,7 @@ internal static string WqlQueryAll(string from) internal static T[] GetAll(CimSession session, string nameSpace, string wmiClassName) where T : class, new() { if (string.IsNullOrEmpty(wmiClassName)) - throw new ArgumentException("String argument may not be null or empty", "wmiClassName"); + throw new ArgumentException("String argument may not be null or empty", nameof(wmiClassName)); var rv = new List(); diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs index 578b4a7efde..ece9d77e511 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs @@ -107,7 +107,7 @@ private RestartComputerTimeoutException(SerializationInfo info, StreamingContext { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } ComputerName = info.GetString("ComputerName"); @@ -128,7 +128,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs index 34f7636174d..2271388c096 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/ContentCommandBase.cs @@ -348,7 +348,7 @@ internal ContentHolder( { if (pathInfo == null) { - throw PSTraceSource.NewArgumentNullException("pathInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(pathInfo)); } PathInfo = pathInfo; @@ -370,7 +370,7 @@ internal void CloseContent(List contentHolders, bool disposing) { if (contentHolders == null) { - throw PSTraceSource.NewArgumentNullException("contentHolders"); + throw PSTraceSource.NewArgumentNullException(nameof(contentHolders)); } foreach (ContentHolder holder in contentHolders) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 2ba50c23459..b17dfa02058 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -3005,7 +3005,7 @@ public override void GetObjectData( base.GetObjectData(info, context); if (info == null) - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); info.AddValue("ProcessName", _processName); } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 8081e98c261..f62591fa19c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -547,7 +547,7 @@ private void IncludeExcludeAdd( private bool Matches(ServiceController service, string[] matchList) { if (matchList == null) - throw PSTraceSource.NewArgumentNullException("matchList"); + throw PSTraceSource.NewArgumentNullException(nameof(matchList)); string serviceID = (selectionMode == SelectionMode.DisplayName) ? service.DisplayName : service.ServiceName; @@ -2566,7 +2566,7 @@ protected ServiceCommandException(SerializationInfo info, StreamingContext conte { if (info == null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } _serviceName = info.GetString("ServiceName"); @@ -2581,7 +2581,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs index b73edc3f291..4e040517b02 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/SetContentCommand.cs @@ -28,7 +28,7 @@ internal override void BeforeOpenStreams(string[] paths) { if (paths == null || paths.Length == 0) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(GetCurrentContext()); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 833c373ca9c..2e733802fa2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -887,7 +887,7 @@ private OutputKind OutputAssemblyTypeToOutputKind(OutputAssemblyType outputType) case OutputAssemblyType.WindowsApplication: return OutputKind.WindowsApplication; default: - throw new ArgumentOutOfRangeException("outputType"); + throw new ArgumentOutOfRangeException(nameof(outputType)); } } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs index 91985bd17c7..22572c65443 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CustomSerialization.cs @@ -55,12 +55,12 @@ internal CustomSerialization(XmlWriter writer, bool notypeinformation, int depth { if (writer == null) { - throw PSTraceSource.NewArgumentException("writer"); + throw PSTraceSource.NewArgumentException(nameof(writer)); } if (depth < 1) { - throw PSTraceSource.NewArgumentException("writer", Serialization.DepthOfOneRequired); + throw PSTraceSource.NewArgumentException(nameof(writer), Serialization.DepthOfOneRequired); } _depth = depth; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs index 6896917429f..c1294a08535 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/EnableDisableRunspaceDebugCommand.cs @@ -75,7 +75,7 @@ public int RunspaceId /// Runspace local Id. public PSRunspaceDebug(bool enabled, bool breakAll, string runspaceName, int runspaceId) { - if (string.IsNullOrEmpty(runspaceName)) { throw new PSArgumentNullException("runspaceName"); } + if (string.IsNullOrEmpty(runspaceName)) { throw new PSArgumentNullException(nameof(runspaceName)); } this.Enabled = enabled; this.BreakAll = breakAll; 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 49d41d8ce3e..871b1a1bb62 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 @@ -59,17 +59,17 @@ internal void AddColumns(string[] propertyNames, string[] displayNames, Type[] t { if (propertyNames == null) { - throw new ArgumentNullException("propertyNames"); + throw new ArgumentNullException(nameof(propertyNames)); } if (displayNames == null) { - throw new ArgumentNullException("displayNames"); + throw new ArgumentNullException(nameof(displayNames)); } if (types == null) { - throw new ArgumentNullException("types"); + throw new ArgumentNullException(nameof(types)); } try @@ -178,7 +178,7 @@ internal void AddItem(PSObject livePSObject) { if (livePSObject == null) { - throw new ArgumentNullException("livePSObject"); + throw new ArgumentNullException(nameof(livePSObject)); } if (_headerInfo == null) @@ -204,7 +204,7 @@ internal void AddHeteroViewItem(PSObject livePSObject) { if (livePSObject == null) { - throw new ArgumentNullException("livePSObject"); + throw new ArgumentNullException(nameof(livePSObject)); } if (_headerInfo == null) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index 91955c0f26c..6e4445ba28e 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -644,7 +644,7 @@ internal int Next(int maxValue) { if (maxValue < 0) { - throw new ArgumentOutOfRangeException("maxValue", GetRandomCommandStrings.MaxMustBeGreaterThanZeroApi); + throw new ArgumentOutOfRangeException(nameof(maxValue), GetRandomCommandStrings.MaxMustBeGreaterThanZeroApi); } return Next(0, maxValue); @@ -660,7 +660,7 @@ public int Next(int minValue, int maxValue) { if (minValue > maxValue) { - throw new ArgumentOutOfRangeException("minValue", GetRandomCommandStrings.MinGreaterThanOrEqualMaxApi); + throw new ArgumentOutOfRangeException(nameof(minValue), GetRandomCommandStrings.MinGreaterThanOrEqualMaxApi); } int randomNumber = 0; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index 61b71fe8f45..a1bc3762fcb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -187,7 +187,7 @@ private void RegisterModuleCleanUp(PSModuleInfo moduleInfo) { if (moduleInfo == null) { - throw PSTraceSource.NewArgumentNullException("moduleInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(moduleInfo)); } // Note: we are using this.Context.Events to make sure that the event handler @@ -534,7 +534,7 @@ internal ErrorDetails GetErrorDetails(string errorId, params object[] args) { if (string.IsNullOrEmpty(errorId)) { - throw PSTraceSource.NewArgumentNullException("errorId"); + throw PSTraceSource.NewArgumentNullException(nameof(errorId)); } return new ErrorDetails( @@ -564,7 +564,7 @@ private ErrorRecord GetErrorMalformedDataFromRemoteCommand(string commandName) { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } string errorId = "ErrorMalformedDataFromRemoteCommand"; @@ -585,7 +585,7 @@ private ErrorRecord GetErrorCommandSkippedBecauseOfShadowing(string commandNames { if (string.IsNullOrEmpty(commandNames)) { - throw PSTraceSource.NewArgumentNullException("commandNames"); + throw PSTraceSource.NewArgumentNullException(nameof(commandNames)); } string errorId = "ErrorCommandSkippedBecauseOfShadowing"; @@ -606,7 +606,7 @@ private ErrorRecord GetErrorSkippedNonRequestedCommand(string commandName) { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } string errorId = "ErrorSkippedNonRequestedCommand"; @@ -627,7 +627,7 @@ private ErrorRecord GetErrorSkippedNonRequestedTypeDefinition(string typeName) { if (string.IsNullOrEmpty(typeName)) { - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); } string errorId = "ErrorSkippedNonRequestedTypeDefinition"; @@ -648,7 +648,7 @@ private ErrorRecord GetErrorSkippedUnsafeCommandName(string commandName) { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } string errorId = "ErrorSkippedUnsafeCommandName"; @@ -669,18 +669,18 @@ private ErrorRecord GetErrorSkippedUnsafeNameInMetadata(string commandName, stri { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } if (string.IsNullOrEmpty(nameType)) { - throw PSTraceSource.NewArgumentNullException("nameType"); + throw PSTraceSource.NewArgumentNullException(nameof(nameType)); } Dbg.Assert(nameType.Equals("Alias") || nameType.Equals("ParameterSet") || nameType.Equals("Parameter"), "nameType matches resource names"); if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } string errorId = "ErrorSkippedUnsafe" + nameType + "Name"; @@ -701,12 +701,12 @@ private ErrorRecord GetErrorFromRemoteCommand(string commandName, RuntimeExcepti { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } if (runtimeException == null) { - throw PSTraceSource.NewArgumentNullException("runtimeException"); + throw PSTraceSource.NewArgumentNullException(nameof(runtimeException)); } string errorId; @@ -755,7 +755,7 @@ private ErrorRecord GetErrorCouldntResolvedAlias(string aliasName) { if (string.IsNullOrEmpty(aliasName)) { - throw PSTraceSource.NewArgumentNullException("aliasName"); + throw PSTraceSource.NewArgumentNullException(nameof(aliasName)); } string errorId = "ErrorCouldntResolveAlias"; @@ -776,7 +776,7 @@ private ErrorRecord GetErrorNoResultsFromRemoteEnd(string commandName) { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } string errorId = "ErrorNoResultsFromRemoteEnd"; @@ -872,7 +872,7 @@ private bool IsCommandNameAllowedForImport(string commandName) { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentNullException("commandName"); + throw PSTraceSource.NewArgumentNullException(nameof(commandName)); } if (this.AllowClobber.IsPresent) @@ -1270,7 +1270,7 @@ private ParameterMetadata RehydrateParameterMetadata(PSObject deserializedParame { if (deserializedParameterMetadata == null) { - throw PSTraceSource.NewArgumentNullException("deserializedParameterMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(deserializedParameterMetadata)); } string name = GetPropertyValue("Get-Command", deserializedParameterMetadata, "Name"); @@ -1311,7 +1311,7 @@ private CommandMetadata RehydrateCommandMetadata(PSObject deserializedCommandInf { if (deserializedCommandInfo == null) { - throw PSTraceSource.NewArgumentNullException("deserializedCommandInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(deserializedCommandInfo)); } string name = GetPropertyValue("Get-Command", deserializedCommandInfo, "Name"); @@ -1964,7 +1964,7 @@ private string EscapeFunctionNameForRemoteHelp(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } StringBuilder result = new StringBuilder(name.Length); @@ -2014,7 +2014,7 @@ private void GenerateManifest(TextWriter writer, string psm1fileName, string for { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } GenerateTopComment(writer); @@ -2087,7 +2087,7 @@ private void GenerateModuleHeader(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } // In Win8, we are no longer loading all assemblies by default. @@ -2123,7 +2123,7 @@ private void GenerateHelperFunctionsWriteMessage(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } writer.Write(HelperFunctionsWriteMessage); @@ -2177,7 +2177,7 @@ private void GenerateHelperFunctionsSetImplicitRunspace(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } string runspaceNameTemplate = StringUtil.Format(ImplicitRemotingStrings.ProxyRunspaceNameTemplate); @@ -2208,7 +2208,7 @@ private void GenerateHelperFunctionsGetSessionOption(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } writer.Write( @@ -2403,7 +2403,7 @@ private void GenerateHelperFunctionsGetImplicitRunspace(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } string hashString; @@ -2752,7 +2752,7 @@ private void GenerateHelperFunctionsClientSideParameters(TextWriter writer) { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } writer.Write(HelperFunctionsModifyParameters); @@ -2831,7 +2831,7 @@ private void GenerateCommandProxy(TextWriter writer, CommandMetadata commandMeta { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } string functionNameForString = CodeGeneration.EscapeSingleQuotedStringContent(commandMetadata.Name); @@ -2853,12 +2853,12 @@ private void GenerateCommandProxy(TextWriter writer, IEnumerable GetListOfCommandNames(IEnumerable listOfCo { if (listOfCommandMetadata == null) { - throw PSTraceSource.NewArgumentNullException("listOfCommandMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(listOfCommandMetadata)); } List listOfCommandNames = new List(); @@ -2915,7 +2915,7 @@ private string GenerateArrayString(IEnumerable listOfStrings) { if (listOfStrings == null) { - throw PSTraceSource.NewArgumentNullException("listOfStrings"); + throw PSTraceSource.NewArgumentNullException(nameof(listOfStrings)); } StringBuilder arrayString = new StringBuilder(); @@ -2976,12 +2976,12 @@ private void GenerateFormatFile(TextWriter writer, List { if (writer == null) { - throw PSTraceSource.NewArgumentNullException("writer"); + throw PSTraceSource.NewArgumentNullException(nameof(writer)); } if (listOfFormatData == null) { - throw PSTraceSource.NewArgumentNullException("listOfFormatData"); + throw PSTraceSource.NewArgumentNullException(nameof(listOfFormatData)); } XmlWriterSettings settings = new XmlWriterSettings(); 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 e5405172bee..7614278b602 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs @@ -25,7 +25,7 @@ internal PSPropertyExpressionFilter(string[] wildcardPatternsStrings) { if (wildcardPatternsStrings == null) { - throw new ArgumentNullException("wildcardPatternsStrings"); + throw new ArgumentNullException(nameof(wildcardPatternsStrings)); } _wildcardPatterns = new WildcardPattern[wildcardPatternsStrings.Length]; 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 115920651a4..c0226471bdd 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandCommandInfo.cs @@ -23,7 +23,7 @@ public ShowCommandCommandInfo(CommandInfo other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Name; @@ -71,7 +71,7 @@ public ShowCommandCommandInfo(PSObject other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Members["Name"].Value as string; 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 9111cd88216..457cf6d7028 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandModuleInfo.cs @@ -21,7 +21,7 @@ public ShowCommandModuleInfo(PSModuleInfo other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Name; @@ -37,7 +37,7 @@ public ShowCommandModuleInfo(PSObject other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Members["Name"].Value as string; 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 6e4732f7eac..665fa039929 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterInfo.cs @@ -23,7 +23,7 @@ public ShowCommandParameterInfo(CommandParameterInfo other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Name; @@ -50,7 +50,7 @@ public ShowCommandParameterInfo(PSObject other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Members["Name"].Value as string; 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 ff63ee13e76..e3c4cbf2cb7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterSetInfo.cs @@ -23,7 +23,7 @@ public ShowCommandParameterSetInfo(CommandParameterSetInfo other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Name; @@ -41,7 +41,7 @@ public ShowCommandParameterSetInfo(PSObject other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.Name = other.Members["Name"].Value as string; 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 f53d72ea868..d7a3258d27b 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ShowCommand/ShowCommandParameterType.cs @@ -22,7 +22,7 @@ public ShowCommandParameterType(Type other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.FullName = other.FullName; @@ -51,7 +51,7 @@ public ShowCommandParameterType(PSObject other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } this.IsEnum = (bool)(other.Members["IsEnum"].Value); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs index e4ef04b961a..1e404991bc9 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/UtilityCommon.cs @@ -121,7 +121,7 @@ public ByteCollection(ulong offset, byte[] value, string path) { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } Offset64 = offset; @@ -150,7 +150,7 @@ public ByteCollection(ulong offset, byte[] value) { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } Offset64 = offset; @@ -179,7 +179,7 @@ public ByteCollection(byte[] value) { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } Bytes = value; 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 fc0921d3c63..273fae835c3 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 @@ -380,7 +380,7 @@ public partial class InvokeRestMethodCommand : WebRequestPSCmdlet /// internal override void ProcessResponse(HttpResponseMessage response) { - if (response == null) { throw new ArgumentNullException("response"); } + if (response == null) { throw new ArgumentNullException(nameof(response)); } var baseResponseStream = StreamHelper.GetResponseStream(response); @@ -480,7 +480,7 @@ internal override void ProcessResponse(HttpResponseMessage response) private RestReturnType CheckReturnType(HttpResponseMessage response) { - if (response == null) { throw new ArgumentNullException("response"); } + if (response == null) { throw new ArgumentNullException(nameof(response)); } RestReturnType rt = RestReturnType.Detect; string contentType = ContentHelper.GetContentType(response); 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 ee56360e103..801660c0e8e 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 @@ -751,7 +751,7 @@ private Uri PrepareUri(Uri uri) private Uri CheckProtocol(Uri uri) { - if (uri == null) { throw new ArgumentNullException("uri"); } + if (uri == null) { throw new ArgumentNullException(nameof(uri)); } if (!uri.IsAbsoluteUri) { @@ -770,7 +770,7 @@ private string QualifyFilePath(string path) private string FormatDictionary(IDictionary content) { if (content == null) - throw new ArgumentNullException("content"); + throw new ArgumentNullException(nameof(content)); StringBuilder bodyBuilder = new StringBuilder(); foreach (string key in content.Keys) @@ -1165,7 +1165,7 @@ internal virtual HttpRequestMessage GetRequest(Uri uri) internal virtual void FillRequestStream(HttpRequestMessage request) { - if (request == null) { throw new ArgumentNullException("request"); } + if (request == null) { throw new ArgumentNullException(nameof(request)); } // set the content type if (ContentType != null) @@ -1338,9 +1338,9 @@ private bool ShouldRetry(HttpStatusCode code) internal virtual HttpResponseMessage GetResponse(HttpClient client, HttpRequestMessage request, bool keepAuthorization) { - if (client == null) { throw new ArgumentNullException("client"); } + if (client == null) { throw new ArgumentNullException(nameof(client)); } - if (request == null) { throw new ArgumentNullException("request"); } + if (request == null) { throw new ArgumentNullException(nameof(request)); } // Add 1 to account for the first request. int totalRequests = WebSession.MaximumRetryCount + 1; @@ -1452,7 +1452,7 @@ internal virtual HttpResponseMessage GetResponse(HttpClient client, HttpRequestM internal virtual void UpdateSession(HttpResponseMessage response) { - if (response == null) { throw new ArgumentNullException("response"); } + if (response == null) { throw new ArgumentNullException(nameof(response)); } } #endregion Virtual Methods @@ -1658,7 +1658,7 @@ protected override void StopProcessing() internal long SetRequestContent(HttpRequestMessage request, byte[] content) { if (request == null) - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); if (content == null) return 0; @@ -1681,7 +1681,7 @@ internal long SetRequestContent(HttpRequestMessage request, byte[] content) internal long SetRequestContent(HttpRequestMessage request, string content) { if (request == null) - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); if (content == null) return 0; @@ -1730,7 +1730,7 @@ internal long SetRequestContent(HttpRequestMessage request, string content) internal long SetRequestContent(HttpRequestMessage request, XmlNode xmlNode) { if (request == null) - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); if (xmlNode == null) return 0; @@ -1767,9 +1767,9 @@ internal long SetRequestContent(HttpRequestMessage request, XmlNode xmlNode) internal long SetRequestContent(HttpRequestMessage request, Stream contentStream) { if (request == null) - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); if (contentStream == null) - throw new ArgumentNullException("contentStream"); + throw new ArgumentNullException(nameof(contentStream)); var streamContent = new StreamContent(contentStream); request.Content = streamContent; @@ -1791,12 +1791,12 @@ internal long SetRequestContent(HttpRequestMessage request, MultipartFormDataCon { if (request == null) { - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); } if (multipartContent == null) { - throw new ArgumentNullException("multipartContent"); + throw new ArgumentNullException(nameof(multipartContent)); } request.Content = multipartContent; @@ -1807,9 +1807,9 @@ internal long SetRequestContent(HttpRequestMessage request, MultipartFormDataCon internal long SetRequestContent(HttpRequestMessage request, IDictionary content) { if (request == null) - throw new ArgumentNullException("request"); + throw new ArgumentNullException(nameof(request)); if (content == null) - throw new ArgumentNullException("content"); + throw new ArgumentNullException(nameof(content)); string body = FormatDictionary(content); return (SetRequestContent(request, body)); 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 40e1ddffab0..70c5721dbc1 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 @@ -182,7 +182,7 @@ private void InitializeRawContent(HttpResponseMessage baseResponse) private void SetResponse(HttpResponseMessage response, Stream contentStream) { - if (response == null) { throw new ArgumentNullException("response"); } + if (response == null) { throw new ArgumentNullException(nameof(response)); } BaseResponse = response; 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 27cca48377c..b0f849490cd 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 @@ -31,7 +31,7 @@ public InvokeWebRequestCommand() : base() /// internal override void ProcessResponse(HttpResponseMessage response) { - if (response == null) { throw new ArgumentNullException("response"); } + if (response == null) { throw new ArgumentNullException(nameof(response)); } Stream responseStream = StreamHelper.GetResponseStream(response); if (ShouldWriteToPipeline) 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 c1df3aa0bf5..5cb4f2b4fde 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 @@ -15,7 +15,7 @@ internal WebProxy(Uri address) { if (address == null) { - throw new ArgumentNullException("address"); + throw new ArgumentNullException(nameof(address)); } _proxyAddress = address; @@ -50,7 +50,7 @@ public Uri GetProxy(Uri destination) { if (destination == null) { - throw new ArgumentNullException("destination"); + throw new ArgumentNullException(nameof(destination)); } if (destination.IsLoopback) 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 fc91cec91c0..9b225bdc141 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs @@ -31,7 +31,7 @@ internal PSHostTraceListener(PSCmdlet cmdlet) { if (cmdlet == null) { - throw new PSArgumentNullException("cmdlet"); + throw new PSArgumentNullException(nameof(cmdlet)); } Diagnostics.Assert( 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 c7668903ed4..12f8e5b4e09 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/TraceExpressionCommand.cs @@ -334,12 +334,12 @@ internal TracePipelineWriter( { if (cmdlet == null) { - throw new ArgumentNullException("cmdlet"); + throw new ArgumentNullException(nameof(cmdlet)); } if (matchingSources == null) { - throw new ArgumentNullException("matchingSources"); + throw new ArgumentNullException(nameof(matchingSources)); } _cmdlet = cmdlet; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs index 3b9d73c0f4f..b877ab4e384 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs @@ -31,7 +31,7 @@ internal PropVariant(string value) { if (value == null) { - throw new ArgumentException("PropVariantNullString", "value"); + throw new ArgumentException("PropVariantNullString", nameof(value)); } #pragma warning disable CS0618 // Type or member is obsolete (might get deprecated in future versions diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 8d3eb856bd0..2229dbb63f1 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -1084,7 +1084,7 @@ internal static void WriteConsoleOutput(ConsoleHandle consoleHandle, Coordinates Dbg.Assert(!consoleHandle.IsClosed, "ConsoleHandle is closed"); if (contents == null) { - throw PSTraceSource.NewArgumentNullException("contents"); + throw PSTraceSource.NewArgumentNullException(nameof(contents)); } uint codePage; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs index 43b3a866096..44ad59579d2 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs @@ -735,7 +735,7 @@ public class ConsoleColorProxy public ConsoleColorProxy(ConsoleHostUserInterface ui) { - if (ui == null) throw new ArgumentNullException("ui"); + if (ui == null) throw new ArgumentNullException(nameof(ui)); _ui = ui; } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs index c1487dead65..91aceef2fbd 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostRawUserInterface.cs @@ -609,7 +609,7 @@ public override { if ((options & (ReadKeyOptions.IncludeKeyDown | ReadKeyOptions.IncludeKeyUp)) == 0) { - throw PSTraceSource.NewArgumentException("options", ConsoleHostRawUserInterfaceStrings.InvalidReadKeyOptionsError); + throw PSTraceSource.NewArgumentException(nameof(options), ConsoleHostRawUserInterfaceStrings.InvalidReadKeyOptionsError); } // keyInfo is initialized in the below if-else statement @@ -880,14 +880,14 @@ public override { if (contents == null) { - PSTraceSource.NewArgumentNullException("contents"); + PSTraceSource.NewArgumentNullException(nameof(contents)); } // the origin must be within the window. ConsoleControl.CONSOLE_SCREEN_BUFFER_INFO bufferInfo; ConsoleHandle handle = GetBufferInfo(out bufferInfo); - CheckCoordinateWithinBuffer(ref origin, ref bufferInfo, "origin"); + CheckCoordinateWithinBuffer(ref origin, ref bufferInfo, nameof(origin)); // The output is clipped by the console subsystem, so we don't have to check that the array exceeds the buffer // boundaries. @@ -931,14 +931,14 @@ public override // make sure the rect is valid if (region.Right < region.Left) { - throw PSTraceSource.NewArgumentException("region", + throw PSTraceSource.NewArgumentException(nameof(region), ConsoleHostRawUserInterfaceStrings.InvalidRegionErrorTemplate, "region.Right", "region.Left"); } if (region.Bottom < region.Top) { - throw PSTraceSource.NewArgumentException("region", + throw PSTraceSource.NewArgumentException(nameof(region), ConsoleHostRawUserInterfaceStrings.InvalidRegionErrorTemplate, "region.Bottom", "region.Top"); } @@ -960,7 +960,7 @@ public override ConsoleControl.IsCJKOutputCodePage(out codePage) && LengthInBufferCells(fill.Character) == 2) { - throw PSTraceSource.NewArgumentException("fill"); + throw PSTraceSource.NewArgumentException(nameof(fill)); } int cells = bufferWidth * bufferHeight; @@ -1005,7 +1005,7 @@ public override { if (leftExisting[r, 0].BufferCellType == BufferCellType.Leading) { - throw PSTraceSource.NewArgumentException("fill"); + throw PSTraceSource.NewArgumentException(nameof(fill)); } } } @@ -1014,7 +1014,7 @@ public override { if (charLength == 2) { - throw PSTraceSource.NewArgumentException("fill"); + throw PSTraceSource.NewArgumentException(nameof(fill)); } } else @@ -1030,7 +1030,7 @@ public override { if (rightExisting[r, 0].BufferCellType == BufferCellType.Leading) { - throw PSTraceSource.NewArgumentException("fill"); + throw PSTraceSource.NewArgumentException(nameof(fill)); } } } @@ -1040,7 +1040,7 @@ public override { if (rightExisting[r, 0].BufferCellType == BufferCellType.Leading ^ charLength == 2) { - throw PSTraceSource.NewArgumentException("fill"); + throw PSTraceSource.NewArgumentException(nameof(fill)); } } } @@ -1091,14 +1091,14 @@ public override // make sure the rect is valid if (region.Right < region.Left) { - throw PSTraceSource.NewArgumentException("region", + throw PSTraceSource.NewArgumentException(nameof(region), ConsoleHostRawUserInterfaceStrings.InvalidRegionErrorTemplate, "region.Right", "region.Left"); } if (region.Bottom < region.Top) { - throw PSTraceSource.NewArgumentException("region", + throw PSTraceSource.NewArgumentException(nameof(region), ConsoleHostRawUserInterfaceStrings.InvalidRegionErrorTemplate, "region.Bottom", "region.Top"); } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs index cd455c0f989..9449669ab65 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePrompt.cs @@ -97,12 +97,12 @@ public override if (descriptions == null) { - throw PSTraceSource.NewArgumentNullException("descriptions"); + throw PSTraceSource.NewArgumentNullException(nameof(descriptions)); } if (descriptions.Count < 1) { - throw PSTraceSource.NewArgumentException("descriptions", + throw PSTraceSource.NewArgumentException(nameof(descriptions), ConsoleHostUserInterfaceStrings.PromptEmptyDescriptionsErrorTemplate, "descriptions"); } @@ -139,7 +139,7 @@ public override descIndex++; if (desc == null) { - throw PSTraceSource.NewArgumentException("descriptions", + throw PSTraceSource.NewArgumentException(nameof(descriptions), ConsoleHostUserInterfaceStrings.NullErrorTemplate, string.Format(CultureInfo.InvariantCulture, "descriptions[{0}]", descIndex)); } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs index 1988104dbdb..70163c865e4 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfacePromptForChoice.cs @@ -46,18 +46,18 @@ public override int PromptForChoice(string caption, string message, Collection= choices.Count)) { - throw PSTraceSource.NewArgumentOutOfRangeException("defaultChoice", defaultChoice, + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(defaultChoice), defaultChoice, ConsoleHostUserInterfaceStrings.InvalidDefaultChoiceErrorTemplate, "defaultChoice", "choice"); } @@ -175,12 +175,12 @@ public Collection PromptForChoice(string caption, if (choices == null) { - throw PSTraceSource.NewArgumentNullException("choices"); + throw PSTraceSource.NewArgumentNullException(nameof(choices)); } if (choices.Count == 0) { - throw PSTraceSource.NewArgumentException("choices", + throw PSTraceSource.NewArgumentException(nameof(choices), ConsoleHostUserInterfaceStrings.EmptyChoicesErrorTemplate, "choices"); } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs index c2a13132e41..55dba38d6b4 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs @@ -27,7 +27,7 @@ class ProgressPane internal ProgressPane(ConsoleHostUserInterface ui) { - if (ui == null) throw new ArgumentNullException("ui"); + if (ui == null) throw new ArgumentNullException(nameof(ui)); _ui = ui; _rawui = ui.RawUI; } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs index e01249c9bc5..7cfef28f7e5 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs @@ -38,12 +38,12 @@ long keywords { if (id < 0) { - throw new ArgumentOutOfRangeException("id", DotNetEventingStrings.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(id), DotNetEventingStrings.ArgumentOutOfRange_NeedNonNegNum); } if (id > ushort.MaxValue) { - throw new ArgumentOutOfRangeException("id", string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); + throw new ArgumentOutOfRangeException(nameof(id), string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } _id = (ushort)id; @@ -55,12 +55,12 @@ long keywords if (task < 0) { - throw new ArgumentOutOfRangeException("task", DotNetEventingStrings.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(task), DotNetEventingStrings.ArgumentOutOfRange_NeedNonNegNum); } if (task > ushort.MaxValue) { - throw new ArgumentOutOfRangeException("task", string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); + throw new ArgumentOutOfRangeException(nameof(task), string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } _task = (ushort)task; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs index 05628d51f8d..1d2038b5bf1 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs @@ -435,7 +435,7 @@ public bool WriteMessageEvent(string eventMessage, byte eventLevel, long eventKe if (eventMessage == null) { - throw new ArgumentNullException("eventMessage"); + throw new ArgumentNullException(nameof(eventMessage)); } if (IsEnabled(eventLevel, eventKeywords)) @@ -619,7 +619,7 @@ public bool WriteTransferEvent(ref EventDescriptor eventDescriptor, Guid related // // too many arguments to log // - throw new ArgumentOutOfRangeException("eventPayload", + throw new ArgumentOutOfRangeException(nameof(eventPayload), string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_MaxArgExceeded, s_etwMaxNumberArguments)); } @@ -656,7 +656,7 @@ public bool WriteTransferEvent(ref EventDescriptor eventDescriptor, Guid related } else { - throw new ArgumentOutOfRangeException("eventPayload", + throw new ArgumentOutOfRangeException(nameof(eventPayload), string.Format(CultureInfo.CurrentCulture, DotNetEventingStrings.ArgumentOutOfRange_MaxStringsExceeded, s_etwAPIMaxStringCount)); } } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs index 2c272226ae2..27b24de945e 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs @@ -70,7 +70,7 @@ public EventProviderTraceListener(string providerId, string name, string delimit : base(name) { if (delimiter == null) - throw new ArgumentNullException("delimiter"); + throw new ArgumentNullException(nameof(delimiter)); if (delimiter.Length == 0) throw new ArgumentException(DotNetEventingStrings.Argument_NeedNonemptyDelimiter); diff --git a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs index 83e99298979..8e6d5ba9967 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs @@ -287,7 +287,7 @@ public VT100EscapeSequences(PSMarkdownOptionInfo optionInfo) { if (optionInfo == null) { - throw new ArgumentNullException("optionInfo"); + throw new ArgumentNullException(nameof(optionInfo)); } options = optionInfo; diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 9cdae9175ae..7447318f054 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -178,7 +178,7 @@ public static string GetPath(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } else { @@ -205,13 +205,13 @@ public static string GetOwner(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ObjectSecurity sd = instance.BaseObject as ObjectSecurity; if (sd == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } // Get owner @@ -245,13 +245,13 @@ public static string GetGroup(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ObjectSecurity sd = instance.BaseObject as ObjectSecurity; if (sd == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } // Get Group @@ -284,13 +284,13 @@ public static AuthorizationRuleCollection GetAccess(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ObjectSecurity sd = instance.BaseObject as ObjectSecurity; if (sd == null) { - PSTraceSource.NewArgumentException("instance"); + PSTraceSource.NewArgumentException(nameof(instance)); } // Get DACL @@ -323,13 +323,13 @@ public static AuthorizationRuleCollection GetAudit(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ObjectSecurity sd = instance.BaseObject as ObjectSecurity; if (sd == null) { - PSTraceSource.NewArgumentException("instance"); + PSTraceSource.NewArgumentException(nameof(instance)); } AuthorizationRuleCollection sacl; @@ -585,13 +585,13 @@ public static string GetSddl(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ObjectSecurity sd = instance.BaseObject as ObjectSecurity; if (sd == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } string sddl = sd.GetSecurityDescriptorSddlForm(AccessControlSections.All); diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 7bdb8286598..cde06e0ed65 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -605,7 +605,7 @@ public CertificateProvider() X509StoreLocation user = new X509StoreLocation(StoreLocation.CurrentUser); s_storeLocations.Add(user); - AddItemToCache(StoreLocation.CurrentUser.ToString(), + AddItemToCache(nameof(StoreLocation.CurrentUser), user); // @@ -614,7 +614,7 @@ public CertificateProvider() X509StoreLocation machine = new X509StoreLocation(StoreLocation.LocalMachine); s_storeLocations.Add(machine); - AddItemToCache(StoreLocation.LocalMachine.ToString(), + AddItemToCache(nameof(StoreLocation.LocalMachine), machine); AddItemToCache(string.Empty, s_storeLocations); @@ -1324,7 +1324,7 @@ private string MyGetChildName(string path) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Normalize the path diff --git a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs index ae9004f8dcf..91a3e8e3a83 100644 --- a/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/SignatureCommands.cs @@ -555,7 +555,7 @@ protected override Signature PerformAction(string filePath) System.Globalization.CultureInfo.CurrentCulture, UtilsStrings.FileSmallerThan4Bytes, filePath); - PSArgumentException e = new PSArgumentException(message, "filePath"); + PSArgumentException e = new PSArgumentException(message, nameof(filePath)); ErrorRecord er = SecurityUtils.CreateInvalidArgumentErrorRecord( e, "SignatureCommandsBaseFileSmallerThan4Bytes" diff --git a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs index 42709bc8337..01ba71f68a7 100644 --- a/src/Microsoft.WSMan.Management/CurrentConfigurations.cs +++ b/src/Microsoft.WSMan.Management/CurrentConfigurations.cs @@ -63,7 +63,7 @@ public CurrentConfigurations(IWSManSession serverSession) { if (serverSession == null) { - throw new ArgumentNullException("serverSession"); + throw new ArgumentNullException(nameof(serverSession)); } this.rootDocument = new XmlDocument(); @@ -81,7 +81,7 @@ public bool RefreshCurrentConfiguration(string responseOfGet) { if (string.IsNullOrEmpty(responseOfGet)) { - throw new ArgumentNullException("responseOfGet"); + throw new ArgumentNullException(nameof(responseOfGet)); } this.rootDocument.LoadXml(responseOfGet); @@ -103,7 +103,7 @@ public void PutConfigurationOnServer(string resourceUri) { if (string.IsNullOrEmpty(resourceUri)) { - throw new ArgumentNullException("resourceUri"); + throw new ArgumentNullException(nameof(resourceUri)); } this.serverSession.Put(resourceUri, this.rootDocument.InnerXml, 0); @@ -119,7 +119,7 @@ public void RemoveOneConfiguration(string pathToNodeFromRoot) { if (pathToNodeFromRoot == null) { - throw new ArgumentNullException("pathToNodeFromRoot"); + throw new ArgumentNullException(nameof(pathToNodeFromRoot)); } XmlNode nodeToRemove = @@ -136,7 +136,7 @@ public void RemoveOneConfiguration(string pathToNodeFromRoot) } else { - throw new ArgumentException("Node is not present in the XML, Please give valid XPath", "pathToNodeFromRoot"); + throw new ArgumentException("Node is not present in the XML, Please give valid XPath", nameof(pathToNodeFromRoot)); } } @@ -152,17 +152,17 @@ public void UpdateOneConfiguration(string pathToNodeFromRoot, string configurati { if (pathToNodeFromRoot == null) { - throw new ArgumentNullException("pathToNodeFromRoot"); + throw new ArgumentNullException(nameof(pathToNodeFromRoot)); } if (string.IsNullOrEmpty(configurationName)) { - throw new ArgumentNullException("configurationName"); + throw new ArgumentNullException(nameof(configurationName)); } if (configurationValue == null) { - throw new ArgumentNullException("configurationValue"); + throw new ArgumentNullException(nameof(configurationValue)); } XmlNode nodeToUpdate = @@ -197,7 +197,7 @@ public string GetOneConfiguration(string pathFromRoot) { if (pathFromRoot == null) { - throw new ArgumentNullException("pathFromRoot"); + throw new ArgumentNullException(nameof(pathFromRoot)); } XmlNode requiredNode = diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 32e1f88e57b..23593d68628 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -180,12 +180,12 @@ private static string FormatResourceMsgFromResourcetextS( { if (resourceManager == null) { - throw new ArgumentNullException("resourceManager"); + throw new ArgumentNullException(nameof(resourceManager)); } if (string.IsNullOrEmpty(resourceName)) { - throw new ArgumentNullException("resourceName"); + throw new ArgumentNullException(nameof(resourceName)); } string template = resourceManager.GetString(resourceName); @@ -478,7 +478,7 @@ internal string ProcessInput(IWSManEx wsman, string filepath, string operation, if (string.IsNullOrEmpty(entry.Key.ToString())) { // XmlNode newnode = xmlfile.CreateNode(XmlNodeType.Attribute, ATTR_NIL_NAME, NS_XSI_URI); - XmlAttribute newnode = xmlfile.CreateAttribute(XmlNodeType.Attribute.ToString(), ATTR_NIL_NAME, NS_XSI_URI); + XmlAttribute newnode = xmlfile.CreateAttribute(nameof(XmlNodeType.Attribute), ATTR_NIL_NAME, NS_XSI_URI); newnode.Value = "true"; node.Attributes.Append(newnode); // (newnode.Attributes.Item(0).FirstChild ); diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index fafd27c2cc4..ef210304ae9 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -78,7 +78,7 @@ private PowerShellAssemblyLoadContext(string basePaths) if (!Directory.Exists(basePath)) { string message = string.Format(CultureInfo.CurrentCulture, BaseFolderDoesNotExist, basePath); - throw new ArgumentException(message, "basePaths"); + throw new ArgumentException(message, nameof(basePaths)); } _probingPaths[i] = basePath.Trim(); @@ -582,7 +582,7 @@ public class PowerShellAssemblyLoadContextInitializer public static void SetPowerShellAssemblyLoadContext([MarshalAs(UnmanagedType.LPWStr)]string basePaths) { if (string.IsNullOrEmpty(basePaths)) - throw new ArgumentNullException("basePaths"); + throw new ArgumentNullException(nameof(basePaths)); PowerShellAssemblyLoadContext.InitializeSingleton(basePaths); } diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index c5fd73bf5b1..908025c14e2 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -298,7 +298,7 @@ public override object Transform(EngineIntrinsics engineIntrinsics, object input if (engineIntrinsics == null) { - throw PSTraceSource.NewArgumentNullException("engineIntrinsics"); + throw PSTraceSource.NewArgumentNullException(nameof(engineIntrinsics)); } return PsUtils.EvaluatePowerShellDataFileAsModuleManifest( @@ -372,7 +372,7 @@ internal static byte[] GetFileContent(string fullFilePath) { if (string.IsNullOrEmpty(fullFilePath)) { - throw PSTraceSource.NewArgumentNullException("fullFilePath"); + throw PSTraceSource.NewArgumentNullException(nameof(fullFilePath)); } if (!File.Exists(fullFilePath)) @@ -951,7 +951,7 @@ public static List ImportClasses(string path, Tuple m { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } s_tracer.WriteLine("DSC ClassCache: importing file: {0}", path); @@ -1179,7 +1179,7 @@ public static List GetCachedClassByFileName(string fileName) { if (string.IsNullOrWhiteSpace(fileName)) { - throw PSTraceSource.NewArgumentNullException("fileName"); + throw PSTraceSource.NewArgumentNullException(nameof(fileName)); } List listCimClass; @@ -1197,7 +1197,7 @@ public static List GetCachedClassByModuleName(string moduleName) { if (string.IsNullOrWhiteSpace(moduleName)) { - throw PSTraceSource.NewArgumentNullException("moduleName"); + throw PSTraceSource.NewArgumentNullException(nameof(moduleName)); } var moduleFileName = moduleName + ".schema.mof"; @@ -1214,7 +1214,7 @@ public static List ImportInstances(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } var parser = new Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser(MyClassCallback); @@ -1256,7 +1256,7 @@ public static void ValidateInstanceText(string instanceText) { if (string.IsNullOrEmpty(instanceText)) { - throw PSTraceSource.NewArgumentNullException("instanceText"); + throw PSTraceSource.NewArgumentNullException(nameof(instanceText)); } var parser = new Microsoft.PowerShell.DesiredStateConfiguration.CimDSCParser(MyClassCallback); @@ -3220,12 +3220,12 @@ public static bool ImportCimKeywordsFromModule(PSModuleInfo module, string resou { if (module == null) { - throw PSTraceSource.NewArgumentNullException("module"); + throw PSTraceSource.NewArgumentNullException(nameof(module)); } if (resourceName == null) { - throw PSTraceSource.NewArgumentNullException("resourceName"); + throw PSTraceSource.NewArgumentNullException(nameof(resourceName)); } string dscResourcesPath = Path.Combine(module.ModuleBase, "DscResources"); @@ -3332,12 +3332,12 @@ public static bool ImportScriptKeywordsFromModule(PSModuleInfo module, string re { if (module == null) { - throw PSTraceSource.NewArgumentNullException("module"); + throw PSTraceSource.NewArgumentNullException(nameof(module)); } if (resourceName == null) { - throw PSTraceSource.NewArgumentNullException("resourceName"); + throw PSTraceSource.NewArgumentNullException(nameof(resourceName)); } schemaFilePath = Path.Combine(Path.Combine(Path.Combine(module.ModuleBase, "DscResources"), resourceName), resourceName + ".Schema.psm1"); diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs index 6574914c396..e03b4ae61eb 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseCommand.cs @@ -18,7 +18,7 @@ internal sealed class TerminatingErrorContext internal TerminatingErrorContext(PSCmdlet command) { if (command == null) - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); _command = command; } diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs index 26e62bc8a79..cdd60637a7a 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommandParameters.cs @@ -171,7 +171,7 @@ internal override object Verify(object val, { if (val == null) { - throw PSTraceSource.NewArgumentNullException("val"); + throw PSTraceSource.NewArgumentNullException(nameof(val)); } // need to check the type: @@ -201,7 +201,7 @@ internal override object Verify(object val, return ex; } - PSTraceSource.NewArgumentException("val"); + PSTraceSource.NewArgumentException(nameof(val)); return null; } diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index 5025fc6c381..4467744a666 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -510,7 +510,7 @@ private void ProcessPayload(FormatEntryData fed, FormatMessagesContextManager.Ou // we assume FormatEntryData as a standard wrapper if (fed == null) { - PSTraceSource.NewArgumentNullException("fed"); + PSTraceSource.NewArgumentNullException(nameof(fed)); } if (fed.formatEntryInfo == null) diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs index da440d8f628..6b647bd0912 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs @@ -87,7 +87,7 @@ protected FormatTableLoadException(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } int errorCount = info.GetInt32("ErrorCount"); @@ -114,7 +114,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -207,7 +207,7 @@ public FormatTable(IEnumerable formatFiles) : this(formatFiles, null, nu public void AppendFormatData(IEnumerable formatData) { if (formatData == null) - throw PSTraceSource.NewArgumentNullException("formatData"); + throw PSTraceSource.NewArgumentNullException(nameof(formatData)); _formatDBMgr.AddFormatData(formatData, false); } @@ -226,7 +226,7 @@ public void AppendFormatData(IEnumerable formatData) public void PrependFormatData(IEnumerable formatData) { if (formatData == null) - throw PSTraceSource.NewArgumentNullException("formatData"); + throw PSTraceSource.NewArgumentNullException(nameof(formatData)); _formatDBMgr.AddFormatData(formatData, true); } @@ -253,7 +253,7 @@ internal FormatTable(IEnumerable formatFiles, AuthorizationManager autho { if (formatFiles == null) { - throw PSTraceSource.NewArgumentNullException("formatFiles"); + throw PSTraceSource.NewArgumentNullException(nameof(formatFiles)); } _formatDBMgr = new TypeInfoDataBaseManager(formatFiles, true, authorizationManager, host); diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs index 50f687c46d1..64af2244fb8 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData.cs @@ -376,22 +376,22 @@ internal static string GetControlShapeName(ControlBase control) { if (control is TableControlBody) { - return FormatShape.Table.ToString(); + return nameof(FormatShape.Table); } if (control is ListControlBody) { - return FormatShape.List.ToString(); + return nameof(FormatShape.List); } if (control is WideControlBody) { - return FormatShape.Wide.ToString(); + return nameof(FormatShape.Wide); } if (control is ComplexControlBody) { - return FormatShape.Complex.ToString(); + return nameof(FormatShape.Complex); } return string.Empty; @@ -635,9 +635,9 @@ public override string ToString() public ExtendedTypeDefinition(string typeName, IEnumerable viewDefinitions) : this() { if (string.IsNullOrEmpty(typeName)) - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); if (viewDefinitions == null) - throw PSTraceSource.NewArgumentNullException("viewDefinitions"); + throw PSTraceSource.NewArgumentNullException(nameof(viewDefinitions)); TypeNames.Add(typeName); foreach (FormatViewDefinition definition in viewDefinitions) @@ -653,7 +653,7 @@ public ExtendedTypeDefinition(string typeName, IEnumerable public ExtendedTypeDefinition(string typeName) : this() { if (string.IsNullOrEmpty(typeName)) - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); TypeNames.Add(typeName); } @@ -691,9 +691,9 @@ internal FormatViewDefinition(string name, PSControl control, Guid instanceid) public FormatViewDefinition(string name, PSControl control) { if (string.IsNullOrEmpty(name)) - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); if (control == null) - throw PSTraceSource.NewArgumentNullException("control"); + throw PSTraceSource.NewArgumentNullException(nameof(control)); Name = name; Control = control; @@ -800,7 +800,7 @@ public DisplayEntry(string value, DisplayEntryValueType type) { if (string.IsNullOrEmpty(value)) if (value == null || type == DisplayEntryValueType.Property) - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); Value = value; ValueType = type; 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 6e11d21647a..d3290c18752 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Complex.cs @@ -420,13 +420,13 @@ public CustomEntryBuilder StartFrame(uint leftIndent = 0, uint rightIndent = 0, // Mutually exclusive if (leftIndent != 0 && rightIndent != 0) { - throw PSTraceSource.NewArgumentException("leftIndent"); + throw PSTraceSource.NewArgumentException(nameof(leftIndent)); } // Mutually exclusive if (firstLineHanging != 0 && firstLineIndent != 0) { - throw PSTraceSource.NewArgumentException("firstLineHanging"); + throw PSTraceSource.NewArgumentException(nameof(firstLineHanging)); } var frame = new CustomItemFrame 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 06a330c0264..6025acfff44 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_List.cs @@ -173,7 +173,7 @@ public ListControl(IEnumerable entries) : this() { if (entries == null) - throw PSTraceSource.NewArgumentNullException("entries"); + throw PSTraceSource.NewArgumentNullException(nameof(entries)); foreach (ListControlEntry entry in entries) { this.Entries.Add(entry); @@ -242,7 +242,7 @@ public ListControlEntry(IEnumerable listItems) : this() { if (listItems == null) - throw PSTraceSource.NewArgumentNullException("listItems"); + throw PSTraceSource.NewArgumentNullException(nameof(listItems)); foreach (ListControlEntryItem item in listItems) { this.Items.Add(item); @@ -253,9 +253,9 @@ public ListControlEntry(IEnumerable listItems) public ListControlEntry(IEnumerable listItems, IEnumerable selectedBy) { if (listItems == null) - throw PSTraceSource.NewArgumentNullException("listItems"); + throw PSTraceSource.NewArgumentNullException(nameof(listItems)); if (selectedBy == null) - throw PSTraceSource.NewArgumentNullException("selectedBy"); + throw PSTraceSource.NewArgumentNullException(nameof(selectedBy)); EntrySelectedBy = new EntrySelectedBy { TypeNames = new List(selectedBy) }; foreach (ListControlEntryItem item in listItems) 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 2afbab8a7e7..ddd8446b065 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs @@ -306,7 +306,7 @@ public TableControl(TableControlRow tableControlRow, IEnumerable columns) : this() { if (columns == null) - throw PSTraceSource.NewArgumentNullException("columns"); + throw PSTraceSource.NewArgumentNullException(nameof(columns)); foreach (TableControlColumn column in columns) { Columns.Add(column); @@ -507,7 +507,7 @@ internal TableRowDefinitionBuilder(TableControlBuilder tcb, TableControlRow tcr) private TableRowDefinitionBuilder AddItem(string value, DisplayEntryValueType entryType, Alignment alignment, string format) { if (string.IsNullOrEmpty(value)) - throw PSTraceSource.NewArgumentException("value"); + throw PSTraceSource.NewArgumentException(nameof(value)); var tableControlColumn = new TableControlColumn(alignment, new DisplayEntry(value, entryType)) { 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 2b4dd913f94..0e140fa5eea 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs @@ -145,7 +145,7 @@ internal WideControl(WideControlBody widecontrolbody, ViewDefinition viewDefinit public WideControl(IEnumerable wideEntries) : this() { if (wideEntries == null) - throw PSTraceSource.NewArgumentNullException("wideEntries"); + throw PSTraceSource.NewArgumentNullException(nameof(wideEntries)); foreach (WideControlEntryItem entryItem in wideEntries) { @@ -157,7 +157,7 @@ public WideControl(IEnumerable wideEntries) : this() public WideControl(IEnumerable wideEntries, uint columns) : this() { if (wideEntries == null) - throw PSTraceSource.NewArgumentNullException("wideEntries"); + throw PSTraceSource.NewArgumentNullException(nameof(wideEntries)); foreach (WideControlEntryItem entryItem in wideEntries) { @@ -224,7 +224,7 @@ internal WideControlEntryItem(WideControlEntryDefinition definition) : this() public WideControlEntryItem(DisplayEntry entry) : this() { if (entry == null) - throw PSTraceSource.NewArgumentNullException("entry"); + throw PSTraceSource.NewArgumentNullException(nameof(entry)); this.DisplayEntry = entry; } @@ -234,9 +234,9 @@ public WideControlEntryItem(DisplayEntry entry) : this() public WideControlEntryItem(DisplayEntry entry, IEnumerable selectedBy) : this() { if (entry == null) - throw PSTraceSource.NewArgumentNullException("entry"); + throw PSTraceSource.NewArgumentNullException(nameof(entry)); if (selectedBy == null) - throw PSTraceSource.NewArgumentNullException("selectedBy"); + throw PSTraceSource.NewArgumentNullException(nameof(selectedBy)); this.DisplayEntry = entry; this.EntrySelectedBy = EntrySelectedBy.Get(selectedBy, null); diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs index d03d2eb1ad3..21a180baf62 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs @@ -79,7 +79,7 @@ internal TypeInfoDataBaseManager( { if (string.IsNullOrEmpty(formatFile) || (!Path.IsPathRooted(formatFile))) { - throw PSTraceSource.NewArgumentException("formatFiles", FormatAndOutXmlLoadingStrings.FormatFileNotRooted, formatFile); + throw PSTraceSource.NewArgumentException(nameof(formatFiles), FormatAndOutXmlLoadingStrings.FormatFileNotRooted, formatFile); } PSSnapInTypeAndFormatErrors fileToLoad = new PSSnapInTypeAndFormatErrors(string.Empty, formatFile); @@ -122,7 +122,7 @@ internal void Add(string formatFile, bool shouldPrepend) { if (string.IsNullOrEmpty(formatFile) || (!Path.IsPathRooted(formatFile))) { - throw PSTraceSource.NewArgumentException("formatFile", FormatAndOutXmlLoadingStrings.FormatFileNotRooted, formatFile); + throw PSTraceSource.NewArgumentException(nameof(formatFile), FormatAndOutXmlLoadingStrings.FormatFileNotRooted, formatFile); } lock (_formatFileList) diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs index 82277eeebd1..79bcbd61dca 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader.cs @@ -193,16 +193,16 @@ internal bool LoadXmlFile( bool preValidated) { if (info == null) - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); if (info.filePath == null) throw PSTraceSource.NewArgumentNullException("info.filePath"); if (db == null) - throw PSTraceSource.NewArgumentNullException("db"); + throw PSTraceSource.NewArgumentNullException(nameof(db)); if (expressionFactory == null) - throw PSTraceSource.NewArgumentNullException("expressionFactory"); + throw PSTraceSource.NewArgumentNullException(nameof(expressionFactory)); if (SecuritySupport.IsProductBinary(info.filePath)) { @@ -288,13 +288,13 @@ internal bool LoadFormattingData( bool isForHelp) { if (typeDefinition == null) - throw PSTraceSource.NewArgumentNullException("typeDefinition"); + throw PSTraceSource.NewArgumentNullException(nameof(typeDefinition)); if (typeDefinition.TypeName == null) throw PSTraceSource.NewArgumentNullException("typeDefinition.TypeName"); if (db == null) - throw PSTraceSource.NewArgumentNullException("db"); + throw PSTraceSource.NewArgumentNullException(nameof(db)); if (expressionFactory == null) - throw PSTraceSource.NewArgumentNullException("expressionFactory"); + throw PSTraceSource.NewArgumentNullException(nameof(expressionFactory)); this.expressionFactory = expressionFactory; this.ReportTrace("loading ExtendedTypeDefinition started"); @@ -337,10 +337,10 @@ internal bool LoadFormattingData( private void LoadData(XmlDocument doc, TypeInfoDataBase db) { if (doc == null) - throw PSTraceSource.NewArgumentNullException("doc"); + throw PSTraceSource.NewArgumentNullException(nameof(doc)); if (db == null) - throw PSTraceSource.NewArgumentNullException("db"); + throw PSTraceSource.NewArgumentNullException(nameof(db)); // create a new instance of the database to be loaded XmlElement documentElement = doc.DocumentElement; @@ -428,7 +428,7 @@ private void LoadData(ExtendedTypeDefinition typeDefinition, TypeInfoDataBase db throw PSTraceSource.NewArgumentNullException("viewDefinition"); if (db == null) - throw PSTraceSource.NewArgumentNullException("db"); + throw PSTraceSource.NewArgumentNullException(nameof(db)); int viewIndex = 0; foreach (FormatViewDefinition formatView in typeDefinition.FormatViewDefinition) @@ -2054,7 +2054,7 @@ internal ViewEntryNodeMatch(TypeInfoDataBaseLoader loader) internal bool ProcessExpressionDirectives(XmlNode containerNode, List unprocessedNodes) { if (containerNode == null) - throw PSTraceSource.NewArgumentNullException("containerNode"); + throw PSTraceSource.NewArgumentNullException(nameof(containerNode)); string formatString = null; TextToken textToken = null; 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 66d819a0f1e..34702849d14 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataXmlLoader_Views.cs @@ -201,10 +201,10 @@ private bool LoadMainControlDependentData(List unprocessedNodes, ViewDe private bool LoadCommonViewData(XmlNode viewNode, ViewDefinition view, List unprocessedNodes) { if (viewNode == null) - throw PSTraceSource.NewArgumentNullException("viewNode"); + throw PSTraceSource.NewArgumentNullException(nameof(viewNode)); if (view == null) - throw PSTraceSource.NewArgumentNullException("view"); + throw PSTraceSource.NewArgumentNullException(nameof(view)); // set loading information view.loadingInfo = this.LoadingInfo; diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs index eeacaad4520..c9cd80bbee8 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormatViewGenerator_Complex.cs @@ -93,7 +93,7 @@ internal void GenerateFormatEntries(int maxTreeDepth, ControlBase control, { if (control == null) { - throw PSTraceSource.NewArgumentNullException("control"); + throw PSTraceSource.NewArgumentNullException(nameof(control)); } ExecuteFormatControl(new TraversalInfo(0, maxTreeDepth), control, @@ -190,7 +190,7 @@ private void ExecuteFormatTokenList(TraversalInfo level, { if (so == null) { - throw PSTraceSource.NewArgumentNullException("so"); + throw PSTraceSource.NewArgumentNullException(nameof(so)); } // guard against infinite loop diff --git a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs index dd0dbf4738e..3e8c320390b 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/FormattingObjectsDeserializer.cs @@ -142,7 +142,7 @@ private void ProcessUnknownInvalidClassId(string classId, object obj, string err string msg = StringUtil.Format(FormatAndOut_format_xxx.FOD_ClassIdInvalid, classId); ErrorRecord errorRecord = new ErrorRecord( - PSTraceSource.NewArgumentException("classId"), + PSTraceSource.NewArgumentException(nameof(classId)), errorId, ErrorCategory.InvalidData, obj); @@ -217,7 +217,7 @@ internal FormatInfoData DeserializeMemberObject(PSObject so, string property) string msg = StringUtil.Format(FormatAndOut_format_xxx.FOD_RecursiveProperty, property); ErrorRecord errorRecord = new ErrorRecord( - PSTraceSource.NewArgumentException("property"), + PSTraceSource.NewArgumentException(nameof(property)), "FormatObjectDeserializerRecursiveProperty", ErrorCategory.InvalidData, so); @@ -247,7 +247,7 @@ private object DeserializeMemberVariable(PSObject so, string property, System.Ty string msg = StringUtil.Format(FormatAndOut_format_xxx.FOD_InvalidPropertyType, t.Name, property); ErrorRecord errorRecord = new ErrorRecord( - PSTraceSource.NewArgumentException("property"), + PSTraceSource.NewArgumentException(nameof(property)), "FormatObjectDeserializerInvalidPropertyType", ErrorCategory.InvalidData, so); @@ -392,7 +392,7 @@ internal static FormatInfoData CreateInstance(PSObject so, FormatObjectDeseriali { if (so == null) { - throw PSTraceSource.NewArgumentNullException("so"); + throw PSTraceSource.NewArgumentNullException(nameof(so)); } // look for the property that defines the type of object @@ -421,7 +421,7 @@ private static FormatInfoData CreateInstance(string clsid, FormatObjectDeseriali Func ctor; if (!s_constructors.TryGetValue(clsid, out ctor)) { - CreateInstanceError(PSTraceSource.NewArgumentException("clsid"), clsid, deserializer); + CreateInstanceError(PSTraceSource.NewArgumentException(nameof(clsid)), clsid, deserializer); return null; } @@ -504,7 +504,7 @@ internal static void ReadList(PSObject so, string property, List lst, FormatO { if (lst == null) { - throw PSTraceSource.NewArgumentNullException("lst"); + throw PSTraceSource.NewArgumentNullException(nameof(lst)); } object memberRaw = FormatObjectDeserializer.GetProperty(so, property); diff --git a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs index 03cd5a1a2a2..09432253e33 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/ILineOutput.cs @@ -282,9 +282,9 @@ internal class WriteLineHelper internal WriteLineHelper(bool lineWrap, WriteCallback wlc, WriteCallback wc, DisplayCells displayCells) { if (wlc == null) - throw PSTraceSource.NewArgumentNullException("wlc"); + throw PSTraceSource.NewArgumentNullException(nameof(wlc)); if (displayCells == null) - throw PSTraceSource.NewArgumentNullException("displayCells"); + throw PSTraceSource.NewArgumentNullException(nameof(displayCells)); _displayCells = displayCells; _writeLineCall = wlc; @@ -474,7 +474,7 @@ internal StreamingTextWriter(WriteLineCallback writeCall, CultureInfo culture) : base(culture) { if (writeCall == null) - throw PSTraceSource.NewArgumentNullException("writeCall"); + throw PSTraceSource.NewArgumentNullException(nameof(writeCall)); _writeCall = writeCall; } diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index 3de036f35da..15aecfacc8f 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -140,7 +140,7 @@ internal CommandParameterDefinition() internal HashtableEntryDefinition MatchEntry(string keyName, TerminatingErrorContext invocationContext) { if (string.IsNullOrEmpty(keyName)) - PSTraceSource.NewArgumentNullException("keyName"); + PSTraceSource.NewArgumentNullException(nameof(keyName)); HashtableEntryDefinition matchingEntry = null; for (int k = 0; k < this.hashEntries.Count; k++) diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs index 25e7fd61250..7042bf85dd1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs @@ -23,7 +23,7 @@ internal sealed class MshResolvedExpressionParameterAssociation internal MshResolvedExpressionParameterAssociation(MshParameter parameter, PSPropertyExpression expression) { if (expression == null) - throw PSTraceSource.NewArgumentNullException("expression"); + throw PSTraceSource.NewArgumentNullException(nameof(expression)); OriginatingParameter = parameter; ResolvedExpression = expression; diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs index 37408c2e76d..bf3acfab2a1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/Mshexpression.cs @@ -71,7 +71,7 @@ public PSPropertyExpression(string s, bool isResolved) { if (string.IsNullOrEmpty(s)) { - throw PSTraceSource.NewArgumentNullException("s"); + throw PSTraceSource.NewArgumentNullException(nameof(s)); } _stringValue = s; @@ -87,7 +87,7 @@ public PSPropertyExpression(ScriptBlock scriptBlock) { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentNullException("scriptBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(scriptBlock)); } Script = scriptBlock; diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs index 0b2dfe2f721..b0fe26cfd49 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs @@ -252,9 +252,9 @@ internal override DisplayCells DisplayCells internal ConsoleLineOutput(PSHostUserInterface hostConsole, bool paging, TerminatingErrorContext errorContext) { if (hostConsole == null) - throw PSTraceSource.NewArgumentNullException("hostConsole"); + throw PSTraceSource.NewArgumentNullException(nameof(hostConsole)); if (errorContext == null) - throw PSTraceSource.NewArgumentNullException("errorContext"); + throw PSTraceSource.NewArgumentNullException(nameof(errorContext)); _console = hostConsole; _errorContext = errorContext; @@ -474,7 +474,7 @@ private class PromptHandler internal PromptHandler(string s, ConsoleLineOutput cmdlet) { if (string.IsNullOrEmpty(s)) - throw PSTraceSource.NewArgumentNullException("s"); + throw PSTraceSource.NewArgumentNullException(nameof(s)); _promptString = s; _callingCmdlet = cmdlet; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs index 44cda85e582..81a4c33062f 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/MethodInvocationInfo.cs @@ -21,8 +21,8 @@ public sealed class MethodInvocationInfo /// Return value of the method (ok to pass null if the method doesn't return anything). public MethodInvocationInfo(string name, IEnumerable parameters, MethodParameter returnValue) { - if (name == null) throw new ArgumentNullException("name"); - if (parameters == null) throw new ArgumentNullException("parameters"); + if (name == null) throw new ArgumentNullException(nameof(name)); + if (parameters == null) throw new ArgumentNullException(nameof(parameters)); // returnValue can be null MethodName = name; diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs index 4851bf1f9da..289ad0c3a76 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ObjectModelWrapper.cs @@ -19,22 +19,22 @@ internal void Initialize(PSCmdlet cmdlet, string className, string classVersion, { if (cmdlet == null) { - throw new ArgumentNullException("cmdlet"); + throw new ArgumentNullException(nameof(cmdlet)); } if (string.IsNullOrEmpty(className)) { - throw new ArgumentNullException("className"); + throw new ArgumentNullException(nameof(className)); } if (classVersion == null) // possible and ok to have classVersion==string.Empty { - throw new ArgumentNullException("classVersion"); + throw new ArgumentNullException(nameof(classVersion)); } if (privateData == null) { - throw new ArgumentNullException("privateData"); + throw new ArgumentNullException(nameof(privateData)); } _cmdlet = cmdlet; diff --git a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs index 47fb00d2e32..3a7e29a4c14 100644 --- a/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs +++ b/src/System.Management.Automation/cimSupport/other/ciminstancetypeadapter.cs @@ -105,7 +105,7 @@ public override PSAdaptedProperty GetProperty(object baseObject, string property { if (propertyName == null) { - throw new PSArgumentNullException("propertyName"); + throw new PSArgumentNullException(nameof(propertyName)); } // baseObject should never be null @@ -199,7 +199,7 @@ public override string GetPropertyTypeName(PSAdaptedProperty adaptedProperty) { if (adaptedProperty == null) { - throw new ArgumentNullException("adaptedProperty"); + throw new ArgumentNullException(nameof(adaptedProperty)); } CimProperty cimProperty = adaptedProperty.Tag as CimProperty; @@ -213,7 +213,7 @@ public override string GetPropertyTypeName(PSAdaptedProperty adaptedProperty) return ToStringCodeMethods.Type(typeof(string)); } - throw new ArgumentNullException("adaptedProperty"); + throw new ArgumentNullException(nameof(adaptedProperty)); } /// @@ -224,7 +224,7 @@ public override object GetPropertyValue(PSAdaptedProperty adaptedProperty) { if (adaptedProperty == null) { - throw new ArgumentNullException("adaptedProperty"); + throw new ArgumentNullException(nameof(adaptedProperty)); } CimProperty cimProperty = adaptedProperty.Tag as CimProperty; @@ -239,7 +239,7 @@ public override object GetPropertyValue(PSAdaptedProperty adaptedProperty) return cimInstance.GetCimSessionComputerName(); } - throw new ArgumentNullException("adaptedProperty"); + throw new ArgumentNullException(nameof(adaptedProperty)); } private void AddTypeNameHierarchy(IList typeNamesWithNamespace, IList typeNamesWithoutNamespace, string namespaceName, string className) @@ -288,7 +288,7 @@ public override Collection GetTypeNameHierarchy(object baseObject) var cimInstance = baseObject as CimInstance; if (cimInstance == null) { - throw new ArgumentNullException("baseObject"); + throw new ArgumentNullException(nameof(baseObject)); } var typeNamesWithNamespace = new List(); @@ -381,7 +381,7 @@ public override void SetPropertyValue(PSAdaptedProperty adaptedProperty, object { if (adaptedProperty == null) { - throw new ArgumentNullException("adaptedProperty"); + throw new ArgumentNullException(nameof(adaptedProperty)); } if (!IsSettable(adaptedProperty)) diff --git a/src/System.Management.Automation/engine/ApplicationInfo.cs b/src/System.Management.Automation/engine/ApplicationInfo.cs index 308cea39b64..9e785aee935 100644 --- a/src/System.Management.Automation/engine/ApplicationInfo.cs +++ b/src/System.Management.Automation/engine/ApplicationInfo.cs @@ -39,12 +39,12 @@ internal ApplicationInfo(string name, string path, ExecutionContext context) : b { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } Path = path; diff --git a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs index 7fafdf84503..85cff4c8efb 100644 --- a/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ChildrenCmdletProviderInterfaces.cs @@ -35,7 +35,7 @@ internal ChildItemCmdletProviderIntrinsics(Cmdlet cmdlet) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } _cmdlet = cmdlet; @@ -55,7 +55,7 @@ internal ChildItemCmdletProviderIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs index 2ce58a04afb..27537b21601 100644 --- a/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/CmdletFamilyProviderInterfaces.cs @@ -38,7 +38,7 @@ internal ProviderIntrinsics(Cmdlet cmdlet) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } _cmdlet = cmdlet; @@ -59,7 +59,7 @@ internal ProviderIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } Item = new ItemCmdletProviderIntrinsics(sessionState); diff --git a/src/System.Management.Automation/engine/CmdletInfo.cs b/src/System.Management.Automation/engine/CmdletInfo.cs index 896763d9d74..2861fa3a8b6 100644 --- a/src/System.Management.Automation/engine/CmdletInfo.cs +++ b/src/System.Management.Automation/engine/CmdletInfo.cs @@ -44,7 +44,7 @@ internal CmdletInfo( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } // Get the verb and noun from the name @@ -52,7 +52,7 @@ internal CmdletInfo( { throw PSTraceSource.NewArgumentException( - "name", + nameof(name), DiscoveryExceptions.InvalidCmdletNameFormat, name); } @@ -105,12 +105,12 @@ public CmdletInfo(string name, Type implementingType) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (implementingType == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (!typeof(Cmdlet).IsAssignableFrom(implementingType)) @@ -123,7 +123,7 @@ public CmdletInfo(string name, Type implementingType) { throw PSTraceSource.NewArgumentException( - "name", + nameof(name), DiscoveryExceptions.InvalidCmdletNameFormat, name); } diff --git a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs index 72d6ba964d4..069201589af 100644 --- a/src/System.Management.Automation/engine/CmdletParameterBinderController.cs +++ b/src/System.Management.Automation/engine/CmdletParameterBinderController.cs @@ -54,12 +54,12 @@ internal CmdletParameterBinderController( { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } if (commandMetadata == null) { - throw PSTraceSource.NewArgumentNullException("commandMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(commandMetadata)); } this.Command = cmdlet; @@ -4275,7 +4275,7 @@ private void RestoreDefaultParameterValues(IEnumerable MapStringInputToParsedInput(s { if (cursorIndex > input.Length) { - throw PSTraceSource.NewArgumentException("cursorIndex"); + throw PSTraceSource.NewArgumentException(nameof(cursorIndex)); } Token[] tokens; @@ -112,17 +112,17 @@ public static CommandCompletion CompleteInput(Ast ast, Token[] tokens, IScriptPo { if (ast == null) { - throw PSTraceSource.NewArgumentNullException("ast"); + throw PSTraceSource.NewArgumentNullException(nameof(ast)); } if (tokens == null) { - throw PSTraceSource.NewArgumentNullException("tokens"); + throw PSTraceSource.NewArgumentNullException(nameof(tokens)); } if (positionOfCursor == null) { - throw PSTraceSource.NewArgumentNullException("positionOfCursor"); + throw PSTraceSource.NewArgumentNullException(nameof(positionOfCursor)); } return CompleteInputImpl(ast, tokens, positionOfCursor, options); @@ -147,12 +147,12 @@ public static CommandCompletion CompleteInput(string input, int cursorIndex, Has if (cursorIndex > input.Length) { - throw PSTraceSource.NewArgumentException("cursorIndex"); + throw PSTraceSource.NewArgumentException(nameof(cursorIndex)); } if (powershell == null) { - throw PSTraceSource.NewArgumentNullException("powershell"); + throw PSTraceSource.NewArgumentNullException(nameof(powershell)); } // If we are in a debugger stop, let the debugger do the command completion. @@ -216,22 +216,22 @@ public static CommandCompletion CompleteInput(Ast ast, Token[] tokens, IScriptPo { if (ast == null) { - throw PSTraceSource.NewArgumentNullException("ast"); + throw PSTraceSource.NewArgumentNullException(nameof(ast)); } if (tokens == null) { - throw PSTraceSource.NewArgumentNullException("tokens"); + throw PSTraceSource.NewArgumentNullException(nameof(tokens)); } if (cursorPosition == null) { - throw PSTraceSource.NewArgumentNullException("cursorPosition"); + throw PSTraceSource.NewArgumentNullException(nameof(cursorPosition)); } if (powershell == null) { - throw PSTraceSource.NewArgumentNullException("powershell"); + throw PSTraceSource.NewArgumentNullException(nameof(powershell)); } // If we are in a debugger stop, let the debugger do the command completion. @@ -334,12 +334,12 @@ internal static CommandCompletion CompleteInputInDebugger(string input, int curs if (cursorIndex > input.Length) { - throw PSTraceSource.NewArgumentException("cursorIndex"); + throw PSTraceSource.NewArgumentException(nameof(cursorIndex)); } if (debugger == null) { - throw PSTraceSource.NewArgumentNullException("debugger"); + throw PSTraceSource.NewArgumentNullException(nameof(debugger)); } Command cmd = new Command("TabExpansion2"); @@ -363,22 +363,22 @@ internal static CommandCompletion CompleteInputInDebugger(Ast ast, Token[] token { if (ast == null) { - throw PSTraceSource.NewArgumentNullException("ast"); + throw PSTraceSource.NewArgumentNullException(nameof(ast)); } if (tokens == null) { - throw PSTraceSource.NewArgumentNullException("tokens"); + throw PSTraceSource.NewArgumentNullException(nameof(tokens)); } if (cursorPosition == null) { - throw PSTraceSource.NewArgumentNullException("cursorPosition"); + throw PSTraceSource.NewArgumentNullException(nameof(cursorPosition)); } if (debugger == null) { - throw PSTraceSource.NewArgumentNullException("debugger"); + throw PSTraceSource.NewArgumentNullException(nameof(debugger)); } // For remote debugging just pass string input. diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 70027d06c43..7ff17435001 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -207,7 +207,7 @@ List ExecuteGetCommandCommand(bool useModulePrefix) } private static readonly HashSet s_keywordsToExcludeFromAddingAmpersand - = new HashSet(StringComparer.OrdinalIgnoreCase) { TokenKind.InlineScript.ToString(), TokenKind.Configuration.ToString() }; + = new HashSet(StringComparer.OrdinalIgnoreCase) { nameof(TokenKind.InlineScript), nameof(TokenKind.Configuration) }; internal static CompletionResult GetCommandNameCompletionResult(string name, object command, bool addAmpersandIfNecessary, string quote) { string syntax = name, listItem = name; diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs index 763f54b60fa..3fe4a54e023 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionResult.cs @@ -170,22 +170,22 @@ public CompletionResult(string completionText, string listItemText, CompletionRe { if (string.IsNullOrEmpty(completionText)) { - throw PSTraceSource.NewArgumentNullException("completionText"); + throw PSTraceSource.NewArgumentNullException(nameof(completionText)); } if (string.IsNullOrEmpty(listItemText)) { - throw PSTraceSource.NewArgumentNullException("listItemText"); + throw PSTraceSource.NewArgumentNullException(nameof(listItemText)); } if (resultType < CompletionResultType.Text || resultType > CompletionResultType.DynamicKeyword) { - throw PSTraceSource.NewArgumentOutOfRangeException("resultType", resultType); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(resultType), resultType); } if (string.IsNullOrEmpty(toolTip)) { - throw PSTraceSource.NewArgumentNullException("toolTip"); + throw PSTraceSource.NewArgumentNullException(nameof(toolTip)); } _completionText = completionText; diff --git a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs index 71c76b3ce67..9bb33ef56ba 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/ExtensibleCompletion.cs @@ -34,7 +34,7 @@ public ArgumentCompleterAttribute(Type type) { if (type == null || (type.GetInterfaces().All(t => t != typeof(IArgumentCompleter)))) { - throw PSTraceSource.NewArgumentException("type"); + throw PSTraceSource.NewArgumentException(nameof(type)); } Type = type; @@ -48,7 +48,7 @@ public ArgumentCompleterAttribute(ScriptBlock scriptBlock) { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentNullException("scriptBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(scriptBlock)); } ScriptBlock = scriptBlock; @@ -176,12 +176,12 @@ public ArgumentCompletionsAttribute(params string[] completions) { if (completions == null) { - throw PSTraceSource.NewArgumentNullException("completions"); + throw PSTraceSource.NewArgumentNullException(nameof(completions)); } if (completions.Length == 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("completions", completions); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(completions), completions); } _completions = completions; diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index 2b10b988ea6..b8ed6df5042 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -75,7 +75,7 @@ internal sealed class PipeObjectPair : AstParameterArgumentPair internal PipeObjectPair(string parameterName, Type pipeObjType) { if (parameterName == null) - throw PSTraceSource.NewArgumentNullException("parameterName"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterName)); Parameter = null; ParameterArgumentType = AstParameterArgumentType.PipeObject; @@ -96,9 +96,9 @@ internal sealed class AstArrayPair : AstParameterArgumentPair internal AstArrayPair(string parameterName, ICollection arguments) { if (parameterName == null) - throw PSTraceSource.NewArgumentNullException("parameterName"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterName)); if (arguments == null || arguments.Count == 0) - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); Parameter = null; ParameterArgumentType = AstParameterArgumentType.AstArray; @@ -125,7 +125,7 @@ internal sealed class FakePair : AstParameterArgumentPair internal FakePair(CommandParameterAst parameterAst) { if (parameterAst == null) - throw PSTraceSource.NewArgumentNullException("parameterAst"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterAst)); Parameter = parameterAst; ParameterArgumentType = AstParameterArgumentType.Fake; @@ -145,7 +145,7 @@ internal sealed class SwitchPair : AstParameterArgumentPair internal SwitchPair(CommandParameterAst parameterAst) { if (parameterAst == null) - throw PSTraceSource.NewArgumentNullException("parameterAst"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterAst)); Parameter = parameterAst; ParameterArgumentType = AstParameterArgumentType.Switch; @@ -175,7 +175,7 @@ internal sealed class AstPair : AstParameterArgumentPair internal AstPair(CommandParameterAst parameterAst) { if (parameterAst == null || parameterAst.Argument == null) - throw PSTraceSource.NewArgumentException("parameterAst"); + throw PSTraceSource.NewArgumentException(nameof(parameterAst)); Parameter = parameterAst; ParameterArgumentType = AstParameterArgumentType.AstPair; @@ -192,10 +192,10 @@ internal AstPair(CommandParameterAst parameterAst) internal AstPair(CommandParameterAst parameterAst, ExpressionAst argumentAst) { if (parameterAst != null && parameterAst.Argument != null) - throw PSTraceSource.NewArgumentException("parameterAst"); + throw PSTraceSource.NewArgumentException(nameof(parameterAst)); if (parameterAst == null && argumentAst == null) - throw PSTraceSource.NewArgumentNullException("argumentAst"); + throw PSTraceSource.NewArgumentNullException(nameof(argumentAst)); Parameter = parameterAst; ParameterArgumentType = AstParameterArgumentType.AstPair; @@ -212,10 +212,10 @@ internal AstPair(CommandParameterAst parameterAst, ExpressionAst argumentAst) internal AstPair(CommandParameterAst parameterAst, CommandElementAst argumentAst) { if (parameterAst != null && parameterAst.Argument != null) - throw PSTraceSource.NewArgumentException("parameterAst"); + throw PSTraceSource.NewArgumentException(nameof(parameterAst)); if (parameterAst == null || argumentAst == null) - throw PSTraceSource.NewArgumentNullException("argumentAst"); + throw PSTraceSource.NewArgumentNullException(nameof(argumentAst)); Parameter = parameterAst; ParameterArgumentType = AstParameterArgumentType.AstPair; @@ -949,7 +949,7 @@ internal PseudoBindingInfo DoPseudoParameterBinding(CommandAst command, Type pip { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } // initialize/reset the private members diff --git a/src/System.Management.Automation/engine/CommandDiscovery.cs b/src/System.Management.Automation/engine/CommandDiscovery.cs index c194a2f40f6..4b58da58cb6 100644 --- a/src/System.Management.Automation/engine/CommandDiscovery.cs +++ b/src/System.Management.Automation/engine/CommandDiscovery.cs @@ -133,7 +133,7 @@ internal CommandDiscovery(ExecutionContext context) { if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } Context = context; @@ -202,7 +202,7 @@ internal CmdletInfo AddCmdletInfoToCache(string name, CmdletInfo newCmdletInfo, { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (newCmdletInfo == null) @@ -1525,7 +1525,7 @@ internal static PSModuleAutoLoadingPreference GetCommandDiscoveryPreference(Exec if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } // check the PSVariable @@ -1687,7 +1687,7 @@ internal Collection IndexOfRelativePath() { if (string.IsNullOrEmpty(item)) { - throw PSTraceSource.NewArgumentException("item"); + throw PSTraceSource.NewArgumentException(nameof(item)); } int result = -1; diff --git a/src/System.Management.Automation/engine/CommandInfo.cs b/src/System.Management.Automation/engine/CommandInfo.cs index e55240a4cfa..1090a3fbb86 100644 --- a/src/System.Management.Automation/engine/CommandInfo.cs +++ b/src/System.Management.Automation/engine/CommandInfo.cs @@ -112,7 +112,7 @@ internal CommandInfo(string name, CommandTypes type) if (name == null) { - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } Name = name; @@ -287,7 +287,7 @@ internal void Rename(string newName) { if (string.IsNullOrEmpty(newName)) { - throw new ArgumentNullException("newName"); + throw new ArgumentNullException(nameof(newName)); } Name = newName; @@ -800,7 +800,7 @@ public PSTypeName(TypeDefinitionAst typeDefinitionAst) { if (typeDefinitionAst == null) { - throw PSTraceSource.NewArgumentNullException("typeDefinitionAst"); + throw PSTraceSource.NewArgumentNullException(nameof(typeDefinitionAst)); } TypeDefinitionAst = typeDefinitionAst; @@ -814,7 +814,7 @@ public PSTypeName(ITypeName typeName) { if (typeName == null) { - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); } _type = typeName.GetReflectionType(); diff --git a/src/System.Management.Automation/engine/CommandMetadata.cs b/src/System.Management.Automation/engine/CommandMetadata.cs index 02f4f23c3cc..5ad657b037f 100644 --- a/src/System.Management.Automation/engine/CommandMetadata.cs +++ b/src/System.Management.Automation/engine/CommandMetadata.cs @@ -105,7 +105,7 @@ public CommandMetadata(CommandInfo commandInfo, bool shouldGenerateCommonParamet { if (commandInfo == null) { - throw PSTraceSource.NewArgumentNullException("commandInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(commandInfo)); } while (commandInfo is AliasInfo) { @@ -162,7 +162,7 @@ public CommandMetadata(CommandMetadata other) { if (other == null) { - throw PSTraceSource.NewArgumentNullException("other"); + throw PSTraceSource.NewArgumentNullException(nameof(other)); } Name = other.Name; @@ -315,7 +315,7 @@ internal static CommandMetadata Get(string commandName, Type cmdletType, Executi { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentException("commandName"); + throw PSTraceSource.NewArgumentException(nameof(commandName)); } CommandMetadata result = null; @@ -369,7 +369,7 @@ internal CommandMetadata(string commandName, Type cmdletType, ExecutionContext c { if (string.IsNullOrEmpty(commandName)) { - throw PSTraceSource.NewArgumentException("commandName"); + throw PSTraceSource.NewArgumentException(nameof(commandName)); } Name = commandName; @@ -412,7 +412,7 @@ internal CommandMetadata(ScriptBlock scriptblock, string commandName, ExecutionC { if (scriptblock == null) { - throw PSTraceSource.NewArgumentException("scriptblock"); + throw PSTraceSource.NewArgumentException(nameof(scriptblock)); } CmdletBindingAttribute cmdletBindingAttribute = scriptblock.CmdletBindingAttribute; @@ -725,7 +725,7 @@ private void ProcessCmdletAttribute(CmdletCommonMetadataAttribute attribute) { if (attribute == null) { - throw PSTraceSource.NewArgumentNullException("attribute"); + throw PSTraceSource.NewArgumentNullException(nameof(attribute)); } // Process the default parameter set name diff --git a/src/System.Management.Automation/engine/CommandProcessor.cs b/src/System.Management.Automation/engine/CommandProcessor.cs index e7454b112a7..48abebc7a17 100644 --- a/src/System.Management.Automation/engine/CommandProcessor.cs +++ b/src/System.Management.Automation/engine/CommandProcessor.cs @@ -104,7 +104,7 @@ internal ParameterBinderController NewParameterBinderController(InternalCommand Cmdlet cmdlet = command as Cmdlet; if (cmdlet == null) { - throw PSTraceSource.NewArgumentException("command"); + throw PSTraceSource.NewArgumentException(nameof(command)); } ParameterBinderBase parameterBinder; diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index 8a01dc34980..e2c8ad46e5c 100644 --- a/src/System.Management.Automation/engine/CommandProcessorBase.cs +++ b/src/System.Management.Automation/engine/CommandProcessorBase.cs @@ -35,7 +35,7 @@ internal CommandProcessorBase(CommandInfo commandInfo) { if (commandInfo == null) { - throw PSTraceSource.NewArgumentNullException("commandInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(commandInfo)); } if (commandInfo is IScriptCommandInfo scriptCommand) @@ -278,12 +278,12 @@ internal static CommandProcessorBase CreateGetHelpCommandProcessor( { if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } if (string.IsNullOrEmpty(helpTarget)) { - throw PSTraceSource.NewArgumentNullException("helpTarget"); + throw PSTraceSource.NewArgumentNullException(nameof(helpTarget)); } CommandProcessorBase helpCommandProcessor = context.CreateCommand("get-help", false); diff --git a/src/System.Management.Automation/engine/CommonCommandParameters.cs b/src/System.Management.Automation/engine/CommonCommandParameters.cs index 19c693551a2..9cc0b2ad899 100644 --- a/src/System.Management.Automation/engine/CommonCommandParameters.cs +++ b/src/System.Management.Automation/engine/CommonCommandParameters.cs @@ -28,7 +28,7 @@ internal CommonParameters(MshCommandRuntime commandRuntime) { if (commandRuntime == null) { - throw PSTraceSource.NewArgumentNullException("commandRuntime"); + throw PSTraceSource.NewArgumentNullException(nameof(commandRuntime)); } _commandRuntime = commandRuntime; diff --git a/src/System.Management.Automation/engine/CompiledCommandParameter.cs b/src/System.Management.Automation/engine/CompiledCommandParameter.cs index 48a7b2fd415..a9e85f43280 100644 --- a/src/System.Management.Automation/engine/CompiledCommandParameter.cs +++ b/src/System.Management.Automation/engine/CompiledCommandParameter.cs @@ -37,7 +37,7 @@ internal CompiledCommandParameter(RuntimeDefinedParameter runtimeDefinedParamete { if (runtimeDefinedParameter == null) { - throw PSTraceSource.NewArgumentNullException("runtimeDefinedParameter"); + throw PSTraceSource.NewArgumentNullException(nameof(runtimeDefinedParameter)); } this.Name = runtimeDefinedParameter.Name; @@ -123,7 +123,7 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam { if (member == null) { - throw PSTraceSource.NewArgumentNullException("member"); + throw PSTraceSource.NewArgumentNullException(nameof(member)); } this.Name = member.Name; @@ -146,7 +146,7 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam { ArgumentException e = PSTraceSource.NewArgumentException( - "member", + nameof(member), DiscoveryExceptions.CompiledCommandParameterMemberMustBeFieldOrProperty); throw e; diff --git a/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs index a2997a77b72..382f6b7e46a 100644 --- a/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ContentCmdletProviderInterfaces.cs @@ -39,7 +39,7 @@ internal ContentCmdletProviderIntrinsics(Cmdlet cmdlet) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } _cmdlet = cmdlet; @@ -59,7 +59,7 @@ internal ContentCmdletProviderIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 6bf9d0c52aa..44361ffa04f 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -1856,7 +1856,7 @@ internal static object MethodArgumentConvertTo(object valueToConvert, { if (resultType == null) { - throw PSTraceSource.NewArgumentNullException("resultType"); + throw PSTraceSource.NewArgumentNullException(nameof(resultType)); } bool isArgumentByRef; @@ -1911,7 +1911,7 @@ internal static object PropertySetAndMethodArgumentConvertTo(object valueToConve { if (resultType == null) { - throw PSTraceSource.NewArgumentNullException("resultType"); + throw PSTraceSource.NewArgumentNullException(nameof(resultType)); } PSObject mshObj = valueToConvert as PSObject; diff --git a/src/System.Management.Automation/engine/Credential.cs b/src/System.Management.Automation/engine/Credential.cs index df17c38a884..6b9c4be8d4d 100644 --- a/src/System.Management.Automation/engine/Credential.cs +++ b/src/System.Management.Automation/engine/Credential.cs @@ -219,7 +219,7 @@ public PSCredential(string userName, SecureString password) public PSCredential(PSObject pso) { if (pso == null) - throw PSTraceSource.NewArgumentNullException("pso"); + throw PSTraceSource.NewArgumentNullException(nameof(pso)); if (pso.Properties["UserName"] != null) { diff --git a/src/System.Management.Automation/engine/DataStoreAdapter.cs b/src/System.Management.Automation/engine/DataStoreAdapter.cs index 3b01bae2934..6b9a77f45f7 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapter.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapter.cs @@ -127,7 +127,7 @@ internal void SetRoot(string path) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!DriveBeingCreated) @@ -271,7 +271,7 @@ protected PSDriveInfo(PSDriveInfo driveInfo) { if (driveInfo == null) { - throw PSTraceSource.NewArgumentNullException("driveInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(driveInfo)); } _name = driveInfo.Name; @@ -326,17 +326,17 @@ public PSDriveInfo( if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } if (root == null) { - throw PSTraceSource.NewArgumentNullException("root"); + throw PSTraceSource.NewArgumentNullException(nameof(root)); } // Copy the parameters to the local members @@ -508,7 +508,7 @@ internal void SetName(string newName) { if (string.IsNullOrEmpty(newName)) { - throw PSTraceSource.NewArgumentException("newName"); + throw PSTraceSource.NewArgumentException(nameof(newName)); } _name = newName; @@ -534,7 +534,7 @@ internal void SetProvider(ProviderInfo newProvider) { if (newProvider == null) { - throw PSTraceSource.NewArgumentNullException("newProvider"); + throw PSTraceSource.NewArgumentNullException(nameof(newProvider)); } _provider = newProvider; @@ -602,7 +602,7 @@ public int CompareTo(PSDriveInfo drive) if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } return string.Compare(Name, drive.Name, StringComparison.OrdinalIgnoreCase); @@ -631,7 +631,7 @@ public int CompareTo(object obj) { ArgumentException e = PSTraceSource.NewArgumentException( - "obj", + nameof(obj), SessionStateStrings.OnlyAbleToComparePSDriveInfo); throw e; } diff --git a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs index d341b2803dd..cfc7528b90b 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs @@ -297,7 +297,7 @@ protected ProviderInfo(ProviderInfo providerInfo) { if (providerInfo == null) { - throw PSTraceSource.NewArgumentNullException("providerInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInfo)); } Name = providerInfo.Name; @@ -394,17 +394,17 @@ internal ProviderInfo( // Verify parameters if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } if (implementingType == null) { - throw PSTraceSource.NewArgumentNullException("implementingType"); + throw PSTraceSource.NewArgumentNullException(nameof(implementingType)); } if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs index 4df5c39fe15..b4f21bb5c26 100644 --- a/src/System.Management.Automation/engine/DefaultCommandRuntime.cs +++ b/src/System.Management.Automation/engine/DefaultCommandRuntime.cs @@ -21,7 +21,7 @@ internal class DefaultCommandRuntime : ICommandRuntime2 public DefaultCommandRuntime(List outputList) { if (outputList == null) - throw new System.ArgumentNullException("outputList"); + throw new System.ArgumentNullException(nameof(outputList)); _output = outputList; } diff --git a/src/System.Management.Automation/engine/DriveInterfaces.cs b/src/System.Management.Automation/engine/DriveInterfaces.cs index 8d605e7313a..36bfc73c573 100644 --- a/src/System.Management.Automation/engine/DriveInterfaces.cs +++ b/src/System.Management.Automation/engine/DriveInterfaces.cs @@ -38,7 +38,7 @@ internal DriveManagementIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/EngineIntrinsics.cs b/src/System.Management.Automation/engine/EngineIntrinsics.cs index ca322dbff06..d0bc7a2f100 100644 --- a/src/System.Management.Automation/engine/EngineIntrinsics.cs +++ b/src/System.Management.Automation/engine/EngineIntrinsics.cs @@ -37,7 +37,7 @@ internal EngineIntrinsics(ExecutionContext context) { if (context == null) { - throw new ArgumentNullException("context"); + throw new ArgumentNullException(nameof(context)); } _context = context; diff --git a/src/System.Management.Automation/engine/ErrorPackage.cs b/src/System.Management.Automation/engine/ErrorPackage.cs index cf02b7db8d1..1f308dc2ecd 100644 --- a/src/System.Management.Automation/engine/ErrorPackage.cs +++ b/src/System.Management.Automation/engine/ErrorPackage.cs @@ -420,7 +420,7 @@ public string GetMessage(CultureInfo uiCultureInfo) if (string.IsNullOrEmpty(errorCategoryString)) { // this probably indicates an invalid ErrorCategory value - errorCategoryString = ErrorCategory.NotSpecified.ToString(); + errorCategoryString = nameof(ErrorCategory.NotSpecified); } string templateText = ErrorCategoryStrings.ResourceManager.GetString(errorCategoryString, uiCultureInfo); diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index 86c639ab9af..c524e3646c5 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -666,7 +666,7 @@ private void ProcessNewSubscriber(PSEventSubscriber subscriber, object source, s { string errorMessage = StringUtil.Format(EventingResources.ReservedIdentifier, sourceIdentifier); - throw new ArgumentException(errorMessage, "sourceIdentifier"); + throw new ArgumentException(errorMessage, nameof(sourceIdentifier)); } EventInfo eventInfo = null; @@ -686,7 +686,7 @@ private void ProcessNewSubscriber(PSEventSubscriber subscriber, object source, s if (eventInfo == null) { string errorMessage = StringUtil.Format(EventingResources.CouldNotFindEvent, eventName); - throw new ArgumentException(errorMessage, "eventName"); + throw new ArgumentException(errorMessage, nameof(eventName)); } // Try to set the EnableRaisingEvents property if it defines one @@ -722,7 +722,7 @@ private void ProcessNewSubscriber(PSEventSubscriber subscriber, object source, s if (invokeMethod.ReturnType != typeof(void)) { string errorMessage = EventingResources.NonVoidDelegateNotSupported; - throw new ArgumentException(errorMessage, "eventName"); + throw new ArgumentException(errorMessage, nameof(eventName)); } // Cache generated event handlers (by type and event name) so that they don't bloat our @@ -818,7 +818,7 @@ private void UnsubscribeEvent(PSEventSubscriber subscriber, bool skipDraining) { if (subscriber == null) { - throw new ArgumentNullException("subscriber"); + throw new ArgumentNullException(nameof(subscriber)); } Delegate existingSubscriber = null; @@ -2362,7 +2362,7 @@ internal void Add(PSEventArgs eventToAdd) { if (eventToAdd == null) { - throw new ArgumentNullException("eventToAdd"); + throw new ArgumentNullException(nameof(eventToAdd)); } _eventCollection.Add(eventToAdd); @@ -2479,9 +2479,9 @@ public PSEventJob(PSEventManager eventManager, PSEventSubscriber subscriber, Scr base(action == null ? null : action.ToString(), name) { if (eventManager == null) - throw new ArgumentNullException("eventManager"); + throw new ArgumentNullException(nameof(eventManager)); if (subscriber == null) - throw new ArgumentNullException("subscriber"); + throw new ArgumentNullException(nameof(subscriber)); UsesResultsCollection = true; ScriptBlock = action; diff --git a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs index 9337f48542b..f6993a03a0a 100644 --- a/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs +++ b/src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs @@ -349,7 +349,7 @@ internal static void ValidateArguments(string experimentName, ExperimentAction e if (experimentAction == ExperimentAction.None) { string paramName = nameof(experimentAction); - string invalidMember = ExperimentAction.None.ToString(); + string invalidMember = nameof(ExperimentAction.None); string validMembers = StringUtil.Format("{0}, {1}", ExperimentAction.Hide, ExperimentAction.Show); throw PSTraceSource.NewArgumentException(paramName, Metadata.InvalidEnumArgument, invalidMember, paramName, validMembers); } diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs index 4866316efdc..542ad8bbf7e 100644 --- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs +++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs @@ -532,7 +532,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/engine/ExternalScriptInfo.cs b/src/System.Management.Automation/engine/ExternalScriptInfo.cs index ef4bc477653..d87e3027f2e 100644 --- a/src/System.Management.Automation/engine/ExternalScriptInfo.cs +++ b/src/System.Management.Automation/engine/ExternalScriptInfo.cs @@ -44,7 +44,7 @@ internal ExternalScriptInfo(string name, string path, ExecutionContext context) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } Diagnostics.Assert(IO.Path.IsPathRooted(path), "Caller makes sure that 'path' is already resolved."); @@ -71,7 +71,7 @@ internal ExternalScriptInfo(string name, string path) : base(name, CommandTypes. { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } Diagnostics.Assert(IO.Path.IsPathRooted(path), "Caller makes sure that 'path' is already resolved."); diff --git a/src/System.Management.Automation/engine/FunctionInfo.cs b/src/System.Management.Automation/engine/FunctionInfo.cs index 95bdf5b0025..8afe41ece15 100644 --- a/src/System.Management.Automation/engine/FunctionInfo.cs +++ b/src/System.Management.Automation/engine/FunctionInfo.cs @@ -55,7 +55,7 @@ internal FunctionInfo(string name, ScriptBlock function, ExecutionContext contex { if (function == null) { - throw PSTraceSource.NewArgumentNullException("function"); + throw PSTraceSource.NewArgumentNullException(nameof(function)); } _scriptBlock = function; diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index 709c84b973c..adc7c9c95bd 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -1660,7 +1660,7 @@ public IEnumerable CompleteArgument(string commandName, string { if (fakeBoundParameters == null) { - throw PSTraceSource.NewArgumentNullException("fakeBoundParameters"); + throw PSTraceSource.NewArgumentNullException(nameof(fakeBoundParameters)); } var commandInfo = new CmdletInfo("Get-Command", typeof(GetCommandCommand)); diff --git a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs index 63f4bbaffcb..699d60dafa0 100644 --- a/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ItemCmdletProviderInterfaces.cs @@ -38,7 +38,7 @@ internal ItemCmdletProviderIntrinsics(Cmdlet cmdlet) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } _cmdlet = cmdlet; @@ -58,7 +58,7 @@ internal ItemCmdletProviderIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 50b2e7950f7..039761b4118 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -639,7 +639,7 @@ public static bool Equals(object first, object second, bool ignoreCase, IFormatP var culture = formatProvider as CultureInfo; if (culture == null) { - throw PSTraceSource.NewArgumentException("formatProvider"); + throw PSTraceSource.NewArgumentException(nameof(formatProvider)); } first = PSObject.Base(first); @@ -787,7 +787,7 @@ public static int Compare(object first, object second, bool ignoreCase, IFormatP var culture = formatProvider as CultureInfo; if (culture == null) { - throw PSTraceSource.NewArgumentException("formatProvider"); + throw PSTraceSource.NewArgumentException(nameof(formatProvider)); } first = PSObject.Base(first); @@ -814,7 +814,7 @@ public static int Compare(object first, object second, bool ignoreCase, IFormatP } catch (PSInvalidCastException e) { - throw PSTraceSource.NewArgumentException("second", ExtendedTypeSystem.ComparisonFailure, + throw PSTraceSource.NewArgumentException(nameof(second), ExtendedTypeSystem.ComparisonFailure, first.ToString(), second.ToString(), e.Message); } } @@ -839,7 +839,7 @@ public static int Compare(object first, object second, bool ignoreCase, IFormatP } catch (PSInvalidCastException e) { - throw PSTraceSource.NewArgumentException("second", ExtendedTypeSystem.ComparisonFailure, + throw PSTraceSource.NewArgumentException(nameof(second), ExtendedTypeSystem.ComparisonFailure, first.ToString(), second.ToString(), e.Message); } @@ -855,7 +855,7 @@ public static int Compare(object first, object second, bool ignoreCase, IFormatP // At this point, we know that they aren't equal but we have no way of // knowing which should compare greater than the other so we throw an exception. - throw PSTraceSource.NewArgumentException("first", ExtendedTypeSystem.NotIcomparable, first.ToString()); + throw PSTraceSource.NewArgumentException(nameof(first), ExtendedTypeSystem.NotIcomparable, first.ToString()); } /// @@ -907,7 +907,7 @@ public static bool TryCompare(object first, object second, bool ignoreCase, IFor if (!(formatProvider is CultureInfo culture)) { - throw PSTraceSource.NewArgumentException("formatProvider"); + throw PSTraceSource.NewArgumentException(nameof(formatProvider)); } first = PSObject.Base(first); @@ -4788,7 +4788,7 @@ internal static object ConvertTo(object valueToConvert, { if (resultType == null) { - throw PSTraceSource.NewArgumentNullException("resultType"); + throw PSTraceSource.NewArgumentNullException(nameof(resultType)); } bool debase; diff --git a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs index 8bb14cebccb..9efd502badb 100644 --- a/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs +++ b/src/System.Management.Automation/engine/MergedCommandParameterMetadata.cs @@ -81,7 +81,7 @@ internal Collection AddMetadataForBinder( { if (parameterMetadata == null) { - throw PSTraceSource.NewArgumentNullException("parameterMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterMetadata)); } Collection result = @@ -443,7 +443,7 @@ internal MergedCompiledCommandParameter GetMatchingParameter( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } Collection matchingParameters = diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index a4b30616132..0e821686f53 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -7148,7 +7148,7 @@ internal static void ImportModuleMembers( ImportModuleOptions options) { if (sourceModule == null) - throw PSTraceSource.NewArgumentNullException("sourceModule"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceModule)); bool isImportModulePrivate = cmdlet.CommandInfo.Visibility == SessionStateEntryVisibility.Private || targetSessionState.DefaultCommandVisibility == SessionStateEntryVisibility.Private; diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index 29bc54a6798..af0b93567b6 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -130,7 +130,7 @@ public PSModuleInfo(ScriptBlock scriptBlock) { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentException("scriptBlock"); + throw PSTraceSource.NewArgumentException(nameof(scriptBlock)); } // Get the ExecutionContext from the thread. @@ -1305,7 +1305,7 @@ public PSVariable GetVariableFromCallersModule(string variableName) { if (string.IsNullOrEmpty(variableName)) { - throw new ArgumentNullException("variableName"); + throw new ArgumentNullException(nameof(variableName)); } var context = LocalPipeline.GetExecutionContextFromTLS(); diff --git a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs index 10f53ef0136..fce9c2e58c8 100644 --- a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs +++ b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs @@ -970,7 +970,7 @@ private static CimCredential GetCimCredentials(string authentication, PSCredenti } Dbg.Assert(false, "Unrecognized authentication mechanism [ValidateSet should prevent that from happening]"); - throw new ArgumentOutOfRangeException("authentication"); + throw new ArgumentOutOfRangeException(nameof(authentication)); } internal static CimSession CreateCimSession( diff --git a/src/System.Management.Automation/engine/MshCmdlet.cs b/src/System.Management.Automation/engine/MshCmdlet.cs index 839ea1c005f..d6c8d941a04 100644 --- a/src/System.Management.Automation/engine/MshCmdlet.cs +++ b/src/System.Management.Automation/engine/MshCmdlet.cs @@ -435,7 +435,7 @@ public CmdletInfo GetCmdletByTypeName(string cmdletTypeName) { if (string.IsNullOrEmpty(cmdletTypeName)) { - throw PSTraceSource.NewArgumentNullException("cmdletTypeName"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdletTypeName)); } Exception e = null; @@ -486,7 +486,7 @@ public List GetCmdlets() public List GetCmdlets(string pattern) { if (pattern == null) - throw PSTraceSource.NewArgumentNullException("pattern"); + throw PSTraceSource.NewArgumentNullException(nameof(pattern)); List cmdlets = new List(); @@ -548,7 +548,7 @@ public List GetCommandName(string name, bool nameIsPattern, bool returnF { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } List commands = new List(); @@ -608,7 +608,7 @@ public IEnumerable GetCommands(string name, CommandTypes commandTyp { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } SearchResolutionOptions options = nameIsPattern ? @@ -707,12 +707,12 @@ public Collection InvokeScript( { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentNullException("scriptBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(scriptBlock)); } if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } SessionStateInternal _oldSessionState = _context.EngineSessionState; @@ -745,7 +745,7 @@ public Collection InvokeScript( { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentNullException("scriptBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(scriptBlock)); } // Force the current runspace onto the callers thread - this is needed @@ -784,7 +784,7 @@ public Collection InvokeScript(string script, bool useNewScope, PipelineResultTypes writeToPipeline, IList input, params object[] args) { if (script == null) - throw new ArgumentNullException("script"); + throw new ArgumentNullException(nameof(script)); // Compile the script text into an executable script block. ScriptBlock sb = ScriptBlock.Create(_context, script); diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index a40ebced867..27c3af3fc60 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -396,7 +396,7 @@ internal void WriteProgress( { if (progressRecord == null) { - throw PSTraceSource.NewArgumentNullException("progressRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(progressRecord)); } if (Host == null || Host.UI == null) @@ -2053,7 +2053,7 @@ public void ThrowTerminatingError(ErrorRecord errorRecord) ThrowIfStopping(); if (errorRecord == null) { - throw PSTraceSource.NewArgumentNullException("errorRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(errorRecord)); } errorRecord.SetInvocationInfo(MyInvocation); @@ -2318,7 +2318,7 @@ private class AllowWrite : IDisposable internal AllowWrite(InternalCommand permittedToWrite, bool permittedToWriteToPipeline) { if (permittedToWrite == null) - throw PSTraceSource.NewArgumentNullException("permittedToWrite"); + throw PSTraceSource.NewArgumentNullException(nameof(permittedToWrite)); MshCommandRuntime mcr = permittedToWrite.commandRuntime as MshCommandRuntime; if (mcr == null) throw PSTraceSource.NewArgumentNullException("permittedToWrite.CommandRuntime"); @@ -2368,7 +2368,7 @@ public void Dispose() public Exception ManageException(Exception e) { if (e == null) - throw PSTraceSource.NewArgumentNullException("e"); + throw PSTraceSource.NewArgumentNullException(nameof(e)); if (PipelineProcessor != null) { diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index e341d6d8dda..4079669d94b 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -228,7 +228,7 @@ protected void SetMemberName(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -375,13 +375,13 @@ public PSAliasProperty(string name, string referencedMemberName) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; if (string.IsNullOrEmpty(referencedMemberName)) { - throw PSTraceSource.NewArgumentException("referencedMemberName"); + throw PSTraceSource.NewArgumentException(nameof(referencedMemberName)); } ReferencedMemberName = referencedMemberName; @@ -400,13 +400,13 @@ public PSAliasProperty(string name, string referencedMemberName, Type conversion { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; if (string.IsNullOrEmpty(referencedMemberName)) { - throw PSTraceSource.NewArgumentException("referencedMemberName"); + throw PSTraceSource.NewArgumentException(nameof(referencedMemberName)); } ReferencedMemberName = referencedMemberName; @@ -772,7 +772,7 @@ internal PSCodeProperty(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -789,13 +789,13 @@ public PSCodeProperty(string name, MethodInfo getterCodeReference) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; if (getterCodeReference == null) { - throw PSTraceSource.NewArgumentNullException("getterCodeReference"); + throw PSTraceSource.NewArgumentNullException(nameof(getterCodeReference)); } SetGetter(getterCodeReference); @@ -818,7 +818,7 @@ public PSCodeProperty(string name, MethodInfo getterCodeReference, MethodInfo se { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -1075,7 +1075,7 @@ internal PSProperty(string name, Adapter adapter, object baseObject, object adap { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -1292,7 +1292,7 @@ public PSNoteProperty(string name, object value) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -1438,7 +1438,7 @@ public override string ToString() public PSVariableProperty(PSVariable variable) : base(variable?.Name, null) { - _variable = variable ?? throw PSTraceSource.NewArgumentException("variable"); + _variable = variable ?? throw PSTraceSource.NewArgumentException(nameof(variable)); } #region virtual implementation @@ -1665,12 +1665,12 @@ public PSScriptProperty(string name, ScriptBlock getterScript) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; - _getterScript = getterScript ?? throw PSTraceSource.NewArgumentNullException("getterScript"); + _getterScript = getterScript ?? throw PSTraceSource.NewArgumentNullException(nameof(getterScript)); } /// @@ -1685,7 +1685,7 @@ public PSScriptProperty(string name, ScriptBlock getterScript, ScriptBlock sette { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -1722,7 +1722,7 @@ internal PSScriptProperty(string name, string getterScript, string setterScript, { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -2156,7 +2156,7 @@ internal PSCodeMethod(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -2173,12 +2173,12 @@ public PSCodeMethod(string name, MethodInfo codeReference) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (codeReference == null) { - throw PSTraceSource.NewArgumentNullException("codeReference"); + throw PSTraceSource.NewArgumentNullException(nameof(codeReference)); } if (!CheckMethodInfo(codeReference)) @@ -2229,7 +2229,7 @@ public override object Invoke(params object[] arguments) { if (arguments == null) { - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); } object[] newArguments = new object[arguments.Length + 1]; @@ -2326,12 +2326,12 @@ public PSScriptMethod(string name, ScriptBlock script) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; - _script = script ?? throw PSTraceSource.NewArgumentNullException("script"); + _script = script ?? throw PSTraceSource.NewArgumentNullException(nameof(script)); } /// @@ -2364,7 +2364,7 @@ public override object Invoke(params object[] arguments) { if (arguments == null) { - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); } return InvokeScript(Name, _script, this.instance, arguments); @@ -2489,7 +2489,7 @@ internal PSMethod(string name, Adapter adapter, object baseObject, object adapte { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -2559,7 +2559,7 @@ internal object Invoke(PSMethodInvocationConstraints invocationConstraints, para { if (arguments == null) { - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); } return _adapter.BaseMethodInvoke(this, invocationConstraints, arguments); @@ -2908,7 +2908,7 @@ internal PSParameterizedProperty(string name, Adapter adapter, object baseObject { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -2921,7 +2921,7 @@ internal PSParameterizedProperty(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; @@ -2950,7 +2950,7 @@ public override object Invoke(params object[] arguments) { if (arguments == null) { - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); } return this.adapter.BaseParameterizedPropertyGet(this, arguments); @@ -2967,7 +2967,7 @@ public void InvokeSet(object valueToSet, params object[] arguments) { if (arguments == null) { - throw PSTraceSource.NewArgumentNullException("arguments"); + throw PSTraceSource.NewArgumentNullException(nameof(arguments)); } this.adapter.BaseParameterizedPropertySet(this, valueToSet, arguments); @@ -3172,13 +3172,13 @@ internal PSMemberSet(string name, PSObject mshObject) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } this.name = name; if (mshObject == null) { - throw PSTraceSource.NewArgumentNullException("mshObject"); + throw PSTraceSource.NewArgumentNullException(nameof(mshObject)); } _constructorPSObject = mshObject; @@ -3692,12 +3692,12 @@ internal static PSMemberInfoInternalCollection Match(PSMemberInfoInternalC PSMemberInfoInternalCollection returnValue = new PSMemberInfoInternalCollection(); if (memberList == null) { - throw PSTraceSource.NewArgumentNullException("memberList"); + throw PSTraceSource.NewArgumentNullException(nameof(memberList)); } if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (nameMatch == null) @@ -3884,7 +3884,7 @@ internal ReadOnlyPSMemberInfoCollection(PSMemberInfoInternalCollection member { if (members == null) { - throw PSTraceSource.NewArgumentNullException("members"); + throw PSTraceSource.NewArgumentNullException(nameof(members)); } _members = members; @@ -3902,7 +3902,7 @@ public T this[string name] { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return _members[name]; @@ -3919,7 +3919,7 @@ public ReadOnlyPSMemberInfoCollection Match(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return _members.Match(name); @@ -3936,7 +3936,7 @@ public ReadOnlyPSMemberInfoCollection Match(string name, PSMemberTypes member { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return _members.Match(name, memberTypes); @@ -4069,7 +4069,7 @@ public override void Add(T member, bool preValidated) { if (member == null) { - throw PSTraceSource.NewArgumentNullException("member"); + throw PSTraceSource.NewArgumentNullException(nameof(member)); } // Save to a local variable to reduce property access. @@ -4101,7 +4101,7 @@ public override void Remove(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (IsReservedName(name)) @@ -4143,7 +4143,7 @@ public override T this[string name] { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (_members == null) @@ -4168,7 +4168,7 @@ public override ReadOnlyPSMemberInfoCollection Match(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return Match(name, PSMemberTypes.All, MshMemberMatchOptions.None); @@ -4185,7 +4185,7 @@ public override ReadOnlyPSMemberInfoCollection Match(string name, PSMemberTyp { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return Match(name, memberTypes, MshMemberMatchOptions.None); @@ -4203,7 +4203,7 @@ internal override ReadOnlyPSMemberInfoCollection Match(string name, PSMemberT { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } PSMemberInfoInternalCollection internalMembers = GetInternalMembers(matchOptions); @@ -4500,19 +4500,19 @@ internal PSMemberInfoIntegratingCollection(object owner, Collection Match(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return Match(name, PSMemberTypes.All, MshMemberMatchOptions.None); @@ -4925,7 +4925,7 @@ public override ReadOnlyPSMemberInfoCollection Match(string name, PSMemberTyp { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } return Match(name, memberTypes, MshMemberMatchOptions.None); @@ -4945,7 +4945,7 @@ internal override ReadOnlyPSMemberInfoCollection Match(string name, PSMemberT { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (_mshOwner != null) diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index 7697f2b413e..79824980475 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -569,7 +569,7 @@ public PSObject(object obj) { if (obj == null) { - throw PSTraceSource.NewArgumentNullException("obj"); + throw PSTraceSource.NewArgumentNullException(nameof(obj)); } CommonInitialization(obj); @@ -584,14 +584,14 @@ protected PSObject(SerializationInfo info, StreamingContext context) { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } string serializedData = info.GetValue("CliXml", typeof(string)) as string; if (serializedData == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } PSObject result = PSObject.AsPSObject(PSSerializer.Deserialize(serializedData)); @@ -1051,7 +1051,7 @@ internal static PSObject AsPSObject(object obj, bool storeTypeNameAndInstanceMem { if (obj == null) { - throw PSTraceSource.NewArgumentNullException("obj"); + throw PSTraceSource.NewArgumentNullException(nameof(obj)); } if (obj is PSObject so) @@ -1815,7 +1815,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } // We create a wrapper PSObject, so that we can successfully deserialize it diff --git a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs index 0ee6945f3a8..3beae965b55 100644 --- a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs +++ b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs @@ -171,7 +171,7 @@ public override object GetValue(object component) { if (component == null) { - throw PSTraceSource.NewArgumentNullException("component"); + throw PSTraceSource.NewArgumentNullException(nameof(component)); } PSObject mshObj = GetComponentPSObject(component); @@ -221,7 +221,7 @@ private static PSObject GetComponentPSObject(object component) PSObjectTypeDescriptor descriptor = component as PSObjectTypeDescriptor; if (descriptor == null) { - throw PSTraceSource.NewArgumentException("component", ExtendedTypeSystem.InvalidComponent, + throw PSTraceSource.NewArgumentException(nameof(component), ExtendedTypeSystem.InvalidComponent, "component", typeof(PSObject).Name, typeof(PSObjectTypeDescriptor).Name); @@ -270,7 +270,7 @@ public override void SetValue(object component, object value) { if (component == null) { - throw PSTraceSource.NewArgumentNullException("component"); + throw PSTraceSource.NewArgumentNullException(nameof(component)); } PSObject mshObj = GetComponentPSObject(component); diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index 45fb9582599..ef9053faf8f 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -161,7 +161,7 @@ internal NativeCommandProcessor(ApplicationInfo applicationInfo, ExecutionContex { if (applicationInfo == null) { - throw PSTraceSource.NewArgumentNullException("applicationInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(applicationInfo)); } _applicationInfo = applicationInfo; diff --git a/src/System.Management.Automation/engine/PSClassInfo.cs b/src/System.Management.Automation/engine/PSClassInfo.cs index 2a22f27b189..199f7f1b2b7 100644 --- a/src/System.Management.Automation/engine/PSClassInfo.cs +++ b/src/System.Management.Automation/engine/PSClassInfo.cs @@ -62,7 +62,7 @@ public sealed class PSClassMemberInfo internal PSClassMemberInfo(string name, string memberType, string defaultValue) { if (string.IsNullOrEmpty(name)) - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); this.Name = name; this.TypeName = memberType; diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index e50395003fe..d6ecd705a30 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -243,7 +243,7 @@ private void ValidatePSTypeName( if (!psTypeNamesOfArgumentValue.Contains(psTypeNameRequestedByParameter, StringComparer.OrdinalIgnoreCase)) { // win8: 228176..The callers know when to ignore and when not to ignore invalid cast exceptions. - PSInvalidCastException e = new PSInvalidCastException(ErrorCategory.InvalidArgument.ToString(), + PSInvalidCastException e = new PSInvalidCastException(nameof(ErrorCategory.InvalidArgument), null, ParameterBinderStrings.MismatchedPSTypeName, (_invocationInfo != null) && (_invocationInfo.MyCommand != null) ? _invocationInfo.MyCommand.Name : string.Empty, @@ -337,12 +337,12 @@ internal virtual bool BindParameter( if (parameter == null) { - throw PSTraceSource.NewArgumentNullException("parameter"); + throw PSTraceSource.NewArgumentNullException(nameof(parameter)); } if (parameterMetadata == null) { - throw PSTraceSource.NewArgumentNullException("parameterMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterMetadata)); } using (bindingTracer.TraceScope( @@ -986,12 +986,12 @@ private object CoerceTypeAsNeeded( { if (argument == null) { - throw PSTraceSource.NewArgumentNullException("argument"); + throw PSTraceSource.NewArgumentNullException(nameof(argument)); } if (toType == null) { - throw PSTraceSource.NewArgumentNullException("toType"); + throw PSTraceSource.NewArgumentNullException(nameof(toType)); } // Construct the collection type information if it wasn't passed in. diff --git a/src/System.Management.Automation/engine/ParameterBinderController.cs b/src/System.Management.Automation/engine/ParameterBinderController.cs index 5105abbc298..a68192c7a90 100644 --- a/src/System.Management.Automation/engine/ParameterBinderController.cs +++ b/src/System.Management.Automation/engine/ParameterBinderController.cs @@ -872,7 +872,7 @@ protected void ThrowElaboratedBindingException(ParameterBindingException pbex) { if (pbex == null) { - throw PSTraceSource.NewArgumentNullException("pbex"); + throw PSTraceSource.NewArgumentNullException(nameof(pbex)); } Diagnostics.Assert(pbex.ErrorRecord != null, "ErrorRecord should not be null in a ParameterBindingException"); diff --git a/src/System.Management.Automation/engine/ParameterInfo.cs b/src/System.Management.Automation/engine/ParameterInfo.cs index 5878fdc400a..cf1784a7b62 100644 --- a/src/System.Management.Automation/engine/ParameterInfo.cs +++ b/src/System.Management.Automation/engine/ParameterInfo.cs @@ -32,7 +32,7 @@ internal CommandParameterInfo( { if (parameter == null) { - throw PSTraceSource.NewArgumentNullException("parameter"); + throw PSTraceSource.NewArgumentNullException(nameof(parameter)); } Name = parameter.Name; diff --git a/src/System.Management.Automation/engine/ParameterSetInfo.cs b/src/System.Management.Automation/engine/ParameterSetInfo.cs index 85a3cf042a6..c166f749b1c 100644 --- a/src/System.Management.Automation/engine/ParameterSetInfo.cs +++ b/src/System.Management.Automation/engine/ParameterSetInfo.cs @@ -52,12 +52,12 @@ internal CommandParameterSetInfo( Name = string.Empty; if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (parameterMetadata == null) { - throw PSTraceSource.NewArgumentNullException("parameterMetadata"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterMetadata)); } this.Name = name; diff --git a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs index 7ffba7fd0dd..4cc4ca7540e 100644 --- a/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs +++ b/src/System.Management.Automation/engine/ParameterSetSpecificMetadata.cs @@ -21,7 +21,7 @@ internal ParameterSetSpecificMetadata(ParameterAttribute attribute) { if (attribute == null) { - throw PSTraceSource.NewArgumentNullException("attribute"); + throw PSTraceSource.NewArgumentNullException(nameof(attribute)); } _attribute = attribute; diff --git a/src/System.Management.Automation/engine/PathInterfaces.cs b/src/System.Management.Automation/engine/PathInterfaces.cs index 342aec3cba0..d11a225797e 100644 --- a/src/System.Management.Automation/engine/PathInterfaces.cs +++ b/src/System.Management.Automation/engine/PathInterfaces.cs @@ -40,7 +40,7 @@ internal PathIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/ProgressRecord.cs b/src/System.Management.Automation/engine/ProgressRecord.cs index 086815105ef..f040e24e416 100644 --- a/src/System.Management.Automation/engine/ProgressRecord.cs +++ b/src/System.Management.Automation/engine/ProgressRecord.cs @@ -43,17 +43,17 @@ class ProgressRecord { // negative Ids are reserved to indicate "no id" for parent Ids. - throw PSTraceSource.NewArgumentOutOfRangeException("activityId", activityId, ProgressRecordStrings.ArgMayNotBeNegative, "activityId"); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(activityId), activityId, ProgressRecordStrings.ArgMayNotBeNegative, "activityId"); } if (string.IsNullOrEmpty(activity)) { - throw PSTraceSource.NewArgumentException("activity", ProgressRecordStrings.ArgMayNotBeNullOrEmpty, "activity"); + throw PSTraceSource.NewArgumentException(nameof(activity), ProgressRecordStrings.ArgMayNotBeNullOrEmpty, "activity"); } if (string.IsNullOrEmpty(statusDescription)) { - throw PSTraceSource.NewArgumentException("activity", ProgressRecordStrings.ArgMayNotBeNullOrEmpty, "statusDescription"); + throw PSTraceSource.NewArgumentException(nameof(activity), ProgressRecordStrings.ArgMayNotBeNullOrEmpty, "statusDescription"); } this.id = activityId; @@ -373,12 +373,12 @@ internal static int GetPercentageComplete(DateTime startTime, TimeSpan expectedD if (startTime > now) { - throw new ArgumentOutOfRangeException("startTime"); + throw new ArgumentOutOfRangeException(nameof(startTime)); } if (expectedDuration <= TimeSpan.Zero) { - throw new ArgumentOutOfRangeException("expectedDuration"); + throw new ArgumentOutOfRangeException(nameof(expectedDuration)); } /* @@ -474,7 +474,7 @@ internal static ProgressRecord FromPSObjectForRemoting(PSObject progressAsPSObje { if (progressAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("progressAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(progressAsPSObject)); } string activity = RemotingDecoder.GetPropertyValue(progressAsPSObject, RemoteDataNameStrings.ProgressRecord_Activity); diff --git a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs index e249a2b7d0c..9c1f9379190 100644 --- a/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/PropertyCmdletProviderInterfaces.cs @@ -38,7 +38,7 @@ internal PropertyCmdletProviderIntrinsics(Cmdlet cmdlet) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } _cmdlet = cmdlet; @@ -58,7 +58,7 @@ internal PropertyCmdletProviderIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/ProviderInterfaces.cs b/src/System.Management.Automation/engine/ProviderInterfaces.cs index c74b1336184..27e2680af5c 100644 --- a/src/System.Management.Automation/engine/ProviderInterfaces.cs +++ b/src/System.Management.Automation/engine/ProviderInterfaces.cs @@ -40,7 +40,7 @@ internal CmdletProviderManagementIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/ProxyCommand.cs b/src/System.Management.Automation/engine/ProxyCommand.cs index a3dca0da40a..54bce30c9d0 100644 --- a/src/System.Management.Automation/engine/ProxyCommand.cs +++ b/src/System.Management.Automation/engine/ProxyCommand.cs @@ -354,7 +354,7 @@ public static string GetHelpComments(PSObject help) { if (help == null) { - throw new ArgumentNullException("help"); + throw new ArgumentNullException(nameof(help)); } bool isHelpObject = false; diff --git a/src/System.Management.Automation/engine/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/PseudoParameterBinder.cs index 123c7291e10..bddbe643f59 100644 --- a/src/System.Management.Automation/engine/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/PseudoParameterBinder.cs @@ -124,7 +124,7 @@ internal override void BindParameter(string name, object value, CompiledCommandP { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } Target[name].Value = value; diff --git a/src/System.Management.Automation/engine/PseudoParameters.cs b/src/System.Management.Automation/engine/PseudoParameters.cs index 28be3daefc6..bccb2fb3f37 100644 --- a/src/System.Management.Automation/engine/PseudoParameters.cs +++ b/src/System.Management.Automation/engine/PseudoParameters.cs @@ -53,12 +53,12 @@ public RuntimeDefinedParameter(string name, Type parameterType, Collection GetChildItems(string[] paths, bool recurse, uint d { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1251,7 +1251,7 @@ internal Collection GetChildItems(string[] paths, bool recurse, uint d { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } GetChildItems(path, recurse, depth, context); @@ -1307,12 +1307,12 @@ internal void GetChildItems( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } ProviderInfo provider = null; @@ -2229,7 +2229,7 @@ internal Collection GetChildNames( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -2240,7 +2240,7 @@ internal Collection GetChildNames( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } GetChildNames(path, returnContainers, recurse, depth, context); @@ -2320,7 +2320,7 @@ internal void GetChildNames( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } // Construct the include filter @@ -2979,7 +2979,7 @@ internal Collection RenameItem(string path, string newName, bool force { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -3037,7 +3037,7 @@ internal void RenameItem( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } ProviderInfo provider = null; @@ -3062,7 +3062,7 @@ internal void RenameItem( { ArgumentException argException = PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.RenameMultipleItemError); context.WriteError( @@ -3345,7 +3345,7 @@ internal Collection NewItem(string[] paths, string name, string type, { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -3409,7 +3409,7 @@ internal void NewItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } foreach (string path in paths) @@ -3417,7 +3417,7 @@ internal void NewItem( string resolvePath = null; if (path == null) { - PSTraceSource.NewArgumentNullException("paths"); + PSTraceSource.NewArgumentNullException(nameof(paths)); } else if (path.EndsWith((":" + Path.DirectorySeparatorChar), StringComparison.Ordinal) || path.EndsWith((":" + Path.AltDirectorySeparatorChar), StringComparison.Ordinal)) @@ -3819,7 +3819,7 @@ internal bool HasChildItems(string path, bool force, bool literalPath) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -3871,7 +3871,7 @@ internal bool HasChildItems( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } ProviderInfo provider = null; @@ -3924,12 +3924,12 @@ internal bool HasChildItems( if (string.IsNullOrEmpty(providerId)) { - throw PSTraceSource.NewArgumentException("providerId"); + throw PSTraceSource.NewArgumentException(nameof(providerId)); } if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -4097,7 +4097,7 @@ internal Collection CopyItem(string[] paths, { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (copyPath == null) @@ -4163,7 +4163,7 @@ internal void CopyItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (copyPath == null) @@ -4260,7 +4260,7 @@ internal void CopyItem( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths; @@ -4839,7 +4839,7 @@ private string ValidateRemotePathAndGetRoot(string path, Runspaces.PSSession ses if (sourceIsRemote) { - ps.AddParameter("sourceIsRemote", true); + ps.AddParameter(nameof(sourceIsRemote), true); } op = Microsoft.PowerShell.Commands.SafeInvokeCommand.Invoke(ps, null, context); diff --git a/src/System.Management.Automation/engine/SessionStateContent.cs b/src/System.Management.Automation/engine/SessionStateContent.cs index 3ace73430c9..0f1cc74bc49 100644 --- a/src/System.Management.Automation/engine/SessionStateContent.cs +++ b/src/System.Management.Automation/engine/SessionStateContent.cs @@ -55,7 +55,7 @@ internal Collection GetContentReader(string[] paths, bool force, { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -107,7 +107,7 @@ internal Collection GetContentReader( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -119,7 +119,7 @@ internal Collection GetContentReader( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -396,7 +396,7 @@ internal Collection GetContentWriter(string[] paths, bool force, { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -448,7 +448,7 @@ internal Collection GetContentWriter( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -459,7 +459,7 @@ internal Collection GetContentWriter( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -738,7 +738,7 @@ internal void ClearContent(string[] paths, bool force, bool literalPath) { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -785,7 +785,7 @@ internal void ClearContent( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -795,7 +795,7 @@ internal void ClearContent( { if (path == null) { - PSTraceSource.NewArgumentNullException("paths"); + PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index abc6b867ae5..91228e4dd1b 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -65,7 +65,7 @@ internal PSDriveInfo NewDrive(PSDriveInfo drive, string scopeID) { if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } PSDriveInfo result = null; @@ -140,12 +140,12 @@ internal void NewDrive(PSDriveInfo drive, string scopeID, CmdletProviderContext { if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } if (!IsValidDriveName(drive.Name)) @@ -432,7 +432,7 @@ private PSDriveInfo GetDrive(string name, bool automount) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } PSDriveInfo result = null; @@ -528,7 +528,7 @@ internal PSDriveInfo GetDrive(string name, string scopeID) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } PSDriveInfo result = null; @@ -994,7 +994,7 @@ internal void RemoveDrive(string driveName, bool force, string scopeID) { if (driveName == null) { - throw PSTraceSource.NewArgumentNullException("driveName"); + throw PSTraceSource.NewArgumentNullException(nameof(driveName)); } PSDriveInfo drive = GetDrive(driveName, scopeID); @@ -1037,7 +1037,7 @@ internal void RemoveDrive( { if (driveName == null) { - throw PSTraceSource.NewArgumentNullException("driveName"); + throw PSTraceSource.NewArgumentNullException(nameof(driveName)); } Dbg.Diagnostics.Assert( @@ -1079,7 +1079,7 @@ internal void RemoveDrive(PSDriveInfo drive, bool force, string scopeID) { if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1241,12 +1241,12 @@ private bool CanRemoveDrive(PSDriveInfo drive, CmdletProviderContext context) { if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } s_tracer.WriteLine("Drive name = {0}", drive.Name); diff --git a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs index 4b6bfef05d7..575c3387d5e 100644 --- a/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateDynamicProperty.cs @@ -70,12 +70,12 @@ internal Collection NewProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) { - throw PSTraceSource.NewArgumentNullException("property"); + throw PSTraceSource.NewArgumentNullException(nameof(property)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -141,12 +141,12 @@ internal void NewProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) { - throw PSTraceSource.NewArgumentNullException("property"); + throw PSTraceSource.NewArgumentNullException(nameof(property)); } ProviderInfo provider = null; @@ -156,7 +156,7 @@ internal void NewProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -467,12 +467,12 @@ internal void RemoveProperty(string[] paths, string property, bool force, bool l { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) { - throw PSTraceSource.NewArgumentNullException("property"); + throw PSTraceSource.NewArgumentNullException(nameof(property)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -523,19 +523,19 @@ internal void RemoveProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) { - throw PSTraceSource.NewArgumentNullException("property"); + throw PSTraceSource.NewArgumentNullException(nameof(property)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -840,22 +840,22 @@ internal Collection CopyProperty( { if (sourcePaths == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -921,29 +921,29 @@ internal void CopyProperty( { if (sourcePaths == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } foreach (string sourcePath in sourcePaths) { if (sourcePath == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } ProviderInfo provider = null; @@ -1327,22 +1327,22 @@ internal Collection MoveProperty( { if (sourcePaths == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1411,22 +1411,22 @@ internal void MoveProperty( { if (sourcePaths == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } ProviderInfo provider = null; @@ -1453,7 +1453,7 @@ internal void MoveProperty( { ArgumentException argException = PSTraceSource.NewArgumentException( - "destinationPath", + nameof(destinationPath), SessionStateStrings.MovePropertyDestinationResolveToSingle); context.WriteError(new ErrorRecord(argException, argException.GetType().FullName, ErrorCategory.InvalidArgument, destinationProviderPaths)); @@ -1464,7 +1464,7 @@ internal void MoveProperty( { if (sourcePath == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } Collection providerPaths = @@ -1805,17 +1805,17 @@ internal Collection RenameProperty( { if (sourcePaths == null) { - throw PSTraceSource.NewArgumentNullException("sourcePaths"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePaths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1874,24 +1874,24 @@ internal void RenameProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (sourceProperty == null) { - throw PSTraceSource.NewArgumentNullException("sourceProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(sourceProperty)); } if (destinationProperty == null) { - throw PSTraceSource.NewArgumentNullException("destinationProperty"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationProperty)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; diff --git a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs index b04e5e8d275..2e45499f485 100644 --- a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs @@ -154,7 +154,7 @@ internal FunctionInfo GetFunction(string name, CommandOrigin origin) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } FunctionInfo result = null; @@ -269,12 +269,12 @@ internal FunctionInfo SetFunctionRaw( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (function == null) { - throw PSTraceSource.NewArgumentNullException("function"); + throw PSTraceSource.NewArgumentNullException(nameof(function)); } string originalName = name; @@ -504,12 +504,12 @@ internal FunctionInfo SetFunction( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (function == null) { - throw PSTraceSource.NewArgumentNullException("function"); + throw PSTraceSource.NewArgumentNullException(nameof(function)); } string originalName = name; @@ -583,12 +583,12 @@ internal FunctionInfo SetFunction( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } if (function == null) { - throw PSTraceSource.NewArgumentNullException("function"); + throw PSTraceSource.NewArgumentNullException(nameof(function)); } string originalName = name; @@ -711,7 +711,7 @@ internal void RemoveFunction(string name, bool force, CommandOrigin origin) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } // Use the scope enumerator to find an existing function diff --git a/src/System.Management.Automation/engine/SessionStateItem.cs b/src/System.Management.Automation/engine/SessionStateItem.cs index aa1d50aab27..3d5262bf6c0 100644 --- a/src/System.Management.Automation/engine/SessionStateItem.cs +++ b/src/System.Management.Automation/engine/SessionStateItem.cs @@ -56,7 +56,7 @@ internal Collection GetItem(string[] paths, bool force, bool literalPa { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -114,7 +114,7 @@ internal void GetItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -124,7 +124,7 @@ internal void GetItem( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -395,7 +395,7 @@ internal Collection SetItem(string[] paths, object value, bool force, { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -451,14 +451,14 @@ internal void SetItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -748,7 +748,7 @@ internal Collection ClearItem(string[] paths, bool force, bool literal { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -800,7 +800,7 @@ internal void ClearItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -810,7 +810,7 @@ internal void ClearItem( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -1079,7 +1079,7 @@ internal void InvokeDefaultAction(string[] paths, bool literalPath) { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1127,7 +1127,7 @@ internal void InvokeDefaultAction( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -1137,7 +1137,7 @@ internal void InvokeDefaultAction( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = diff --git a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs index 591c20f184a..ca048aa0931 100644 --- a/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateLocationAPIs.cs @@ -75,7 +75,7 @@ internal PathInfo GetNamespaceCurrentLocation(string namespaceID) { if (namespaceID == null) { - throw PSTraceSource.NewArgumentNullException("namespaceID"); + throw PSTraceSource.NewArgumentNullException(nameof(namespaceID)); } // If namespace ID is empty, we will use the current working drive @@ -236,7 +236,7 @@ internal PathInfo SetLocation(string path, CmdletProviderContext context, bool l { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } PathInfo current = CurrentLocation; @@ -519,7 +519,7 @@ internal PathInfo SetLocation(string path, CmdletProviderContext context, bool l throw PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.PathResolvedToMultiple, originalPath); } @@ -636,7 +636,7 @@ internal bool IsCurrentLocationOrAncestor(string path, CmdletProviderContext con if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } PSDriveInfo drive = null; @@ -913,7 +913,7 @@ internal PathInfo PopLocation(string stackName) { throw PSTraceSource.NewArgumentException( - "stackName", + nameof(stackName), SessionStateStrings.StackNameResolvedToMultiple, stackName); } @@ -935,7 +935,7 @@ internal PathInfo PopLocation(string stackName) { throw PSTraceSource.NewArgumentException( - "stackName", + nameof(stackName), SessionStateStrings.StackNotFound, stackName); } @@ -1012,7 +1012,7 @@ internal PathInfoStack LocationStack(string stackName) } else { - throw PSTraceSource.NewArgumentException("stackName"); + throw PSTraceSource.NewArgumentException(nameof(stackName)); } } diff --git a/src/System.Management.Automation/engine/SessionStateNavigation.cs b/src/System.Management.Automation/engine/SessionStateNavigation.cs index f42e79433ad..4afb9218dd7 100644 --- a/src/System.Management.Automation/engine/SessionStateNavigation.cs +++ b/src/System.Management.Automation/engine/SessionStateNavigation.cs @@ -48,7 +48,7 @@ internal string GetParentPath(string path, string root) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -125,7 +125,7 @@ internal string GetParentPath( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext getProviderPathContext = @@ -469,7 +469,7 @@ internal string NormalizeRelativePath(string path, string basePath) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -517,7 +517,7 @@ internal string NormalizeRelativePath( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext getProviderPathContext = @@ -546,7 +546,7 @@ internal string NormalizeRelativePath( // Since the provider didn't write an error, and we didn't get any // results ourselves, we need to write out our own error. - Exception e = PSTraceSource.NewArgumentException("path"); + Exception e = PSTraceSource.NewArgumentException(nameof(path)); context.WriteError(new ErrorRecord(e, "NormalizePathNullResult", ErrorCategory.InvalidArgument, path)); return null; } @@ -816,13 +816,13 @@ internal string MakePath( if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } if (parent == null && child == null) { - throw PSTraceSource.NewArgumentException("parent"); + throw PSTraceSource.NewArgumentException(nameof(parent)); } // Set the drive data for the context @@ -1046,7 +1046,7 @@ internal string GetChildName(string path) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1117,7 +1117,7 @@ internal string GetChildName( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } PSDriveInfo drive = null; @@ -1340,7 +1340,7 @@ internal Collection MoveItem(string[] paths, string destination, bool { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -1398,12 +1398,12 @@ internal void MoveItem( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (destination == null) { - throw PSTraceSource.NewArgumentNullException("destination"); + throw PSTraceSource.NewArgumentNullException(nameof(destination)); } ProviderInfo provider = null; @@ -1420,7 +1420,7 @@ internal void MoveItem( { ArgumentException argException = PSTraceSource.NewArgumentException( - "destination", + nameof(destination), SessionStateStrings.MoveItemOneDestination); context.WriteError(new ErrorRecord(argException, argException.GetType().FullName, ErrorCategory.InvalidArgument, destination)); @@ -1431,7 +1431,7 @@ internal void MoveItem( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } Collection providerPaths = @@ -1496,7 +1496,7 @@ internal void MoveItem( { ArgumentException argException = PSTraceSource.NewArgumentException( - "destination", + nameof(destination), SessionStateStrings.MoveItemSourceAndDestinationNotSameProvider); context.WriteError(new ErrorRecord(argException, argException.GetType().FullName, ErrorCategory.InvalidArgument, providerPaths)); diff --git a/src/System.Management.Automation/engine/SessionStateProperty.cs b/src/System.Management.Automation/engine/SessionStateProperty.cs index 003da25d93f..d4568d2ebb3 100644 --- a/src/System.Management.Automation/engine/SessionStateProperty.cs +++ b/src/System.Management.Automation/engine/SessionStateProperty.cs @@ -116,14 +116,14 @@ internal void GetProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -416,7 +416,7 @@ internal Collection SetProperty(string[] paths, PSObject property, boo { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) @@ -480,19 +480,19 @@ internal void SetProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (property == null) { - throw PSTraceSource.NewArgumentNullException("property"); + throw PSTraceSource.NewArgumentNullException(nameof(property)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; @@ -789,12 +789,12 @@ internal void ClearProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (propertyToClear == null) { - throw PSTraceSource.NewArgumentNullException("propertyToClear"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyToClear)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -845,19 +845,19 @@ internal void ClearProperty( { if (paths == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } if (propertyToClear == null) { - throw PSTraceSource.NewArgumentNullException("propertyToClear"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyToClear)); } foreach (string path in paths) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("paths"); + throw PSTraceSource.NewArgumentNullException(nameof(paths)); } ProviderInfo provider = null; diff --git a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs index 61d21413604..d6971865232 100644 --- a/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateProviderAPIs.cs @@ -254,7 +254,7 @@ internal Provider.CmdletProvider GetProviderInstance(string providerId) { if (providerId == null) { - throw PSTraceSource.NewArgumentNullException("providerId"); + throw PSTraceSource.NewArgumentNullException(nameof(providerId)); } ProviderInfo provider = GetSingleProvider(providerId); @@ -278,7 +278,7 @@ internal Provider.CmdletProvider GetProviderInstance(ProviderInfo provider) { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } return provider.CreateInstance(); @@ -347,7 +347,7 @@ internal DriveCmdletProvider GetDriveProviderInstance(string providerId) { if (providerId == null) { - throw PSTraceSource.NewArgumentNullException("providerId"); + throw PSTraceSource.NewArgumentNullException(nameof(providerId)); } DriveCmdletProvider driveCmdletProvider = @@ -382,7 +382,7 @@ internal DriveCmdletProvider GetDriveProviderInstance(ProviderInfo provider) { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } DriveCmdletProvider driveCmdletProvider = @@ -417,7 +417,7 @@ private static DriveCmdletProvider GetDriveProviderInstance(CmdletProvider provi { if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } DriveCmdletProvider driveCmdletProvider = @@ -455,7 +455,7 @@ internal ItemCmdletProvider GetItemProviderInstance(string providerId) { if (providerId == null) { - throw PSTraceSource.NewArgumentNullException("providerId"); + throw PSTraceSource.NewArgumentNullException(nameof(providerId)); } ItemCmdletProvider itemCmdletProvider = @@ -490,7 +490,7 @@ internal ItemCmdletProvider GetItemProviderInstance(ProviderInfo provider) { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } ItemCmdletProvider itemCmdletProvider = @@ -525,7 +525,7 @@ private static ItemCmdletProvider GetItemProviderInstance(CmdletProvider provide { if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } ItemCmdletProvider itemCmdletProvider = @@ -563,7 +563,7 @@ internal ContainerCmdletProvider GetContainerProviderInstance(string providerId) { if (providerId == null) { - throw PSTraceSource.NewArgumentNullException("providerId"); + throw PSTraceSource.NewArgumentNullException(nameof(providerId)); } ContainerCmdletProvider containerCmdletProvider = @@ -598,7 +598,7 @@ internal ContainerCmdletProvider GetContainerProviderInstance(ProviderInfo provi { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } ContainerCmdletProvider containerCmdletProvider = @@ -633,7 +633,7 @@ private static ContainerCmdletProvider GetContainerProviderInstance(CmdletProvid { if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } ContainerCmdletProvider containerCmdletProvider = @@ -668,7 +668,7 @@ internal NavigationCmdletProvider GetNavigationProviderInstance(ProviderInfo pro { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } NavigationCmdletProvider navigationCmdletProvider = @@ -707,7 +707,7 @@ private static NavigationCmdletProvider GetNavigationProviderInstance(CmdletProv { if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } NavigationCmdletProvider navigationCmdletProvider = @@ -742,7 +742,7 @@ internal bool IsProviderLoaded(string name) if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } // Get the provider from the providers container @@ -780,7 +780,7 @@ internal Collection GetProvider(string name) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } PSSnapinQualifiedName providerName = PSSnapinQualifiedName.GetInstance(name); @@ -987,7 +987,7 @@ internal void InitializeProvider( { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } if (context == null) @@ -1105,7 +1105,7 @@ internal ProviderInfo NewProvider(ProviderInfo provider) { if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } // Check to see if the provider already exists. @@ -1394,12 +1394,12 @@ internal void RemoveProvider( { if (context == null) { - throw PSTraceSource.NewArgumentNullException("context"); + throw PSTraceSource.NewArgumentNullException(nameof(context)); } if (string.IsNullOrEmpty(providerName)) { - throw PSTraceSource.NewArgumentException("providerName"); + throw PSTraceSource.NewArgumentException(nameof(providerName)); } bool errors = false; diff --git a/src/System.Management.Automation/engine/SessionStatePublic.cs b/src/System.Management.Automation/engine/SessionStatePublic.cs index de23eff9479..0dca57054db 100644 --- a/src/System.Management.Automation/engine/SessionStatePublic.cs +++ b/src/System.Management.Automation/engine/SessionStatePublic.cs @@ -28,7 +28,7 @@ internal SessionState(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentNullException("sessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(sessionState)); } _sessionState = sessionState; @@ -273,7 +273,7 @@ public static bool IsVisible(CommandOrigin origin, PSVariable variable) return true; if (variable == null) { - throw PSTraceSource.NewArgumentNullException("variable"); + throw PSTraceSource.NewArgumentNullException(nameof(variable)); } return (variable.Visibility == SessionStateEntryVisibility.Public); @@ -290,7 +290,7 @@ public static bool IsVisible(CommandOrigin origin, CommandInfo commandInfo) return true; if (commandInfo == null) { - throw PSTraceSource.NewArgumentNullException("commandInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(commandInfo)); } return (commandInfo.Visibility == SessionStateEntryVisibility.Public); diff --git a/src/System.Management.Automation/engine/SessionStateScope.cs b/src/System.Management.Automation/engine/SessionStateScope.cs index aac49ab5a4c..382df13dd1d 100644 --- a/src/System.Management.Automation/engine/SessionStateScope.cs +++ b/src/System.Management.Automation/engine/SessionStateScope.cs @@ -120,7 +120,7 @@ internal void NewDrive(PSDriveInfo newDrive) { if (newDrive == null) { - throw PSTraceSource.NewArgumentNullException("newDrive"); + throw PSTraceSource.NewArgumentNullException(nameof(newDrive)); } // Ensure that multiple threads do not try to modify the @@ -171,7 +171,7 @@ internal void RemoveDrive(PSDriveInfo drive) { if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } if (_drives == null) @@ -222,7 +222,7 @@ internal PSDriveInfo GetDrive(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } PSDriveInfo result = null; diff --git a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs index 574e2266638..73cf89cebdf 100644 --- a/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs +++ b/src/System.Management.Automation/engine/SessionStateSecurityDescriptorInterface.cs @@ -32,7 +32,7 @@ internal static ISecurityDescriptorCmdletProvider GetPermissionProviderInstance( { if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } ISecurityDescriptorCmdletProvider permissionCmdletProvider = @@ -69,7 +69,7 @@ internal Collection GetSecurityDescriptor(string path, { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -110,7 +110,7 @@ internal void GetSecurityDescriptor( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } ProviderInfo provider = null; @@ -200,12 +200,12 @@ internal Collection SetSecurityDescriptor(string path, ObjectSecurity { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (securityDescriptor == null) { - throw PSTraceSource.NewArgumentNullException("securityDescriptor"); + throw PSTraceSource.NewArgumentNullException(nameof(securityDescriptor)); } CmdletProviderContext context = new CmdletProviderContext(this.ExecutionContext); @@ -247,12 +247,12 @@ internal void SetSecurityDescriptor( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (securityDescriptor == null) { - throw PSTraceSource.NewArgumentNullException("securityDescriptor"); + throw PSTraceSource.NewArgumentNullException(nameof(securityDescriptor)); } ProviderInfo provider = null; @@ -394,7 +394,7 @@ internal ObjectSecurity NewSecurityDescriptorFromPath( if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } ProviderInfo provider = null; @@ -419,7 +419,7 @@ internal ObjectSecurity NewSecurityDescriptorFromPath( } else { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } return sd; @@ -533,12 +533,12 @@ internal ObjectSecurity NewSecurityDescriptorOfType( if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } if (providerInstance == null) { - throw PSTraceSource.NewArgumentNullException("providerInstance"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInstance)); } // This just verifies that the provider supports the interface. diff --git a/src/System.Management.Automation/engine/SessionStateUtils.cs b/src/System.Management.Automation/engine/SessionStateUtils.cs index 4eaf5b23312..7c684abd1c3 100644 --- a/src/System.Management.Automation/engine/SessionStateUtils.cs +++ b/src/System.Management.Automation/engine/SessionStateUtils.cs @@ -153,7 +153,7 @@ internal static bool CollectionContainsValue(IEnumerable collection, object valu { if (collection == null) { - throw new ArgumentNullException("collection"); + throw new ArgumentNullException(nameof(collection)); } bool result = false; diff --git a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs index 9ad3b6eddcd..9b4028314b8 100644 --- a/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateVariableAPIs.cs @@ -54,7 +54,7 @@ internal PSVariable GetVariable(string name, CommandOrigin origin) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name, VariablePathFlags.Variable | VariablePathFlags.Unqualified); @@ -114,7 +114,7 @@ internal object GetVariableValue(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -287,7 +287,7 @@ internal object GetVariableValueFromProvider( if (variablePath == null) { - throw PSTraceSource.NewArgumentNullException("variablePath"); + throw PSTraceSource.NewArgumentNullException(nameof(variablePath)); } Dbg.Diagnostics.Assert( @@ -542,7 +542,7 @@ internal PSVariable GetVariableItem( if (variablePath == null) { - throw PSTraceSource.NewArgumentNullException("variablePath"); + throw PSTraceSource.NewArgumentNullException(nameof(variablePath)); } Dbg.Diagnostics.Assert(variablePath.IsVariable, "Can't get variable w/ non-variable path"); @@ -621,7 +621,7 @@ internal PSVariable GetVariableAtScope(string name, string scopeID) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -685,7 +685,7 @@ internal object GetVariableValueAtScope(string name, string scopeID) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -956,7 +956,7 @@ internal void SetVariableValue(string name, object newValue, CommandOrigin origi { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -1030,7 +1030,7 @@ internal object SetVariable(PSVariable variable, bool force, CommandOrigin origi { if (variable == null || string.IsNullOrEmpty(variable.Name)) { - throw PSTraceSource.NewArgumentException("variable"); + throw PSTraceSource.NewArgumentException(nameof(variable)); } VariablePath variablePath = new VariablePath(variable.Name, VariablePathFlags.Variable | VariablePathFlags.Unqualified); @@ -1138,7 +1138,7 @@ internal object SetVariable( object result = null; if (variablePath == null) { - throw PSTraceSource.NewArgumentNullException("variablePath"); + throw PSTraceSource.NewArgumentNullException(nameof(variablePath)); } CmdletProviderContext context = null; @@ -1405,7 +1405,7 @@ internal object SetVariableAtScope(PSVariable variable, string scopeID, bool for { if (variable == null || string.IsNullOrEmpty(variable.Name)) { - throw PSTraceSource.NewArgumentException("variable"); + throw PSTraceSource.NewArgumentException(nameof(variable)); } SessionStateScope lookupScope = GetScopeByID(scopeID); @@ -1441,7 +1441,7 @@ internal object NewVariable(PSVariable variable, bool force) { if (variable == null || string.IsNullOrEmpty(variable.Name)) { - throw PSTraceSource.NewArgumentException("variable"); + throw PSTraceSource.NewArgumentException(nameof(variable)); } return @@ -1485,7 +1485,7 @@ internal object NewVariableAtScope(PSVariable variable, string scopeID, bool for { if (variable == null || string.IsNullOrEmpty(variable.Name)) { - throw PSTraceSource.NewArgumentException("variable"); + throw PSTraceSource.NewArgumentException(nameof(variable)); } // The lookup scope from above is ignored and the scope is retrieved by @@ -1564,7 +1564,7 @@ internal void RemoveVariable(string name, bool force) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -1623,7 +1623,7 @@ internal void RemoveVariable(PSVariable variable, bool force) { if (variable == null) { - throw PSTraceSource.NewArgumentNullException("variable"); + throw PSTraceSource.NewArgumentNullException(nameof(variable)); } VariablePath variablePath = new VariablePath(variable.Name); @@ -1698,7 +1698,7 @@ internal void RemoveVariableAtScope(string name, string scopeID, bool force) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } VariablePath variablePath = new VariablePath(name); @@ -1780,7 +1780,7 @@ internal void RemoveVariableAtScope(PSVariable variable, string scopeID, bool fo { if (variable == null) { - throw PSTraceSource.NewArgumentNullException("variable"); + throw PSTraceSource.NewArgumentNullException(nameof(variable)); } VariablePath variablePath = new VariablePath(variable.Name); diff --git a/src/System.Management.Automation/engine/ShellVariable.cs b/src/System.Management.Automation/engine/ShellVariable.cs index 42cc174083b..fd2b8b34a6d 100644 --- a/src/System.Management.Automation/engine/ShellVariable.cs +++ b/src/System.Management.Automation/engine/ShellVariable.cs @@ -159,7 +159,7 @@ public PSVariable( { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } Name = name; diff --git a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs index 75e958693d9..9840aaa0555 100644 --- a/src/System.Management.Automation/engine/ThirdPartyAdapter.cs +++ b/src/System.Management.Automation/engine/ThirdPartyAdapter.cs @@ -298,7 +298,7 @@ public virtual Collection GetTypeNameHierarchy(object baseObject) { if (baseObject == null) { - throw new ArgumentNullException("baseObject"); + throw new ArgumentNullException(nameof(baseObject)); } Collection types = new Collection(); diff --git a/src/System.Management.Automation/engine/TypeMetadata.cs b/src/System.Management.Automation/engine/TypeMetadata.cs index 76f22734f8a..192042a3def 100644 --- a/src/System.Management.Automation/engine/TypeMetadata.cs +++ b/src/System.Management.Automation/engine/TypeMetadata.cs @@ -51,7 +51,7 @@ internal ParameterSetMetadata(ParameterSetMetadata other) { if (other == null) { - throw PSTraceSource.NewArgumentNullException("other"); + throw PSTraceSource.NewArgumentNullException(nameof(other)); } _helpMessage = other._helpMessage; @@ -411,7 +411,7 @@ public ParameterMetadata(string name, Type parameterType) { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } _name = name; @@ -431,7 +431,7 @@ public ParameterMetadata(ParameterMetadata other) { if (other == null) { - throw PSTraceSource.NewArgumentNullException("other"); + throw PSTraceSource.NewArgumentNullException(nameof(other)); } _isDynamic = other._isDynamic; @@ -625,7 +625,7 @@ public static Dictionary GetParameterMetadata(Type ty { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } CommandMetadata cmdMetaData = new CommandMetadata(type); @@ -1165,7 +1165,7 @@ internal static InternalParameterMetadata Get(Type type, ExecutionContext contex { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } InternalParameterMetadata result; @@ -1208,7 +1208,7 @@ internal InternalParameterMetadata(RuntimeDefinedParameterDictionary runtimeDefi { if (runtimeDefinedParameters == null) { - throw PSTraceSource.NewArgumentNullException("runtimeDefinedParameters"); + throw PSTraceSource.NewArgumentNullException(nameof(runtimeDefinedParameters)); } ConstructCompiledParametersUsingRuntimeDefinedParameters(runtimeDefinedParameters, processingDynamicParameters, checkNames); @@ -1236,7 +1236,7 @@ internal InternalParameterMetadata(Type type, bool processingDynamicParameters) { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } _type = type; diff --git a/src/System.Management.Automation/engine/TypeTable.cs b/src/System.Management.Automation/engine/TypeTable.cs index c6d52a7ff1b..0f2fab28cc0 100644 --- a/src/System.Management.Automation/engine/TypeTable.cs +++ b/src/System.Management.Automation/engine/TypeTable.cs @@ -1606,7 +1606,7 @@ protected override void SetItem(int index, string item) { if (string.IsNullOrEmpty(item)) { - throw PSTraceSource.NewArgumentException("item"); + throw PSTraceSource.NewArgumentException(nameof(item)); } base.SetItem(index, item); @@ -1623,7 +1623,7 @@ protected override void InsertItem(int index, string item) { if (string.IsNullOrEmpty(item)) { - throw PSTraceSource.NewArgumentException("item"); + throw PSTraceSource.NewArgumentException(nameof(item)); } base.InsertItem(index, item); @@ -1672,7 +1672,7 @@ public ConsolidatedString(IEnumerable strings) string str = this[i]; if (string.IsNullOrEmpty(str)) { - throw PSTraceSource.NewArgumentException("strings"); + throw PSTraceSource.NewArgumentException(nameof(strings)); } } @@ -1816,7 +1816,7 @@ protected TypeTableLoadException(SerializationInfo info, StreamingContext contex { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } int errorCount = info.GetInt32("ErrorCount"); @@ -1843,7 +1843,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -1912,7 +1912,7 @@ private TypeData() public TypeData(string typeName) : this() { if (string.IsNullOrWhiteSpace(typeName)) - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); this.TypeName = typeName; } @@ -1930,7 +1930,7 @@ public TypeData(Type type) : this() { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } this.TypeName = type.FullName; @@ -2367,7 +2367,7 @@ internal TypeMemberData(string name) { if (string.IsNullOrWhiteSpace(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } Name = name; @@ -2716,7 +2716,7 @@ public PropertySetData(IEnumerable referencedProperties) { if (referencedProperties == null) { - throw PSTraceSource.NewArgumentNullException("referencedProperties"); + throw PSTraceSource.NewArgumentNullException(nameof(referencedProperties)); } ReferencedProperties = new Collection(new List(referencedProperties)); @@ -3147,7 +3147,7 @@ private static bool CheckStandardMembers(ConcurrentBag errors, string ty TypesXmlStrings.MemberMustBePresent, PropertySerializationSet, SerializationMethodNode, - SerializationMethod.SpecificProperties.ToString(), + nameof(SerializationMethod.SpecificProperties), InheritPropertySerializationSet, "false"); serializationSettingsOk = false; @@ -3922,7 +3922,7 @@ internal TypeTable(IEnumerable typeFiles, AuthorizationManager authoriza { if (typeFiles == null) { - throw PSTraceSource.NewArgumentNullException("typeFiles"); + throw PSTraceSource.NewArgumentNullException(nameof(typeFiles)); } ConcurrentBag errors = new ConcurrentBag(); @@ -4668,7 +4668,7 @@ private void UpdateWithModuleContents( public void AddType(TypeData typeData) { if (typeData == null) - throw PSTraceSource.NewArgumentNullException("typeData"); + throw PSTraceSource.NewArgumentNullException(nameof(typeData)); Dbg.Assert(isShared, "This method should only be called by the developer user. It should not be used internally."); @@ -4695,7 +4695,7 @@ public void RemoveType(string typeName) { if (string.IsNullOrEmpty(typeName)) { - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); } Dbg.Assert(isShared, "This method should only be called by the developer user. It should not be used internally."); @@ -4741,12 +4741,12 @@ internal void Update( { if (filePath == null) { - throw new ArgumentNullException("filePath"); + throw new ArgumentNullException(nameof(filePath)); } if (errors == null) { - throw new ArgumentNullException("errors"); + throw new ArgumentNullException(nameof(errors)); } if (isShared) @@ -4818,9 +4818,9 @@ internal void Update( bool isRemove) { if (type == null) - throw new ArgumentNullException("type"); + throw new ArgumentNullException(nameof(type)); if (errors == null) - throw new ArgumentNullException("errors"); + throw new ArgumentNullException(nameof(errors)); if (isShared) { diff --git a/src/System.Management.Automation/engine/UserFeedbackParameters.cs b/src/System.Management.Automation/engine/UserFeedbackParameters.cs index e74e309b3b1..feb1464d922 100644 --- a/src/System.Management.Automation/engine/UserFeedbackParameters.cs +++ b/src/System.Management.Automation/engine/UserFeedbackParameters.cs @@ -18,7 +18,7 @@ internal PagingParameters(MshCommandRuntime commandRuntime) { if (commandRuntime == null) { - throw PSTraceSource.NewArgumentNullException("commandRuntime"); + throw PSTraceSource.NewArgumentNullException(nameof(commandRuntime)); } commandRuntime.PagingParameters = this; @@ -116,7 +116,7 @@ internal ShouldProcessParameters(MshCommandRuntime commandRuntime) { if (commandRuntime == null) { - throw PSTraceSource.NewArgumentNullException("commandRuntime"); + throw PSTraceSource.NewArgumentNullException(nameof(commandRuntime)); } _commandRuntime = commandRuntime; diff --git a/src/System.Management.Automation/engine/VariableAttributeCollection.cs b/src/System.Management.Automation/engine/VariableAttributeCollection.cs index 918b040a0f6..f41bb3380ba 100644 --- a/src/System.Management.Automation/engine/VariableAttributeCollection.cs +++ b/src/System.Management.Automation/engine/VariableAttributeCollection.cs @@ -30,7 +30,7 @@ internal PSVariableAttributeCollection(PSVariable variable) { if (variable == null) { - throw PSTraceSource.NewArgumentNullException("variable"); + throw PSTraceSource.NewArgumentNullException(nameof(variable)); } _variable = variable; diff --git a/src/System.Management.Automation/engine/VariableInterfaces.cs b/src/System.Management.Automation/engine/VariableInterfaces.cs index 60d23f9e12a..90411860b6d 100644 --- a/src/System.Management.Automation/engine/VariableInterfaces.cs +++ b/src/System.Management.Automation/engine/VariableInterfaces.cs @@ -35,7 +35,7 @@ internal PSVariableIntrinsics(SessionStateInternal sessionState) { if (sessionState == null) { - throw PSTraceSource.NewArgumentException("sessionState"); + throw PSTraceSource.NewArgumentException(nameof(sessionState)); } _sessionState = sessionState; diff --git a/src/System.Management.Automation/engine/VariablePath.cs b/src/System.Management.Automation/engine/VariablePath.cs index 17cf9b95fac..0e33ae620c5 100644 --- a/src/System.Management.Automation/engine/VariablePath.cs +++ b/src/System.Management.Automation/engine/VariablePath.cs @@ -83,7 +83,7 @@ internal VariablePath(string path, VariablePathFlags knownFlags) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } _userPath = path; diff --git a/src/System.Management.Automation/engine/cmdlet.cs b/src/System.Management.Automation/engine/cmdlet.cs index 4a330b34ed0..00890bb31a4 100644 --- a/src/System.Management.Automation/engine/cmdlet.cs +++ b/src/System.Management.Automation/engine/cmdlet.cs @@ -252,10 +252,10 @@ public virtual string GetResourceString(string baseName, string resourceId) using (PSTransactionManager.GetEngineProtectionScope()) { if (string.IsNullOrEmpty(baseName)) - throw PSTraceSource.NewArgumentNullException("baseName"); + throw PSTraceSource.NewArgumentNullException(nameof(baseName)); if (string.IsNullOrEmpty(resourceId)) - throw PSTraceSource.NewArgumentNullException("resourceId"); + throw PSTraceSource.NewArgumentNullException(nameof(resourceId)); ResourceManager manager = ResourceManagerCache.GetResourceManager(this.GetType().Assembly, baseName); string retValue = null; @@ -266,12 +266,12 @@ public virtual string GetResourceString(string baseName, string resourceId) } catch (MissingManifestResourceException) { - throw PSTraceSource.NewArgumentException("baseName", GetErrorText.ResourceBaseNameFailure, baseName); + throw PSTraceSource.NewArgumentException(nameof(baseName), GetErrorText.ResourceBaseNameFailure, baseName); } if (retValue == null) { - throw PSTraceSource.NewArgumentException("resourceId", GetErrorText.ResourceIdFailure, resourceId); + throw PSTraceSource.NewArgumentException(nameof(resourceId), GetErrorText.ResourceIdFailure, resourceId); } return retValue; @@ -1719,7 +1719,7 @@ public void ThrowTerminatingError(ErrorRecord errorRecord) using (PSTransactionManager.GetEngineProtectionScope()) { if (errorRecord == null) - throw new ArgumentNullException("errorRecord"); + throw new ArgumentNullException(nameof(errorRecord)); if (commandRuntime != null) { diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index ab715b053ff..0bc4595c390 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -248,7 +248,7 @@ public bool UseDefaultProcessing /// public StartRunspaceDebugProcessingEventArgs(Runspace runspace) { - if (runspace == null) { throw new PSArgumentNullException("runspace"); } + if (runspace == null) { throw new PSArgumentNullException(nameof(runspace)); } Runspace = runspace; } @@ -274,7 +274,7 @@ public Runspace Runspace /// public ProcessRunspaceDebugEndEventArgs(Runspace runspace) { - if (runspace == null) { throw new PSArgumentNullException("runspace"); } + if (runspace == null) { throw new PSArgumentNullException(nameof(runspace)); } Runspace = runspace; } @@ -525,7 +525,7 @@ protected bool IsDebuggerBreakpointUpdatedEventSubscribed() /// protected void RaiseStartRunspaceDebugProcessingEvent(StartRunspaceDebugProcessingEventArgs args) { - if (args == null) { throw new PSArgumentNullException("args"); } + if (args == null) { throw new PSArgumentNullException(nameof(args)); } StartRunspaceDebugProcessing.SafeInvoke(this, args); } @@ -533,7 +533,7 @@ protected void RaiseStartRunspaceDebugProcessingEvent(StartRunspaceDebugProcessi /// protected void RaiseRunspaceProcessingCompletedEvent(ProcessRunspaceDebugEndEventArgs args) { - if (args == null) { throw new PSArgumentNullException("args"); } + if (args == null) { throw new PSArgumentNullException(nameof(args)); } RunspaceDebugProcessingCompleted.SafeInvoke(this, args); } @@ -2306,12 +2306,12 @@ public override DebuggerCommandResults ProcessCommand(PSCommand command, PSDataC { if (command == null) { - throw new PSArgumentNullException("command"); + throw new PSArgumentNullException(nameof(command)); } if (output == null) { - throw new PSArgumentNullException("output"); + throw new PSArgumentNullException(nameof(output)); } if (!DebuggerStopped) @@ -2915,7 +2915,7 @@ private Debugger GetRunspaceDebugger(int runspaceId) /// internal override void DebugJob(Job job, bool breakAll) { - if (job == null) { throw new PSArgumentNullException("job"); } + if (job == null) { throw new PSArgumentNullException(nameof(job)); } lock (_syncObject) { @@ -2989,7 +2989,7 @@ private bool TryAddDebugJob(Job job, bool breakAll) internal override void StopDebugJob(Job job) { // Parameter validation. - if (job == null) { throw new PSArgumentNullException("job"); } + if (job == null) { throw new PSArgumentNullException(nameof(job)); } SetInternalDebugMode(InternalDebugMode.Disabled); @@ -3036,7 +3036,7 @@ internal override void DebugRunspace(Runspace runspace, bool breakAll) { if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } if (runspace.RunspaceStateInfo.State != RunspaceState.Opened) @@ -3079,7 +3079,7 @@ internal override void DebugRunspace(Runspace runspace, bool breakAll) /// Runspace. internal override void StopDebugRunspace(Runspace runspace) { - if (runspace == null) { throw new PSArgumentNullException("runspace"); } + if (runspace == null) { throw new PSArgumentNullException(nameof(runspace)); } SetInternalDebugMode(InternalDebugMode.Disabled); @@ -4225,7 +4225,7 @@ public NestedRunspaceDebugger( { if (runspace == null || runspace.Debugger == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } _runspace = runspace; @@ -4725,7 +4725,7 @@ public EmbeddedRunspaceDebugger( { if (rootDebugger == null) { - throw new PSArgumentNullException("rootDebugger"); + throw new PSArgumentNullException(nameof(rootDebugger)); } _command = command; @@ -5474,7 +5474,7 @@ public PSDebugContext(InvocationInfo invocationInfo, List breakpoint { if (breakpoints == null) { - throw new PSArgumentNullException("breakpoints"); + throw new PSArgumentNullException(nameof(breakpoints)); } this.InvocationInfo = invocationInfo; @@ -5526,7 +5526,7 @@ internal CallStackFrame(FunctionContext functionContext, InvocationInfo invocati { if (invocationInfo == null) { - throw new PSArgumentNullException("invocationInfo"); + throw new PSArgumentNullException(nameof(invocationInfo)); } if (functionContext != null) @@ -5682,7 +5682,7 @@ public static bool ShouldAddCommandToHistory(string command) { if (command == null) { - throw new PSArgumentNullException("command"); + throw new PSArgumentNullException(nameof(command)); } lock (s_noHistoryCommandNames) @@ -5700,12 +5700,12 @@ public static void StartMonitoringRunspace(Debugger debugger, PSMonitorRunspaceI { if (debugger == null) { - throw new PSArgumentNullException("debugger"); + throw new PSArgumentNullException(nameof(debugger)); } if (runspaceInfo == null) { - throw new PSArgumentNullException("runspaceInfo"); + throw new PSArgumentNullException(nameof(runspaceInfo)); } debugger.StartMonitoringRunspace(runspaceInfo); @@ -5720,12 +5720,12 @@ public static void EndMonitoringRunspace(Debugger debugger, PSMonitorRunspaceInf { if (debugger == null) { - throw new PSArgumentNullException("debugger"); + throw new PSArgumentNullException(nameof(debugger)); } if (runspaceInfo == null) { - throw new PSArgumentNullException("runspaceInfo"); + throw new PSArgumentNullException(nameof(runspaceInfo)); } debugger.EndMonitoringRunspace(runspaceInfo); @@ -5791,7 +5791,7 @@ protected PSMonitorRunspaceInfo( { if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } Runspace = runspace; diff --git a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs index e55f7618df6..8a0101ae802 100644 --- a/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs +++ b/src/System.Management.Automation/engine/hostifaces/AsyncResult.cs @@ -241,7 +241,7 @@ internal bool InvokeCallbackOnThread(WaitCallback callback, object state) { if (callback == null) { - throw new PSArgumentNullException("callback"); + throw new PSArgumentNullException(nameof(callback)); } _invokeCallback = callback; diff --git a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs index ba3a8c13b66..9fca84d4a33 100644 --- a/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/ChoiceDescription.cs @@ -38,7 +38,7 @@ class ChoiceDescription if (string.IsNullOrEmpty(label)) { // "label" is not localizable - throw PSTraceSource.NewArgumentException("label", DescriptionsStrings.NullOrEmptyErrorTemplate, "label"); + throw PSTraceSource.NewArgumentException(nameof(label), DescriptionsStrings.NullOrEmptyErrorTemplate, "label"); } this.label = label; @@ -68,13 +68,13 @@ class ChoiceDescription if (string.IsNullOrEmpty(label)) { // "label" is not localizable - throw PSTraceSource.NewArgumentException("label", DescriptionsStrings.NullOrEmptyErrorTemplate, "label"); + throw PSTraceSource.NewArgumentException(nameof(label), DescriptionsStrings.NullOrEmptyErrorTemplate, "label"); } if (helpMessage == null) { // "helpMessage" is not localizable - throw PSTraceSource.NewArgumentNullException("helpMessage"); + throw PSTraceSource.NewArgumentNullException(nameof(helpMessage)); } this.label = label; diff --git a/src/System.Management.Automation/engine/hostifaces/Command.cs b/src/System.Management.Automation/engine/hostifaces/Command.cs index 08f323d809a..b98e447563b 100644 --- a/src/System.Management.Automation/engine/hostifaces/Command.cs +++ b/src/System.Management.Automation/engine/hostifaces/Command.cs @@ -52,7 +52,7 @@ public Command(string command, bool isScript, bool useLocalScope) IsEndOfStatement = false; if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } CommandText = command; @@ -65,7 +65,7 @@ internal Command(string command, bool isScript, bool? useLocalScope) IsEndOfStatement = false; if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } CommandText = command; @@ -318,17 +318,17 @@ public void MergeMyResults(PipelineResultTypes myResult, PipelineResultTypes toR // Validate parameters. if (myResult == PipelineResultTypes.None || myResult == PipelineResultTypes.Output) { - throw PSTraceSource.NewArgumentException("myResult", RunspaceStrings.InvalidMyResultError); + throw PSTraceSource.NewArgumentException(nameof(myResult), RunspaceStrings.InvalidMyResultError); } if (myResult == PipelineResultTypes.Error && toResult != PipelineResultTypes.Output) { - throw PSTraceSource.NewArgumentException("toResult", RunspaceStrings.InvalidValueToResultError); + throw PSTraceSource.NewArgumentException(nameof(toResult), RunspaceStrings.InvalidValueToResultError); } if (toResult != PipelineResultTypes.Output && toResult != PipelineResultTypes.Null) { - throw PSTraceSource.NewArgumentException("toResult", RunspaceStrings.InvalidValueToResult); + throw PSTraceSource.NewArgumentException(nameof(toResult), RunspaceStrings.InvalidValueToResult); } // For V2 backwards compatibility. @@ -518,8 +518,8 @@ CommandOrigin origin case PSLanguageMode.NoLanguage: string message = StringUtil.Format(RunspaceStrings.UseLocalScopeNotAllowed, "UseLocalScope", - PSLanguageMode.RestrictedLanguage.ToString(), - PSLanguageMode.NoLanguage.ToString()); + nameof(PSLanguageMode.RestrictedLanguage), + nameof(PSLanguageMode.NoLanguage)); throw new RuntimeException(message); case PSLanguageMode.FullLanguage: // Interactive script commands are permitted in this mode... @@ -592,7 +592,7 @@ internal static Command FromPSObjectForRemoting(PSObject commandAsPSObject) { if (commandAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("commandAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(commandAsPSObject)); } string commandText = RemotingDecoder.GetPropertyValue(commandAsPSObject, RemoteDataNameStrings.CommandText); diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index 89d04fa515b..fef195ac1a2 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -333,7 +333,7 @@ internal RunspaceStateEventArgs(RunspaceStateInfo runspaceStateInfo) { if (runspaceStateInfo == null) { - throw PSTraceSource.NewArgumentNullException("runspaceStateInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(runspaceStateInfo)); } RunspaceStateInfo = runspaceStateInfo; @@ -1700,7 +1700,7 @@ public virtual void SetVariable(string name, object value) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } _runspace.SetVariable(name, value); @@ -1728,7 +1728,7 @@ public virtual object GetVariable(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (name.Equals(string.Empty)) diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs index dd3544aa406..bd0f7943b54 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionBase.cs @@ -40,7 +40,7 @@ protected RunspaceBase(PSHost host) { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } InitialSessionState = InitialSessionState.CreateDefault(); @@ -66,12 +66,12 @@ protected RunspaceBase(PSHost host, InitialSessionState initialSessionState) { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } Host = host; @@ -104,12 +104,12 @@ protected RunspaceBase(PSHost host, InitialSessionState initialSessionState, boo { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } Host = host; @@ -535,7 +535,7 @@ public override Pipeline CreatePipeline(string command) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, false, false); @@ -556,7 +556,7 @@ public override Pipeline CreatePipeline(string command, bool addToHistory) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, addToHistory, false); @@ -590,7 +590,7 @@ public override Pipeline CreateNestedPipeline(string command, bool addToHistory) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, addToHistory, true); diff --git a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs index b42d8d7198a..2021ae6abf9 100644 --- a/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs +++ b/src/System.Management.Automation/engine/hostifaces/ConnectionFactory.cs @@ -62,7 +62,7 @@ public static Runspace CreateRunspace(PSHost host) { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } return new LocalRunspace(host, InitialSessionState.CreateDefault()); @@ -85,7 +85,7 @@ public static Runspace CreateRunspace(InitialSessionState initialSessionState) { if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } PSHost host = new DefaultHost(CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture); @@ -116,12 +116,12 @@ public static Runspace CreateRunspace(PSHost host, InitialSessionState initialSe { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } return new LocalRunspace(host, initialSessionState); @@ -150,12 +150,12 @@ internal static Runspace CreateRunspaceFromSessionStateNoClone(PSHost host, Init { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } return new LocalRunspace(host, initialSessionState, true); diff --git a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs index 1556d10aa55..545440a1574 100644 --- a/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs +++ b/src/System.Management.Automation/engine/hostifaces/FieldDescription.cs @@ -43,7 +43,7 @@ public class if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentException("name", DescriptionsStrings.NullOrEmptyErrorTemplate, "name"); + throw PSTraceSource.NewArgumentException(nameof(name), DescriptionsStrings.NullOrEmptyErrorTemplate, "name"); } this.name = name; @@ -76,7 +76,7 @@ public string Name { if (parameterType == null) { - throw PSTraceSource.NewArgumentNullException("parameterType"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterType)); } SetParameterTypeName(parameterType.Name); @@ -319,7 +319,7 @@ public string Name { if (string.IsNullOrEmpty(nameOfType)) { - throw PSTraceSource.NewArgumentException("nameOfType", DescriptionsStrings.NullOrEmptyErrorTemplate, "nameOfType"); + throw PSTraceSource.NewArgumentException(nameof(nameOfType), DescriptionsStrings.NullOrEmptyErrorTemplate, "nameOfType"); } parameterTypeName = nameOfType; @@ -339,7 +339,7 @@ public string Name { if (string.IsNullOrEmpty(fullNameOfType)) { - throw PSTraceSource.NewArgumentException("fullNameOfType", DescriptionsStrings.NullOrEmptyErrorTemplate, "fullNameOfType"); + throw PSTraceSource.NewArgumentException(nameof(fullNameOfType), DescriptionsStrings.NullOrEmptyErrorTemplate, "fullNameOfType"); } parameterTypeFullName = fullNameOfType; @@ -359,7 +359,7 @@ public string Name { if (string.IsNullOrEmpty(fullNameOfAssembly)) { - throw PSTraceSource.NewArgumentException("fullNameOfAssembly", DescriptionsStrings.NullOrEmptyErrorTemplate, "fullNameOfAssembly"); + throw PSTraceSource.NewArgumentException(nameof(fullNameOfAssembly), DescriptionsStrings.NullOrEmptyErrorTemplate, "fullNameOfAssembly"); } parameterAssemblyFullName = fullNameOfAssembly; diff --git a/src/System.Management.Automation/engine/hostifaces/History.cs b/src/System.Management.Automation/engine/hostifaces/History.cs index b6138df546c..e22aa0804eb 100644 --- a/src/System.Management.Automation/engine/hostifaces/History.cs +++ b/src/System.Management.Automation/engine/hostifaces/History.cs @@ -285,12 +285,12 @@ internal HistoryInfo[] GetEntries(long id, long count, SwitchParameter newest) if (count < -1) { - throw PSTraceSource.NewArgumentOutOfRangeException("count", count); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(count), count); } if (newest.ToString() == null) { - throw PSTraceSource.NewArgumentNullException("newest"); + throw PSTraceSource.NewArgumentNullException(nameof(newest)); } if (count == -1 || count > _countEntriesAdded || count > _countEntriesInBuffer) @@ -467,12 +467,12 @@ internal HistoryInfo[] GetEntries(WildcardPattern wildcardpattern, long count, S { if (count < -1) { - throw PSTraceSource.NewArgumentOutOfRangeException("count", count); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(count), count); } if (newest.ToString() == null) { - throw PSTraceSource.NewArgumentNullException("newest"); + throw PSTraceSource.NewArgumentNullException(nameof(newest)); } if (count > _countEntriesAdded || count == -1) @@ -560,7 +560,7 @@ internal void ClearEntry(long id) { if (id < 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("id", id); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(id), id); } // no entries are present to clear if (_countEntriesInBuffer == 0) @@ -610,7 +610,7 @@ private long Add(HistoryInfo entry) { if (entry == null) { - throw PSTraceSource.NewArgumentNullException("entry"); + throw PSTraceSource.NewArgumentNullException(nameof(entry)); } _buffer[GetIndexForNewEntry()] = entry; @@ -638,7 +638,7 @@ private HistoryInfo CoreGetEntry(long id) { if (id <= 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("id", id); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(id), id); } if (_countEntriesInBuffer == 0) diff --git a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs index 66f0d841bfb..ecc4780c284 100644 --- a/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs +++ b/src/System.Management.Automation/engine/hostifaces/HostUtilities.cs @@ -800,12 +800,12 @@ public static Collection InvokeOnRunspace(PSCommand command, Runspace { if (command == null) { - throw new PSArgumentNullException("command"); + throw new PSArgumentNullException(nameof(command)); } if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } if ((runspace.Debugger != null) && runspace.Debugger.InBreakpoint) diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index f0185900bbb..1e61ca236bd 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -27,7 +27,7 @@ class InternalHostUserInterface : PSHostUserInterface, IHostUISupportsMultipleCh Dbg.Assert(parentHost != null, "parent may not be null"); if (parentHost == null) { - throw PSTraceSource.NewArgumentNullException("parentHost"); + throw PSTraceSource.NewArgumentNullException(nameof(parentHost)); } _parent = parentHost; @@ -414,7 +414,7 @@ internal void WriteDebugInfoBuffers(DebugRecord record) throw ense; default: Dbg.Assert(false, "all preferences should be checked"); - throw PSTraceSource.NewArgumentException("preference", + throw PSTraceSource.NewArgumentException(nameof(preference), InternalHostUserInterfaceStrings.UnsupportedPreferenceError, preference); // break; } @@ -546,7 +546,7 @@ public override { if (record == null) { - throw PSTraceSource.NewArgumentNullException("record"); + throw PSTraceSource.NewArgumentNullException(nameof(record)); } // Write to Information Buffers @@ -732,12 +732,12 @@ public override { if (descriptions == null) { - throw PSTraceSource.NewArgumentNullException("descriptions"); + throw PSTraceSource.NewArgumentNullException(nameof(descriptions)); } if (descriptions.Count < 1) { - throw PSTraceSource.NewArgumentException("descriptions", InternalHostUserInterfaceStrings.PromptEmptyDescriptionsError, "descriptions"); + throw PSTraceSource.NewArgumentException(nameof(descriptions), InternalHostUserInterfaceStrings.PromptEmptyDescriptionsError, "descriptions"); } if (_externalUI == null) @@ -898,12 +898,12 @@ private Collection EmulatePromptForMultipleChoice(string caption, if (choices == null) { - throw PSTraceSource.NewArgumentNullException("choices"); + throw PSTraceSource.NewArgumentNullException(nameof(choices)); } if (choices.Count == 0) { - throw PSTraceSource.NewArgumentException("choices", + throw PSTraceSource.NewArgumentException(nameof(choices), InternalHostUserInterfaceStrings.EmptyChoicesError, "choices"); } diff --git a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs index bc25d928ef3..191a5309cc7 100644 --- a/src/System.Management.Automation/engine/hostifaces/ListModifier.cs +++ b/src/System.Management.Automation/engine/hostifaces/ListModifier.cs @@ -88,7 +88,7 @@ public PSListModifier(Hashtable hash) { if (hash == null) { - throw PSTraceSource.NewArgumentNullException("hash"); + throw PSTraceSource.NewArgumentNullException(nameof(hash)); } _itemsToAdd = new Collection(); @@ -106,7 +106,7 @@ public PSListModifier(Hashtable hash) if (!isAdd && !isRemove && !isReplace) { - throw PSTraceSource.NewArgumentException("hash", PSListModifierStrings.ListModifierDisallowedKey, key); + throw PSTraceSource.NewArgumentException(nameof(hash), PSListModifierStrings.ListModifierDisallowedKey, key); } Collection collection; @@ -138,7 +138,7 @@ public PSListModifier(Hashtable hash) } else { - throw PSTraceSource.NewArgumentException("hash", PSListModifierStrings.ListModifierDisallowedKey, entry.Key); + throw PSTraceSource.NewArgumentException(nameof(hash), PSListModifierStrings.ListModifierDisallowedKey, entry.Key); } } } @@ -181,7 +181,7 @@ public void ApplyTo(IList collectionToUpdate) { if (collectionToUpdate == null) { - throw PSTraceSource.NewArgumentNullException("collectionToUpdate"); + throw PSTraceSource.NewArgumentNullException(nameof(collectionToUpdate)); } if (_replacementItems.Count > 0) @@ -214,7 +214,7 @@ public void ApplyTo(object collectionToUpdate) { if (collectionToUpdate == null) { - throw new ArgumentNullException("collectionToUpdate"); + throw new ArgumentNullException(nameof(collectionToUpdate)); } collectionToUpdate = PSObject.Base(collectionToUpdate); diff --git a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs index f924985fb5c..e63fc85e614 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalConnection.cs @@ -1592,7 +1592,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index 48ab16c579a..da0877747de 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs @@ -1341,7 +1341,7 @@ internal void Push(PipelineProcessor item) { if (item == null) { - throw PSTraceSource.NewArgumentNullException("item"); + throw PSTraceSource.NewArgumentNullException(nameof(item)); } lock (_syncRoot) diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs index e107054326e..79f4bcff66a 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostRawUserInterface.cs @@ -794,13 +794,13 @@ public int Bottom if (right < left) { // "right" and "left" are not localizable - throw PSTraceSource.NewArgumentException("right", MshHostRawUserInterfaceStrings.LessThanErrorTemplate, "right", "left"); + throw PSTraceSource.NewArgumentException(nameof(right), MshHostRawUserInterfaceStrings.LessThanErrorTemplate, "right", "left"); } if (bottom < top) { // "bottom" and "top" are not localizable - throw PSTraceSource.NewArgumentException("bottom", MshHostRawUserInterfaceStrings.LessThanErrorTemplate, "bottom", "top"); + throw PSTraceSource.NewArgumentException(nameof(bottom), MshHostRawUserInterfaceStrings.LessThanErrorTemplate, "bottom", "top"); } this.left = left; @@ -1681,7 +1681,7 @@ int offset { if (source == null) { - throw PSTraceSource.NewArgumentNullException("source"); + throw PSTraceSource.NewArgumentNullException(nameof(source)); } // this implementation is inefficient @@ -1720,7 +1720,7 @@ string source { if (source == null) { - throw PSTraceSource.NewArgumentNullException("source"); + throw PSTraceSource.NewArgumentNullException(nameof(source)); } return source.Length; @@ -1807,7 +1807,7 @@ char source if (contents == null) { - throw PSTraceSource.NewArgumentNullException("contents"); + throw PSTraceSource.NewArgumentNullException(nameof(contents)); } byte[][] charLengths = new byte[contents.Length][]; @@ -1835,7 +1835,7 @@ char source if (maxStringLengthInBufferCells <= 0) { - throw PSTraceSource.NewArgumentException("contents", MshHostRawUserInterfaceStrings.AllNullOrEmptyStringsErrorTemplate); + throw PSTraceSource.NewArgumentException(nameof(contents), MshHostRawUserInterfaceStrings.AllNullOrEmptyStringsErrorTemplate); } BufferCell[,] results = new BufferCell[contents.Length, maxStringLengthInBufferCells]; @@ -1920,14 +1920,14 @@ char source if (width <= 0) { // "width" is not localizable - throw PSTraceSource.NewArgumentOutOfRangeException("width", width, + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(width), width, MshHostRawUserInterfaceStrings.NonPositiveNumberErrorTemplate, "width"); } if (height <= 0) { // "height" is not localizable - throw PSTraceSource.NewArgumentOutOfRangeException("height", height, + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(height), height, MshHostRawUserInterfaceStrings.NonPositiveNumberErrorTemplate, "height"); } diff --git a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs index 9da8f7c9081..781e53eaf51 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSCommand.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSCommand.cs @@ -133,7 +133,7 @@ public PSCommand AddCommand(string cmdlet, bool useLocalScope) { if (cmdlet == null) { - throw PSTraceSource.NewArgumentNullException("cmdlet"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdlet)); } if (_owner != null) @@ -175,7 +175,7 @@ public PSCommand AddScript(string script) { if (script == null) { - throw PSTraceSource.NewArgumentNullException("script"); + throw PSTraceSource.NewArgumentNullException(nameof(script)); } if (_owner != null) @@ -220,7 +220,7 @@ public PSCommand AddScript(string script, bool useLocalScope) { if (script == null) { - throw PSTraceSource.NewArgumentNullException("script"); + throw PSTraceSource.NewArgumentNullException(nameof(script)); } if (_owner != null) @@ -258,7 +258,7 @@ public PSCommand AddCommand(Command command) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } if (_owner != null) diff --git a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs index 5d6fc8578ca..51d74dcc269 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSDataCollection.cs @@ -333,14 +333,14 @@ protected PSDataCollection(SerializationInfo info, StreamingContext context) { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } IList listToUse = info.GetValue("Data", typeof(IList)) as IList; if (listToUse == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } _data = listToUse; @@ -664,7 +664,7 @@ public T this[int index] { if ((index < 0) || (index >= _data.Count)) { - throw PSTraceSource.NewArgumentOutOfRangeException("index", index, + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(index), index, PSDataBufferStrings.IndexOutOfRange, 0, _data.Count - 1); } @@ -738,7 +738,7 @@ public void RemoveAt(int index) { if ((index < 0) || (index >= _data.Count)) { - throw PSTraceSource.NewArgumentOutOfRangeException("index", index, + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(index), index, PSDataBufferStrings.IndexOutOfRange, 0, _data.Count - 1); } @@ -1299,7 +1299,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } info.AddValue("Data", _data); @@ -1514,7 +1514,7 @@ internal void InternalAddRange(Guid psInstanceId, ICollection collection) { if (collection == null) { - throw PSTraceSource.NewArgumentNullException("collection"); + throw PSTraceSource.NewArgumentNullException(nameof(collection)); } int index = -1; @@ -1631,12 +1631,12 @@ private static void VerifyValueType(object value) { if (typeof(T).IsValueType) { - throw PSTraceSource.NewArgumentNullException("value", PSDataBufferStrings.ValueNullReference); + throw PSTraceSource.NewArgumentNullException(nameof(value), PSDataBufferStrings.ValueNullReference); } } else if (!(value is T)) { - throw PSTraceSource.NewArgumentException("value", PSDataBufferStrings.CannotConvertToGenericType, + throw PSTraceSource.NewArgumentException(nameof(value), PSDataBufferStrings.CannotConvertToGenericType, value.GetType().FullName, typeof(T).FullName); } diff --git a/src/System.Management.Automation/engine/hostifaces/PSTask.cs b/src/System.Management.Automation/engine/hostifaces/PSTask.cs index fe42bd55d24..6bf8a74b839 100644 --- a/src/System.Management.Automation/engine/hostifaces/PSTask.cs +++ b/src/System.Management.Automation/engine/hostifaces/PSTask.cs @@ -1191,7 +1191,7 @@ public PSTaskChildDebugger( { if (debugger == null) { - throw new PSArgumentNullException("debugger"); + throw new PSArgumentNullException(nameof(debugger)); } _wrappedDebugger = debugger; diff --git a/src/System.Management.Automation/engine/hostifaces/Parameter.cs b/src/System.Management.Automation/engine/hostifaces/Parameter.cs index 3ffb3d22f97..3f7d072318a 100644 --- a/src/System.Management.Automation/engine/hostifaces/Parameter.cs +++ b/src/System.Management.Automation/engine/hostifaces/Parameter.cs @@ -33,7 +33,7 @@ public CommandParameter(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } } @@ -51,7 +51,7 @@ public CommandParameter(string name, object value) { if (string.IsNullOrWhiteSpace(name)) { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } Name = name; @@ -90,7 +90,7 @@ internal static CommandParameter FromCommandParameterInternal(CommandParameterIn { if (internalParameter == null) { - throw PSTraceSource.NewArgumentNullException("internalParameter"); + throw PSTraceSource.NewArgumentNullException(nameof(internalParameter)); } // we want the name to preserve 1) dashes, 2) colons, 3) followed-by-space information @@ -125,7 +125,7 @@ internal static CommandParameterInternal ToCommandParameterInternal(CommandParam { if (publicParameter == null) { - throw PSTraceSource.NewArgumentNullException("publicParameter"); + throw PSTraceSource.NewArgumentNullException(nameof(publicParameter)); } string name = publicParameter.Name; @@ -211,7 +211,7 @@ internal static CommandParameter FromPSObjectForRemoting(PSObject parameterAsPSO { if (parameterAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("parameterAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(parameterAsPSObject)); } string name = RemotingDecoder.GetPropertyValue(parameterAsPSObject, RemoteDataNameStrings.ParameterName); diff --git a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs b/src/System.Management.Automation/engine/hostifaces/Pipeline.cs index 7c20c17f194..0a584c6fc36 100644 --- a/src/System.Management.Automation/engine/hostifaces/Pipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/Pipeline.cs @@ -305,7 +305,7 @@ internal Pipeline(Runspace runspace, CommandCollection command) { if (runspace == null) { - PSTraceSource.NewArgumentNullException("runspace"); + PSTraceSource.NewArgumentNullException(nameof(runspace)); } // This constructor is used only internally. // Caller should make sure the input is valid diff --git a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs index 0bb95d30d55..646f289076c 100644 --- a/src/System.Management.Automation/engine/hostifaces/PowerShell.cs +++ b/src/System.Management.Automation/engine/hostifaces/PowerShell.cs @@ -1169,7 +1169,7 @@ public PowerShell AddCommand(CommandInfo commandInfo) { if (commandInfo == null) { - throw PSTraceSource.NewArgumentNullException("commandInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(commandInfo)); } Command cmd = new Command(commandInfo); @@ -1292,7 +1292,7 @@ public PowerShell AddParameters(IList parameters) { if (parameters == null) { - throw PSTraceSource.NewArgumentNullException("parameters"); + throw PSTraceSource.NewArgumentNullException(nameof(parameters)); } if (_psCommand.Commands.Count == 0) @@ -1340,7 +1340,7 @@ public PowerShell AddParameters(IDictionary parameters) { if (parameters == null) { - throw PSTraceSource.NewArgumentNullException("parameters"); + throw PSTraceSource.NewArgumentNullException(nameof(parameters)); } if (_psCommand.Commands.Count == 0) @@ -1356,7 +1356,7 @@ public PowerShell AddParameters(IDictionary parameters) if (parameterName == null) { - throw PSTraceSource.NewArgumentException("parameters", PowerShellStrings.KeyMustBeString); + throw PSTraceSource.NewArgumentException(nameof(parameters), PowerShellStrings.KeyMustBeString); } _psCommand.AddParameter(parameterName, entry.Value); @@ -2727,7 +2727,7 @@ public void Invoke(IEnumerable input, IList output, PSInvocationSettings s { if (output == null) { - throw PSTraceSource.NewArgumentNullException("output"); + throw PSTraceSource.NewArgumentNullException(nameof(output)); } // use the above collection as the data store. PSDataCollection listToWriteTo = new PSDataCollection(output); @@ -2798,7 +2798,7 @@ public void Invoke(PSDataCollection input, PSDataCollec { if (output == null) { - throw PSTraceSource.NewArgumentNullException("output"); + throw PSTraceSource.NewArgumentNullException(nameof(output)); } CoreInvoke(input, output, settings); @@ -3034,7 +3034,7 @@ public IAsyncResult BeginInvoke(PSDataCollection input, { if (output == null) { - throw PSTraceSource.NewArgumentNullException("output"); + throw PSTraceSource.NewArgumentNullException(nameof(output)); } DetermineIsBatching(); @@ -3649,7 +3649,7 @@ public PSDataCollection EndInvoke(IAsyncResult asyncResult) if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } PowerShellAsyncResult psAsyncResult = asyncResult as PowerShellAsyncResult; @@ -3658,7 +3658,7 @@ public PSDataCollection EndInvoke(IAsyncResult asyncResult) (psAsyncResult.OwnerId != InstanceId) || (psAsyncResult.IsAssociatedWithAsyncInvoke != true)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), PowerShellStrings.AsyncResultNotOwned, "IAsyncResult", "BeginInvoke"); } @@ -3752,7 +3752,7 @@ public void EndStop(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } PowerShellAsyncResult psAsyncResult = asyncResult as PowerShellAsyncResult; @@ -3761,7 +3761,7 @@ public void EndStop(IAsyncResult asyncResult) (psAsyncResult.OwnerId != InstanceId) || (psAsyncResult.IsAssociatedWithAsyncInvoke != false)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), PowerShellStrings.AsyncResultNotOwned, "IAsyncResult", "BeginStop"); } @@ -5720,7 +5720,7 @@ internal static PowerShell FromPSObjectForRemoting(PSObject powerShellAsPSObject { if (powerShellAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("powerShellAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(powerShellAsPSObject)); } Collection extraCommands = null; @@ -6153,12 +6153,12 @@ internal PowerShellStopper(ExecutionContext context, PowerShell powerShell) { if (context == null) { - throw new ArgumentNullException("context"); + throw new ArgumentNullException(nameof(context)); } if (powerShell == null) { - throw new ArgumentNullException("powerShell"); + throw new ArgumentNullException(nameof(powerShell)); } _powerShell = powerShell; diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs index 49950ac0fa1..aa4252cfcb1 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePoolInternal.cs @@ -76,7 +76,7 @@ public RunspacePoolInternal(int minRunspaces, { if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } this.host = host; @@ -121,12 +121,12 @@ public RunspacePoolInternal(int minRunspaces, { if (initialSessionState == null) { - throw PSTraceSource.NewArgumentNullException("initialSessionState"); + throw PSTraceSource.NewArgumentNullException(nameof(initialSessionState)); } if (host == null) { - throw PSTraceSource.NewArgumentNullException("host"); + throw PSTraceSource.NewArgumentNullException(nameof(host)); } _initialSessionState = initialSessionState.Clone(); @@ -154,17 +154,17 @@ protected RunspacePoolInternal(int minRunspaces, int maxRunspaces) { if (maxRunspaces < 1) { - throw PSTraceSource.NewArgumentException("maxRunspaces", RunspacePoolStrings.MaxPoolLessThan1); + throw PSTraceSource.NewArgumentException(nameof(maxRunspaces), RunspacePoolStrings.MaxPoolLessThan1); } if (minRunspaces < 1) { - throw PSTraceSource.NewArgumentException("minRunspaces", RunspacePoolStrings.MinPoolLessThan1); + throw PSTraceSource.NewArgumentException(nameof(minRunspaces), RunspacePoolStrings.MinPoolLessThan1); } if (minRunspaces > maxRunspaces) { - throw PSTraceSource.NewArgumentException("minRunspaces", RunspacePoolStrings.MinPoolGreaterThanMaxPool); + throw PSTraceSource.NewArgumentException(nameof(minRunspaces), RunspacePoolStrings.MinPoolGreaterThanMaxPool); } maxPoolSz = maxRunspaces; @@ -618,7 +618,7 @@ public void EndOpen(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } RunspacePoolAsyncResult rsAsyncResult = asyncResult as RunspacePoolAsyncResult; @@ -627,7 +627,7 @@ public void EndOpen(IAsyncResult asyncResult) (rsAsyncResult.OwnerId != instanceId) || (!rsAsyncResult.IsAssociatedWithAsyncOpen)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginOpen"); @@ -685,7 +685,7 @@ public virtual void EndClose(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } RunspacePoolAsyncResult rsAsyncResult = asyncResult as RunspacePoolAsyncResult; @@ -694,7 +694,7 @@ public virtual void EndClose(IAsyncResult asyncResult) (rsAsyncResult.OwnerId != instanceId) || (rsAsyncResult.IsAssociatedWithAsyncOpen)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginClose"); @@ -754,7 +754,7 @@ public void ReleaseRunspace(Runspace runspace) { if (runspace == null) { - throw PSTraceSource.NewArgumentNullException("runspace"); + throw PSTraceSource.NewArgumentNullException(nameof(runspace)); } AssertPoolIsOpen(); @@ -893,7 +893,7 @@ internal void CancelGetRunspace(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } GetRunspaceAsyncResult grsAsyncResult = @@ -901,7 +901,7 @@ internal void CancelGetRunspace(IAsyncResult asyncResult) if ((grsAsyncResult == null) || (grsAsyncResult.OwnerId != instanceId)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginGetRunspace"); @@ -932,7 +932,7 @@ internal Runspace EndGetRunspace(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } GetRunspaceAsyncResult grsAsyncResult = @@ -940,7 +940,7 @@ internal Runspace EndGetRunspace(IAsyncResult asyncResult) if ((grsAsyncResult == null) || (grsAsyncResult.OwnerId != instanceId)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginGetRunspace"); diff --git a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs index fbc2276f693..df15ce6313e 100644 --- a/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs +++ b/src/System.Management.Automation/engine/hostifaces/pipelinebase.cs @@ -128,7 +128,7 @@ protected PipelineBase(PipelineBase pipeline) // NTRAID#Windows Out Of Band Releases-915851-2005/09/13 if (pipeline == null) { - throw PSTraceSource.NewArgumentNullException("pipeline"); + throw PSTraceSource.NewArgumentNullException(nameof(pipeline)); } if (pipeline._disposed) @@ -997,7 +997,7 @@ private void Initialize(Runspace runspace, string command, bool addToHistory, bo if (addToHistory && command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } if (command != null) diff --git a/src/System.Management.Automation/engine/lang/interface/PSParser.cs b/src/System.Management.Automation/engine/lang/interface/PSParser.cs index 0a4f93e2d5a..2b6886dbce6 100644 --- a/src/System.Management.Automation/engine/lang/interface/PSParser.cs +++ b/src/System.Management.Automation/engine/lang/interface/PSParser.cs @@ -147,7 +147,7 @@ private Collection Errors public static Collection Tokenize(string script, out Collection errors) { if (script == null) - throw PSTraceSource.NewArgumentNullException("script"); + throw PSTraceSource.NewArgumentNullException(nameof(script)); PSParser psParser = new PSParser(); @@ -174,7 +174,7 @@ public static Collection Tokenize(string script, out Collection Tokenize(object[] script, out Collection errors) { if (script == null) - throw PSTraceSource.NewArgumentNullException("script"); + throw PSTraceSource.NewArgumentNullException(nameof(script)); StringBuilder sb = new StringBuilder(); foreach (object obj in script) diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 180a1fe0f69..d2203f8b90e 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -1810,7 +1810,7 @@ internal static RuntimeException NewInterpreterExceptionWithInnerException(objec { // errToken may be null if (string.IsNullOrEmpty(resourceIdAndErrorId)) - throw PSTraceSource.NewArgumentException("resourceIdAndErrorId"); + throw PSTraceSource.NewArgumentException(nameof(resourceIdAndErrorId)); // innerException may be null // args may be null or empty diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 776691a68f0..e787c9e9f9b 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -2281,7 +2281,7 @@ private Expression CaptureAstResults( result = resultList; break; default: - throw new ArgumentOutOfRangeException("context"); + throw new ArgumentOutOfRangeException(nameof(context)); } finallyExprs.Add(Expression.Assign(s_getCurrentPipe, oldPipe)); diff --git a/src/System.Management.Automation/engine/parser/SafeValues.cs b/src/System.Management.Automation/engine/parser/SafeValues.cs index abe3b95b933..d91ec35356d 100644 --- a/src/System.Management.Automation/engine/parser/SafeValues.cs +++ b/src/System.Management.Automation/engine/parser/SafeValues.cs @@ -529,7 +529,7 @@ public object VisitIndexExpression(IndexExpressionAst indexExpressionAst) var target = indexExpressionAst.Target.Accept(this); if (index == null || target == null) { - throw new ArgumentNullException("indexExpressionAst"); + throw new ArgumentNullException(nameof(indexExpressionAst)); } return GetIndexedValueFromTarget(target, index); diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index f135fadfd54..8877109a51c 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -93,7 +93,7 @@ protected Ast(IScriptExtent extent) { if (extent == null) { - throw PSTraceSource.NewArgumentNullException("extent"); + throw PSTraceSource.NewArgumentNullException(nameof(extent)); } this.Extent = extent; @@ -119,7 +119,7 @@ public object Visit(ICustomAstVisitor astVisitor) { if (astVisitor == null) { - throw PSTraceSource.NewArgumentNullException("astVisitor"); + throw PSTraceSource.NewArgumentNullException(nameof(astVisitor)); } return this.Accept(astVisitor); @@ -133,7 +133,7 @@ public void Visit(AstVisitor astVisitor) { if (astVisitor == null) { - throw PSTraceSource.NewArgumentNullException("astVisitor"); + throw PSTraceSource.NewArgumentNullException(nameof(astVisitor)); } this.InternalVisit(astVisitor); @@ -149,7 +149,7 @@ public IEnumerable FindAll(Func predicate, bool searchNestedScri { if (predicate == null) { - throw PSTraceSource.NewArgumentNullException("predicate"); + throw PSTraceSource.NewArgumentNullException(nameof(predicate)); } return AstSearcher.FindAll(this, predicate, searchNestedScriptBlocks); @@ -165,7 +165,7 @@ public Ast Find(Func predicate, bool searchNestedScriptBlocks) { if (predicate == null) { - throw PSTraceSource.NewArgumentNullException("predicate"); + throw PSTraceSource.NewArgumentNullException(nameof(predicate)); } return AstSearcher.FindFirst(this, predicate, searchNestedScriptBlocks); @@ -449,7 +449,7 @@ internal ErrorStatementAst(IScriptExtent extent, Token kind, IEnumerable ne { if (kind == null) { - throw PSTraceSource.NewArgumentNullException("kind"); + throw PSTraceSource.NewArgumentNullException(nameof(kind)); } Kind = kind; @@ -465,7 +465,7 @@ internal ErrorStatementAst(IScriptExtent extent, Token kind, IEnumerable using if (statements == null) { - throw PSTraceSource.NewArgumentNullException("statements"); + throw PSTraceSource.NewArgumentNullException(nameof(statements)); } if (paramBlock != null) @@ -1753,12 +1753,12 @@ public NamedBlockAst(IScriptExtent extent, TokenKind blockName, StatementBlockAs if (!blockName.HasTrait(TokenFlags.ScriptBlockBlockName) || (unnamed && (blockName == TokenKind.Begin || blockName == TokenKind.Dynamicparam))) { - throw PSTraceSource.NewArgumentException("blockName"); + throw PSTraceSource.NewArgumentException(nameof(blockName)); } if (statementBlock == null) { - throw PSTraceSource.NewArgumentNullException("statementBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(statementBlock)); } this.Unnamed = unnamed; @@ -1901,12 +1901,12 @@ public NamedAttributeArgumentAst(IScriptExtent extent, string argumentName, Expr { if (string.IsNullOrEmpty(argumentName)) { - throw PSTraceSource.NewArgumentNullException("argumentName"); + throw PSTraceSource.NewArgumentNullException(nameof(argumentName)); } if (argument == null) { - throw PSTraceSource.NewArgumentNullException("argument"); + throw PSTraceSource.NewArgumentNullException(nameof(argument)); } this.Argument = argument; @@ -1979,7 +1979,7 @@ protected AttributeBaseAst(IScriptExtent extent, ITypeName typeName) { if (typeName == null) { - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); } this.TypeName = typeName; @@ -2190,7 +2190,7 @@ public ParameterAst(IScriptExtent extent, { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (attributes != null) @@ -2533,7 +2533,7 @@ public TypeDefinitionAst(IScriptExtent extent, string name, IEnumerable scriptBlockTokenC { if (scriptBlockTokenCache == null) { - throw new ArgumentNullException("scriptBlockTokenCache"); + throw new ArgumentNullException(nameof(scriptBlockTokenCache)); } var commentTokens = HelpCommentsParser.GetHelpCommentTokens(this, scriptBlockTokenCache); @@ -3890,7 +3890,7 @@ public IfStatementAst(IScriptExtent extent, IEnumerable clauses, State { if (clauses == null || !clauses.Any()) { - throw PSTraceSource.NewArgumentException("clauses"); + throw PSTraceSource.NewArgumentException(nameof(clauses)); } this.Clauses = new ReadOnlyCollection(clauses.ToArray()); @@ -3995,7 +3995,7 @@ public DataStatementAst(IScriptExtent extent, { if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } if (string.IsNullOrWhiteSpace(variableName)) @@ -4137,7 +4137,7 @@ protected LoopStatementAst(IScriptExtent extent, string label, PipelineBaseAst c { if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } this.Body = body; @@ -4404,7 +4404,7 @@ public DoWhileStatementAst(IScriptExtent extent, string label, PipelineBaseAst c { if (condition == null) { - throw PSTraceSource.NewArgumentNullException("condition"); + throw PSTraceSource.NewArgumentNullException(nameof(condition)); } } @@ -4460,7 +4460,7 @@ public DoUntilStatementAst(IScriptExtent extent, string label, PipelineBaseAst c { if (condition == null) { - throw PSTraceSource.NewArgumentNullException("condition"); + throw PSTraceSource.NewArgumentNullException(nameof(condition)); } } @@ -4516,7 +4516,7 @@ public WhileStatementAst(IScriptExtent extent, string label, PipelineBaseAst con { if (condition == null) { - throw PSTraceSource.NewArgumentNullException("condition"); + throw PSTraceSource.NewArgumentNullException(nameof(condition)); } } @@ -4636,7 +4636,7 @@ public SwitchStatementAst(IScriptExtent extent, { // Must specify either clauses or default. If neither, just complain about clauses as that's the most likely // invalid argument. - throw PSTraceSource.NewArgumentException("clauses"); + throw PSTraceSource.NewArgumentException(nameof(clauses)); } this.Flags = flags; @@ -4752,7 +4752,7 @@ public CatchClauseAst(IScriptExtent extent, IEnumerable catch { if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } if (catchTypes != null) @@ -4855,13 +4855,13 @@ public TryStatementAst(IScriptExtent extent, { if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } if ((catchClauses == null || !catchClauses.Any()) && @finally == null) { // If no catches and no finally, just complain about catchClauses as that's the most likely invalid argument. - throw PSTraceSource.NewArgumentException("catchClauses"); + throw PSTraceSource.NewArgumentException(nameof(catchClauses)); } this.Body = body; @@ -4964,7 +4964,7 @@ public TrapStatementAst(IScriptExtent extent, TypeConstraintAst trapType, Statem { if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } if (trapType != null) @@ -5520,7 +5520,7 @@ public PipelineAst(IScriptExtent extent, IEnumerable pipelineEle { if (pipelineElements == null || !pipelineElements.Any()) { - throw PSTraceSource.NewArgumentException("pipelineElements"); + throw PSTraceSource.NewArgumentException(nameof(pipelineElements)); } this.Background = background; @@ -5557,7 +5557,7 @@ public PipelineAst(IScriptExtent extent, CommandBaseAst commandAst, bool backgro { if (commandAst == null) { - throw PSTraceSource.NewArgumentNullException("commandAst"); + throw PSTraceSource.NewArgumentNullException(nameof(commandAst)); } this.Background = background; @@ -5830,12 +5830,12 @@ public CommandAst(IScriptExtent extent, { if (commandElements == null || !commandElements.Any()) { - throw PSTraceSource.NewArgumentException("commandElements"); + throw PSTraceSource.NewArgumentException(nameof(commandElements)); } if (invocationOperator != TokenKind.Dot && invocationOperator != TokenKind.Ampersand && invocationOperator != TokenKind.Unknown) { - throw PSTraceSource.NewArgumentException("invocationOperator"); + throw PSTraceSource.NewArgumentException(nameof(invocationOperator)); } this.CommandElements = new ReadOnlyCollection(commandElements.ToArray()); @@ -5951,7 +5951,7 @@ public CommandExpressionAst(IScriptExtent extent, { if (expression == null) { - throw PSTraceSource.NewArgumentNullException("expression"); + throw PSTraceSource.NewArgumentNullException(nameof(expression)); } this.Expression = expression; @@ -6144,7 +6144,7 @@ public FileRedirectionAst(IScriptExtent extent, RedirectionStream stream, Expres { if (file == null) { - throw PSTraceSource.NewArgumentNullException("file"); + throw PSTraceSource.NewArgumentNullException(nameof(file)); } this.Location = file; @@ -6220,7 +6220,7 @@ public AssignmentStatementAst(IScriptExtent extent, ExpressionAst left, TokenKin if ((@operator.GetTraits() & TokenFlags.AssignmentOperator) == 0) { - throw PSTraceSource.NewArgumentException("operator"); + throw PSTraceSource.NewArgumentException(nameof(@operator)); } // If the assignment is just an expression and the expression is not backgrounded then @@ -6361,17 +6361,17 @@ public ConfigurationDefinitionAst(IScriptExtent extent, { if (extent == null) { - throw PSTraceSource.NewArgumentNullException("extent"); + throw PSTraceSource.NewArgumentNullException(nameof(extent)); } if (body == null) { - throw PSTraceSource.NewArgumentNullException("body"); + throw PSTraceSource.NewArgumentNullException(nameof(body)); } if (instanceName == null) { - throw PSTraceSource.NewArgumentNullException("instanceName"); + throw PSTraceSource.NewArgumentNullException(nameof(instanceName)); } this.Body = body; @@ -6842,7 +6842,7 @@ public DynamicKeywordStatementAst(IScriptExtent extent, { if (commandElements == null || commandElements.Count() <= 0) { - throw PSTraceSource.NewArgumentException("commandElements"); + throw PSTraceSource.NewArgumentException(nameof(commandElements)); } this.CommandElements = new ReadOnlyCollection(commandElements.ToArray()); @@ -7348,7 +7348,7 @@ public BinaryExpressionAst(IScriptExtent extent, ExpressionAst left, TokenKind @ { if ((@operator.GetTraits() & TokenFlags.BinaryOperator) == 0) { - throw PSTraceSource.NewArgumentException("operator"); + throw PSTraceSource.NewArgumentException(nameof(@operator)); } if (left == null || right == null || errorPosition == null) @@ -7461,12 +7461,12 @@ public UnaryExpressionAst(IScriptExtent extent, TokenKind tokenKind, ExpressionA { if ((tokenKind.GetTraits() & TokenFlags.UnaryOperator) == 0) { - throw PSTraceSource.NewArgumentException("tokenKind"); + throw PSTraceSource.NewArgumentException(nameof(tokenKind)); } if (child == null) { - throw PSTraceSource.NewArgumentNullException("child"); + throw PSTraceSource.NewArgumentNullException(nameof(child)); } this.TokenKind = tokenKind; @@ -7548,7 +7548,7 @@ public BlockStatementAst(IScriptExtent extent, Token kind, StatementBlockAst bod if (kind.Kind != TokenKind.Sequence && kind.Kind != TokenKind.Parallel) { - throw PSTraceSource.NewArgumentException("kind"); + throw PSTraceSource.NewArgumentException(nameof(kind)); } this.Kind = kind; @@ -8179,7 +8179,7 @@ public TypeName(IScriptExtent extent, string name) var c = name[0]; if (c == '[' || c == ']' || c == ',') { - throw PSTraceSource.NewArgumentException("name"); + throw PSTraceSource.NewArgumentException(nameof(name)); } int backtick = name.IndexOf('`'); @@ -8209,7 +8209,7 @@ public TypeName(IScriptExtent extent, string name, string assembly) { if (string.IsNullOrEmpty(assembly)) { - throw PSTraceSource.NewArgumentNullException("assembly"); + throw PSTraceSource.NewArgumentNullException(nameof(assembly)); } AssemblyName = assembly; @@ -8449,7 +8449,7 @@ public GenericTypeName(IScriptExtent extent, ITypeName genericTypeName, IEnumera if (genericArguments == null) { - throw PSTraceSource.NewArgumentException("genericArguments"); + throw PSTraceSource.NewArgumentException(nameof(genericArguments)); } Extent = extent; @@ -8458,7 +8458,7 @@ public GenericTypeName(IScriptExtent extent, ITypeName genericTypeName, IEnumera if (this.GenericArguments.Count == 0) { - throw PSTraceSource.NewArgumentException("genericArguments"); + throw PSTraceSource.NewArgumentException(nameof(genericArguments)); } } @@ -8746,7 +8746,7 @@ public ArrayTypeName(IScriptExtent extent, ITypeName elementType, int rank) if (rank <= 0) { - throw PSTraceSource.NewArgumentException("rank"); + throw PSTraceSource.NewArgumentException(nameof(rank)); } Extent = extent; @@ -8941,7 +8941,7 @@ public ReflectionTypeName(Type type) { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } _type = type; @@ -9042,7 +9042,7 @@ public TypeExpressionAst(IScriptExtent extent, ITypeName typeName) { if (typeName == null) { - throw PSTraceSource.NewArgumentNullException("typeName"); + throw PSTraceSource.NewArgumentNullException(nameof(typeName)); } this.TypeName = typeName; @@ -9107,7 +9107,7 @@ public VariableExpressionAst(IScriptExtent extent, string variableName, bool spl { if (string.IsNullOrEmpty(variableName)) { - throw PSTraceSource.NewArgumentNullException("variableName"); + throw PSTraceSource.NewArgumentNullException(nameof(variableName)); } this.VariablePath = new VariablePath(variableName); @@ -9134,7 +9134,7 @@ public VariableExpressionAst(IScriptExtent extent, VariablePath variablePath, bo { if (variablePath == null) { - throw PSTraceSource.NewArgumentNullException("variablePath"); + throw PSTraceSource.NewArgumentNullException(nameof(variablePath)); } this.VariablePath = variablePath; @@ -9429,7 +9429,7 @@ public StringConstantExpressionAst(IScriptExtent extent, string value, StringCon { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } this.StringConstantType = stringConstantType; @@ -9529,13 +9529,13 @@ public ExpandableStringExpressionAst(IScriptExtent extent, { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } if (type != StringConstantType.DoubleQuoted && type != StringConstantType.DoubleQuotedHereString && type != StringConstantType.BareWord) { - throw PSTraceSource.NewArgumentException("type"); + throw PSTraceSource.NewArgumentException(nameof(type)); } var ast = Language.Parser.ScanString(value); @@ -9676,7 +9676,7 @@ public ScriptBlockExpressionAst(IScriptExtent extent, ScriptBlockAst scriptBlock { if (scriptBlock == null) { - throw PSTraceSource.NewArgumentNullException("scriptBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(scriptBlock)); } this.ScriptBlock = scriptBlock; @@ -9748,7 +9748,7 @@ public ArrayLiteralAst(IScriptExtent extent, IList elements) { if (elements == null || !elements.Any()) { - throw PSTraceSource.NewArgumentException("elements"); + throw PSTraceSource.NewArgumentException(nameof(elements)); } this.Elements = new ReadOnlyCollection(elements); @@ -9921,7 +9921,7 @@ public ArrayExpressionAst(IScriptExtent extent, StatementBlockAst statementBlock { if (statementBlock == null) { - throw PSTraceSource.NewArgumentNullException("statementBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(statementBlock)); } this.SubExpression = statementBlock; @@ -9987,7 +9987,7 @@ public ParenExpressionAst(IScriptExtent extent, PipelineBaseAst pipeline) { if (pipeline == null) { - throw PSTraceSource.NewArgumentNullException("pipeline"); + throw PSTraceSource.NewArgumentNullException(nameof(pipeline)); } this.Pipeline = pipeline; @@ -10053,7 +10053,7 @@ public SubExpressionAst(IScriptExtent extent, StatementBlockAst statementBlock) { if (statementBlock == null) { - throw PSTraceSource.NewArgumentNullException("statementBlock"); + throw PSTraceSource.NewArgumentNullException(nameof(statementBlock)); } this.SubExpression = statementBlock; @@ -10113,7 +10113,7 @@ public UsingExpressionAst(IScriptExtent extent, ExpressionAst expressionAst) { if (expressionAst == null) { - throw PSTraceSource.NewArgumentNullException("expressionAst"); + throw PSTraceSource.NewArgumentNullException(nameof(expressionAst)); } RuntimeUsingIndex = -1; @@ -10163,7 +10163,7 @@ public static VariableExpressionAst ExtractUsingVariable(UsingExpressionAst usin { if (usingExpressionAst == null) { - throw new ArgumentNullException("usingExpressionAst"); + throw new ArgumentNullException(nameof(usingExpressionAst)); } return ExtractUsingVariableImpl(usingExpressionAst); diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 64cd02d4185..ba8fdeac87d 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -153,7 +153,7 @@ public static bool ContainsKeyword(string name) { if (string.IsNullOrEmpty(name)) { - PSArgumentNullException e = PSTraceSource.NewArgumentNullException("name"); + PSArgumentNullException e = PSTraceSource.NewArgumentNullException(nameof(name)); throw e; } @@ -167,7 +167,7 @@ public static void AddKeyword(DynamicKeyword keywordToAdd) { if (keywordToAdd == null) { - PSArgumentNullException e = PSTraceSource.NewArgumentNullException("keywordToAdd"); + PSArgumentNullException e = PSTraceSource.NewArgumentNullException(nameof(keywordToAdd)); throw e; } @@ -191,7 +191,7 @@ public static void RemoveKeyword(string name) { if (string.IsNullOrEmpty(name)) { - PSArgumentNullException e = PSTraceSource.NewArgumentNullException("name"); + PSArgumentNullException e = PSTraceSource.NewArgumentNullException(nameof(name)); throw e; } @@ -207,7 +207,7 @@ internal static bool IsHiddenKeyword(string name) { if (string.IsNullOrEmpty(name)) { - PSArgumentNullException e = PSTraceSource.NewArgumentNullException("name"); + PSArgumentNullException e = PSTraceSource.NewArgumentNullException(nameof(name)); throw e; } diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index d963afffad1..e118bce374d 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -285,7 +285,7 @@ internal int Add(CommandProcessorBase commandProcessor) internal void AddRedirectionPipe(PipelineProcessor pipelineProcessor) { - if (pipelineProcessor == null) throw PSTraceSource.NewArgumentNullException("pipelineProcessor"); + if (pipelineProcessor == null) throw PSTraceSource.NewArgumentNullException(nameof(pipelineProcessor)); if (_redirectionPipes == null) _redirectionPipes = new List(); _redirectionPipes.Add(pipelineProcessor); @@ -317,7 +317,7 @@ internal int AddCommand(CommandProcessorBase commandProcessor, int readFromComma { if (commandProcessor == null) { - throw PSTraceSource.NewArgumentNullException("commandProcessor"); + throw PSTraceSource.NewArgumentNullException(nameof(commandProcessor)); } if (_commands == null) @@ -349,7 +349,7 @@ internal int AddCommand(CommandProcessorBase commandProcessor, int readFromComma { // "First command cannot have input" throw PSTraceSource.NewArgumentException( - "readFromCommand", + nameof(readFromCommand), PipelineStrings.FirstCommandCannotHaveInput); } @@ -360,7 +360,7 @@ internal int AddCommand(CommandProcessorBase commandProcessor, int readFromComma { // "invalid command number" throw PSTraceSource.NewArgumentException( - "readFromCommand", + nameof(readFromCommand), PipelineStrings.InvalidCommandNumber); } else diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index 2a62a8a543e..d04c3a98fba 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -125,7 +125,7 @@ public WildcardPattern(string pattern, WildcardOptions options) public static WildcardPattern Get(string pattern, WildcardOptions options) { if (pattern == null) - throw PSTraceSource.NewArgumentNullException("pattern"); + throw PSTraceSource.NewArgumentNullException(nameof(pattern)); if (pattern.Length == 1 && pattern[0] == '*') return s_matchAllIgnoreCasePattern; @@ -449,7 +449,7 @@ internal WildcardPatternException(ErrorRecord errorRecord) { if (errorRecord == null) { - throw new ArgumentNullException("errorRecord"); + throw new ArgumentNullException(nameof(errorRecord)); } _errorRecord = errorRecord; diff --git a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs index ccee756d654..ba4e08c8f6f 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientMethodExecutor.cs @@ -238,7 +238,7 @@ internal void ExecuteVoid(Action writeErrorAction) // Create an error record and write it to the stream. ErrorRecord errorRecord = new ErrorRecord( exception, - PSRemotingErrorId.RemoteHostCallFailed.ToString(), + nameof(PSRemotingErrorId.RemoteHostCallFailed), ErrorCategory.InvalidArgument, _remoteHostCall.MethodName); writeErrorAction(errorRecord); diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 7cbf139d361..1c8daf5630e 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -333,7 +333,7 @@ public JobStateEventArgs(JobStateInfo jobStateInfo, JobStateInfo previousJobStat { if (jobStateInfo == null) { - throw PSTraceSource.NewArgumentNullException("jobStateInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(jobStateInfo)); } JobStateInfo = jobStateInfo; @@ -366,7 +366,7 @@ public sealed class JobIdentifier internal JobIdentifier(int id, Guid instanceId) { if (id <= 0) - PSTraceSource.NewArgumentException("id", RemotingErrorIdStrings.JobSessionIdLessThanOne, id); + PSTraceSource.NewArgumentException(nameof(id), RemotingErrorIdStrings.JobSessionIdLessThanOne, id); Id = id; InstanceId = instanceId; } @@ -463,10 +463,10 @@ protected Job(string command, string name, IList childJobs) protected Job(string command, string name, JobIdentifier token) { if (token == null) - throw PSTraceSource.NewArgumentNullException("token", RemotingErrorIdStrings.JobIdentifierNull); + throw PSTraceSource.NewArgumentNullException(nameof(token), RemotingErrorIdStrings.JobIdentifierNull); if (token.Id > s_jobIdSeed) { - throw PSTraceSource.NewArgumentException("token", RemotingErrorIdStrings.JobIdNotYetAssigned, token.Id); + throw PSTraceSource.NewArgumentException(nameof(token), RemotingErrorIdStrings.JobIdNotYetAssigned, token.Id); } Command = command; @@ -3882,12 +3882,12 @@ public RemotingJobDebugger( { if (debugger == null) { - throw new PSArgumentNullException("debugger"); + throw new PSArgumentNullException(nameof(debugger)); } if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } _wrappedDebugger = debugger; diff --git a/src/System.Management.Automation/engine/remoting/client/Job2.cs b/src/System.Management.Automation/engine/remoting/client/Job2.cs index b97243651fb..7b972cf5a1a 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job2.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job2.cs @@ -704,7 +704,7 @@ public void AddChildJob(Job2 childJob) AssertNotDisposed(); if (childJob == null) { - throw new ArgumentNullException("childJob"); + throw new ArgumentNullException(nameof(childJob)); } _tracer.WriteMessage(TraceClassName, "AddChildJob", Guid.Empty, childJob, "Adding Child to Parent with InstanceId : ", InstanceId.ToString()); @@ -2181,7 +2181,7 @@ protected JobFailedException(SerializationInfo serializationInfo, StreamingConte public override void GetObjectData(SerializationInfo info, StreamingContext context) { if (info == null) - throw new ArgumentNullException("info"); + throw new ArgumentNullException(nameof(info)); base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/engine/remoting/client/JobManager.cs b/src/System.Management.Automation/engine/remoting/client/JobManager.cs index 88952ef893b..6ef47c19752 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobManager.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobManager.cs @@ -178,7 +178,7 @@ public Job2 NewJob(JobDefinition definition) { if (definition == null) { - throw new ArgumentNullException("definition"); + throw new ArgumentNullException(nameof(definition)); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(definition); @@ -218,12 +218,12 @@ public Job2 NewJob(JobInvocationInfo specification) { if (specification == null) { - throw new ArgumentNullException("specification"); + throw new ArgumentNullException(nameof(specification)); } if (specification.Definition == null) { - throw new ArgumentException(RemotingErrorIdStrings.NewJobSpecificationError, "specification"); + throw new ArgumentException(RemotingErrorIdStrings.NewJobSpecificationError, nameof(specification)); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(specification.Definition); @@ -263,12 +263,12 @@ public void PersistJob(Job2 job, JobDefinition definition) { if (job == null) { - throw new PSArgumentNullException("job"); + throw new PSArgumentNullException(nameof(job)); } if (definition == null) { - throw new PSArgumentNullException("definition"); + throw new PSArgumentNullException(nameof(definition)); } JobSourceAdapter sourceAdapter = GetJobSourceAdapter(definition); diff --git a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs index 8802c3a2f61..f38ac4a39d0 100644 --- a/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs +++ b/src/System.Management.Automation/engine/remoting/client/JobSourceAdapter.cs @@ -405,7 +405,7 @@ public void StoreJobIdForReuse(Job2 job, bool recurse) { if (job == null) { - PSTraceSource.NewArgumentNullException("job", RemotingErrorIdStrings.JobSourceAdapterCannotSaveNullJob); + PSTraceSource.NewArgumentNullException(nameof(job), RemotingErrorIdStrings.JobSourceAdapterCannotSaveNullJob); } JobManager.SaveJobId(job.InstanceId, job.Id, this.GetType().Name); diff --git a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs index 640bbb11f33..8c35c5f948f 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemoteRunspacePoolInternal.cs @@ -1074,7 +1074,7 @@ public override void EndDisconnect(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } RunspacePoolAsyncResult rsAsyncResult = asyncResult as RunspacePoolAsyncResult; @@ -1083,7 +1083,7 @@ public override void EndDisconnect(IAsyncResult asyncResult) (rsAsyncResult.OwnerId != instanceId) || (rsAsyncResult.IsAssociatedWithAsyncOpen)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginOpen"); @@ -1184,7 +1184,7 @@ public override void EndConnect(IAsyncResult asyncResult) { if (asyncResult == null) { - throw PSTraceSource.NewArgumentNullException("asyncResult"); + throw PSTraceSource.NewArgumentNullException(nameof(asyncResult)); } RunspacePoolAsyncResult rsAsyncResult = asyncResult as RunspacePoolAsyncResult; @@ -1193,7 +1193,7 @@ public override void EndConnect(IAsyncResult asyncResult) (rsAsyncResult.OwnerId != instanceId) || (rsAsyncResult.IsAssociatedWithAsyncOpen)) { - throw PSTraceSource.NewArgumentException("asyncResult", + throw PSTraceSource.NewArgumentException(nameof(asyncResult), RunspacePoolStrings.AsyncResultNotOwned, "IAsyncResult", "BeginOpen"); diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs index 5665a0e3be0..7a7a70f9296 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs @@ -63,7 +63,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -143,7 +143,7 @@ public RemotingProgressRecord(ProgressRecord progressRecord, OriginInfo originIn private static ProgressRecord Validate(ProgressRecord progressRecord) { - if (progressRecord == null) throw new ArgumentNullException("progressRecord"); + if (progressRecord == null) throw new ArgumentNullException(nameof(progressRecord)); return progressRecord; } } diff --git a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs index f63376179a8..a6ad69843cc 100644 --- a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs +++ b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs @@ -296,7 +296,7 @@ internal void AddChildJobAndPotentiallyBlock( { using (var jobGotEnqueued = new ManualResetEventSlim(initialState: false)) { - if (childJob == null) throw new ArgumentNullException("childJob"); + if (childJob == null) throw new ArgumentNullException(nameof(childJob)); this.AddChildJobWithoutBlocking(childJob, flags, jobGotEnqueued.Set); jobGotEnqueued.Wait(); @@ -310,7 +310,7 @@ internal void AddChildJobAndPotentiallyBlock( { using (var forwardingCancellation = new CancellationTokenSource()) { - if (childJob == null) throw new ArgumentNullException("childJob"); + if (childJob == null) throw new ArgumentNullException(nameof(childJob)); this.AddChildJobWithoutBlocking(childJob, flags, forwardingCancellation.Cancel); this.ForwardAllResultsToCmdlet(cmdlet, forwardingCancellation.Token); @@ -371,8 +371,8 @@ internal void DisableFlowControlForPendingCmdletActionsQueue() /// internal void AddChildJobWithoutBlocking(StartableJob childJob, ChildJobFlags flags, Action jobEnqueuedAction = null) { - if (childJob == null) throw new ArgumentNullException("childJob"); - if (childJob.JobStateInfo.State != JobState.NotStarted) throw new ArgumentException(RemotingErrorIdStrings.ThrottlingJobChildAlreadyRunning, "childJob"); + if (childJob == null) throw new ArgumentNullException(nameof(childJob)); + if (childJob.JobStateInfo.State != JobState.NotStarted) throw new ArgumentException(RemotingErrorIdStrings.ThrottlingJobChildAlreadyRunning, nameof(childJob)); this.AssertNotDisposed(); JobStateInfo newJobStateInfo = null; diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs index fc7e4ffa8c9..e3249765446 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesession.cs @@ -299,7 +299,7 @@ private void HandleConnectionStateChanged(object sender, RemoteSessionStateEvent { if (arg == null) { - throw PSTraceSource.NewArgumentNullException("arg"); + throw PSTraceSource.NewArgumentNullException(nameof(arg)); } if (arg.SessionStateInfo.State == RemoteSessionState.EstablishedAndKeyReceived) // TODO - Client session would never get into this state... to be removed @@ -454,12 +454,12 @@ private void HandleNegotiationReceived(object sender, RemoteSessionNegotiationEv { if (arg == null) { - throw PSTraceSource.NewArgumentNullException("arg"); + throw PSTraceSource.NewArgumentNullException(nameof(arg)); } if (arg.RemoteSessionCapability == null) { - throw PSTraceSource.NewArgumentException("arg"); + throw PSTraceSource.NewArgumentException(nameof(arg)); } Context.ServerCapability = arg.RemoteSessionCapability; diff --git a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs index 63713c2c200..ec55f22fc22 100644 --- a/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/client/clientremotesessionprotocolstatemachine.cs @@ -190,7 +190,7 @@ private void SetStateHandler(object sender, RemoteSessionStateMachineEventArgs e "State can be set to NegotiationReceived only when RemoteSessionCapability is not null"); if (eventArgs.RemoteSessionCapability == null) { - throw PSTraceSource.NewArgumentException("eventArgs"); + throw PSTraceSource.NewArgumentException(nameof(eventArgs)); } SetState(RemoteSessionState.NegotiationReceived, null); @@ -554,7 +554,7 @@ private void RaiseEventPrivate(RemoteSessionStateMachineEventArgs arg) { if (arg == null) { - throw PSTraceSource.NewArgumentNullException("arg"); + throw PSTraceSource.NewArgumentNullException(nameof(arg)); } EventHandler handler = _stateMachineHandle[(int)State, (int)arg.StateEvent]; diff --git a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs index 5b7ddd301ee..a711c7dd8f2 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotepipeline.cs @@ -173,7 +173,7 @@ private RemotePipeline(RemotePipeline pipeline) : // originally copied it from PipelineBase if (pipeline == null) { - throw PSTraceSource.NewArgumentNullException("pipeline"); + throw PSTraceSource.NewArgumentNullException(nameof(pipeline)); } if (pipeline._disposed) diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs index 0b8cd69e2de..61be515408f 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs @@ -1041,7 +1041,7 @@ public override Pipeline CreatePipeline(string command) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, false, false); @@ -1062,7 +1062,7 @@ public override Pipeline CreatePipeline(string command, bool addToHistory) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, addToHistory, false); @@ -1097,7 +1097,7 @@ public override Pipeline CreateNestedPipeline(string command, bool addToHistory) { if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } return CoreCreatePipeline(command, addToHistory, true); @@ -1853,7 +1853,7 @@ public RemoteDebugger(RemoteRunspace runspace) { if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } _runspace = runspace; @@ -1882,12 +1882,12 @@ public override DebuggerCommandResults ProcessCommand(PSCommand command, PSDataC if (command == null) { - throw new PSArgumentNullException("command"); + throw new PSArgumentNullException(nameof(command)); } if (output == null) { - throw new PSArgumentNullException("output"); + throw new PSArgumentNullException(nameof(output)); } if (!DebuggerStopped) @@ -2978,7 +2978,7 @@ public override void SetVariable(string name, object value) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } // Verify the runspace has the Set-Variable command. For performance, throw if we got an error @@ -3038,7 +3038,7 @@ public override object GetVariable(string name) { if (name == null) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } // Verify the runspace has the Get-Variable command. For performance, throw if we got an error diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs index 486b9c4cf13..42c50b42035 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs @@ -66,7 +66,7 @@ internal ClientRemoteSessionDSHandlerImpl(ClientRemoteSession session, if (session == null) { - throw PSTraceSource.NewArgumentNullException("session"); + throw PSTraceSource.NewArgumentNullException(nameof(session)); } _session = session; @@ -278,7 +278,7 @@ private void HandleStateChanged(object sender, RemoteSessionStateEventArgs arg) { if (arg == null) { - throw PSTraceSource.NewArgumentNullException("arg"); + throw PSTraceSource.NewArgumentNullException(nameof(arg)); } // Enqueue session related negotiation packets first @@ -540,14 +540,14 @@ internal void DispatchInputQueueData(object sender, RemoteDataEventArgs dataArg) { if (dataArg == null) { - throw PSTraceSource.NewArgumentNullException("dataArg"); + throw PSTraceSource.NewArgumentNullException(nameof(dataArg)); } RemoteDataObject rcvdData = dataArg.ReceivedData; if (rcvdData == null) { - throw PSTraceSource.NewArgumentException("dataArg"); + throw PSTraceSource.NewArgumentException(nameof(dataArg)); } RemotingDestination destination = rcvdData.Destination; @@ -610,7 +610,7 @@ private void ProcessSessionMessages(RemoteDataEventArgs arg) { if (arg == null || arg.ReceivedData == null) { - throw PSTraceSource.NewArgumentNullException("arg"); + throw PSTraceSource.NewArgumentNullException(nameof(arg)); } RemoteDataObject rcvdData = arg.ReceivedData; @@ -684,7 +684,7 @@ internal void ProcessNonSessionMessages(RemoteDataObject rcvdData) // TODO: Consider changing to Dbg.Assert() if (rcvdData == null) { - throw PSTraceSource.NewArgumentNullException("rcvdData"); + throw PSTraceSource.NewArgumentNullException(nameof(rcvdData)); } RemotingTargetInterface targetInterface = rcvdData.TargetInterface; diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs index 6b2fa8c804e..86734f85fc4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs @@ -2137,7 +2137,7 @@ public void StartProgress( if (string.IsNullOrEmpty(computerName)) { - throw new ArgumentNullException("computerName"); + throw new ArgumentNullException(nameof(computerName)); } lock (_syncObject) diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index a000e2d0bbe..248c3a5718e 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -986,7 +986,7 @@ protected void ValidateRemoteRunspacesSpecified() { ThrowTerminatingError(new ErrorRecord(new ArgumentException( GetMessage(RemotingErrorIdStrings.RemoteRunspaceInfoHasDuplicates)), - PSRemotingErrorId.RemoteRunspaceInfoHasDuplicates.ToString(), + nameof(PSRemotingErrorId.RemoteRunspaceInfoHasDuplicates), ErrorCategory.InvalidArgument, Session)); } @@ -997,7 +997,7 @@ protected void ValidateRemoteRunspacesSpecified() { ThrowTerminatingError(new ErrorRecord(new ArgumentException( GetMessage(RemotingErrorIdStrings.RemoteRunspaceInfoLimitExceeded)), - PSRemotingErrorId.RemoteRunspaceInfoLimitExceeded.ToString(), + nameof(PSRemotingErrorId.RemoteRunspaceInfoLimitExceeded), ErrorCategory.InvalidArgument, Session)); } } @@ -1608,7 +1608,7 @@ protected virtual void CreateHelpersForSpecifiedVMSession() ThrowTerminatingError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.HyperVModuleNotAvailable), - PSRemotingErrorId.HyperVModuleNotAvailable.ToString(), + nameof(PSRemotingErrorId.HyperVModuleNotAvailable), ErrorCategory.NotInstalled, null)); @@ -1656,7 +1656,7 @@ protected virtual void CreateHelpersForSpecifiedVMSession() ThrowTerminatingError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.HyperVModuleNotAvailable), - PSRemotingErrorId.HyperVModuleNotAvailable.ToString(), + nameof(PSRemotingErrorId.HyperVModuleNotAvailable), ErrorCategory.NotInstalled, null)); @@ -1692,7 +1692,7 @@ protected virtual void CreateHelpersForSpecifiedVMSession() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMNameNotSingle, this.VMName[index])), - PSRemotingErrorId.InvalidVMNameNotSingle.ToString(), + nameof(PSRemotingErrorId.InvalidVMNameNotSingle), ErrorCategory.InvalidArgument, null)); @@ -1706,7 +1706,7 @@ protected virtual void CreateHelpersForSpecifiedVMSession() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMIdNotSingle, this.VMId[index].ToString(null))), - PSRemotingErrorId.InvalidVMIdNotSingle.ToString(), + nameof(PSRemotingErrorId.InvalidVMIdNotSingle), ErrorCategory.InvalidArgument, null)); @@ -1718,7 +1718,7 @@ protected virtual void CreateHelpersForSpecifiedVMSession() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMState, this.VMName[index])), - PSRemotingErrorId.InvalidVMState.ToString(), + nameof(PSRemotingErrorId.InvalidVMState), ErrorCategory.InvalidArgument, null)); @@ -2013,12 +2013,12 @@ protected ScriptBlock GetScriptBlockFromFile(string filePath, bool isLiteralPath // Make sure filepath doesn't contain wildcards if ((!isLiteralPath) && WildcardPattern.ContainsWildcardCharacters(filePath)) { - throw new ArgumentException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.WildCardErrorFilePathParameter), "filePath"); + throw new ArgumentException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.WildCardErrorFilePathParameter), nameof(filePath)); } if (!filePath.EndsWith(".ps1", StringComparison.OrdinalIgnoreCase)) { - throw new ArgumentException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.FilePathShouldPS1Extension), "filePath"); + throw new ArgumentException(PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.FilePathShouldPS1Extension), nameof(filePath)); } // Resolve file path @@ -2430,7 +2430,7 @@ private List GetUsingVariables(ScriptBlock localScriptBlo { if (localScriptBlock == null) { - throw new ArgumentNullException("localScriptBlock", "Caller needs to make sure the parameter value is not null"); + throw new ArgumentNullException(nameof(localScriptBlock), "Caller needs to make sure the parameter value is not null"); } var allUsingExprs = UsingExpressionAstSearcher.FindAllUsingExpressionExceptForWorkflow(localScriptBlock.Ast); @@ -4368,9 +4368,9 @@ public AuthenticationMechanism ProxyAuthentication default: string message = PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.ProxyAmbiguousAuthentication, value, - AuthenticationMechanism.Basic.ToString(), - AuthenticationMechanism.Negotiate.ToString(), - AuthenticationMechanism.Digest.ToString()); + nameof(AuthenticationMechanism.Basic), + nameof(AuthenticationMechanism.Negotiate), + nameof(AuthenticationMechanism.Digest)); throw new ArgumentException(message); } } diff --git a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs index c5d9648cd0a..5f80dfb5d0c 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PopRunspaceCommand.cs @@ -28,7 +28,7 @@ protected override void ProcessRecord() WriteError( new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.HostDoesNotSupportPushRunspace)), - PSRemotingErrorId.HostDoesNotSupportPushRunspace.ToString(), + nameof(PSRemotingErrorId.HostDoesNotSupportPushRunspace), ErrorCategory.InvalidArgument, null)); return; diff --git a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs index 9a063d935e1..a7751e0138d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs @@ -240,7 +240,7 @@ protected override void ProcessRecord() WriteError( new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.HostDoesNotSupportPushRunspace)), - PSRemotingErrorId.HostDoesNotSupportPushRunspace.ToString(), + nameof(PSRemotingErrorId.HostDoesNotSupportPushRunspace), ErrorCategory.InvalidArgument, null)); return; @@ -373,7 +373,7 @@ protected override void ProcessRecord() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.EnterPSSessionBrokenSession, sessionName, remoteRunspace.ConnectionInfo.ComputerName, remoteRunspace.InstanceId)), - PSRemotingErrorId.PushedRunspaceMustBeOpen.ToString(), + nameof(PSRemotingErrorId.PushedRunspaceMustBeOpen), ErrorCategory.InvalidArgument, null)); } @@ -382,7 +382,7 @@ protected override void ProcessRecord() WriteError( new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.PushedRunspaceMustBeOpen)), - PSRemotingErrorId.PushedRunspaceMustBeOpen.ToString(), + nameof(PSRemotingErrorId.PushedRunspaceMustBeOpen), ErrorCategory.InvalidArgument, null)); } @@ -537,7 +537,7 @@ protected override void StopProcessing() WriteError( new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.HostDoesNotSupportPushRunspace)), - PSRemotingErrorId.HostDoesNotSupportPushRunspace.ToString(), + nameof(PSRemotingErrorId.HostDoesNotSupportPushRunspace), ErrorCategory.InvalidArgument, null)); return; @@ -940,7 +940,7 @@ private RemoteRunspace GetRunspaceForVMSession() WriteError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.HyperVModuleNotAvailable), - PSRemotingErrorId.HyperVModuleNotAvailable.ToString(), + nameof(PSRemotingErrorId.HyperVModuleNotAvailable), ErrorCategory.NotInstalled, null)); @@ -952,7 +952,7 @@ private RemoteRunspace GetRunspaceForVMSession() WriteError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.InvalidVMId), - PSRemotingErrorId.InvalidVMId.ToString(), + nameof(PSRemotingErrorId.InvalidVMId), ErrorCategory.InvalidArgument, null)); @@ -977,7 +977,7 @@ private RemoteRunspace GetRunspaceForVMSession() WriteError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.HyperVModuleNotAvailable), - PSRemotingErrorId.HyperVModuleNotAvailable.ToString(), + nameof(PSRemotingErrorId.HyperVModuleNotAvailable), ErrorCategory.NotInstalled, null)); @@ -989,7 +989,7 @@ private RemoteRunspace GetRunspaceForVMSession() WriteError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.InvalidVMNameNoVM), - PSRemotingErrorId.InvalidVMNameNoVM.ToString(), + nameof(PSRemotingErrorId.InvalidVMNameNoVM), ErrorCategory.InvalidArgument, null)); @@ -1000,7 +1000,7 @@ private RemoteRunspace GetRunspaceForVMSession() WriteError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.InvalidVMNameMultipleVM), - PSRemotingErrorId.InvalidVMNameMultipleVM.ToString(), + nameof(PSRemotingErrorId.InvalidVMNameMultipleVM), ErrorCategory.InvalidArgument, null)); @@ -1020,7 +1020,7 @@ private RemoteRunspace GetRunspaceForVMSession() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMState, this.VMName)), - PSRemotingErrorId.InvalidVMState.ToString(), + nameof(PSRemotingErrorId.InvalidVMState), ErrorCategory.InvalidArgument, null)); diff --git a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs index c9df93cd05b..16f4af800f7 100644 --- a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs @@ -416,12 +416,12 @@ private void HandleRunspaceStateChanged(object sender, OperationStateEventArgs s { if (sender == null) { - throw PSTraceSource.NewArgumentNullException("sender"); + throw PSTraceSource.NewArgumentNullException(nameof(sender)); } if (stateEventArgs == null) { - throw PSTraceSource.NewArgumentNullException("stateEventArgs"); + throw PSTraceSource.NewArgumentNullException(nameof(stateEventArgs)); } RunspaceStateEventArgs runspaceStateEventArgs = @@ -909,7 +909,7 @@ private List CreateRunspacesWhenVMParameterSpecified() ThrowTerminatingError( new ErrorRecord( new ArgumentException(RemotingErrorIdStrings.HyperVModuleNotAvailable), - PSRemotingErrorId.HyperVModuleNotAvailable.ToString(), + nameof(PSRemotingErrorId.HyperVModuleNotAvailable), ErrorCategory.NotInstalled, null)); @@ -927,7 +927,7 @@ private List CreateRunspacesWhenVMParameterSpecified() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMIdNotSingle, this.VMId[index].ToString(null))), - PSRemotingErrorId.InvalidVMIdNotSingle.ToString(), + nameof(PSRemotingErrorId.InvalidVMIdNotSingle), ErrorCategory.InvalidArgument, null)); @@ -941,7 +941,7 @@ private List CreateRunspacesWhenVMParameterSpecified() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMNameNotSingle, this.VMName[index])), - PSRemotingErrorId.InvalidVMNameNotSingle.ToString(), + nameof(PSRemotingErrorId.InvalidVMNameNotSingle), ErrorCategory.InvalidArgument, null)); @@ -962,7 +962,7 @@ private List CreateRunspacesWhenVMParameterSpecified() new ErrorRecord( new ArgumentException(GetMessage(RemotingErrorIdStrings.InvalidVMState, this.VMName[index])), - PSRemotingErrorId.InvalidVMState.ToString(), + nameof(PSRemotingErrorId.InvalidVMState), ErrorCategory.InvalidArgument, null)); diff --git a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs index 1ccdd82c396..ad233ccb481 100644 --- a/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs +++ b/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs @@ -36,12 +36,12 @@ internal static bool HasRepeatingRunspaces(PSSession[] runspaceInfos) { if (runspaceInfos == null) { - throw PSTraceSource.NewArgumentNullException("runspaceInfos"); + throw PSTraceSource.NewArgumentNullException(nameof(runspaceInfos)); } if (runspaceInfos.GetLength(0) == 0) { - throw PSTraceSource.NewArgumentException("runspaceInfos"); + throw PSTraceSource.NewArgumentException(nameof(runspaceInfos)); } for (int i = 0; i < runspaceInfos.GetLength(0); i++) @@ -65,12 +65,12 @@ internal static bool ExceedMaximumAllowableRunspaces(PSSession[] runspaceInfos) { if (runspaceInfos == null) { - throw PSTraceSource.NewArgumentNullException("runspaceInfos"); + throw PSTraceSource.NewArgumentNullException(nameof(runspaceInfos)); } if (runspaceInfos.GetLength(0) == 0) { - throw PSTraceSource.NewArgumentException("runspaceInfos"); + throw PSTraceSource.NewArgumentException(nameof(runspaceInfos)); } return false; diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs index dff56e407f9..12bd7e1ad63 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionHyperVSocket.cs @@ -278,7 +278,7 @@ public RemoteSessionHyperVSocketServer(bool LoopbackMode) throw new PSInvalidOperationException( PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.RemoteSessionHyperVSocketServerConstructorFailure), ex, - PSRemotingErrorId.RemoteSessionHyperVSocketServerConstructorFailure.ToString(), + nameof(PSRemotingErrorId.RemoteSessionHyperVSocketServerConstructorFailure), ErrorCategory.InvalidOperation, null); } diff --git a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs index 6c0e0625bdd..e8c546ff5e1 100644 --- a/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs +++ b/src/System.Management.Automation/engine/remoting/common/RemoteSessionNamedPipe.cs @@ -96,7 +96,7 @@ internal static string CreateProcessPipeName( { if (proc == null) { - throw new PSArgumentNullException("proc"); + throw new PSArgumentNullException(nameof(proc)); } if (string.IsNullOrEmpty(appDomainName)) @@ -453,7 +453,7 @@ internal RemoteSessionNamedPipeServer( { if (pipeName == null) { - throw new PSArgumentNullException("pipeName"); + throw new PSArgumentNullException(nameof(pipeName)); } _syncObject = new object(); @@ -481,11 +481,11 @@ private NamedPipeServerStream CreateNamedPipe( string coreName, CommonSecurityDescriptor securityDesc) { - if (serverName == null) { throw new PSArgumentNullException("serverName"); } + if (serverName == null) { throw new PSArgumentNullException(nameof(serverName)); } - if (namespaceName == null) { throw new PSArgumentNullException("namespaceName"); } + if (namespaceName == null) { throw new PSArgumentNullException(nameof(namespaceName)); } - if (coreName == null) { throw new PSArgumentNullException("coreName"); } + if (coreName == null) { throw new PSArgumentNullException(nameof(coreName)); } #if !UNIX string fullPipeName = @"\\" + serverName + @"\" + namespaceName + @"\" + coreName; @@ -682,7 +682,7 @@ internal void StartListening( { if (clientConnectCallback == null) { - throw new PSArgumentNullException("clientConnectCallback"); + throw new PSArgumentNullException(nameof(clientConnectCallback)); } lock (_syncObject) @@ -1177,7 +1177,7 @@ internal RemoteSessionNamedPipeClient( { if (pipeName == null) { - throw new PSArgumentNullException("pipeName"); + throw new PSArgumentNullException(nameof(pipeName)); } _pipeName = pipeName; @@ -1197,11 +1197,11 @@ internal RemoteSessionNamedPipeClient( string namespaceName, string coreName) { - if (serverName == null) { throw new PSArgumentNullException("serverName"); } + if (serverName == null) { throw new PSArgumentNullException(nameof(serverName)); } - if (namespaceName == null) { throw new PSArgumentNullException("namespaceName"); } + if (namespaceName == null) { throw new PSArgumentNullException(nameof(namespaceName)); } - if (coreName == null) { throw new PSArgumentNullException("coreName"); } + if (coreName == null) { throw new PSArgumentNullException(nameof(coreName)); } _pipeName = @"\\" + serverName + @"\" + namespaceName + @"\" + coreName; @@ -1283,7 +1283,7 @@ public ContainerSessionNamedPipeClient( { if (string.IsNullOrEmpty(containerObRoot)) { - throw new PSArgumentNullException("containerObRoot"); + throw new PSArgumentNullException(nameof(containerObRoot)); } // diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 8736f49050f..1ae89dfd4ef 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -280,7 +280,7 @@ public virtual void SetSessionOptions(PSSessionOption options) { if (options == null) { - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); } if (options.Culture != null) @@ -688,9 +688,9 @@ public AuthenticationMechanism ProxyAuthentication default: string message = PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.ProxyAmbiguousAuthentication, value, - AuthenticationMechanism.Basic.ToString(), - AuthenticationMechanism.Negotiate.ToString(), - AuthenticationMechanism.Digest.ToString()); + nameof(AuthenticationMechanism.Basic), + nameof(AuthenticationMechanism.Negotiate), + nameof(AuthenticationMechanism.Digest)); throw new ArgumentException(message); } } @@ -974,7 +974,7 @@ public override void SetSessionOptions(PSSessionOption options) { if (options == null) { - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); } if ((options.ProxyAccessType == ProxyAccessType.None) && (options.ProxyCredential != null)) @@ -1570,7 +1570,7 @@ public override AuthenticationMechanism AuthenticationMechanism if (value != AuthenticationMechanism.Default) { throw PSTraceSource.NewInvalidOperationException(RemotingErrorIdStrings.IPCSupportsOnlyDefaultAuth, - value.ToString(), AuthenticationMechanism.Default.ToString()); + value.ToString(), nameof(AuthenticationMechanism.Default)); } _authMechanism = value; @@ -1801,7 +1801,7 @@ public override AuthenticationMechanism AuthenticationMechanism if (value != Runspaces.AuthenticationMechanism.Default) { throw PSTraceSource.NewInvalidOperationException(RemotingErrorIdStrings.IPCSupportsOnlyDefaultAuth, - value.ToString(), AuthenticationMechanism.Default.ToString()); + value.ToString(), nameof(AuthenticationMechanism.Default)); } _authMechanism = value; @@ -1912,7 +1912,7 @@ public SSHConnectionInfo( string computerName, string keyFilePath) { - if (computerName == null) { throw new PSArgumentNullException("computerName"); } + if (computerName == null) { throw new PSArgumentNullException(nameof(computerName)); } this.UserName = userName; this.ComputerName = computerName; @@ -2740,7 +2740,7 @@ public override AuthenticationMechanism AuthenticationMechanism if (value != AuthenticationMechanism.Default) { throw PSTraceSource.NewInvalidOperationException(RemotingErrorIdStrings.IPCSupportsOnlyDefaultAuth, - value.ToString(), AuthenticationMechanism.Default.ToString()); + value.ToString(), nameof(AuthenticationMechanism.Default)); } _authMechanism = value; @@ -2864,7 +2864,7 @@ public override AuthenticationMechanism AuthenticationMechanism if (value != AuthenticationMechanism.Default) { throw PSTraceSource.NewInvalidOperationException(RemotingErrorIdStrings.IPCSupportsOnlyDefaultAuth, - value.ToString(), AuthenticationMechanism.Default.ToString()); + value.ToString(), nameof(AuthenticationMechanism.Default)); } _authMechanism = value; 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 bfc4bdaca6b..85ba02b2e7b 100644 --- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs +++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs @@ -1414,7 +1414,7 @@ internal static RemoteDataObject GeneratePowerShellInformational(ProgressRecord { if (progressRecord == null) { - throw PSTraceSource.NewArgumentNullException("progressRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(progressRecord)); } return RemoteDataObject.CreateFrom(RemotingDestination.Client, @@ -1447,7 +1447,7 @@ internal static RemoteDataObject GeneratePowerShellInformational(InformationReco { if (informationRecord == null) { - throw PSTraceSource.NewArgumentNullException("informationRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(informationRecord)); } return RemoteDataObject.CreateFrom(RemotingDestination.Client, @@ -1637,7 +1637,7 @@ private static T ConvertPropertyValueTo(string propertyName, object propertyV { if (propertyName == null) // comes from internal caller { - throw PSTraceSource.NewArgumentNullException("propertyName"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyName)); } if (typeof(T).IsEnum) @@ -1745,12 +1745,12 @@ private static PSPropertyInfo GetProperty(PSObject psObject, string propertyName { if (psObject == null) { - throw PSTraceSource.NewArgumentNullException("psObject"); + throw PSTraceSource.NewArgumentNullException(nameof(psObject)); } if (propertyName == null) { - throw PSTraceSource.NewArgumentNullException("propertyName"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyName)); } PSPropertyInfo property = psObject.Properties[propertyName]; @@ -1767,12 +1767,12 @@ internal static T GetPropertyValue(PSObject psObject, string propertyName) { if (psObject == null) { - throw PSTraceSource.NewArgumentNullException("psObject"); + throw PSTraceSource.NewArgumentNullException(nameof(psObject)); } if (propertyName == null) { - throw PSTraceSource.NewArgumentNullException("propertyName"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyName)); } PSPropertyInfo property = GetProperty(psObject, propertyName); @@ -1784,12 +1784,12 @@ internal static IEnumerable EnumerateListProperty(PSObject psObject, strin { if (psObject == null) { - throw PSTraceSource.NewArgumentNullException("psObject"); + throw PSTraceSource.NewArgumentNullException(nameof(psObject)); } if (propertyName == null) { - throw PSTraceSource.NewArgumentNullException("propertyName"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyName)); } IEnumerable e = GetPropertyValue(psObject, propertyName); @@ -1806,12 +1806,12 @@ internal static IEnumerable> EnumerateHashtable { if (psObject == null) { - throw PSTraceSource.NewArgumentNullException("psObject"); + throw PSTraceSource.NewArgumentNullException(nameof(psObject)); } if (propertyName == null) { - throw PSTraceSource.NewArgumentNullException("propertyName"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyName)); } Hashtable h = GetPropertyValue(psObject, propertyName); @@ -1836,7 +1836,7 @@ internal static RunspacePoolStateInfo GetRunspacePoolStateInfo(PSObject dataAsPS { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } RunspacePoolState state = GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.RunspaceState); @@ -1855,7 +1855,7 @@ internal static PSPrimitiveDictionary GetApplicationPrivateData(PSObject dataAsP { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.ApplicationPrivateData); @@ -1870,7 +1870,7 @@ internal static string GetPublicKey(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.PublicKey); @@ -1885,7 +1885,7 @@ internal static string GetEncryptedSessionKey(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.EncryptedSessionKey); @@ -1901,7 +1901,7 @@ internal static PSEventArgs GetPSEventArgs(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } int eventIdentifier = GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.PSEventArgsEventIdentifier); @@ -1941,7 +1941,7 @@ internal static int GetMinRunspaces(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.MinRunspaces); @@ -1957,7 +1957,7 @@ internal static int GetMaxRunspaces(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.MaxRunspaces); @@ -1973,7 +1973,7 @@ internal static PSPrimitiveDictionary GetApplicationArguments(PSObject dataAsPSO { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } // rehydration might not work yet (there is no type table before a runspace is created) @@ -1990,7 +1990,7 @@ internal static RunspacePoolInitInfo GetRunspacePoolInitInfo(PSObject dataAsPSOb { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } int maxRS = GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.MaxRunspaces); @@ -2009,7 +2009,7 @@ internal static PSThreadOptions GetThreadOptions(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } return GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.ThreadOptions); @@ -2025,7 +2025,7 @@ internal static HostInfo GetHostInfo(PSObject dataAsPSObject) { if (dataAsPSObject == null) { - throw PSTraceSource.NewArgumentNullException("dataAsPSObject"); + throw PSTraceSource.NewArgumentNullException(nameof(dataAsPSObject)); } PSObject propertyValue = GetPropertyValue(dataAsPSObject, RemoteDataNameStrings.HostInfo); @@ -2109,7 +2109,7 @@ internal static ErrorRecord GetPowerShellError(object data) { if (data == null) { - throw PSTraceSource.NewArgumentNullException("data"); + throw PSTraceSource.NewArgumentNullException(nameof(data)); } PSObject dataAsPSObject = data as PSObject; @@ -2126,7 +2126,7 @@ internal static WarningRecord GetPowerShellWarning(object data) { if (data == null) { - throw PSTraceSource.NewArgumentNullException("data"); + throw PSTraceSource.NewArgumentNullException(nameof(data)); } return new WarningRecord((PSObject)data); @@ -2139,7 +2139,7 @@ internal static VerboseRecord GetPowerShellVerbose(object data) { if (data == null) { - throw PSTraceSource.NewArgumentNullException("data"); + throw PSTraceSource.NewArgumentNullException(nameof(data)); } return new VerboseRecord((PSObject)data); @@ -2152,7 +2152,7 @@ internal static DebugRecord GetPowerShellDebug(object data) { if (data == null) { - throw PSTraceSource.NewArgumentNullException("data"); + throw PSTraceSource.NewArgumentNullException(nameof(data)); } return new DebugRecord((PSObject)data); diff --git a/src/System.Management.Automation/engine/remoting/common/misc.cs b/src/System.Management.Automation/engine/remoting/common/misc.cs index ab344497f8b..e5b1f1edc04 100644 --- a/src/System.Management.Automation/engine/remoting/common/misc.cs +++ b/src/System.Management.Automation/engine/remoting/common/misc.cs @@ -17,7 +17,7 @@ internal RemoteSessionNegotiationEventArgs(RemoteSessionCapability remoteSession if (remoteSessionCapability == null) { - throw PSTraceSource.NewArgumentNullException("remoteSessionCapability"); + throw PSTraceSource.NewArgumentNullException(nameof(remoteSessionCapability)); } RemoteSessionCapability = remoteSessionCapability; @@ -50,7 +50,7 @@ internal RemoteDataEventArgs(RemoteDataObject receivedData) if (receivedData == null) { - throw PSTraceSource.NewArgumentNullException("receivedData"); + throw PSTraceSource.NewArgumentNullException(nameof(receivedData)); } ReceivedData = receivedData; @@ -314,7 +314,7 @@ internal RemoteSessionStateEventArgs(RemoteSessionStateInfo remoteSessionStateIn if (remoteSessionStateInfo == null) { - PSTraceSource.NewArgumentNullException("remoteSessionStateInfo"); + PSTraceSource.NewArgumentNullException(nameof(remoteSessionStateInfo)); } SessionStateInfo = remoteSessionStateInfo; diff --git a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs index 47fb742f448..72f404bce10 100644 --- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs +++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs @@ -475,7 +475,7 @@ protected PSRemotingTransportException(SerializationInfo info, StreamingContext { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } _errorCode = info.GetInt32("ErrorCode"); @@ -494,7 +494,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -618,7 +618,7 @@ protected PSRemotingTransportRedirectException(SerializationInfo info, Streaming { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } RedirectLocation = info.GetString("RedirectLocation"); @@ -659,7 +659,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 6ed7eb06245..555bc974d1b 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -528,7 +528,7 @@ private static Type LoadAndAnalyzeAssembly(string shellId, string applicationBas assembly = LoadSsnStateProviderAssembly(applicationBase, assemblyName); if (assembly == null) { - throw PSTraceSource.NewArgumentException("assemblyName", RemotingErrorIdStrings.UnableToLoadAssembly, + throw PSTraceSource.NewArgumentException(nameof(assemblyName), RemotingErrorIdStrings.UnableToLoadAssembly, assemblyName, ConfigurationDataFromXML.INITPARAMETERSTOKEN); } } @@ -545,7 +545,7 @@ private static Type LoadAndAnalyzeAssembly(string shellId, string applicationBas Type type = assembly.GetType(typeToLoad, true, true); if (type == null) { - throw PSTraceSource.NewArgumentException("typeToLoad", RemotingErrorIdStrings.UnableToLoadType, + throw PSTraceSource.NewArgumentException(nameof(typeToLoad), RemotingErrorIdStrings.UnableToLoadType, typeToLoad, ConfigurationDataFromXML.INITPARAMETERSTOKEN); } @@ -572,7 +572,7 @@ private static Type LoadAndAnalyzeAssembly(string shellId, string applicationBas // if we are here, that means we are unable to load the type specified // in the config xml.. notify the same. - throw PSTraceSource.NewArgumentException("typeToLoad", RemotingErrorIdStrings.UnableToLoadType, + throw PSTraceSource.NewArgumentException(nameof(typeToLoad), RemotingErrorIdStrings.UnableToLoadType, typeToLoad, ConfigurationDataFromXML.INITPARAMETERSTOKEN); } @@ -767,7 +767,7 @@ private static string { s_tracer.TraceError("Mandatory property {0} not specified for registry key {1}", name, registryKey.Name); - throw PSTraceSource.NewArgumentException("name", RemotingErrorIdStrings.MandatoryValueNotPresent, name, registryKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), RemotingErrorIdStrings.MandatoryValueNotPresent, name, registryKey.Name); } string s = value as string; @@ -775,7 +775,7 @@ private static string { s_tracer.TraceError("Value is null or empty for mandatory property {0} in {1}", name, registryKey.Name); - throw PSTraceSource.NewArgumentException("name", RemotingErrorIdStrings.MandatoryValueNotInCorrectFormat, name, registryKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), RemotingErrorIdStrings.MandatoryValueNotInCorrectFormat, name, registryKey.Name); } return s; @@ -812,13 +812,13 @@ public override InitialSessionState GetInitialSessionState(PSSenderInfo senderIn public override InitialSessionState GetInitialSessionState(PSSessionConfigurationData sessionConfigurationData, PSSenderInfo senderInfo, string configProviderId) { if (sessionConfigurationData == null) - throw new ArgumentNullException("sessionConfigurationData"); + throw new ArgumentNullException(nameof(sessionConfigurationData)); if (senderInfo == null) - throw new ArgumentNullException("senderInfo"); + throw new ArgumentNullException(nameof(senderInfo)); if (configProviderId == null) - throw new ArgumentNullException("configProviderId"); + throw new ArgumentNullException(nameof(configProviderId)); InitialSessionState sessionState = InitialSessionState.CreateDefault2(); // now get all the modules in the specified path and import the same diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index fd55cd51bd3..eefe68521b7 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -196,8 +196,8 @@ internal static void ProcessData(string data, DataProcessingDelegates callbacks) default: throw new PSRemotingTransportException(PSRemotingErrorId.IPCUnknownNodeType, RemotingErrorIdStrings.IPCUnknownNodeType, reader.NodeType.ToString(), - XmlNodeType.Element.ToString(), - XmlNodeType.EndElement.ToString()); + nameof(XmlNodeType.Element), + nameof(XmlNodeType.EndElement)); } } } @@ -903,7 +903,7 @@ private void OnRemoteSessionSendCompleted() private void OnDataPacketReceived(byte[] rawData, string stream, Guid psGuid) { string streamTemp = System.Management.Automation.Remoting.Client.WSManNativeApi.WSMAN_STREAM_ID_STDOUT; - if (stream.Equals(DataPriorityType.PromptResponse.ToString(), StringComparison.OrdinalIgnoreCase)) + if (stream.Equals(nameof(DataPriorityType.PromptResponse), StringComparison.OrdinalIgnoreCase)) { streamTemp = System.Management.Automation.Remoting.Client.WSManNativeApi.WSMAN_STREAM_ID_PROMPTRESPONSE; } @@ -1444,7 +1444,7 @@ internal VMHyperVSocketClientSessionTransportManager( { if (connectionInfo == null) { - throw new PSArgumentNullException("connectionInfo"); + throw new PSArgumentNullException(nameof(connectionInfo)); } _connectionInfo = connectionInfo; @@ -1478,7 +1478,7 @@ internal override void CreateAsync() throw new PSInvalidOperationException( PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.VMSessionConnectFailed), null, - PSRemotingErrorId.VMSessionConnectFailed.ToString(), + nameof(PSRemotingErrorId.VMSessionConnectFailed), ErrorCategory.InvalidOperation, null); } @@ -1492,7 +1492,7 @@ internal override void CreateAsync() throw new PSInvalidOperationException( PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.VMSessionConnectFailed), null, - PSRemotingErrorId.VMSessionConnectFailed.ToString(), + nameof(PSRemotingErrorId.VMSessionConnectFailed), ErrorCategory.InvalidOperation, null); } @@ -1527,7 +1527,7 @@ internal ContainerHyperVSocketClientSessionTransportManager( { if (connectionInfo == null) { - throw new PSArgumentNullException("connectionInfo"); + throw new PSArgumentNullException(nameof(connectionInfo)); } _connectionInfo = connectionInfo; @@ -1551,7 +1551,7 @@ internal override void CreateAsync() throw new PSInvalidOperationException( PSRemotingErrorInvariants.FormatResourceString(RemotingErrorIdStrings.ContainerSessionConnectFailed), null, - PSRemotingErrorId.ContainerSessionConnectFailed.ToString(), + nameof(PSRemotingErrorId.ContainerSessionConnectFailed), ErrorCategory.InvalidOperation, null); } @@ -1875,7 +1875,7 @@ internal NamedPipeClientSessionTransportManagerBase( { if (connectionInfo == null) { - throw new PSArgumentNullException("connectionInfo"); + throw new PSArgumentNullException(nameof(connectionInfo)); } _connectionInfo = connectionInfo; @@ -2000,7 +2000,7 @@ internal NamedPipeClientSessionTransportManager( { if (connectionInfo == null) { - throw new PSArgumentNullException("connectionInfo"); + throw new PSArgumentNullException(nameof(connectionInfo)); } _connectionInfo = connectionInfo; @@ -2067,7 +2067,7 @@ internal ContainerNamedPipeClientSessionTransportManager( { if (connectionInfo == null) { - throw new PSArgumentNullException("connectionInfo"); + throw new PSArgumentNullException(nameof(connectionInfo)); } _connectionInfo = connectionInfo; diff --git a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs index e88447a61d7..a89f1a9d285 100644 --- a/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs +++ b/src/System.Management.Automation/engine/remoting/server/OutOfProcServerMediator.cs @@ -120,7 +120,7 @@ protected void ProcessingThreadStart(object state) protected void OnDataPacketReceived(byte[] rawData, string stream, Guid psGuid) { string streamTemp = System.Management.Automation.Remoting.Client.WSManNativeApi.WSMAN_STREAM_ID_STDIN; - if (stream.Equals(DataPriorityType.PromptResponse.ToString(), StringComparison.OrdinalIgnoreCase)) + if (stream.Equals(nameof(DataPriorityType.PromptResponse), StringComparison.OrdinalIgnoreCase)) { streamTemp = System.Management.Automation.Remoting.Client.WSManNativeApi.WSMAN_STREAM_ID_PROMPTRESPONSE; } @@ -603,7 +603,7 @@ private NamedPipeProcessMediator( { if (namedPipeServer == null) { - throw new PSArgumentNullException("namedPipeServer"); + throw new PSArgumentNullException(nameof(namedPipeServer)); } _namedPipeServer = namedPipeServer; diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs index 5fe393171d3..1a709b11246 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostRawUserInterface.cs @@ -345,7 +345,7 @@ public override int LengthInBufferCells(string source) { if (source == null) { - throw new ArgumentNullException("source"); + throw new ArgumentNullException(nameof(source)); } return source.Length; @@ -356,7 +356,7 @@ public override int LengthInBufferCells(string source, int offset) { if (source == null) { - throw new ArgumentNullException("source"); + throw new ArgumentNullException(nameof(source)); } Dbg.Assert(offset >= 0, "offset >= 0"); diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs index 15dc8654f88..56d41812a55 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs @@ -110,7 +110,7 @@ internal void ProcessReceivedData(RemoteDataObject receivedData) { if (receivedData == null) { - throw PSTraceSource.NewArgumentNullException("receivedData"); + throw PSTraceSource.NewArgumentNullException(nameof(receivedData)); } Dbg.Assert(receivedData.TargetInterface == RemotingTargetInterface.RunspacePool, @@ -617,7 +617,7 @@ internal void ProcessReceivedData(RemoteDataObject receivedData) { if (receivedData == null) { - throw PSTraceSource.NewArgumentNullException("receivedData"); + throw PSTraceSource.NewArgumentNullException(nameof(receivedData)); } Dbg.Assert(receivedData.TargetInterface == RemotingTargetInterface.PowerShell, diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index 36bbfb4bc08..04f7da23555 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -1846,17 +1846,17 @@ internal ServerRemoteDebugger( { if (driverInvoker == null) { - throw new PSArgumentNullException("driverInvoker"); + throw new PSArgumentNullException(nameof(driverInvoker)); } if (runspace == null) { - throw new PSArgumentNullException("runspace"); + throw new PSArgumentNullException(nameof(runspace)); } if (debugger == null) { - throw new PSArgumentNullException("debugger"); + throw new PSArgumentNullException(nameof(debugger)); } _driverInvoker = driverInvoker; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs index e6520a9d389..1c239133313 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -298,14 +298,14 @@ internal void DispatchInputQueueData(object sender, RemoteDataEventArgs dataEven { if (dataEventArg == null) { - throw PSTraceSource.NewArgumentNullException("dataEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(dataEventArg)); } RemoteDataObject rcvdData = dataEventArg.ReceivedData; if (rcvdData == null) { - throw PSTraceSource.NewArgumentException("dataEventArg"); + throw PSTraceSource.NewArgumentException(nameof(dataEventArg)); } RemotingDestination destination = rcvdData.Destination; @@ -744,7 +744,7 @@ private void HandleCreateRunspacePool(object sender, RemoteDataEventArgs createR { if (createRunspaceEventArg == null) { - throw PSTraceSource.NewArgumentNullException("createRunspaceEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(createRunspaceEventArg)); } RemoteDataObject rcvdData = createRunspaceEventArg.ReceivedData; @@ -922,7 +922,7 @@ private void HandleNegotiationReceived(object sender, RemoteSessionNegotiationEv { if (negotiationEventArg == null) { - throw PSTraceSource.NewArgumentNullException("negotiationEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(negotiationEventArg)); } try diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs index 27bd41330f1..2eae977a8da 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesessionstatemachine.cs @@ -71,7 +71,7 @@ internal ServerRemoteSessionDSHandlerStateMachine(ServerRemoteSession session) { if (session == null) { - throw PSTraceSource.NewArgumentNullException("session"); + throw PSTraceSource.NewArgumentNullException(nameof(session)); } _session = session; @@ -257,7 +257,7 @@ private void RaiseEventPrivate(RemoteSessionStateMachineEventArgs fsmEventArg) { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } EventHandler handler = _stateMachineHandle[(int)_state, (int)fsmEventArg.StateEvent]; @@ -291,7 +291,7 @@ private void DoCreateSession(object sender, RemoteSessionStateMachineEventArgs f { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.CreateSession, "StateEvent must be CreateSession"); @@ -320,7 +320,7 @@ private void DoNegotiationPending(object sender, RemoteSessionStateMachineEventA { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert((_state == RemoteSessionState.Idle) || (_state == RemoteSessionState.NegotiationSent), @@ -352,7 +352,7 @@ private void DoNegotiationReceived(object sender, RemoteSessionStateMachineEvent { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationReceived, "StateEvent must be NegotiationReceived"); @@ -361,12 +361,12 @@ private void DoNegotiationReceived(object sender, RemoteSessionStateMachineEvent if (fsmEventArg.StateEvent != RemoteSessionEvent.NegotiationReceived) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } if (fsmEventArg.RemoteSessionCapability == null) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } SetState(RemoteSessionState.NegotiationReceived, null); @@ -390,7 +390,7 @@ private void DoNegotiationSending(object sender, RemoteSessionStateMachineEventA { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationSending, "Event must be NegotiationSending"); @@ -419,7 +419,7 @@ private void DoNegotiationCompleted(object sender, RemoteSessionStateMachineEven { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(_state == RemoteSessionState.NegotiationSending, "State must be NegotiationSending"); @@ -447,7 +447,7 @@ private void DoEstablished(object sender, RemoteSessionStateMachineEventArgs fsm { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(_state == RemoteSessionState.NegotiationSent, "State must be NegotiationReceived"); @@ -455,7 +455,7 @@ private void DoEstablished(object sender, RemoteSessionStateMachineEventArgs fsm if (fsmEventArg.StateEvent != RemoteSessionEvent.NegotiationCompleted) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } if (_state != RemoteSessionState.NegotiationSent) @@ -487,12 +487,12 @@ internal void DoMessageReceived(object sender, RemoteSessionStateMachineEventArg { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } if (fsmEventArg.RemoteData == null) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } Dbg.Assert(_state == RemoteSessionState.Established || @@ -592,14 +592,14 @@ private void DoConnectFailed(object sender, RemoteSessionStateMachineEventArgs f { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.ConnectFailed, "StateEvent must be ConnectFailed"); if (fsmEventArg.StateEvent != RemoteSessionEvent.ConnectFailed) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } Dbg.Assert(_state == RemoteSessionState.Connecting, "session State must be Connecting"); @@ -629,14 +629,14 @@ private void DoFatalError(object sender, RemoteSessionStateMachineEventArgs fsmE { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.FatalError, "StateEvent must be FatalError"); if (fsmEventArg.StateEvent != RemoteSessionEvent.FatalError) { - throw PSTraceSource.NewArgumentException("fsmEventArg"); + throw PSTraceSource.NewArgumentException(nameof(fsmEventArg)); } DoClose(this, fsmEventArg); @@ -674,7 +674,7 @@ private void DoClose(object sender, RemoteSessionStateMachineEventArgs fsmEventA { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } RemoteSessionState oldState = _state; @@ -728,7 +728,7 @@ private void DoCloseFailed(object sender, RemoteSessionStateMachineEventArgs fsm { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.CloseFailed, "StateEvent must be CloseFailed"); @@ -758,7 +758,7 @@ private void DoCloseCompleted(object sender, RemoteSessionStateMachineEventArgs { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.CloseCompleted, "StateEvent must be CloseCompleted"); @@ -788,7 +788,7 @@ private void DoNegotiationFailed(object sender, RemoteSessionStateMachineEventAr { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationFailed, "StateEvent must be NegotiationFailed"); @@ -817,7 +817,7 @@ private void DoNegotiationTimeout(object sender, RemoteSessionStateMachineEventA { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationTimeout, "StateEvent must be NegotiationTimeout"); @@ -852,7 +852,7 @@ private void DoSendFailed(object sender, RemoteSessionStateMachineEventArgs fsmE { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.SendFailed, "StateEvent must be SendFailed"); @@ -881,7 +881,7 @@ private void DoReceiveFailed(object sender, RemoteSessionStateMachineEventArgs f { if (fsmEventArg == null) { - throw PSTraceSource.NewArgumentNullException("fsmEventArg"); + throw PSTraceSource.NewArgumentNullException(nameof(fsmEventArg)); } Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.ReceiveFailed, "StateEvent must be ReceivedFailed"); diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs index 653299e2cbb..1e72be279c7 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotingprotocolimplementation.cs @@ -172,7 +172,7 @@ internal override void RaiseDataReceivedEvent(RemoteDataEventArgs dataArg) { if (dataArg == null) { - throw PSTraceSource.NewArgumentNullException("dataArg"); + throw PSTraceSource.NewArgumentNullException(nameof(dataArg)); } RemoteDataObject rcvdData = dataArg.ReceivedData; diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index 2341dca4042..5ffa9cf1af4 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -2154,7 +2154,7 @@ private ScriptBlockSerializationHelper(SerializationInfo info, StreamingContext _scriptText = info.GetValue("ScriptText", typeof(string)) as string; if (_scriptText == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } } diff --git a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs index 8ae6da58655..7077ebeacbe 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs @@ -2538,7 +2538,7 @@ internal static object Where(IEnumerator enumerator, ScriptBlock expressionSB, W if (numberToReturn < 0) { - throw new ArgumentOutOfRangeException("numberToReturn", numberToReturn, ParserStrings.NumberToReturnMustBeGreaterThanZero); + throw new ArgumentOutOfRangeException(nameof(numberToReturn), numberToReturn, ParserStrings.NumberToReturnMustBeGreaterThanZero); } var context = Runspace.DefaultRunspace.ExecutionContext; @@ -2771,7 +2771,7 @@ internal static object ForEach(IEnumerator enumerator, object expression, object Diagnostics.Assert(arguments != null, "The ForEach() operator should never receive a null value for the 'arguments' parameter from the runtime."); if (expression == null) { - throw new ArgumentNullException("expression"); + throw new ArgumentNullException(nameof(expression)); } var context = Runspace.DefaultRunspace.ExecutionContext; diff --git a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs index 1f0c26ab01a..0c4658cc14d 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/StringOps.cs @@ -31,7 +31,7 @@ internal static string Multiply(string s, int times) if (times < 0) { // TODO: this should be a runtime error. - throw new ArgumentOutOfRangeException("times"); + throw new ArgumentOutOfRangeException(nameof(times)); } if (times == 0 || s.Length == 0) diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index ddc44bd8970..1b17a39a4a7 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -218,12 +218,12 @@ internal Serializer(XmlWriter writer, SerializationContext context) { if (writer == null) { - throw PSTraceSource.NewArgumentException("writer"); + throw PSTraceSource.NewArgumentException(nameof(writer)); } if (context == null) { - throw PSTraceSource.NewArgumentException("context"); + throw PSTraceSource.NewArgumentException(nameof(context)); } _serializer = new InternalSerializer(writer, context); @@ -484,7 +484,7 @@ internal Deserializer(XmlReader reader, DeserializationContext context) { if (reader == null) { - throw PSTraceSource.NewArgumentNullException("reader"); + throw PSTraceSource.NewArgumentNullException(nameof(reader)); } _reader = reader; @@ -666,7 +666,7 @@ internal static bool IsInstanceOfType(object o, Type type) { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } if (o == null) @@ -687,7 +687,7 @@ internal static bool IsDeserializedInstanceOfType(object o, Type type) { if (type == null) { - throw PSTraceSource.NewArgumentNullException("type"); + throw PSTraceSource.NewArgumentNullException(nameof(type)); } if (o == null) @@ -3110,7 +3110,7 @@ private object ReadOneDeserializedObject(out string streamName, out bool isKnown if (_reader.NodeType != XmlNodeType.Element) { throw NewXmlException(Serialization.InvalidNodeType, null, - _reader.NodeType.ToString(), XmlNodeType.Element.ToString()); + _reader.NodeType.ToString(), nameof(XmlNodeType.Element)); } s_trace.WriteLine("Processing start node {0}", _reader.LocalName); @@ -5905,7 +5905,7 @@ public PSPrimitiveDictionary(Hashtable other) { if (other == null) { - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); } foreach (DictionaryEntry entry in other) @@ -6691,14 +6691,14 @@ public override object ConvertFrom(PSObject sourceValue, Type destinationType, I { if (destinationType == null) { - throw PSTraceSource.NewArgumentNullException("destinationType"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationType)); } if (sourceValue == null) { throw new PSInvalidCastException( "InvalidCastWhenRehydratingFromNull", - PSTraceSource.NewArgumentNullException("sourceValue"), + PSTraceSource.NewArgumentNullException(nameof(sourceValue)), ExtendedTypeSystem.InvalidCastFromNull, destinationType.ToString()); } @@ -7274,13 +7274,13 @@ public static UInt32 GetParameterSetMetadataFlags(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } ParameterSetMetadata parameterSetMetadata = instance.BaseObject as ParameterSetMetadata; if (parameterSetMetadata == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } return (UInt32)(parameterSetMetadata.Flags); @@ -7296,13 +7296,13 @@ public static PSObject GetInvocationInfo(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } DebuggerStopEventArgs dbgStopEventArgs = instance.BaseObject as DebuggerStopEventArgs; if (dbgStopEventArgs == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } if (dbgStopEventArgs.InvocationInfo == null) @@ -7474,7 +7474,7 @@ private static CustomItemBase RehydrateCustomItemBase(PSObject deserializedItem) } else { - throw PSTraceSource.NewArgumentException("deserializedItem"); + throw PSTraceSource.NewArgumentException(nameof(deserializedItem)); } return result; @@ -7556,13 +7556,13 @@ public static Guid GetFormatViewDefinitionInstanceId(PSObject instance) { if (instance == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } FormatViewDefinition formatViewDefinition = instance.BaseObject as FormatViewDefinition; if (formatViewDefinition == null) { - throw PSTraceSource.NewArgumentNullException("instance"); + throw PSTraceSource.NewArgumentNullException(nameof(instance)); } return formatViewDefinition.InstanceId; diff --git a/src/System.Management.Automation/help/CommandHelpProvider.cs b/src/System.Management.Automation/help/CommandHelpProvider.cs index e89bbcc40c4..52e6b3e2916 100644 --- a/src/System.Management.Automation/help/CommandHelpProvider.cs +++ b/src/System.Management.Automation/help/CommandHelpProvider.cs @@ -566,7 +566,7 @@ private string FindHelpFile(CmdletInfo cmdletInfo) if (cmdletInfo == null) { - throw PSTraceSource.NewArgumentNullException("cmdletInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(cmdletInfo)); } // Get the help file name from the cmdlet metadata diff --git a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs index 194160ad5e2..4d2a8100d0c 100644 --- a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs +++ b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs @@ -128,7 +128,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/help/HelpNotFoundException.cs b/src/System.Management.Automation/help/HelpNotFoundException.cs index e6dc7a21ee4..355be44fd7c 100644 --- a/src/System.Management.Automation/help/HelpNotFoundException.cs +++ b/src/System.Management.Automation/help/HelpNotFoundException.cs @@ -134,7 +134,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/help/ProviderHelpProvider.cs b/src/System.Management.Automation/help/ProviderHelpProvider.cs index a21c3038b43..a7d92f58f24 100644 --- a/src/System.Management.Automation/help/ProviderHelpProvider.cs +++ b/src/System.Management.Automation/help/ProviderHelpProvider.cs @@ -149,7 +149,7 @@ private void LoadHelpFile(ProviderInfo providerInfo) { if (providerInfo == null) { - throw PSTraceSource.NewArgumentNullException("providerInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInfo)); } string helpFile = providerInfo.HelpFile; diff --git a/src/System.Management.Automation/logging/MshLog.cs b/src/System.Management.Automation/logging/MshLog.cs index 9ebdb699e40..23c687b58ee 100644 --- a/src/System.Management.Automation/logging/MshLog.cs +++ b/src/System.Management.Automation/logging/MshLog.cs @@ -101,7 +101,7 @@ private static IEnumerable GetLogProvider(ExecutionContext executio { if (executionContext == null) { - throw PSTraceSource.NewArgumentNullException("executionContext"); + throw PSTraceSource.NewArgumentNullException(nameof(executionContext)); } string shellId = executionContext.ShellID; @@ -205,13 +205,13 @@ internal static void LogEngineHealthEvent(ExecutionContext executionContext, { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } if (exception == null) { - PSTraceSource.NewArgumentNullException("exception"); + PSTraceSource.NewArgumentNullException(nameof(exception)); return; } @@ -320,13 +320,13 @@ Dictionary additionalInfo { if (logContext == null) { - PSTraceSource.NewArgumentNullException("logContext"); + PSTraceSource.NewArgumentNullException(nameof(logContext)); return; } if (exception == null) { - PSTraceSource.NewArgumentNullException("exception"); + PSTraceSource.NewArgumentNullException(nameof(exception)); return; } @@ -359,7 +359,7 @@ internal static void LogEngineLifecycleEvent(ExecutionContext executionContext, { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } @@ -407,13 +407,13 @@ Severity severity { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } if (exception == null) { - PSTraceSource.NewArgumentNullException("exception"); + PSTraceSource.NewArgumentNullException(nameof(exception)); return; } @@ -448,13 +448,13 @@ internal static void LogCommandLifecycleEvent(ExecutionContext executionContext, { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } if (invocationInfo == null) { - PSTraceSource.NewArgumentNullException("invocationInfo"); + PSTraceSource.NewArgumentNullException(nameof(invocationInfo)); return; } @@ -490,7 +490,7 @@ internal static void LogCommandLifecycleEvent(ExecutionContext executionContext, { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } @@ -531,7 +531,7 @@ internal static void LogPipelineExecutionDetailEvent(ExecutionContext executionC { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } @@ -562,7 +562,7 @@ internal static void LogPipelineExecutionDetailEvent(ExecutionContext executionC { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } @@ -598,13 +598,13 @@ Severity severity { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } if (exception == null) { - PSTraceSource.NewArgumentNullException("exception"); + PSTraceSource.NewArgumentNullException(nameof(exception)); return; } @@ -639,7 +639,7 @@ internal static void LogProviderLifecycleEvent(ExecutionContext executionContext { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } @@ -675,7 +675,7 @@ internal static void LogSettingsEvent(ExecutionContext executionContext, { if (executionContext == null) { - PSTraceSource.NewArgumentNullException("executionContext"); + PSTraceSource.NewArgumentNullException(nameof(executionContext)); return; } diff --git a/src/System.Management.Automation/namespaces/AliasProvider.cs b/src/System.Management.Automation/namespaces/AliasProvider.cs index 700d2a7ce84..d6b99155630 100644 --- a/src/System.Management.Automation/namespaces/AliasProvider.cs +++ b/src/System.Management.Automation/namespaces/AliasProvider.cs @@ -244,7 +244,7 @@ internal override void SetSessionStateItem(string name, object value, bool write break; } - throw PSTraceSource.NewArgumentException("value"); + throw PSTraceSource.NewArgumentException(nameof(value)); } while (false); } diff --git a/src/System.Management.Automation/namespaces/CoreCommandContext.cs b/src/System.Management.Automation/namespaces/CoreCommandContext.cs index 4c571a6fb73..34cdb0d68b7 100644 --- a/src/System.Management.Automation/namespaces/CoreCommandContext.cs +++ b/src/System.Management.Automation/namespaces/CoreCommandContext.cs @@ -54,7 +54,7 @@ internal CmdletProviderContext(ExecutionContext executionContext) { if (executionContext == null) { - throw PSTraceSource.NewArgumentNullException("executionContext"); + throw PSTraceSource.NewArgumentNullException(nameof(executionContext)); } ExecutionContext = executionContext; @@ -84,7 +84,7 @@ internal CmdletProviderContext(ExecutionContext executionContext, CommandOrigin { if (executionContext == null) { - throw PSTraceSource.NewArgumentNullException("executionContext"); + throw PSTraceSource.NewArgumentNullException(nameof(executionContext)); } ExecutionContext = executionContext; @@ -118,7 +118,7 @@ internal CmdletProviderContext( // verify the command parameter if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } _command = command; @@ -172,7 +172,7 @@ internal CmdletProviderContext( // verify the command parameter if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } _command = command; @@ -220,7 +220,7 @@ internal CmdletProviderContext( // verify the command parameter if (command == null) { - throw PSTraceSource.NewArgumentNullException("command"); + throw PSTraceSource.NewArgumentNullException(nameof(command)); } _command = command; @@ -256,7 +256,7 @@ internal CmdletProviderContext( { if (contextToCopyFrom == null) { - throw PSTraceSource.NewArgumentNullException("contextToCopyFrom"); + throw PSTraceSource.NewArgumentNullException(nameof(contextToCopyFrom)); } ExecutionContext = contextToCopyFrom.ExecutionContext; @@ -985,7 +985,7 @@ internal void WriteErrorsToContext(CmdletProviderContext errorContext) { if (errorContext == null) { - throw PSTraceSource.NewArgumentNullException("errorContext"); + throw PSTraceSource.NewArgumentNullException(nameof(errorContext)); } if (HasErrors()) diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index da2d708aa99..fc60be64a41 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -156,7 +156,7 @@ public FileSystemContentReaderWriter( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (s_tracer.IsEnabled) @@ -435,7 +435,7 @@ internal void SeekItemsBackward(int backCount) if (backCount < 0) { // The caller needs to guarantee that 'backCount' is greater or equals to 0 - throw PSTraceSource.NewArgumentException("backCount"); + throw PSTraceSource.NewArgumentException(nameof(backCount)); } if (_isRawStream && _waitForChanges) @@ -1088,7 +1088,7 @@ private void WriteObject(object content) } catch (InvalidCastException) { - throw PSTraceSource.NewArgumentException("content", FileSystemProviderStrings.ByteEncodingError); + throw PSTraceSource.NewArgumentException(nameof(content), FileSystemProviderStrings.ByteEncodingError); } } else diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 3c35e1bab60..081e51228b6 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -507,7 +507,7 @@ protected override PSDriveInfo NewDrive(PSDriveInfo drive) // verify parameters if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } if (string.IsNullOrEmpty(drive.Root)) @@ -1260,7 +1260,7 @@ protected override void GetItem(string path) if (string.IsNullOrEmpty(path)) { // The parameter was null, throw an exception - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } try @@ -1446,7 +1446,7 @@ protected override void InvokeDefaultAction(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -1628,7 +1628,7 @@ private void GetPathItems( // Verify parameters if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -2114,14 +2114,14 @@ protected override void RenameItem( // Check the parameters if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); if (string.IsNullOrEmpty(newName)) { - throw PSTraceSource.NewArgumentException("newName"); + throw PSTraceSource.NewArgumentException(nameof(newName)); } // Clean up "newname" to fix some common usability problems: @@ -2141,7 +2141,7 @@ protected override void RenameItem( // If a path is specified for the newName then we flag that as an error. if (string.Compare(Path.GetFileName(newName), newName, StringComparison.OrdinalIgnoreCase) != 0) { - throw PSTraceSource.NewArgumentException("newName", FileSystemProviderStrings.RenameError); + throw PSTraceSource.NewArgumentException(nameof(newName), FileSystemProviderStrings.RenameError); } // Verify that the target doesn't represent a device name @@ -2255,7 +2255,7 @@ protected override void NewItem( // Verify parameters if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(type)) @@ -2351,7 +2351,7 @@ protected override void NewItem( if (string.IsNullOrEmpty(strTargetPath)) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } bool exists = false; @@ -2663,7 +2663,7 @@ protected override void NewItem( } else { - throw PSTraceSource.NewArgumentException("type", FileSystemProviderStrings.UnknownType); + throw PSTraceSource.NewArgumentException(nameof(type), FileSystemProviderStrings.UnknownType); } } @@ -2822,7 +2822,7 @@ private bool CreateIntermediateDirectories(string path) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } try @@ -2912,7 +2912,7 @@ protected override void RemoveItem(string path, bool recurse) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } try @@ -3385,7 +3385,7 @@ private bool ItemExists(string path, out ErrorRecord error) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } bool result = false; @@ -3486,7 +3486,7 @@ protected override bool HasChildItems(string path) // verify parameters if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -3588,12 +3588,12 @@ protected override void CopyItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(destinationPath)) { - throw PSTraceSource.NewArgumentException("destinationPath"); + throw PSTraceSource.NewArgumentException(nameof(destinationPath)); } path = NormalizePath(path); @@ -4367,14 +4367,14 @@ private bool PerformCopyFileFromRemoteSession(string sourceFileFullName, FileInf ps.AddParameter("copyFromNumBytes", fragmentSize); if (force) { - ps.AddParameter("force", true); + ps.AddParameter(nameof(force), true); } #if !UNIX if (isAlternateDataStream) { ps.AddParameter("isAlternateStream", true); - ps.AddParameter("streamName", streamName); + ps.AddParameter(nameof(streamName), streamName); } #endif @@ -4528,7 +4528,7 @@ private string MakeRemotePath(System.Management.Automation.PowerShell ps, string string path = null; ps.AddCommand(CopyFileRemoteUtils.PSCopyToSessionHelperName); - ps.AddParameter("remotePath", remotePath); + ps.AddParameter(nameof(remotePath), remotePath); Hashtable op = SafeInvokeCommand.Invoke(ps, this, null); if (op != null) @@ -4689,7 +4689,7 @@ private bool CopyFileStreamToRemoteSession(FileInfo file, string destinationPath ps.AddCommand(CopyFileRemoteUtils.PSCopyToSessionHelperName); ps.AddParameter("copyToFilePath", destinationPath); ps.AddParameter("b64Fragment", b64Fragment); - ps.AddParameter("streamName", streamName); + ps.AddParameter(nameof(streamName), streamName); } Hashtable op = SafeInvokeCommand.Invoke(ps, this, null); @@ -4843,7 +4843,7 @@ private string CreateDirectoryOnRemoteSession(string destination, bool force, Sy ps.AddParameter("createDirectoryPath", destination); if (force) { - ps.AddParameter("force", true); + ps.AddParameter(nameof(force), true); } Hashtable op = SafeInvokeCommand.Invoke(ps, this, null); @@ -5050,7 +5050,7 @@ protected override string NormalizeRelativePath( { if (string.IsNullOrEmpty(path) || !IsValidPath(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (basePath == null) @@ -5237,7 +5237,7 @@ private string NormalizeRelativePathHelper(string path, string basePath) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (path.Length == 0) @@ -5661,7 +5661,7 @@ protected override string GetChildName(string path) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Normalize the path @@ -5724,7 +5724,7 @@ protected override bool IsItemContainer(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -5758,12 +5758,12 @@ protected override void MoveItem( if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(destination)) { - throw PSTraceSource.NewArgumentException("destination"); + throw PSTraceSource.NewArgumentException(nameof(destination)); } path = NormalizePath(path); @@ -6122,7 +6122,7 @@ public void GetProperty(string path, Collection providerSpecificPickList { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -6255,12 +6255,12 @@ public void SetProperty(string path, PSObject propertyToSet) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (propertyToSet == null) { - throw PSTraceSource.NewArgumentNullException("propertyToSet"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyToSet)); } path = NormalizePath(path); @@ -6426,7 +6426,7 @@ public void ClearProperty( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -6434,14 +6434,14 @@ public void ClearProperty( if (propertiesToClear == null || propertiesToClear.Count == 0) { - throw PSTraceSource.NewArgumentNullException("propertiesToClear"); + throw PSTraceSource.NewArgumentNullException(nameof(propertiesToClear)); } // Only the attributes property can be cleared if (propertiesToClear.Count > 1 || Host.CurrentCulture.CompareInfo.Compare("Attributes", propertiesToClear[0], CompareOptions.IgnoreCase) != 0) { - throw PSTraceSource.NewArgumentException("propertiesToClear", FileSystemProviderStrings.CannotClearProperty); + throw PSTraceSource.NewArgumentException(nameof(propertiesToClear), FileSystemProviderStrings.CannotClearProperty); } try @@ -6544,7 +6544,7 @@ public IContentReader GetContentReader(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -6718,7 +6718,7 @@ public IContentWriter GetContentWriter(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -6847,7 +6847,7 @@ public void ClearContent(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); @@ -8455,12 +8455,12 @@ private static bool WinCreateJunction(string path, string target) } else { - throw new ArgumentNullException("target"); + throw new ArgumentNullException(nameof(target)); } } else { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } } @@ -8535,7 +8535,7 @@ public static class AlternateDataStreamUtilities /// The list of streams (and their size) in the file. internal static List GetStreams(string path) { - if (path == null) throw new ArgumentNullException("path"); + if (path == null) throw new ArgumentNullException(nameof(path)); List alternateStreams = new List(); @@ -8648,8 +8648,8 @@ internal static bool TryCreateFileStream(string path, string streamName, FileMod /// The name of the alternate data stream to delete. internal static void DeleteFileStream(string path, string streamName) { - if (path == null) throw new ArgumentNullException("path"); - if (streamName == null) throw new ArgumentNullException("streamName"); + if (path == null) throw new ArgumentNullException(nameof(path)); + if (streamName == null) throw new ArgumentNullException(nameof(streamName)); string adjustedStreamName = streamName.Trim(); if (adjustedStreamName.IndexOf(':') != 0) diff --git a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs index 25143673900..8a95b16ee8b 100644 --- a/src/System.Management.Automation/namespaces/FileSystemSecurity.cs +++ b/src/System.Management.Automation/namespaces/FileSystemSecurity.cs @@ -46,12 +46,12 @@ public void GetSecurityDescriptor(string path, if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if ((sections & ~AccessControlSections.All) != 0) { - throw PSTraceSource.NewArgumentException("sections"); + throw PSTraceSource.NewArgumentException(nameof(sections)); } var currentPrivilegeState = new PlatformInvokes.TOKEN_PRIVILEGE(); @@ -103,14 +103,14 @@ public void SetSecurityDescriptor( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } path = NormalizePath(path); if (securityDescriptor == null) { - throw PSTraceSource.NewArgumentNullException("securityDescriptor"); + throw PSTraceSource.NewArgumentNullException(nameof(securityDescriptor)); } if (!File.Exists(path) && !Directory.Exists(path)) @@ -123,7 +123,7 @@ public void SetSecurityDescriptor( if (sd == null) { - throw PSTraceSource.NewArgumentException("securityDescriptor"); + throw PSTraceSource.NewArgumentException(nameof(securityDescriptor)); } else { diff --git a/src/System.Management.Automation/namespaces/FunctionProvider.cs b/src/System.Management.Automation/namespaces/FunctionProvider.cs index d12808cf7c0..47db2f63adb 100644 --- a/src/System.Management.Automation/namespaces/FunctionProvider.cs +++ b/src/System.Management.Automation/namespaces/FunctionProvider.cs @@ -238,7 +238,7 @@ internal override void SetSessionStateItem(string name, object value, bool write break; } - throw PSTraceSource.NewArgumentException("value"); + throw PSTraceSource.NewArgumentException(nameof(value)); } while (false); if (writeItem && modifiedItem != null) diff --git a/src/System.Management.Automation/namespaces/LocationGlobber.cs b/src/System.Management.Automation/namespaces/LocationGlobber.cs index 0a4e1785e4c..ab43d492d8f 100644 --- a/src/System.Management.Automation/namespaces/LocationGlobber.cs +++ b/src/System.Management.Automation/namespaces/LocationGlobber.cs @@ -2387,7 +2387,7 @@ private static string ParseProviderPath(string path, out string providerId) { ArgumentException e = PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.NotProviderQualifiedPath); throw e; } diff --git a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs index bacaa547a60..9bb1e3813b5 100644 --- a/src/System.Management.Automation/namespaces/NavigationProviderBase.cs +++ b/src/System.Management.Automation/namespaces/NavigationProviderBase.cs @@ -407,7 +407,7 @@ protected virtual string GetParentPath(string path, string root) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (root == null) @@ -508,7 +508,7 @@ internal string ContractRelativePath( if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (path.Length == 0) @@ -706,7 +706,7 @@ protected virtual string GetChildName(string path) if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Normalize the path @@ -1039,7 +1039,7 @@ private static Stack NormalizeThePath( PSArgumentException e = (PSArgumentException) PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.NormalizeRelativePathOutsideBase, path, basePath); diff --git a/src/System.Management.Automation/namespaces/ProviderBase.cs b/src/System.Management.Automation/namespaces/ProviderBase.cs index 9441cf90e75..22bd599f637 100644 --- a/src/System.Management.Automation/namespaces/ProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ProviderBase.cs @@ -98,7 +98,7 @@ internal void SetProviderInformation(ProviderInfo providerInfoToSet) { if (providerInfoToSet == null) { - throw PSTraceSource.NewArgumentNullException("providerInfoToSet"); + throw PSTraceSource.NewArgumentNullException(nameof(providerInfoToSet)); } _providerInformation = providerInfoToSet; @@ -1425,12 +1425,12 @@ public virtual string GetResourceString(string baseName, string resourceId) { if (string.IsNullOrEmpty(baseName)) { - throw PSTraceSource.NewArgumentException("baseName"); + throw PSTraceSource.NewArgumentException(nameof(baseName)); } if (string.IsNullOrEmpty(resourceId)) { - throw PSTraceSource.NewArgumentException("resourceId"); + throw PSTraceSource.NewArgumentException(nameof(resourceId)); } ResourceManager manager = @@ -1447,12 +1447,12 @@ public virtual string GetResourceString(string baseName, string resourceId) } catch (MissingManifestResourceException) { - throw PSTraceSource.NewArgumentException("baseName", GetErrorText.ResourceBaseNameFailure, baseName); + throw PSTraceSource.NewArgumentException(nameof(baseName), GetErrorText.ResourceBaseNameFailure, baseName); } if (retValue == null) { - throw PSTraceSource.NewArgumentException("resourceId", GetErrorText.ResourceIdFailure, resourceId); + throw PSTraceSource.NewArgumentException(nameof(resourceId), GetErrorText.ResourceIdFailure, resourceId); } return retValue; @@ -1468,7 +1468,7 @@ public void ThrowTerminatingError(ErrorRecord errorRecord) { if (errorRecord == null) { - throw PSTraceSource.NewArgumentNullException("errorRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(errorRecord)); } if (errorRecord.ErrorDetails != null @@ -1677,7 +1677,7 @@ public void WriteProgress(ProgressRecord progressRecord) if (progressRecord == null) { - throw PSTraceSource.NewArgumentNullException("progressRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(progressRecord)); } Context.WriteProgress(progressRecord); @@ -1801,7 +1801,7 @@ private PSObject WrapOutputInPSObject( { if (item == null) { - throw PSTraceSource.NewArgumentNullException("item"); + throw PSTraceSource.NewArgumentNullException(nameof(item)); } PSObject result = new PSObject(item); @@ -2000,7 +2000,7 @@ public void WriteError(ErrorRecord errorRecord) if (errorRecord == null) { - throw PSTraceSource.NewArgumentNullException("errorRecord"); + throw PSTraceSource.NewArgumentNullException(nameof(errorRecord)); } if (errorRecord.ErrorDetails != null diff --git a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs index 4107dc662c6..dbc03a69181 100644 --- a/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs +++ b/src/System.Management.Automation/namespaces/ProviderDeclarationAttribute.cs @@ -37,13 +37,13 @@ public CmdletProviderAttribute( if (string.IsNullOrEmpty(providerName)) { - throw PSTraceSource.NewArgumentNullException("providerName"); + throw PSTraceSource.NewArgumentNullException(nameof(providerName)); } if (providerName.IndexOfAny(_illegalCharacters) != -1) { throw PSTraceSource.NewArgumentException( - "providerName", + nameof(providerName), SessionStateStrings.ProviderNameNotValid, providerName); } diff --git a/src/System.Management.Automation/namespaces/RegistryProvider.cs b/src/System.Management.Automation/namespaces/RegistryProvider.cs index 5436dfb0bbb..121d2f1f872 100644 --- a/src/System.Management.Automation/namespaces/RegistryProvider.cs +++ b/src/System.Management.Automation/namespaces/RegistryProvider.cs @@ -112,7 +112,7 @@ protected override PSDriveInfo NewDrive(PSDriveInfo drive) { if (drive == null) { - throw PSTraceSource.NewArgumentNullException("drive"); + throw PSTraceSource.NewArgumentNullException(nameof(drive)); } if (!ItemExists(drive.Root)) @@ -249,7 +249,7 @@ protected override void SetItem(string path, object value) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Confirm the set item with the user @@ -413,7 +413,7 @@ protected override void ClearItem(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Confirm the clear item with the user @@ -533,7 +533,7 @@ protected override void GetChildItems( if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (IsHiveContainer(path)) @@ -680,7 +680,7 @@ protected override void GetChildNames( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (path.Length == 0) @@ -871,12 +871,12 @@ protected override void RenameItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(newName)) { - throw PSTraceSource.NewArgumentException("newName"); + throw PSTraceSource.NewArgumentException(nameof(newName)); } s_tracer.WriteLine("newName = {0}", newName); @@ -941,7 +941,7 @@ protected override void NewItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Confirm the new item with the user @@ -1100,7 +1100,7 @@ protected override void RemoveItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } s_tracer.WriteLine("recurse = {0}", recurse); @@ -1186,7 +1186,7 @@ protected override bool ItemExists(string path) if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } try @@ -1240,7 +1240,7 @@ protected override bool HasChildItems(string path) if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } try @@ -1298,12 +1298,12 @@ protected override void CopyItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(destination)) { - throw PSTraceSource.NewArgumentException("destination"); + throw PSTraceSource.NewArgumentException(nameof(destination)); } s_tracer.WriteLine("destination = {0}", destination); @@ -1586,7 +1586,7 @@ protected override bool IsItemContainer(string path) { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } bool result = false; @@ -1642,12 +1642,12 @@ protected override void MoveItem( { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (string.IsNullOrEmpty(destination)) { - throw PSTraceSource.NewArgumentException("destination"); + throw PSTraceSource.NewArgumentException(nameof(destination)); } s_tracer.WriteLine("destination = {0}", destination); @@ -1785,7 +1785,7 @@ public void GetProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -1853,7 +1853,7 @@ public void SetProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -1863,7 +1863,7 @@ public void SetProperty( if (propertyValue == null) { - throw PSTraceSource.NewArgumentNullException("propertyValue"); + throw PSTraceSource.NewArgumentNullException(nameof(propertyValue)); } IRegistryWrapper key = GetRegkeyForPathWriteIfError(path, true); @@ -1978,7 +1978,7 @@ public void ClearProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -2122,7 +2122,7 @@ public void NewProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -2234,7 +2234,7 @@ public void RemoveProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -2337,7 +2337,7 @@ public void RenameProperty( { if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (!CheckOperationNotAllowedOnHiveContainer(path)) @@ -2426,12 +2426,12 @@ public void CopyProperty( { if (sourcePath == null) { - throw PSTraceSource.NewArgumentNullException("sourcePath"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePath)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (!CheckOperationNotAllowedOnHiveContainer(sourcePath, destinationPath)) @@ -2526,12 +2526,12 @@ public void MoveProperty( { if (sourcePath == null) { - throw PSTraceSource.NewArgumentNullException("sourcePath"); + throw PSTraceSource.NewArgumentNullException(nameof(sourcePath)); } if (destinationPath == null) { - throw PSTraceSource.NewArgumentNullException("destinationPath"); + throw PSTraceSource.NewArgumentNullException(nameof(destinationPath)); } if (!CheckOperationNotAllowedOnHiveContainer(sourcePath, destinationPath)) @@ -2979,7 +2979,7 @@ private void GetFilteredRegistryKeyProperties(string path, if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } filteredCollection = new Collection(); @@ -3199,7 +3199,7 @@ private bool IsHiveContainer(string path) bool result = false; if (path == null) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if (string.IsNullOrEmpty(path) || @@ -3273,7 +3273,7 @@ private IRegistryWrapper GetHiveRoot(string path) { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (TransactionAvailable()) @@ -3321,7 +3321,7 @@ private bool CreateIntermediateKeys(string path) // Check input. if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } try @@ -3359,7 +3359,7 @@ private bool CreateIntermediateKeys(string path) if (remainingPath.Length == 0 || rootKey == null) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } // Create new subkey..and close @@ -3373,7 +3373,7 @@ private bool CreateIntermediateKeys(string path) { // SubKey is null // Unable to create intermediate keys - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } result = true; @@ -3896,7 +3896,7 @@ private static RegistryValueKind GetValueKindFromObject(object value) { if (value == null) { - throw PSTraceSource.NewArgumentNullException("value"); + throw PSTraceSource.NewArgumentNullException(nameof(value)); } RegistryValueKind result = RegistryValueKind.Unknown; diff --git a/src/System.Management.Automation/namespaces/RegistrySecurity.cs b/src/System.Management.Automation/namespaces/RegistrySecurity.cs index cd05967b7eb..04f25d7f06f 100644 --- a/src/System.Management.Automation/namespaces/RegistrySecurity.cs +++ b/src/System.Management.Automation/namespaces/RegistrySecurity.cs @@ -48,12 +48,12 @@ public void GetSecurityDescriptor(string path, // Validate input first. if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentNullException("path"); + throw PSTraceSource.NewArgumentNullException(nameof(path)); } if ((sections & ~AccessControlSections.All) != 0) { - throw PSTraceSource.NewArgumentException("sections"); + throw PSTraceSource.NewArgumentException(nameof(sections)); } path = NormalizePath(path); @@ -93,12 +93,12 @@ public void SetSecurityDescriptor( if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (securityDescriptor == null) { - throw PSTraceSource.NewArgumentNullException("securityDescriptor"); + throw PSTraceSource.NewArgumentNullException(nameof(securityDescriptor)); } path = NormalizePath(path); @@ -110,7 +110,7 @@ public void SetSecurityDescriptor( if (sd == null) { - throw PSTraceSource.NewArgumentException("securityDescriptor"); + throw PSTraceSource.NewArgumentException(nameof(securityDescriptor)); } } else @@ -119,7 +119,7 @@ public void SetSecurityDescriptor( if (sd == null) { - throw PSTraceSource.NewArgumentException("securityDescriptor"); + throw PSTraceSource.NewArgumentException(nameof(securityDescriptor)); } } diff --git a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs index f3720bb130d..33b043ce919 100644 --- a/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs +++ b/src/System.Management.Automation/namespaces/SessionStateProviderBase.cs @@ -190,7 +190,7 @@ protected override void SetItem( if (string.IsNullOrEmpty(name)) { WriteError(new ErrorRecord( - PSTraceSource.NewArgumentNullException("name"), + PSTraceSource.NewArgumentNullException(nameof(name)), "SetItemNullName", ErrorCategory.InvalidArgument, name)); @@ -241,7 +241,7 @@ protected override void ClearItem(string path) if (string.IsNullOrEmpty(path)) { WriteError(new ErrorRecord( - PSTraceSource.NewArgumentNullException("path"), + PSTraceSource.NewArgumentNullException(nameof(path)), "ClearItemNullPath", ErrorCategory.InvalidArgument, path)); @@ -608,7 +608,7 @@ protected override void RemoveItem(string path, bool recurse) if (string.IsNullOrEmpty(path)) { Exception e = - PSTraceSource.NewArgumentException("path"); + PSTraceSource.NewArgumentException(nameof(path)); WriteError(new ErrorRecord( e, "RemoveItemNullPath", @@ -682,7 +682,7 @@ protected override void NewItem(string path, string type, object newItem) if (string.IsNullOrEmpty(path)) { Exception e = - PSTraceSource.NewArgumentException("path"); + PSTraceSource.NewArgumentException(nameof(path)); WriteError(new ErrorRecord( e, "NewItemNullPath", @@ -710,7 +710,7 @@ protected override void NewItem(string path, string type, object newItem) PSArgumentException e = (PSArgumentException) PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.NewItemAlreadyExists, path); @@ -760,7 +760,7 @@ protected override void CopyItem(string path, string copyPath, bool recurse) if (string.IsNullOrEmpty(path)) { Exception e = - PSTraceSource.NewArgumentException("path"); + PSTraceSource.NewArgumentException(nameof(path)); WriteError(new ErrorRecord( e, "CopyItemNullPath", @@ -840,7 +840,7 @@ protected override void CopyItem(string path, string copyPath, bool recurse) PSArgumentException e = (PSArgumentException) PSTraceSource.NewArgumentException( - "path", + nameof(path), SessionStateStrings.CopyItemDoesntExist, path); @@ -866,7 +866,7 @@ protected override void RenameItem(string name, string newName) if (string.IsNullOrEmpty(name)) { Exception e = - PSTraceSource.NewArgumentException("name"); + PSTraceSource.NewArgumentException(nameof(name)); WriteError(new ErrorRecord( e, "RenameItemNullPath", @@ -899,7 +899,7 @@ protected override void RenameItem(string name, string newName) PSArgumentException e = (PSArgumentException) PSTraceSource.NewArgumentException( - "newName", + nameof(newName), SessionStateStrings.NewItemAlreadyExists, newName); @@ -986,7 +986,7 @@ protected override void RenameItem(string name, string newName) PSArgumentException e = (PSArgumentException) PSTraceSource.NewArgumentException( - "name", + nameof(name), SessionStateStrings.RenameItemDoesntExist, name); @@ -1104,12 +1104,12 @@ internal SessionStateProviderBaseContentReaderWriter(string path, SessionStatePr { if (string.IsNullOrEmpty(path)) { - throw PSTraceSource.NewArgumentException("path"); + throw PSTraceSource.NewArgumentException(nameof(path)); } if (provider == null) { - throw PSTraceSource.NewArgumentNullException("provider"); + throw PSTraceSource.NewArgumentNullException(nameof(provider)); } _path = path; @@ -1175,7 +1175,7 @@ public IList Write(IList content) { if (content == null) { - throw PSTraceSource.NewArgumentNullException("content"); + throw PSTraceSource.NewArgumentNullException(nameof(content)); } // Unravel the IList if there is only one value diff --git a/src/System.Management.Automation/namespaces/StackInfo.cs b/src/System.Management.Automation/namespaces/StackInfo.cs index 4715c28172a..887285c37fe 100644 --- a/src/System.Management.Automation/namespaces/StackInfo.cs +++ b/src/System.Management.Automation/namespaces/StackInfo.cs @@ -29,12 +29,12 @@ internal PathInfoStack(string stackName, Stack locationStack) : base() { if (locationStack == null) { - throw PSTraceSource.NewArgumentNullException("locationStack"); + throw PSTraceSource.NewArgumentNullException(nameof(locationStack)); } if (string.IsNullOrEmpty(stackName)) { - throw PSTraceSource.NewArgumentException("stackName"); + throw PSTraceSource.NewArgumentException(nameof(stackName)); } Name = stackName; diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index 49d0f79783e..cf5e559f830 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -112,7 +112,7 @@ internal static Signature SignFile(SigningOption option, (timeStampServerUrl.IndexOf("http://", StringComparison.OrdinalIgnoreCase) != 0)) { throw PSTraceSource.NewArgumentException( - "certificate", + nameof(certificate), Authenticode.TimeStampUrlRequired); } } @@ -131,7 +131,7 @@ internal static Signature SignFile(SigningOption option, if (oidPtr == IntPtr.Zero) { throw PSTraceSource.NewArgumentException( - "certificate", + nameof(certificate), Authenticode.InvalidHashAlgorithm); } else @@ -146,7 +146,7 @@ internal static Signature SignFile(SigningOption option, if (!SecuritySupport.CertIsGoodForSigning(certificate)) { throw PSTraceSource.NewArgumentException( - "certificate", + nameof(certificate), Authenticode.CertNotGoodForSigning); } @@ -226,7 +226,7 @@ internal static Signature SignFile(SigningOption option, if (error == Win32Errors.NTE_BAD_ALGID) { throw PSTraceSource.NewArgumentException( - "certificate", + nameof(certificate), Authenticode.InvalidHashAlgorithm); } diff --git a/src/System.Management.Automation/security/CredentialParameter.cs b/src/System.Management.Automation/security/CredentialParameter.cs index 1472f331e49..0d48e4fa738 100644 --- a/src/System.Management.Automation/security/CredentialParameter.cs +++ b/src/System.Management.Automation/security/CredentialParameter.cs @@ -37,7 +37,7 @@ public override object Transform(EngineIntrinsics engineIntrinsics, object input (engineIntrinsics.Host == null) || (engineIntrinsics.Host.UI == null)) { - throw PSTraceSource.NewArgumentNullException("engineIntrinsics"); + throw PSTraceSource.NewArgumentNullException(nameof(engineIntrinsics)); } if (inputData == null) diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index bc2c3c6374c..63066cbd291 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -185,7 +185,7 @@ internal static SecureString Unprotect(string input) Utils.CheckArgForNullOrEmpty(input, "input"); if ((input.Length % 2) != 0) { - throw PSTraceSource.NewArgumentException("input", Serialization.InvalidEncryptedString, input); + throw PSTraceSource.NewArgumentException(nameof(input), Serialization.InvalidEncryptedString, input); } byte[] data = null; @@ -432,7 +432,7 @@ public static byte[] Protect(byte[] userData, byte[] optionalEntropy, DataProtec { if (userData == null) { - throw new ArgumentNullException("userData"); + throw new ArgumentNullException(nameof(userData)); } GCHandle pbDataIn = new GCHandle(); @@ -520,7 +520,7 @@ public static byte[] Unprotect(byte[] encryptedData, byte[] optionalEntropy, Dat { if (encryptedData == null) { - throw new ArgumentNullException("encryptedData"); + throw new ArgumentNullException(nameof(encryptedData)); } GCHandle pbDataIn = new GCHandle(); diff --git a/src/System.Management.Automation/security/SecurityManager.cs b/src/System.Management.Automation/security/SecurityManager.cs index 7d6478601d7..a5140ea8b19 100644 --- a/src/System.Management.Automation/security/SecurityManager.cs +++ b/src/System.Management.Automation/security/SecurityManager.cs @@ -83,7 +83,7 @@ public PSAuthorizationManager(string shellId) { if (string.IsNullOrEmpty(shellId)) { - throw PSTraceSource.NewArgumentNullException("shellId"); + throw PSTraceSource.NewArgumentNullException(nameof(shellId)); } _shellId = shellId; diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs index b1f13ab0cf0..927bf963332 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinInfo.cs @@ -90,27 +90,27 @@ string vendorFallback { if (string.IsNullOrEmpty(name)) { - throw PSTraceSource.NewArgumentNullException("name"); + throw PSTraceSource.NewArgumentNullException(nameof(name)); } if (string.IsNullOrEmpty(applicationBase)) { - throw PSTraceSource.NewArgumentNullException("applicationBase"); + throw PSTraceSource.NewArgumentNullException(nameof(applicationBase)); } if (string.IsNullOrEmpty(assemblyName)) { - throw PSTraceSource.NewArgumentNullException("assemblyName"); + throw PSTraceSource.NewArgumentNullException(nameof(assemblyName)); } if (string.IsNullOrEmpty(moduleName)) { - throw PSTraceSource.NewArgumentNullException("moduleName"); + throw PSTraceSource.NewArgumentNullException(nameof(moduleName)); } if (psVersion == null) { - throw PSTraceSource.NewArgumentNullException("psVersion"); + throw PSTraceSource.NewArgumentNullException(nameof(psVersion)); } if (version == null) @@ -578,7 +578,7 @@ internal static Collection ReadAll(string psVersion) { if (string.IsNullOrEmpty(psVersion)) { - throw PSTraceSource.NewArgumentNullException("psVersion"); + throw PSTraceSource.NewArgumentNullException(nameof(psVersion)); } RegistryKey monadRootKey = GetMonadRootKey(); @@ -655,12 +655,12 @@ internal static PSSnapInInfo Read(string psVersion, string mshsnapinId) { if (string.IsNullOrEmpty(psVersion)) { - throw PSTraceSource.NewArgumentNullException("psVersion"); + throw PSTraceSource.NewArgumentNullException(nameof(psVersion)); } if (string.IsNullOrEmpty(mshsnapinId)) { - throw PSTraceSource.NewArgumentNullException("mshsnapinId"); + throw PSTraceSource.NewArgumentNullException(nameof(mshsnapinId)); } // PSSnapIn Reader wont service invalid mshsnapins // Monad has specific restrictions on the mshsnapinid like @@ -698,7 +698,7 @@ private static PSSnapInInfo ReadOne(RegistryKey mshSnapInRoot, string mshsnapinI if (mshsnapinKey == null) { s_mshsnapinTracer.TraceError("Error opening registry key {0}\\{1}.", mshSnapInRoot.Name, mshsnapinId); - throw PSTraceSource.NewArgumentException("mshsnapinId", MshSnapinInfo.MshSnapinDoesNotExist, mshsnapinId); + throw PSTraceSource.NewArgumentException(nameof(mshsnapinId), MshSnapinInfo.MshSnapinDoesNotExist, mshsnapinId); } string applicationBase = ReadStringValue(mshsnapinKey, RegistryStrings.MshSnapin_ApplicationBase, true); @@ -759,7 +759,7 @@ private static Collection ReadMultiStringValue(RegistryKey mshsnapinKey, { s_mshsnapinTracer.TraceError("Mandatory property {0} not specified for registry key {1}", name, mshsnapinKey.Name); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.MandatoryValueNotPresent, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.MandatoryValueNotPresent, name, mshsnapinKey.Name); } else { @@ -787,7 +787,7 @@ private static Collection ReadMultiStringValue(RegistryKey mshsnapinKey, { s_mshsnapinTracer.TraceError("Cannot get string/multi-string value for mandatory property {0} in registry key {1}", name, mshsnapinKey.Name); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.MandatoryValueNotInCorrectFormatMultiString, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.MandatoryValueNotInCorrectFormatMultiString, name, mshsnapinKey.Name); } else { @@ -820,7 +820,7 @@ internal static string ReadStringValue(RegistryKey mshsnapinKey, string name, bo { s_mshsnapinTracer.TraceError("Mandatory property {0} not specified for registry key {1}", name, mshsnapinKey.Name); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.MandatoryValueNotPresent, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.MandatoryValueNotPresent, name, mshsnapinKey.Name); } string s = value as string; @@ -828,7 +828,7 @@ internal static string ReadStringValue(RegistryKey mshsnapinKey, string name, bo { s_mshsnapinTracer.TraceError("Value is null or empty for mandatory property {0} in {1}", name, mshsnapinKey.Name); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.MandatoryValueNotInCorrectFormat, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.MandatoryValueNotInCorrectFormat, name, mshsnapinKey.Name); } s_mshsnapinTracer.WriteLine("Successfully read value {0} for property {1} from {2}", @@ -855,22 +855,22 @@ internal static Version ReadVersionValue(RegistryKey mshsnapinKey, string name, catch (ArgumentOutOfRangeException) { s_mshsnapinTracer.TraceError("Cannot convert value {0} to version format", temp); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); } catch (ArgumentException) { s_mshsnapinTracer.TraceError("Cannot convert value {0} to version format", temp); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); } catch (OverflowException) { s_mshsnapinTracer.TraceError("Cannot convert value {0} to version format", temp); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); } catch (FormatException) { s_mshsnapinTracer.TraceError("Cannot convert value {0} to version format", temp); - throw PSTraceSource.NewArgumentException("name", MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); + throw PSTraceSource.NewArgumentException(nameof(name), MshSnapinInfo.VersionValueInCorrect, name, mshsnapinKey.Name); } s_mshsnapinTracer.WriteLine("Successfully converted string {0} to version format.", v); @@ -1192,7 +1192,7 @@ internal static RegistryKey versionRoot = rootKey.OpenSubKey(versionKey); if (versionRoot == null) { - throw PSTraceSource.NewArgumentException("psVersion", MshSnapinInfo.SpecifiedVersionNotFound, versionKey); + throw PSTraceSource.NewArgumentException(nameof(psVersion), MshSnapinInfo.SpecifiedVersionNotFound, versionKey); } return versionRoot; @@ -1219,7 +1219,7 @@ private static RegistryKey mshsnapinRoot = versionRootKey.OpenSubKey(RegistryStrings.MshSnapinKey); if (mshsnapinRoot == null) { - throw PSTraceSource.NewArgumentException("psVersion", MshSnapinInfo.NoMshSnapinPresentForVersion, psVersion); + throw PSTraceSource.NewArgumentException(nameof(psVersion), MshSnapinInfo.NoMshSnapinPresentForVersion, psVersion); } return mshsnapinRoot; @@ -1246,7 +1246,7 @@ internal static RegistryKey mshsnapinRoot = versionRootKey.OpenSubKey(RegistryStrings.MshSnapinKey); if (mshsnapinRoot == null) { - throw PSTraceSource.NewArgumentException("psVersion", MshSnapinInfo.NoMshSnapinPresentForVersion, psVersion); + throw PSTraceSource.NewArgumentException(nameof(psVersion), MshSnapinInfo.NoMshSnapinPresentForVersion, psVersion); } RegistryKey mshsnapinKey = mshsnapinRoot.OpenSubKey(mshSnapInName); diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs index 130ebbe8241..9ee9588be65 100644 --- a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs @@ -192,7 +192,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw PSTraceSource.NewArgumentNullException("info"); + throw PSTraceSource.NewArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs index ea6ecd3b0ba..2dc15062394 100644 --- a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs +++ b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs @@ -87,7 +87,7 @@ protected CommandNotFoundException(SerializationInfo info, { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } _commandName = info.GetString("CommandName"); @@ -107,7 +107,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -394,7 +394,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -470,7 +470,7 @@ private static string BuildMessage( StringBuilder sb = new StringBuilder(); if (missingItems == null) { - throw PSTraceSource.NewArgumentNullException("missingItems"); + throw PSTraceSource.NewArgumentNullException(nameof(missingItems)); } foreach (string missingItem in missingItems) diff --git a/src/System.Management.Automation/utils/ExecutionExceptions.cs b/src/System.Management.Automation/utils/ExecutionExceptions.cs index ab60cc636ba..2b7fcd7cff4 100644 --- a/src/System.Management.Automation/utils/ExecutionExceptions.cs +++ b/src/System.Management.Automation/utils/ExecutionExceptions.cs @@ -33,7 +33,7 @@ internal CmdletInvocationException(ErrorRecord errorRecord) { if (errorRecord == null) { - throw new ArgumentNullException("errorRecord"); + throw new ArgumentNullException(nameof(errorRecord)); } _errorRecord = errorRecord; @@ -58,7 +58,7 @@ internal CmdletInvocationException(Exception innerException, { if (innerException == null) { - throw new ArgumentNullException("innerException"); + throw new ArgumentNullException(nameof(innerException)); } // invocationInfo may be null @@ -142,7 +142,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -208,7 +208,7 @@ internal CmdletProviderInvocationException( { if (innerException == null) { - throw new ArgumentNullException("innerException"); + throw new ArgumentNullException(nameof(innerException)); } _providerInvocationException = innerException; @@ -473,7 +473,7 @@ internal ActionPreferenceStopException(ErrorRecord error) { if (error == null) { - throw new ArgumentNullException("error"); + throw new ArgumentNullException(nameof(error)); } _errorRecord = error; @@ -501,7 +501,7 @@ internal ActionPreferenceStopException(InvocationInfo invocationInfo, { if (errorRecord == null) { - throw new ArgumentNullException("errorRecord"); + throw new ArgumentNullException(nameof(errorRecord)); } _errorRecord = errorRecord; @@ -725,7 +725,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshArgumentException.cs b/src/System.Management.Automation/utils/MshArgumentException.cs index e937a275b4d..26980059c00 100644 --- a/src/System.Management.Automation/utils/MshArgumentException.cs +++ b/src/System.Management.Automation/utils/MshArgumentException.cs @@ -88,7 +88,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshArgumentNullException.cs b/src/System.Management.Automation/utils/MshArgumentNullException.cs index a7b870bcab0..03ab45654a3 100644 --- a/src/System.Management.Automation/utils/MshArgumentNullException.cs +++ b/src/System.Management.Automation/utils/MshArgumentNullException.cs @@ -99,7 +99,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs index e54320235a2..a6bb0dfd3ff 100644 --- a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs +++ b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs @@ -86,7 +86,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshInvalidOperationException.cs b/src/System.Management.Automation/utils/MshInvalidOperationException.cs index e4c0b7b111e..75d7094432e 100644 --- a/src/System.Management.Automation/utils/MshInvalidOperationException.cs +++ b/src/System.Management.Automation/utils/MshInvalidOperationException.cs @@ -57,7 +57,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshNotImplementedException.cs b/src/System.Management.Automation/utils/MshNotImplementedException.cs index c84f66e1ac4..e6a1128a38d 100644 --- a/src/System.Management.Automation/utils/MshNotImplementedException.cs +++ b/src/System.Management.Automation/utils/MshNotImplementedException.cs @@ -57,7 +57,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshNotSupportedException.cs b/src/System.Management.Automation/utils/MshNotSupportedException.cs index fc4ce6871f3..e6847ba6d16 100644 --- a/src/System.Management.Automation/utils/MshNotSupportedException.cs +++ b/src/System.Management.Automation/utils/MshNotSupportedException.cs @@ -57,7 +57,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshObjectDisposedException.cs b/src/System.Management.Automation/utils/MshObjectDisposedException.cs index 0de12d3b0d3..93cf76100bb 100644 --- a/src/System.Management.Automation/utils/MshObjectDisposedException.cs +++ b/src/System.Management.Automation/utils/MshObjectDisposedException.cs @@ -85,7 +85,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/MshTraceSource.cs b/src/System.Management.Automation/utils/MshTraceSource.cs index 9a4d28b8b5b..9bb0cfbcc3d 100644 --- a/src/System.Management.Automation/utils/MshTraceSource.cs +++ b/src/System.Management.Automation/utils/MshTraceSource.cs @@ -103,7 +103,7 @@ internal static PSTraceSource GetTracer( // 2005/04/13-JonN In theory this should be ArgumentException, // but I don't want to deal with loading the string in this // low-level code. - throw new ArgumentNullException("name"); + throw new ArgumentNullException(nameof(name)); } lock (PSTraceSource.s_getTracerLock) @@ -230,7 +230,7 @@ internal static PSArgumentNullException NewArgumentNullException(string paramNam { if (string.IsNullOrEmpty(paramName)) { - throw new ArgumentNullException("paramName"); + throw new ArgumentNullException(nameof(paramName)); } string message = StringUtil.Format(AutomationExceptions.ArgumentNull, paramName); @@ -259,12 +259,12 @@ internal static PSArgumentNullException NewArgumentNullException( { if (string.IsNullOrEmpty(paramName)) { - throw NewArgumentNullException("paramName"); + throw NewArgumentNullException(nameof(paramName)); } if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -289,7 +289,7 @@ internal static PSArgumentException NewArgumentException(string paramName) { if (string.IsNullOrEmpty(paramName)) { - throw new ArgumentNullException("paramName"); + throw new ArgumentNullException(nameof(paramName)); } string message = StringUtil.Format(AutomationExceptions.Argument, paramName); @@ -319,12 +319,12 @@ internal static PSArgumentException NewArgumentException( { if (string.IsNullOrEmpty(paramName)) { - throw NewArgumentNullException("paramName"); + throw NewArgumentNullException(nameof(paramName)); } if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -366,7 +366,7 @@ internal static PSInvalidOperationException NewInvalidOperationException( { if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -396,7 +396,7 @@ internal static PSInvalidOperationException NewInvalidOperationException( { if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -438,7 +438,7 @@ internal static PSNotSupportedException NewNotSupportedException( { if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -479,7 +479,7 @@ internal static PSArgumentOutOfRangeException NewArgumentOutOfRangeException(str { if (string.IsNullOrEmpty(paramName)) { - throw new ArgumentNullException("paramName"); + throw new ArgumentNullException(nameof(paramName)); } string message = StringUtil.Format(AutomationExceptions.ArgumentOutOfRange, paramName); @@ -511,12 +511,12 @@ internal static PSArgumentOutOfRangeException NewArgumentOutOfRangeException( { if (string.IsNullOrEmpty(paramName)) { - throw NewArgumentNullException("paramName"); + throw NewArgumentNullException(nameof(paramName)); } if (string.IsNullOrEmpty(resourceString)) { - throw NewArgumentNullException("resourceString"); + throw NewArgumentNullException(nameof(resourceString)); } string message = StringUtil.Format(resourceString, args); @@ -542,7 +542,7 @@ internal static PSObjectDisposedException NewObjectDisposedException(string obje { if (string.IsNullOrEmpty(objectName)) { - throw NewArgumentNullException("objectName"); + throw NewArgumentNullException(nameof(objectName)); } string message = StringUtil.Format(AutomationExceptions.ObjectDisposed, objectName); diff --git a/src/System.Management.Automation/utils/ObjectReader.cs b/src/System.Management.Automation/utils/ObjectReader.cs index 99cf452fb38..5f9a57eec18 100644 --- a/src/System.Management.Automation/utils/ObjectReader.cs +++ b/src/System.Management.Automation/utils/ObjectReader.cs @@ -27,7 +27,7 @@ public ObjectReaderBase([In, Out] ObjectStreamBase stream) { if (stream == null) { - throw new ArgumentNullException("stream", "stream may not be null"); + throw new ArgumentNullException(nameof(stream), "stream may not be null"); } _stream = stream; @@ -573,7 +573,7 @@ public override Collection NonBlockingRead(int maxRequested) { if (maxRequested < 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("maxRequested", maxRequested); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(maxRequested), maxRequested); } if (maxRequested == 0) @@ -755,7 +755,7 @@ public override Collection NonBlockingRead(int maxRequested) { if (maxRequested < 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("maxRequested", maxRequested); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(maxRequested), maxRequested); } if (maxRequested == 0) diff --git a/src/System.Management.Automation/utils/ObjectStream.cs b/src/System.Management.Automation/utils/ObjectStream.cs index 607d6acc94a..eccfdfad901 100644 --- a/src/System.Management.Automation/utils/ObjectStream.cs +++ b/src/System.Management.Automation/utils/ObjectStream.cs @@ -541,7 +541,7 @@ internal ObjectStream(int capacity) { if (capacity <= 0 || capacity > Int32.MaxValue) { - throw PSTraceSource.NewArgumentOutOfRangeException("capacity", capacity); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(capacity), capacity); } // the maximum number of objects to allow in the stream at a given time. @@ -1124,7 +1124,7 @@ internal override Collection Read(int count) { if (count < 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("count", count); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(count), count); } if (count == 0) @@ -1232,7 +1232,7 @@ internal override Collection NonBlockingRead(int maxRequested) if (maxRequested < 0) { - throw PSTraceSource.NewArgumentOutOfRangeException("maxRequested", maxRequested); + throw PSTraceSource.NewArgumentOutOfRangeException(nameof(maxRequested), maxRequested); } try @@ -1583,7 +1583,7 @@ internal PSDataCollectionStream(Guid psInstanceId, PSDataCollection storeToUs { if (storeToUse == null) { - throw PSTraceSource.NewArgumentNullException("storeToUse"); + throw PSTraceSource.NewArgumentNullException(nameof(storeToUse)); } _objects = storeToUse; diff --git a/src/System.Management.Automation/utils/ObjectWriter.cs b/src/System.Management.Automation/utils/ObjectWriter.cs index 9da4a2307a3..d4fe3493b78 100644 --- a/src/System.Management.Automation/utils/ObjectWriter.cs +++ b/src/System.Management.Automation/utils/ObjectWriter.cs @@ -25,7 +25,7 @@ public ObjectWriter([In, Out] ObjectStreamBase stream) { if (stream == null) { - throw new ArgumentNullException("stream"); + throw new ArgumentNullException(nameof(stream)); } _stream = stream; diff --git a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs index 4daa7dc5962..df08765bb2f 100644 --- a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs +++ b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs @@ -86,12 +86,12 @@ internal ParameterBindingException( { if (string.IsNullOrEmpty(resourceString)) { - throw PSTraceSource.NewArgumentException("resourceString"); + throw PSTraceSource.NewArgumentException(nameof(resourceString)); } if (string.IsNullOrEmpty(errorId)) { - throw PSTraceSource.NewArgumentException("errorId"); + throw PSTraceSource.NewArgumentException(nameof(errorId)); } _invocationInfo = invocationInfo; @@ -194,17 +194,17 @@ internal ParameterBindingException( { if (invocationInfo == null) { - throw PSTraceSource.NewArgumentNullException("invocationInfo"); + throw PSTraceSource.NewArgumentNullException(nameof(invocationInfo)); } if (string.IsNullOrEmpty(resourceString)) { - throw PSTraceSource.NewArgumentException("resourceString"); + throw PSTraceSource.NewArgumentException(nameof(resourceString)); } if (string.IsNullOrEmpty(errorId)) { - throw PSTraceSource.NewArgumentException("errorId"); + throw PSTraceSource.NewArgumentException(nameof(errorId)); } _invocationInfo = invocationInfo; @@ -248,12 +248,12 @@ internal ParameterBindingException( { if (pbex == null) { - throw PSTraceSource.NewArgumentNullException("pbex"); + throw PSTraceSource.NewArgumentNullException(nameof(pbex)); } if (string.IsNullOrEmpty(resourceString)) { - throw PSTraceSource.NewArgumentException("resourceString"); + throw PSTraceSource.NewArgumentException(nameof(resourceString)); } _invocationInfo = pbex.CommandInvocation; @@ -327,7 +327,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/ParserException.cs b/src/System.Management.Automation/utils/ParserException.cs index ac10c577481..098617d0fdd 100644 --- a/src/System.Management.Automation/utils/ParserException.cs +++ b/src/System.Management.Automation/utils/ParserException.cs @@ -47,7 +47,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); @@ -132,7 +132,7 @@ public ParseException(Language.ParseError[] errors) { if ((errors == null) || (errors.Length == 0)) { - throw new ArgumentNullException("errors"); + throw new ArgumentNullException(nameof(errors)); } _errors = errors; diff --git a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs index 0f35f718faa..d6d845c7281 100644 --- a/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs +++ b/src/System.Management.Automation/utils/PowerShellExecutionHelper.cs @@ -18,7 +18,7 @@ internal PowerShellExecutionHelper(PowerShell powershell) { if (powershell == null) { - throw PSTraceSource.NewArgumentNullException("powershell"); + throw PSTraceSource.NewArgumentNullException(nameof(powershell)); } CurrentPowerShell = powershell; diff --git a/src/System.Management.Automation/utils/PsUtils.cs b/src/System.Management.Automation/utils/PsUtils.cs index 0d8c3473ba0..b27f6f7e149 100644 --- a/src/System.Management.Automation/utils/PsUtils.cs +++ b/src/System.Management.Automation/utils/PsUtils.cs @@ -298,11 +298,11 @@ internal static Hashtable EvaluatePowerShellDataFile( bool allowEnvironmentVariables, bool skipPathValidation) { - if (!skipPathValidation && string.IsNullOrEmpty(parameterName)) { throw PSTraceSource.NewArgumentNullException("parameterName"); } + if (!skipPathValidation && string.IsNullOrEmpty(parameterName)) { throw PSTraceSource.NewArgumentNullException(nameof(parameterName)); } - if (string.IsNullOrEmpty(psDataFilePath)) { throw PSTraceSource.NewArgumentNullException("psDataFilePath"); } + if (string.IsNullOrEmpty(psDataFilePath)) { throw PSTraceSource.NewArgumentNullException(nameof(psDataFilePath)); } - if (context == null) { throw PSTraceSource.NewArgumentNullException("context"); } + if (context == null) { throw PSTraceSource.NewArgumentNullException(nameof(context)); } string resolvedPath; if (skipPathValidation) @@ -486,7 +486,7 @@ internal static string StringToBase64String(string input) // shell crashes if you pass an empty script block to a native command if (input == null) { - throw PSTraceSource.NewArgumentNullException("input"); + throw PSTraceSource.NewArgumentNullException(nameof(input)); } string base64 = Convert.ToBase64String @@ -505,7 +505,7 @@ internal static string Base64ToString(string base64) { if (string.IsNullOrEmpty(base64)) { - throw PSTraceSource.NewArgumentNullException("base64"); + throw PSTraceSource.NewArgumentNullException(nameof(base64)); } string output = new string(Encoding.Unicode.GetChars(Convert.FromBase64String(base64))); @@ -521,7 +521,7 @@ internal static object[] Base64ToArgsConverter(string base64) { if (string.IsNullOrEmpty(base64)) { - throw PSTraceSource.NewArgumentNullException("base64"); + throw PSTraceSource.NewArgumentNullException(nameof(base64)); } string decoded = new string(Encoding.Unicode.GetChars(Convert.FromBase64String(base64))); diff --git a/src/System.Management.Automation/utils/ResourceManagerCache.cs b/src/System.Management.Automation/utils/ResourceManagerCache.cs index 7c7036e5f09..c1e463f5ad9 100644 --- a/src/System.Management.Automation/utils/ResourceManagerCache.cs +++ b/src/System.Management.Automation/utils/ResourceManagerCache.cs @@ -43,12 +43,12 @@ internal static ResourceManager GetResourceManager( { if (assembly == null) { - throw PSTraceSource.NewArgumentNullException("assembly"); + throw PSTraceSource.NewArgumentNullException(nameof(assembly)); } if (string.IsNullOrEmpty(baseName)) { - throw PSTraceSource.NewArgumentException("baseName"); + throw PSTraceSource.NewArgumentException(nameof(baseName)); } // Check to see if the manager is already in the cache @@ -153,17 +153,17 @@ internal static string GetResourceString( { if (assembly == null) { - throw PSTraceSource.NewArgumentNullException("assembly"); + throw PSTraceSource.NewArgumentNullException(nameof(assembly)); } if (string.IsNullOrEmpty(baseName)) { - throw PSTraceSource.NewArgumentException("baseName"); + throw PSTraceSource.NewArgumentException(nameof(baseName)); } if (string.IsNullOrEmpty(resourceId)) { - throw PSTraceSource.NewArgumentException("resourceId"); + throw PSTraceSource.NewArgumentException(nameof(resourceId)); } ResourceManager resourceManager = null; @@ -234,7 +234,7 @@ private static ResourceManager InitRMWithAssembly(string baseName, Assembly asse { // 2004/10/11-JonN Do we need a better error message? I don't think so, // since this is private. - throw PSTraceSource.NewArgumentException("assemblyToUse"); + throw PSTraceSource.NewArgumentException(nameof(assemblyToUse)); } return rm; diff --git a/src/System.Management.Automation/utils/RuntimeException.cs b/src/System.Management.Automation/utils/RuntimeException.cs index 17ceb5d0068..3b9d6ae3d73 100644 --- a/src/System.Management.Automation/utils/RuntimeException.cs +++ b/src/System.Management.Automation/utils/RuntimeException.cs @@ -60,7 +60,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/SessionStateExceptions.cs b/src/System.Management.Automation/utils/SessionStateExceptions.cs index bb2532347f7..acf3d9b8306 100644 --- a/src/System.Management.Automation/utils/SessionStateExceptions.cs +++ b/src/System.Management.Automation/utils/SessionStateExceptions.cs @@ -98,7 +98,7 @@ internal ProviderInvocationException(ProviderInfo provider, ErrorRecord errorRec { if (errorRecord == null) { - throw new ArgumentNullException("errorRecord"); + throw new ArgumentNullException(nameof(errorRecord)); } _message = base.Message; @@ -482,7 +482,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont { if (info == null) { - throw new PSArgumentNullException("info"); + throw new PSArgumentNullException(nameof(info)); } base.GetObjectData(info, context); diff --git a/src/System.Management.Automation/utils/StructuredTraceSource.cs b/src/System.Management.Automation/utils/StructuredTraceSource.cs index 1aebf9534e4..c464a27cbaa 100644 --- a/src/System.Management.Automation/utils/StructuredTraceSource.cs +++ b/src/System.Management.Automation/utils/StructuredTraceSource.cs @@ -274,7 +274,7 @@ internal PSTraceSource(string fullName, string name, string description, bool tr // 2005/04/13-JonN In theory this should be ArgumentException, // but I don't want to deal with loading the string in this // low-level code. - throw new ArgumentNullException("fullName"); + throw new ArgumentNullException(nameof(fullName)); } try diff --git a/src/System.Management.Automation/utils/tracing/EtwActivity.cs b/src/System.Management.Automation/utils/tracing/EtwActivity.cs index 7dfac67ddb2..2bd8a57fbeb 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivity.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivity.cs @@ -122,12 +122,12 @@ public CorrelatedCallback(EtwActivity tracer, CallbackNoParameter callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } if (tracer == null) { - throw new ArgumentNullException("tracer"); + throw new ArgumentNullException(nameof(tracer)); } this.tracer = tracer; @@ -144,12 +144,12 @@ public CorrelatedCallback(EtwActivity tracer, CallbackWithState callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } if (tracer == null) { - throw new ArgumentNullException("tracer"); + throw new ArgumentNullException(nameof(tracer)); } this.tracer = tracer; @@ -166,12 +166,12 @@ public CorrelatedCallback(EtwActivity tracer, AsyncCallback callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } if (tracer == null) { - throw new ArgumentNullException("tracer"); + throw new ArgumentNullException(nameof(tracer)); } this.tracer = tracer; @@ -193,12 +193,12 @@ public CorrelatedCallback(EtwActivity tracer, CallbackWithStateAndArgs callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } if (tracer == null) { - throw new ArgumentNullException("tracer"); + throw new ArgumentNullException(nameof(tracer)); } this.tracer = tracer; @@ -380,7 +380,7 @@ public CallbackNoParameter Correlate(CallbackNoParameter callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } return new CorrelatedCallback(this, callback).Callback; @@ -395,7 +395,7 @@ public CallbackWithState Correlate(CallbackWithState callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } return new CorrelatedCallback(this, callback).Callback; @@ -410,7 +410,7 @@ public AsyncCallback Correlate(AsyncCallback callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } return new CorrelatedCallback(this, callback).Callback; @@ -426,7 +426,7 @@ public CallbackWithStateAndArgs Correlate(CallbackWithStateAndArgs callback) { if (callback == null) { - throw new ArgumentNullException("callback"); + throw new ArgumentNullException(nameof(callback)); } return new CorrelatedCallback(this, callback).Callback; diff --git a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs index 50bb00dd488..db63b2727d3 100644 --- a/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs +++ b/src/System.Management.Automation/utils/tracing/EtwActivityReverterMethodInvoker.cs @@ -22,7 +22,7 @@ public EtwActivityReverterMethodInvoker(IEtwEventCorrelator eventCorrelator) { if (eventCorrelator == null) { - throw new ArgumentNullException("eventCorrelator"); + throw new ArgumentNullException(nameof(eventCorrelator)); } _eventCorrelator = eventCorrelator; diff --git a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs index 32b0bb5a222..7e4e81abe06 100644 --- a/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs +++ b/src/System.Management.Automation/utils/tracing/EtwEventCorrelator.cs @@ -63,7 +63,7 @@ public EtwEventCorrelator(EventProvider transferProvider, EventDescriptor transf { if (transferProvider == null) { - throw new ArgumentNullException("transferProvider"); + throw new ArgumentNullException(nameof(transferProvider)); } _transferProvider = transferProvider; From 3131ab3f630c6b9022f3d257593ed6985bd00f62 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 19 May 2020 13:13:37 -0700 Subject: [PATCH 200/275] Update `LICENSE.txt` so that it's recognized as MIT (#12729) --- LICENSE.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 6eb8dc060c3..b2f52a2bad4 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,11 +1,9 @@ -PowerShell - Copyright (c) Microsoft Corporation. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal +of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is From 5cb7847969ef8acfe77ebbecf2f1baebf8c73a75 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 19 May 2020 14:32:04 -0700 Subject: [PATCH 201/275] Bump `Microsoft.CodeAnalysis.CSharp` from `3.5.0` to `3.6.0` (#12731) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 80a65c2032f..62552f73fae 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -31,7 +31,7 @@ - + From 9fe96f0d8e67a4d66e051b2f8d7fc4567f39dab0 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Wed, 20 May 2020 07:36:06 +0200 Subject: [PATCH 202/275] IDictionary -> IDictionary for FunctionTable (#12658) # PR Summary Typed return value for SessionStateInternal.GetFunctionTable. IDictionary instead of IDictionary. ## PR Context Removes unnecessary casts, and helps with later nullablility changes. ## PR Checklist - [ ] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [ ] N/A or can only be tested interactively - **OR** - [x] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../engine/CommandSearcher.cs | 12 ++++++------ .../engine/GetCommandCommand.cs | 18 ++++++++---------- .../engine/Modules/ModuleCmdletBase.cs | 16 ++++++++-------- .../engine/SessionStateFunctionAPIs.cs | 2 +- .../namespaces/FunctionProvider.cs | 2 +- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index aafdadf924d..cb258dfcf06 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -778,19 +778,19 @@ private CommandInfo GetNextFunction() _commandName, WildcardOptions.IgnoreCase); - foreach (DictionaryEntry functionEntry in _context.EngineSessionState.GetFunctionTable()) + foreach ((string functionName, FunctionInfo functionInfo) in _context.EngineSessionState.GetFunctionTable()) { - if (functionMatcher.IsMatch((string)functionEntry.Key) || + if (functionMatcher.IsMatch(functionName) || (_commandResolutionOptions.HasFlag(SearchResolutionOptions.FuzzyMatch) && - FuzzyMatcher.IsFuzzyMatch(functionEntry.Key.ToString(), _commandName))) + FuzzyMatcher.IsFuzzyMatch(functionName, _commandName))) { - matchingFunction.Add((CommandInfo)functionEntry.Value); + matchingFunction.Add(functionInfo); } else if (_commandResolutionOptions.HasFlag(SearchResolutionOptions.UseAbbreviationExpansion)) { - if (_commandName.Equals(ModuleUtils.AbbreviateName((string)functionEntry.Key), StringComparison.OrdinalIgnoreCase)) + if (_commandName.Equals(ModuleUtils.AbbreviateName(functionName), StringComparison.OrdinalIgnoreCase)) { - matchingFunction.Add((CommandInfo)functionEntry.Value); + matchingFunction.Add(functionInfo); } } } diff --git a/src/System.Management.Automation/engine/GetCommandCommand.cs b/src/System.Management.Automation/engine/GetCommandCommand.cs index adc7c9c95bd..eef50f29a24 100644 --- a/src/System.Management.Automation/engine/GetCommandCommand.cs +++ b/src/System.Management.Automation/engine/GetCommandCommand.cs @@ -591,12 +591,12 @@ private PSObject GetSyntaxObject(CommandInfo command) if (this.Name != null && !Array.Exists(this.Name, name => name.Equals(command.Name, StringComparison.InvariantCultureIgnoreCase))) { string aliasName = _nameContainsWildcard ? command.Name : this.Name[0]; - + IDictionary aliasTable = SessionState.Internal.GetAliasTable(); foreach (KeyValuePair tableEntry in aliasTable) { - if ((Array.Exists(this.Name, name => name.Equals(tableEntry.Key, StringComparison.InvariantCultureIgnoreCase)) && - tableEntry.Value.Definition == command.Name) || + if ((Array.Exists(this.Name, name => name.Equals(tableEntry.Key, StringComparison.InvariantCultureIgnoreCase)) && + tableEntry.Value.Definition == command.Name) || (_nameContainsWildcard && tableEntry.Value.Definition == command.Name)) { aliasName = tableEntry.Key; @@ -635,7 +635,7 @@ private PSObject GetSyntaxObject(CommandInfo command) break; } - + syntax = PSObject.AsPSObject(replacedSyntax); } @@ -1444,15 +1444,13 @@ private IEnumerable GetMatchingCommandsFromModules(string commandNa // Look in function table if ((this.CommandType & (CommandTypes.Function | CommandTypes.Filter | CommandTypes.Configuration)) != 0) { - foreach (DictionaryEntry function in module.SessionState.Internal.GetFunctionTable()) + foreach ((string functionName, FunctionInfo functionInfo) in module.SessionState.Internal.GetFunctionTable()) { - FunctionInfo func = (FunctionInfo)function.Value; - - if (matcher.IsMatch((string)function.Key) && func.IsImported) + if (matcher.IsMatch(functionName) && functionInfo.IsImported) { // make sure function doesn't come from the current module's nested module - if (func.Module.Path.Equals(module.Path, StringComparison.OrdinalIgnoreCase)) - yield return (CommandInfo)function.Value; + if (functionInfo.Module.Path.Equals(module.Path, StringComparison.OrdinalIgnoreCase)) + yield return functionInfo; } } } diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index 0e821686f53..ebf89ed90cc 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -5074,29 +5074,29 @@ internal void RemoveModule(PSModuleInfo module, string moduleNameInRemoveModuleC // Remove the imported functions from SessionState... // (can't just go through module.SessionState.Internal.ExportedFunctions, // because the names of the functions might have been changed by the -Prefix parameter of Import-Module) - foreach (DictionaryEntry entry in ss.GetFunctionTable()) + foreach ((var _, FunctionInfo functionInfo) in ss.GetFunctionTable()) { - FunctionInfo func = (FunctionInfo)entry.Value; - if (func.Module == null) + if (functionInfo.Module == null) { continue; } - if (func.Module.Path.Equals(module.Path, StringComparison.OrdinalIgnoreCase)) + if (functionInfo.Module.Path.Equals(module.Path, StringComparison.OrdinalIgnoreCase)) { + string functionName = functionInfo.Name; try { - ss.RemoveFunction(func.Name, true); + ss.RemoveFunction(functionName, true); - string memberMessage = StringUtil.Format(Modules.RemovingImportedFunction, func.Name); + string memberMessage = StringUtil.Format(Modules.RemovingImportedFunction, functionName); WriteVerbose(memberMessage); } catch (SessionStateUnauthorizedAccessException e) { - string message = StringUtil.Format(Modules.UnableToRemoveModuleMember, func.Name, module.Name, e.Message); + string message = StringUtil.Format(Modules.UnableToRemoveModuleMember, functionName, module.Name, e.Message); InvalidOperationException memberNotRemoved = new InvalidOperationException(message, e); ErrorRecord er = new ErrorRecord(memberNotRemoved, "Modules_MemberNotRemoved", - ErrorCategory.PermissionDenied, func.Name); + ErrorCategory.PermissionDenied, functionName); WriteError(er); } } diff --git a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs index 2e45499f485..573667573a3 100644 --- a/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateFunctionAPIs.cs @@ -39,7 +39,7 @@ internal void AddSessionStateEntry(SessionStateFunctionEntry entry) /// /// An IDictionary representing the visible functions. /// - internal IDictionary GetFunctionTable() + internal IDictionary GetFunctionTable() { SessionStateScopeEnumerator scopeEnumerator = new SessionStateScopeEnumerator(_currentScope); diff --git a/src/System.Management.Automation/namespaces/FunctionProvider.cs b/src/System.Management.Automation/namespaces/FunctionProvider.cs index 47db2f63adb..1843d1edff8 100644 --- a/src/System.Management.Automation/namespaces/FunctionProvider.cs +++ b/src/System.Management.Automation/namespaces/FunctionProvider.cs @@ -309,7 +309,7 @@ internal override object GetValueOfItem(object item) /// internal override IDictionary GetSessionStateTable() { - return SessionState.Internal.GetFunctionTable(); + return (IDictionary)SessionState.Internal.GetFunctionTable(); } /// From a015bfe44e539449faaf3aba5f3bc2cbdb5ea6fd Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 20 May 2020 11:25:19 +0100 Subject: [PATCH 203/275] Remove `assets\license.rtf` (#12721) # PR Summary Since #8846, we do not show an EULA in the MSI, so we can remove `license.rtf`. ## PR Context Fix #12719 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- tools/packaging/packaging.psm1 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 3faacf27467..507d8fe902b 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -337,7 +337,6 @@ function Start-PSPackage { ProductSourcePath = $Source ProductVersion = $Version AssetsPath = "$RepoRoot\assets" - LicenseFilePath = "$RepoRoot\assets\license.rtf" # Product Code needs to be unique for every PowerShell version since it is a unique identifier for the particular product release ProductCode = New-Guid ProductTargetArchitecture = $TargetArchitecture @@ -2959,11 +2958,6 @@ function New-MSIPackage [ValidateScript( {Test-Path $_})] [string] $AssetsPath = "$RepoRoot\assets", - # Path to license.rtf file - for the EULA - [ValidateNotNullOrEmpty()] - [ValidateScript( {Test-Path $_})] - [string] $LicenseFilePath = "$RepoRoot\assets\license.rtf", - # Architecture to use when creating the MSI [Parameter(Mandatory = $true)] [ValidateSet("x86", "x64")] @@ -3087,7 +3081,7 @@ function New-MSIPackage Write-Log "running light..." # suppress ICE61, because we allow same version upgrades # suppress ICE57, this suppresses an error caused by our shortcut not being installed per user - Start-NativeExecution -VerboseOutputOnError {& $wixPaths.wixLightExePath -sice:ICE61 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath"} + Start-NativeExecution -VerboseOutputOnError {& $wixPaths.wixLightExePath -sice:ICE61 -sice:ICE57 -out $msiLocationPath -pdbout $msiPdbLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension } Remove-Item -ErrorAction SilentlyContinue $wixFragmentPath -Force Remove-Item -ErrorAction SilentlyContinue $wixObjProductPath -Force From d98f131c5aa4d1e9ee73cb95b2ac1b939b76a736 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 20 May 2020 13:02:38 +0100 Subject: [PATCH 204/275] Remove phrase 'All rights reserved' from Microsoft copyright statements (#12722) # PR Summary ## PR Context follow-up #12190 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- PowerShell.Common.props | 2 +- assets/pwsh.1.ronn | 1 - .../cimSupport/cmdletization/xml/cmdlets-over-objects.xsd | 2 +- .../engine/Modules/ImportProvider.Tests.ps1 | 2 +- test/Test.Common.props | 2 +- test/powershell/engine/Api/PSCommand.Tests.ps1 | 2 +- .../Microsoft.PowerShell.RemotingTools.psd1 | 2 +- tools/packaging/packaging.strings.psd1 | 4 ++-- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 6cae0785ec3..c2ee2dbf2a2 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -93,7 +93,7 @@ PowerShell Microsoft Corporation - (c) Microsoft Corporation. All rights reserved. + (c) Microsoft Corporation. net5.0 8.0 diff --git a/assets/pwsh.1.ronn b/assets/pwsh.1.ronn index 01e57148be0..bcc38f7b8b0 100644 --- a/assets/pwsh.1.ronn +++ b/assets/pwsh.1.ronn @@ -120,4 +120,3 @@ These are automatically defined PowerShell-language variables. ## COPYRIGHT Copyright (c) Microsoft Corporation. -All rights reserved. diff --git a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xsd b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xsd index f96c261d9c0..0766b785451 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xsd +++ b/src/System.Management.Automation/cimSupport/cmdletization/xml/cmdlets-over-objects.xsd @@ -1,6 +1,6 @@ PowerShell Test Microsoft Corporation - (c) Microsoft Corporation. All rights reserved. + (c) Microsoft Corporation. netcoreapp5.0 8.0 diff --git a/test/powershell/engine/Api/PSCommand.Tests.ps1 b/test/powershell/engine/Api/PSCommand.Tests.ps1 index 9609db963e7..373951cd29e 100644 --- a/test/powershell/engine/Api/PSCommand.Tests.ps1 +++ b/test/powershell/engine/Api/PSCommand.Tests.ps1 @@ -1,4 +1,4 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. +# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "PSCommand API tests" -Tag "CI" { diff --git a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 index 770b3135db4..328889af53f 100644 --- a/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 +++ b/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psd1 @@ -11,7 +11,7 @@ GUID = 'e11d52a1-d5a0-4e4d-92cd-e87114bf4a5c' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' -Copyright = '(c) Microsoft Corporation. All rights reserved.' +Copyright = '(c) Microsoft Corporation.' Description = ' This module contains remoting tool cmdlets. diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index 8406eb7994e..7d8a38fd05c 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -137,7 +137,7 @@ open {0} https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt PowerShell en-US - © Microsoft Corporation. All rights reserved. + © Microsoft Corporation. @@ -173,7 +173,7 @@ open {0} MIT PowerShell en-US - © Microsoft Corporation. All rights reserved. + © Microsoft Corporation. From 36951e05c9546bb08634093ef6844496140998d5 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 20 May 2020 16:01:58 +0100 Subject: [PATCH 205/275] Redundancy: Remove 'partial' modifier from type with a single part (#12725) # PR Summary Fix RCS1043 ## PR Context https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1043.md ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../utility/WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs | 2 +- .../WebCmdlet/CoreCLR/WebResponseHelper.CoreClr.cs | 2 +- src/Microsoft.WSMan.Management/ConfigProvider.cs | 2 +- src/System.Management.Automation/engine/cmdlet.cs | 2 +- .../engine/interpreter/DynamicSplatInstruction.cs | 2 +- .../engine/interpreter/Instruction.cs | 2 +- .../engine/interpreter/Utilities.cs | 2 +- .../engine/remoting/commands/PSRemotingCmdlet.cs | 10 +++++----- .../utils/ExtensionMethods.cs | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) 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 84e96e34675..30ad227c7aa 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 @@ -6,7 +6,7 @@ namespace Microsoft.PowerShell.Commands { - internal static partial class HttpKnownHeaderNames + internal static class HttpKnownHeaderNames { #region Known_HTTP_Header_Names 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 7b118840576..dc2f734d6bd 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 @@ -8,7 +8,7 @@ namespace Microsoft.PowerShell.Commands { - internal static partial class WebResponseHelper + internal static class WebResponseHelper { internal static string GetCharacterSet(HttpResponseMessage response) { diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 3738af380f5..9ded9e76f04 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -24,7 +24,7 @@ namespace Microsoft.WSMan.Management /// WsMan Provider. /// [CmdletProvider(WSManStringLiterals.ProviderName, ProviderCapabilities.Credentials)] - public sealed partial class WSManConfigProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp + public sealed class WSManConfigProvider : NavigationCmdletProvider, ICmdletProviderSupportsHelp { // Plugin Name Storage private PSObject objPluginNames = null; diff --git a/src/System.Management.Automation/engine/cmdlet.cs b/src/System.Management.Automation/engine/cmdlet.cs index 00890bb31a4..b676337531e 100644 --- a/src/System.Management.Automation/engine/cmdlet.cs +++ b/src/System.Management.Automation/engine/cmdlet.cs @@ -30,7 +30,7 @@ namespace System.Management.Automation /// task, extending the Cmdlet or PSCmdlet classes only as a thin management layer. /// /// - public abstract partial class Cmdlet : InternalCommand + public abstract class Cmdlet : InternalCommand { #region public_properties diff --git a/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs b/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs index 0bb35e1ff26..ab7aa891a26 100644 --- a/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs +++ b/src/System.Management.Automation/engine/interpreter/DynamicSplatInstruction.cs @@ -20,7 +20,7 @@ namespace System.Management.Automation.Interpreter /// /// Implements dynamic call site with many arguments. Wraps the arguments into . /// - internal sealed partial class DynamicSplatInstruction : Instruction + internal sealed class DynamicSplatInstruction : Instruction { private readonly CallSite> _site; private readonly int _argumentCount; diff --git a/src/System.Management.Automation/engine/interpreter/Instruction.cs b/src/System.Management.Automation/engine/interpreter/Instruction.cs index f2072b2a488..0a46fd88dfa 100644 --- a/src/System.Management.Automation/engine/interpreter/Instruction.cs +++ b/src/System.Management.Automation/engine/interpreter/Instruction.cs @@ -22,7 +22,7 @@ internal interface IInstructionProvider void AddInstructions(LightCompiler compiler); } - internal abstract partial class Instruction + internal abstract class Instruction { public const int UnknownInstrIndex = int.MaxValue; diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index 85d7c09841c..2ea3258120f 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -126,7 +126,7 @@ internal static T[] AddLast(this IList list, T item) } } - internal static partial class DelegateHelpers + internal static class DelegateHelpers { #region Generated Maximum Delegate Arity diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index 248c3a5718e..ef9236f5bfd 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Commands /// It contains tons of utility functions which are used all /// across the remoting cmdlets. /// - public abstract partial class PSRemotingCmdlet : PSCmdlet + public abstract class PSRemotingCmdlet : PSCmdlet { #region Overrides @@ -296,7 +296,7 @@ internal struct SSHConnection /// 2. Invoke-Expression /// 3. Start-PSJob. /// - public abstract partial class PSRemotingBaseCmdlet : PSRemotingCmdlet + public abstract class PSRemotingBaseCmdlet : PSRemotingCmdlet { #region Enums @@ -1149,7 +1149,7 @@ protected override void BeginProcessing() /// 1. Invoke-Expression /// 2. Start-PSJob. /// - public abstract partial class PSExecutionCmdlet : PSRemotingBaseCmdlet + public abstract class PSExecutionCmdlet : PSRemotingBaseCmdlet { #region Strings @@ -2448,7 +2448,7 @@ private List GetUsingVariables(ScriptBlock localScriptBlo /// 3. Disconnect-PSSession /// 4. Connect-PSSession. /// - public abstract partial class PSRunspaceCmdlet : PSRemotingCmdlet + public abstract class PSRunspaceCmdlet : PSRemotingCmdlet { #region Parameters @@ -3222,7 +3222,7 @@ private void WriteInvalidArgumentError(PSRemotingErrorId errorId, string resourc /// Base class for both the helpers. This is an abstract class /// and the helpers need to derive from this. /// - internal abstract partial class ExecutionCmdletHelper : IThrottleOperation + internal abstract class ExecutionCmdletHelper : IThrottleOperation { /// /// Pipeline associated with this operation. diff --git a/src/System.Management.Automation/utils/ExtensionMethods.cs b/src/System.Management.Automation/utils/ExtensionMethods.cs index 93951bb1ac1..127c9a226cf 100644 --- a/src/System.Management.Automation/utils/ExtensionMethods.cs +++ b/src/System.Management.Automation/utils/ExtensionMethods.cs @@ -68,7 +68,7 @@ internal static int SequenceGetHashCode(this IEnumerable xs) /// * If you want to add an extension method that will be used only by CoreCLR powershell, please add it to the partial /// 'PSTypeExtensions' class in 'CorePsExtensions.cs'. /// - internal static partial class PSTypeExtensions + internal static class PSTypeExtensions { /// /// Check does the type have an instance default constructor with visibility that allows calling it from subclass. From 15c2245af9748659643626db863540aed4d4f72e Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Wed, 20 May 2020 13:43:58 -0700 Subject: [PATCH 206/275] Restrict loading of `amsi.dll` from system32 folder (#12730) # PR Summary Restrict search path for `amsi.dll` and `wldp.dll` to just System32 on Windows ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../security/SecuritySupport.cs | 6 ++++++ .../security/wldpNativeMethods.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index d9c1f0d3994..556e1aa236d 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -1652,24 +1652,28 @@ internal enum AMSI_RESULT /// Return Type: HRESULT->LONG->int ///appName: LPCWSTR->WCHAR* ///amsiContext: HAMSICONTEXT* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("amsi.dll", EntryPoint = "AmsiInitialize", CallingConvention = CallingConvention.StdCall)] internal static extern int AmsiInitialize( [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string appName, ref System.IntPtr amsiContext); /// Return Type: void ///amsiContext: HAMSICONTEXT->HAMSICONTEXT__* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [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* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [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__* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("amsi.dll", EntryPoint = "AmsiCloseSession", CallingConvention = CallingConvention.StdCall)] internal static extern void AmsiCloseSession(System.IntPtr amsiContext, System.IntPtr amsiSession); @@ -1680,6 +1684,7 @@ internal static extern int AmsiInitialize( ///contentName: LPCWSTR->WCHAR* ///amsiSession: HAMSISESSION->HAMSISESSION__* ///result: AMSI_RESULT* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("amsi.dll", EntryPoint = "AmsiScanBuffer", CallingConvention = CallingConvention.StdCall)] internal static extern int AmsiScanBuffer( System.IntPtr amsiContext, System.IntPtr buffer, uint length, @@ -1691,6 +1696,7 @@ internal static extern int AmsiScanBuffer( ///contentName: LPCWSTR->WCHAR* ///amsiSession: HAMSISESSION->HAMSISESSION__* ///result: AMSI_RESULT* + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("amsi.dll", EntryPoint = "AmsiScanString", CallingConvention = CallingConvention.StdCall)] internal static extern int AmsiScanString( System.IntPtr amsiContext, [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string @string, diff --git a/src/System.Management.Automation/security/wldpNativeMethods.cs b/src/System.Management.Automation/security/wldpNativeMethods.cs index 6f814ed8ca2..974392424eb 100644 --- a/src/System.Management.Automation/security/wldpNativeMethods.cs +++ b/src/System.Management.Automation/security/wldpNativeMethods.cs @@ -564,6 +564,7 @@ internal class WldpNativeMethods /// pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION* /// pdwLockdownState: PDWORD->DWORD* /// dwFlags: DWORD->unsigned int + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("wldp.dll", EntryPoint = "WldpGetLockdownPolicy")] internal static extern int WldpGetLockdownPolicy(ref WLDP_HOST_INFORMATION pHostInformation, ref uint pdwLockdownState, uint dwFlags); @@ -572,6 +573,7 @@ internal class WldpNativeMethods /// pHostInformation: PWLDP_HOST_INFORMATION->_WLDP_HOST_INFORMATION* /// ptIsApproved: PBOOL->BOOL* /// dwFlags: DWORD->unsigned int + [DefaultDllImportSearchPathsAttribute(DllImportSearchPath.System32)] [DllImportAttribute("wldp.dll", EntryPoint = "WldpIsClassInApprovedList")] internal static extern int WldpIsClassInApprovedList(ref Guid rclsid, ref WLDP_HOST_INFORMATION pHostInformation, ref int ptIsApproved, uint dwFlags); From 16c1a369b336b864025e5564c737386d273ee1f7 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 21 May 2020 03:17:02 +0500 Subject: [PATCH 207/275] Make `-OutFile` param in web cmdlets to work like -LiteralPath (#11701) --- .../utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs | 2 +- .../Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 801660c0e8e..e36eee9ad41 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 @@ -763,7 +763,7 @@ private Uri CheckProtocol(Uri uri) private string QualifyFilePath(string path) { - string resolvedFilePath = PathUtils.ResolveFilePath(path, this, false); + string resolvedFilePath = PathUtils.ResolveFilePath(filePath: path, command: this, isLiteralPath: true); return resolvedFilePath; } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 index 9d73d398ef3..ba6185777f9 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 @@ -41,14 +41,15 @@ function ExecuteRequestWithOutFile { ) $result = [PSObject]@{Output = $null; Error = $null} - $filePath = Join-Path $TestDrive ((Get-Random).ToString() + ".txt") + # We use '[outfile1]' in the file name to check that OutFile parameter is literal path + $filePath = Join-Path $TestDrive ((Get-Random).ToString() + "[outfile1].txt") try { if ($cmdletName -eq "Invoke-WebRequest") { Invoke-WebRequest -Uri $uri -OutFile $filePath } else { Invoke-RestMethod -Uri $uri -OutFile $filePath } - $result.Output = Get-Content $filePath -Raw -ErrorAction SilentlyContinue + $result.Output = Get-Content -LiteralPath $filePath -Raw -ErrorAction SilentlyContinue } catch { $result.Error = $_ } finally { From f8a588c9551875b129d11edf9d6023bf6c57c432 Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Thu, 21 May 2020 09:25:16 +0200 Subject: [PATCH 208/275] Nullable annotations for CommandSearcher (#12733) # PR Summary Nullable annotations for CommandSearcher ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [ ] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../engine/CommandPathSearch.cs | 8 +- .../engine/CommandSearcher.cs | 154 +++++++++--------- .../engine/MshSnapinQualifiedName.cs | 15 +- 3 files changed, 87 insertions(+), 90 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandPathSearch.cs b/src/System.Management.Automation/engine/CommandPathSearch.cs index 415736b8561..96c6c8c1953 100644 --- a/src/System.Management.Automation/engine/CommandPathSearch.cs +++ b/src/System.Management.Automation/engine/CommandPathSearch.cs @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#nullable enable + using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; -#nullable enable - namespace System.Management.Automation { /// @@ -18,7 +18,7 @@ namespace System.Management.Automation internal class CommandPathSearch : IEnumerable, IEnumerator { [TraceSource("CommandSearch", "CommandSearch")] - private static PSTraceSource s_tracer = PSTraceSource.GetTracer("CommandSearch", "CommandSearch"); + private static readonly PSTraceSource s_tracer = PSTraceSource.GetTracer("CommandSearch", "CommandSearch"); /// /// Constructs a command searching enumerator that resolves the location @@ -44,7 +44,7 @@ internal CommandPathSearch( string commandName, LookupPathCollection lookupPaths, ExecutionContext context, - Collection acceptableCommandNames, + Collection? acceptableCommandNames, bool useFuzzyMatch) { _useFuzzyMatch = useFuzzyMatch; diff --git a/src/System.Management.Automation/engine/CommandSearcher.cs b/src/System.Management.Automation/engine/CommandSearcher.cs index cb258dfcf06..d3a1033c932 100644 --- a/src/System.Management.Automation/engine/CommandSearcher.cs +++ b/src/System.Management.Automation/engine/CommandSearcher.cs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#nullable enable + using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Management.Automation.Internal; @@ -242,9 +245,9 @@ public bool MoveNext() return false; } - private CommandInfo SearchForAliases() + private CommandInfo? SearchForAliases() { - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; if (_context.EngineSessionState != null && (_commandTypes & CommandTypes.Alias) != 0) @@ -255,9 +258,9 @@ private CommandInfo SearchForAliases() return currentMatch; } - private CommandInfo SearchForFunctions() + private CommandInfo? SearchForFunctions() { - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; if (_context.EngineSessionState != null && (_commandTypes & (CommandTypes.Function | CommandTypes.Filter | CommandTypes.Configuration)) != 0) @@ -268,9 +271,9 @@ private CommandInfo SearchForFunctions() return currentMatch; } - private CommandInfo SearchForCmdlets() + private CommandInfo? SearchForCmdlets() { - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; if ((_commandTypes & CommandTypes.Cmdlet) != 0) { @@ -280,9 +283,9 @@ private CommandInfo SearchForCmdlets() return currentMatch; } - private CommandInfo ProcessBuiltinScriptState() + private CommandInfo? ProcessBuiltinScriptState() { - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; // Check to see if the path is qualified @@ -296,9 +299,9 @@ private CommandInfo ProcessBuiltinScriptState() return currentMatch; } - private CommandInfo ProcessPathResolutionState() + private CommandInfo? ProcessPathResolutionState() { - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; try { @@ -338,7 +341,7 @@ private CommandInfo ProcessPathResolutionState() return currentMatch; } - private CommandInfo ProcessQualifiedFileSystemState() + private CommandInfo? ProcessQualifiedFileSystemState() { try { @@ -355,13 +358,14 @@ private CommandInfo ProcessQualifiedFileSystemState() throw; } - CommandInfo currentMatch = null; + CommandInfo? currentMatch = null; _currentState = SearchState.PathSearch; if (_canDoPathLookup) { try { - while (currentMatch == null && _pathSearcher.MoveNext()) + // the previous call to setupPathSearcher ensures _pathSearcher != null + while (currentMatch == null && _pathSearcher!.MoveNext()) { currentMatch = GetInfoFromPath(((IEnumerator)_pathSearcher).Current); } @@ -375,10 +379,10 @@ private CommandInfo ProcessQualifiedFileSystemState() return currentMatch; } - private CommandInfo ProcessPathSearchState() + private CommandInfo? ProcessPathSearchState() { - CommandInfo currentMatch = null; - string path = DoPowerShellRelativePathLookup(); + CommandInfo? currentMatch = null; + string? path = DoPowerShellRelativePathLookup(); if (!string.IsNullOrEmpty(path)) { @@ -443,9 +447,9 @@ public void Dispose() /// /// A CommandInfo for the next command if it exists as a path, or null otherwise. /// - private CommandInfo GetNextFromPath() + private CommandInfo? GetNextFromPath() { - CommandInfo result = null; + CommandInfo? result = null; do // false loop { @@ -478,7 +482,7 @@ private CommandInfo GetNextFromPath() if (!_commandResolutionOptions.HasFlag(SearchResolutionOptions.ResolveLiteralThenPathPatterns) && resolvedPaths.Count == 0) { - string path = GetNextLiteralPathThatExistsAndHandleExceptions(_commandName, out _); + string? path = GetNextLiteralPathThatExistsAndHandleExceptions(_commandName, out _); if (path != null) { @@ -520,7 +524,7 @@ private CommandInfo GetNextFromPath() /// /// A collection of full paths to the commands which were found. /// - private Collection GetNextFromPathUsingWildcards(string command, out ProviderInfo provider) + private Collection GetNextFromPathUsingWildcards(string? command, out ProviderInfo? provider) { try { @@ -594,9 +598,9 @@ private static bool checkPath(string path, string commandName) /// If refers to a cmdlet file that /// contains invalid metadata. /// - private CommandInfo GetInfoFromPath(string path) + private CommandInfo? GetInfoFromPath(string path) { - CommandInfo result = null; + CommandInfo? result = null; do // false loop { @@ -607,7 +611,7 @@ private CommandInfo GetInfoFromPath(string path) } // Now create the appropriate CommandInfo using the extension - string extension = null; + string? extension = null; try { @@ -681,9 +685,9 @@ private CommandInfo GetInfoFromPath(string path) /// /// A CommandInfo representing the next matching alias if found, otherwise null. /// - private CommandInfo GetNextAlias() + private CommandInfo? GetNextAlias() { - CommandInfo result = null; + CommandInfo? result = null; if ((_commandResolutionOptions & SearchResolutionOptions.ResolveAliasPatterns) != 0) { @@ -709,7 +713,7 @@ private CommandInfo GetNextAlias() } // Process alias from modules - AliasInfo c = GetAliasFromModules(_commandName); + AliasInfo? c = GetAliasFromModules(_commandName); if (c != null) { matchingAliases.Add(c); @@ -762,15 +766,15 @@ private CommandInfo GetNextAlias() /// /// A CommandInfo representing the next matching function if found, otherwise null. /// - private CommandInfo GetNextFunction() + private CommandInfo? GetNextFunction() { - CommandInfo result = null; + CommandInfo? result = null; if (_commandResolutionOptions.HasFlag(SearchResolutionOptions.ResolveFunctionPatterns)) { if (_matchingFunctionEnumerator == null) { - Collection matchingFunction = new Collection(); + Collection matchingFunction = new Collection(); // Generate the enumerator of matching function names WildcardPattern functionMatcher = @@ -796,7 +800,7 @@ private CommandInfo GetNextFunction() } // Process functions from modules - CommandInfo cmdInfo = GetFunctionFromModules(_commandName); + CommandInfo? cmdInfo = GetFunctionFromModules(_commandName); if (cmdInfo != null) { matchingFunction.Add(cmdInfo); @@ -838,7 +842,7 @@ private CommandInfo GetNextFunction() // Don't return commands to the user if that might result in: // - Trusted commands calling untrusted functions that the user has overridden // - Debug prompts calling internal functions that are likely to have code injection - private bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo result, ExecutionContext executionContext) + private bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo? result, ExecutionContext executionContext) { if (result == null) { @@ -870,60 +874,54 @@ private bool ShouldSkipCommandResolutionForConstrainedLanguage(CommandInfo resul return false; } - private AliasInfo GetAliasFromModules(string command) + private AliasInfo? GetAliasFromModules(string command) { - AliasInfo result = null; + AliasInfo? result = null; if (command.IndexOf('\\') > 0) { // See if it's a module qualified alias... - PSSnapinQualifiedName qualifiedName = PSSnapinQualifiedName.GetInstance(command); + PSSnapinQualifiedName? qualifiedName = PSSnapinQualifiedName.GetInstance(command); if (qualifiedName != null && !string.IsNullOrEmpty(qualifiedName.PSSnapInName)) { - PSModuleInfo module = GetImportedModuleByName(qualifiedName.PSSnapInName); + PSModuleInfo? module = GetImportedModuleByName(qualifiedName.PSSnapInName); - if (module != null) - { - module.ExportedAliases.TryGetValue(qualifiedName.ShortName, out result); - } + module?.ExportedAliases.TryGetValue(qualifiedName.ShortName, out result); } } return result; } - private CommandInfo GetFunctionFromModules(string command) + private CommandInfo? GetFunctionFromModules(string command) { - FunctionInfo result = null; + FunctionInfo? result = null; if (command.IndexOf('\\') > 0) { // See if it's a module qualified function call... - PSSnapinQualifiedName qualifiedName = PSSnapinQualifiedName.GetInstance(command); + PSSnapinQualifiedName? qualifiedName = PSSnapinQualifiedName.GetInstance(command); if (qualifiedName != null && !string.IsNullOrEmpty(qualifiedName.PSSnapInName)) { - PSModuleInfo module = GetImportedModuleByName(qualifiedName.PSSnapInName); + PSModuleInfo? module = GetImportedModuleByName(qualifiedName.PSSnapInName); - if (module != null) - { - module.ExportedFunctions.TryGetValue(qualifiedName.ShortName, out result); - } + module?.ExportedFunctions.TryGetValue(qualifiedName.ShortName, out result); } } return result; } - private PSModuleInfo GetImportedModuleByName(string moduleName) + private PSModuleInfo? GetImportedModuleByName(string moduleName) { - PSModuleInfo module = null; + PSModuleInfo? module = null; List modules = _context.Modules.GetModules(new string[] { moduleName }, false); if (modules != null && modules.Count > 0) { foreach (PSModuleInfo m in modules) { - if (_context.previousModuleImported.ContainsKey(m.Name) && ((string)_context.previousModuleImported[m.Name] == m.Path)) + if (_context.previousModuleImported.ContainsKey(m.Name) && ((string?)_context.previousModuleImported[m.Name] == m.Path)) { module = m; break; @@ -949,9 +947,9 @@ private PSModuleInfo GetImportedModuleByName(string moduleName) /// A FunctionInfo if the function name exists and is a function, a FilterInfo if /// the filter name exists and is a filter, or null otherwise. /// - private CommandInfo GetFunction(string function) + private CommandInfo? GetFunction(string function) { - CommandInfo result = _context.EngineSessionState.GetFunction(function); + CommandInfo? result = _context.EngineSessionState.GetFunction(function); if (result != null) { @@ -991,9 +989,9 @@ private CommandInfo GetFunction(string function) /// A CmdletInfo for the next matching Cmdlet or null if there are /// no more matches. /// - private CmdletInfo GetNextCmdlet() + private CmdletInfo? GetNextCmdlet() { - CmdletInfo result = null; + CmdletInfo? result = null; bool useAbbreviationExpansion = _commandResolutionOptions.HasFlag(SearchResolutionOptions.UseAbbreviationExpansion); if (_matchingCmdlet == null) @@ -1002,7 +1000,7 @@ private CmdletInfo GetNextCmdlet() { Collection matchingCmdletInfo = new Collection(); - PSSnapinQualifiedName PSSnapinQualifiedCommandName = + PSSnapinQualifiedName? PSSnapinQualifiedCommandName = PSSnapinQualifiedName.GetInstance(_commandName); if (!useAbbreviationExpansion && PSSnapinQualifiedCommandName == null) @@ -1010,10 +1008,10 @@ private CmdletInfo GetNextCmdlet() return null; } - string moduleName = PSSnapinQualifiedCommandName?.PSSnapInName; + string? moduleName = PSSnapinQualifiedCommandName?.PSSnapInName; var cmdletShortName = PSSnapinQualifiedCommandName?.ShortName; - WildcardPattern cmdletMatcher = cmdletShortName != null + WildcardPattern? cmdletMatcher = cmdletShortName != null ? WildcardPattern.Get(cmdletShortName, WildcardOptions.IgnoreCase) : null; @@ -1068,9 +1066,10 @@ private CmdletInfo GetNextCmdlet() return traceResult(result); } - private IEnumerator _matchingCmdlet; + private IEnumerator? _matchingCmdlet; - private static CmdletInfo traceResult(CmdletInfo result) + [return: NotNullIfNotNull("result")] + private static CmdletInfo? traceResult(CmdletInfo? result) { if (result != null) { @@ -1083,9 +1082,9 @@ private static CmdletInfo traceResult(CmdletInfo result) return result; } - private string DoPowerShellRelativePathLookup() + private string? DoPowerShellRelativePathLookup() { - string result = null; + string? result = null; if (_context.EngineSessionState != null && _context.EngineSessionState.ProviderCount > 0) @@ -1125,14 +1124,14 @@ private string DoPowerShellRelativePathLookup() /// The path that was resolved. Null if the path couldn't be resolved or was /// not resolved by the FileSystemProvider. /// - private string ResolvePSPath(string path) + private string? ResolvePSPath(string? path) { - string result = null; + string? result = null; try { - ProviderInfo provider = null; - string resolvedPath = null; + ProviderInfo? provider = null; + string? resolvedPath = null; // Try literal path resolution if it is set to run first if (_commandResolutionOptions.HasFlag(SearchResolutionOptions.ResolveLiteralThenPathPatterns)) @@ -1235,7 +1234,7 @@ private string ResolvePSPath(string path) /// /// Full path to the command. /// - private string GetNextLiteralPathThatExistsAndHandleExceptions(string command, out ProviderInfo provider) + private string? GetNextLiteralPathThatExistsAndHandleExceptions(string command, out ProviderInfo? provider) { try { @@ -1297,7 +1296,7 @@ private string GetNextLiteralPathThatExistsAndHandleExceptions(string command, o /// /// Full path to the command. /// - private string GetNextLiteralPathThatExists(string command, out ProviderInfo provider) + private string? GetNextLiteralPathThatExists(string? command, out ProviderInfo? provider) { string resolvedPath = _context.LocationGlobber.GetProviderPath(command, out provider); @@ -1484,7 +1483,7 @@ private static CanDoPathLookupResult CanDoPathLookup(string possiblePath) /// /// Determines which command types will be globbed. /// - private SearchResolutionOptions _commandResolutionOptions; + private readonly SearchResolutionOptions _commandResolutionOptions; /// /// Determines which types of commands to look for. @@ -1495,12 +1494,12 @@ private static CanDoPathLookupResult CanDoPathLookup(string possiblePath) /// The enumerator that uses the Path to /// search for commands. /// - private CommandPathSearch _pathSearcher; + private CommandPathSearch? _pathSearcher; /// /// The execution context instance for the current engine... /// - private ExecutionContext _context; + private readonly ExecutionContext _context; /// /// A routine to initialize the path searcher... @@ -1556,7 +1555,7 @@ private void setupPathSearcher() { _canDoPathLookup = true; - string directory = Path.GetDirectoryName(_commandName); + string? directory = Path.GetDirectoryName(_commandName); var directoryCollection = new LookupPathCollection { directory }; CommandDiscovery.discoveryTracer.WriteLine( @@ -1588,7 +1587,7 @@ private void setupPathSearcher() // We must try to resolve the path as an PSPath or else we can't do // path lookup for relative paths. - string directory = Path.GetDirectoryName(_commandName); + string? directory = Path.GetDirectoryName(_commandName); directory = ResolvePSPath(directory); CommandDiscovery.discoveryTracer.WriteLine( @@ -1641,10 +1640,7 @@ public void Reset() _commandTypes &= ~CommandTypes.ExternalScript; } - if (_pathSearcher != null) - { - _pathSearcher.Reset(); - } + _pathSearcher?.Reset(); _currentMatch = null; _currentState = SearchState.SearchingAliases; @@ -1664,17 +1660,17 @@ internal CommandOrigin CommandOrigin /// /// An enumerator of the matching aliases. /// - private IEnumerator _matchingAlias; + private IEnumerator? _matchingAlias; /// /// An enumerator of the matching functions. /// - private IEnumerator _matchingFunctionEnumerator; + private IEnumerator? _matchingFunctionEnumerator; /// /// The CommandInfo that references the command that matches the pattern. /// - private CommandInfo _currentMatch; + private CommandInfo? _currentMatch; private bool _canDoPathLookup; private CanDoPathLookupResult _canDoPathLookupResult = CanDoPathLookupResult.Yes; diff --git a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs index 42f73df2a46..b23df2202eb 100644 --- a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs +++ b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +#nullable enable + using Dbg = System.Management.Automation.Diagnostics; namespace System.Management.Automation @@ -62,15 +64,14 @@ private PSSnapinQualifiedName(string[] splitName) /// /// An instance of the Name class. /// - internal static PSSnapinQualifiedName GetInstance(string name) + internal static PSSnapinQualifiedName? GetInstance(string? name) { if (name == null) return null; - PSSnapinQualifiedName result = null; string[] splitName = name.Split(Utils.Separators.Backslash); if (splitName.Length == 0 || splitName.Length > 2) return null; - result = new PSSnapinQualifiedName(splitName); + var result = new PSSnapinQualifiedName(splitName); // If the shortname is empty, then return null... if (string.IsNullOrEmpty(result.ShortName)) { @@ -91,12 +92,12 @@ internal string FullName } } - private string _fullName; + private readonly string _fullName; /// /// Gets the command's PSSnapin name. /// - internal string PSSnapInName + internal string? PSSnapInName { get { @@ -104,7 +105,7 @@ internal string PSSnapInName } } - private string _psSnapinName; + private readonly string? _psSnapinName; /// /// Gets the command's short name. @@ -117,7 +118,7 @@ internal string ShortName } } - private string _shortName; + private readonly string _shortName; /// /// The full name. From bd228a216743232daf6906ff98ad8b38f7b709a7 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 21 May 2020 14:30:37 +0100 Subject: [PATCH 209/275] Delete license.rtf (#12738) # PR Summary ## PR Context #12721 did not actually delete `license.rtf` ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [ ] N/A or can only be tested interactively - **OR** - [x] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- assets/license.rtf | 389 --------------------------------------------- 1 file changed, 389 deletions(-) delete mode 100644 assets/license.rtf diff --git a/assets/license.rtf b/assets/license.rtf deleted file mode 100644 index 0129ec54408..00000000000 --- a/assets/license.rtf +++ /dev/null @@ -1,389 +0,0 @@ -{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} -{\f3\fbidi \fdecor\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fbidi \fdecor\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f11\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt ?l?r ??fc};} -{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f42\fbidi \fswiss\fcharset0\fprq2{\*\panose 00000000000000000000}Tahoma;} -{\f43\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS;}{\f44\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}@MS Mincho;} -{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} -{\fhimajor\f31502\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0302020204030204}Calibri Light;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} -{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} -{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f45\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\f46\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\f48\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f49\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f50\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\f51\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f52\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f53\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f65\fbidi \fmodern\fcharset238\fprq1 Courier New CE;} -{\f66\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}{\f68\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f69\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f70\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);} -{\f71\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f72\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f73\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);} -{\f157\fbidi \fmodern\fcharset0\fprq1 MS Mincho Western{\*\falt ?l?r ??fc};}{\f155\fbidi \fmodern\fcharset238\fprq1 MS Mincho CE{\*\falt ?l?r ??fc};}{\f156\fbidi \fmodern\fcharset204\fprq1 MS Mincho Cyr{\*\falt ?l?r ??fc};} -{\f158\fbidi \fmodern\fcharset161\fprq1 MS Mincho Greek{\*\falt ?l?r ??fc};}{\f159\fbidi \fmodern\fcharset162\fprq1 MS Mincho Tur{\*\falt ?l?r ??fc};}{\f162\fbidi \fmodern\fcharset186\fprq1 MS Mincho Baltic{\*\falt ?l?r ??fc};} -{\f385\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f386\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f388\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f389\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;} -{\f392\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f393\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f415\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f416\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} -{\f418\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f419\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f420\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\f421\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);} -{\f422\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f423\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\f465\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f466\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;} -{\f468\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f469\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}{\f470\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f471\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);} -{\f472\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f473\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f474\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f475\fbidi \fswiss\fcharset238\fprq2 Trebuchet MS CE;} -{\f476\fbidi \fswiss\fcharset204\fprq2 Trebuchet MS Cyr;}{\f478\fbidi \fswiss\fcharset161\fprq2 Trebuchet MS Greek;}{\f479\fbidi \fswiss\fcharset162\fprq2 Trebuchet MS Tur;}{\f482\fbidi \fswiss\fcharset186\fprq2 Trebuchet MS Baltic;} -{\f487\fbidi \fmodern\fcharset0\fprq1 @MS Mincho Western;}{\f485\fbidi \fmodern\fcharset238\fprq1 @MS Mincho CE;}{\f486\fbidi \fmodern\fcharset204\fprq1 @MS Mincho Cyr;}{\f488\fbidi \fmodern\fcharset161\fprq1 @MS Mincho Greek;} -{\f489\fbidi \fmodern\fcharset162\fprq1 @MS Mincho Tur;}{\f492\fbidi \fmodern\fcharset186\fprq1 @MS Mincho Baltic;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} -{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} -{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} -{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} -{\fhimajor\f31528\fbidi \fswiss\fcharset238\fprq2 Calibri Light CE;}{\fhimajor\f31529\fbidi \fswiss\fcharset204\fprq2 Calibri Light Cyr;}{\fhimajor\f31531\fbidi \fswiss\fcharset161\fprq2 Calibri Light Greek;} -{\fhimajor\f31532\fbidi \fswiss\fcharset162\fprq2 Calibri Light Tur;}{\fhimajor\f31533\fbidi \fswiss\fcharset177\fprq2 Calibri Light (Hebrew);}{\fhimajor\f31534\fbidi \fswiss\fcharset178\fprq2 Calibri Light (Arabic);} -{\fhimajor\f31535\fbidi \fswiss\fcharset186\fprq2 Calibri Light Baltic;}{\fhimajor\f31536\fbidi \fswiss\fcharset163\fprq2 Calibri Light (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} -{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} -{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} -{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} -{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} -{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} -{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} -{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} -{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} -{\fhiminor\f31573\fbidi \fswiss\fcharset177\fprq2 Calibri (Hebrew);}{\fhiminor\f31574\fbidi \fswiss\fcharset178\fprq2 Calibri (Arabic);}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} -{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} -{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} -{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} -{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; -\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green0\blue0;\red0\green0\blue0;\red51\green51\blue51;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa160\sl259\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 -\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\s1\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af42\afs19\alang1025 -\ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext1 \slink15 \sqformat \styrsid7813854 heading 1;}{ -\s2\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af42\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext2 \slink16 \sqformat \styrsid7813854 heading 2;}{\s3\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar\tx1077\jclisttab\tx1440\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 -\af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext3 \slink17 \sqformat \styrsid7813854 heading 3;}{\s4\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar -\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl3\outlinelevel3\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 \af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext4 \slink18 \sqformat \styrsid7813854 heading 4;}{\s5\ql \fi-357\li1792\ri0\sb120\sa120\widctlpar\tx1792\jclisttab\tx2155\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl4\outlinelevel4\adjustright\rin0\lin1792\itap0 \rtlch\fcs1 -\af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext5 \slink19 \sqformat \styrsid7813854 heading 5;}{\s6\ql \fi-357\li2149\ri0\sb120\sa120\widctlpar -\jclisttab\tx2152\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl5\outlinelevel5\adjustright\rin0\lin2149\itap0 \rtlch\fcs1 \af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext6 \slink20 \sqformat \styrsid7813854 heading 6;}{\s7\ql \fi-357\li2506\ri0\sb120\sa120\widctlpar\jclisttab\tx2509\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl6\outlinelevel6\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 -\af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext7 \slink21 \sqformat \styrsid7813854 heading 7;}{\s8\ql \fi-357\li2863\ri0\sb120\sa120\widctlpar -\jclisttab\tx2866\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl7\outlinelevel7\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 \af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext8 \slink22 \sqformat \styrsid7813854 heading 8;}{\s9\ql \fi-358\li3221\ri0\sb120\sa120\widctlpar\jclisttab\tx3223\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl8\outlinelevel8\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 -\af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext9 \slink23 \sqformat \styrsid7813854 heading 9;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 -Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv -\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31506\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused -Normal Table;}{\*\cs15 \additive \rtlch\fcs1 \ab\af42\afs19 \ltrch\fcs0 \fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink1 \slocked \styrsid7813854 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af42\afs19 \ltrch\fcs0 -\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink2 \slocked \styrsid7813854 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink3 \slocked \styrsid7813854 Heading 3 Char;}{\* -\cs18 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink4 \slocked \styrsid7813854 Heading 4 Char;}{\*\cs19 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 -\sbasedon10 \slink5 \slocked \styrsid7813854 Heading 5 Char;}{\*\cs20 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink6 \slocked \styrsid7813854 Heading 6 Char;}{\*\cs21 \additive \rtlch\fcs1 -\af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink7 \slocked \styrsid7813854 Heading 7 Char;}{\*\cs22 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 -\sbasedon10 \slink8 \slocked \styrsid7813854 Heading 8 Char;}{\*\cs23 \additive \rtlch\fcs1 \af42\afs19 \ltrch\fcs0 \b\fs19\loch\f42\hich\af42\dbch\af11 \sbasedon10 \slink9 \slocked \styrsid7813854 Heading 9 Char;}{ -\s24\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext24 \sunhideused \styrsid3804850 Normal (Web);}{\s25\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af37\afs22\alang1025 \ltrch\fcs0 -\f37\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext25 \sqformat \spriority34 \styrsid6173475 List Paragraph;}{\s26\ql \li0\ri0\widctlpar -\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 -\f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext26 \slink27 \ssemihidden \sunhideused \styrsid6573559 HTML Preformatted;}{\*\cs27 \additive \rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20 -\sbasedon10 \slink26 \slocked \ssemihidden \styrsid6573559 HTML Preformatted Char;}{\*\cs28 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf1 \sbasedon10 \sunhideused \styrsid7092439 Hyperlink;}{\*\cs29 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 -\sbasedon10 \spriority0 \styrsid7092439 spelle;}{\*\cs30 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid7092439 grame;}{\s31\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 -\rtlch\fcs1 \af42\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext31 \styrsid7813854 Body 1;}{ -\s32\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af42\afs28\alang1025 \ltrch\fcs0 \fs28\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext0 \styrsid7813854 Heading EULA;}{\s33\ql \li0\ri0\sb120\sa120\widctlpar\brdrb\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af42\afs28\alang1025 \ltrch\fcs0 -\fs28\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid7813854 Heading Software Title;}{\s34\ql \li0\ri0\sb120\sa120\widctlpar\brdrt\brdrs\brdrw10\brsp20 -\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af42\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f42\hich\af42\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext34 \styrsid7813854 -Preamble Border Above;}}{\*\listtable{\list\listtemplateid412752146\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 -\fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid256596791}{\list\listtemplateid-234466468 -\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative -\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid268852893}{\list\listtemplateid2071779370\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative -\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers -;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid472724034}{\list\listtemplateid837583652\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers -;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li6480\lin6480 }{\listname ;}\listid678236712}{\list\listtemplateid468190476\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;} -\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 -\fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname -;}\listid696808916}{\list\listtemplateid256027766\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 -\fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid833446968}{\list\listtemplateid812297174 -{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \b\hres0\chhres0 \fi-360\li717\lin717 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1077\lin1077 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1437\lin1437 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'03(\'03);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1797\lin1797 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'04);}{\levelnumbers\'02;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2157\lin2157 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\hres0\chhres0 \fi-360\li2517\lin2517 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2877\lin2877 } -{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3237\lin3237 }{\listlevel\levelnfc2\levelnfcn2\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3597\lin3597 }{\listname ;}\listid888110291}{\list\listtemplateid812297174{\listlevel\levelnfc4 -\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \b\hres0\chhres0 \fi-360\li717\lin717 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1077\lin1077 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1437\lin1437 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'03(\'03);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1797\lin1797 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'04);}{\levelnumbers\'02;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2157\lin2157 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\hres0\chhres0 \fi-360\li2517\lin2517 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2877\lin2877 } -{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3237\lin3237 }{\listlevel\levelnfc2\levelnfcn2\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3597\lin3597 }{\listname ;}\listid1282881056}{\list\listtemplateid827650700\listhybrid{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative -\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid1470391773}{\list\listtemplateid-1331279738\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid1543639483}{\list\listtemplateid812297174{\listlevel\levelnfc4\levelnfcn4 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \b\hres0\chhres0 \fi-360\li717\lin717 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1077\lin1077 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1437\lin1437 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'03);}{\levelnumbers -\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1797\lin1797 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'04);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\hres0\chhres0 \fi-360\li2157\lin2157 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2517\lin2517 } -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2877\lin2877 }{\listlevel\levelnfc4\levelnfcn4\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3237\lin3237 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3597\lin3597 }{\listname ;}\listid1670060985}{\list\listtemplateid-1676387632{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af42\afs20 \ltrch\fcs0 \b\i0\f42\fs20\fbias0\hres0\chhres0 \fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 _;}{\levelnumbers;}\b\i0\f3\fs20\fbias0\hres0\chhres0 \fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af42\afs20 \ltrch\fcs0 \b\i0\f42\fs20\fbias0\hres0\chhres0 \s3\fi-357\li1077\jclisttab\tx1440\lin1077 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af43\afs20 \ltrch\fcs0 \b0\i0\strike0\f43\fs20\ulnone\fbias0\hres0\chhres0 \s4\fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc1\levelnfcn1 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af43\afs20 \ltrch\fcs0 \b0\i0\strike0\f43\fs20\ulnone\fbias0\hres0\chhres0 \s5\fi-357\li1792\jclisttab\tx2155\lin1792 } -{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af43\afs20 \ltrch\fcs0 \b0\i0\f43\fs20\fbias0\hres0\chhres0 \s6\fi-357\li2149 -\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af43\afs20 \ltrch\fcs0 \b0\i0\f43\fs20\fbias0\hres0\chhres0 -\s7\fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02i.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af43\afs20 \ltrch\fcs0 -\b0\i0\f43\fs20\fbias0\hres0\chhres0 \s8\fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02A.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af43\afs20 -\ltrch\fcs0 \b0\i0\f43\fs20\fbias0\hres0\chhres0 \s9\fi-358\li3221\jclisttab\tx3223\lin3221 }{\listname ;}\listid1743720866}{\list\listtemplateid-646571904\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers -;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname ;}\listid2003921709}{\list\listtemplateid1067461628\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers -;}\f2\fbias0\hres0\chhres0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li6480\lin6480 }{\listname ;}\listid2022782249}{\list\listtemplateid1736062262\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;} -\f2\fbias0\hres0\chhres0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;} -\f10\fbias0\hres0\chhres0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;} -\f3\fbias0\hres0\chhres0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 -\fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 -\fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 _;}{\levelnumbers;}\f3\fbias0\hres0\chhres0 -\fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0\hres0\chhres0 \fi-360\li5760\lin5760 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 _;}{\levelnumbers;}\f10\fbias0\hres0\chhres0 \fi-360\li6480\lin6480 }{\listname -;}\listid2055036124}{\list\listtemplateid812297174{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \b\hres0\chhres0 -\fi-360\li717\lin717 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1077\lin1077 }{\listlevel -\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1437\lin1437 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'03);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li1797\lin1797 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\'03(\'04);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2157\lin2157 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2517\lin2517 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li2877\lin2877 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\hres0\chhres0 \fi-360\li3237\lin3237 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \hres0\chhres0 \fi-360\li3597\lin3597 } -{\listname ;}\listid2106000387}}{\*\listoverridetable{\listoverride\listid256596791\listoverridecount0\ls1}{\listoverride\listid1543639483\listoverridecount0\ls2}{\listoverride\listid268852893\listoverridecount0\ls3}{\listoverride\listid678236712 -\listoverridecount0\ls4}{\listoverride\listid2022782249\listoverridecount0\ls5}{\listoverride\listid472724034\listoverridecount0\ls6}{\listoverride\listid1470391773\listoverridecount0\ls7}{\listoverride\listid2003921709\listoverridecount0\ls8} -{\listoverride\listid2055036124\listoverridecount0\ls9}{\listoverride\listid696808916\listoverridecount0\ls10}{\listoverride\listid833446968\listoverridecount0\ls11}{\listoverride\listid1743720866\listoverridecount0\ls12}{\listoverride\listid1670060985 -\listoverridecount0\ls13}{\listoverride\listid1282881056\listoverridecount0\ls14}{\listoverride\listid888110291\listoverridecount0\ls15}{\listoverride\listid2106000387\listoverridecount0\ls16}}{\*\pgptbl {\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0 -\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp10\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li300\ri300\sb300\sa300}{\pgp\ipgp0\itap0\li0\ri0 -\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid93983\rsid217518\rsid1376282\rsid1984289\rsid2438441\rsid3364025\rsid3804850\rsid5786794\rsid5845909\rsid6112664\rsid6173475 -\rsid6573559\rsid6758551\rsid6843334\rsid7092439\rsid7813854\rsid8005660\rsid8394862\rsid10169937\rsid10363382\rsid10624128\rsid10625519\rsid11493340\rsid13960513\rsid14557619\rsid16084641\rsid16459130}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0 -\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author Duane Okamoto (CELA)}{\operator Travis Plunk}{\creatim\yr2016\mo8\dy12\hr14\min30}{\revtim\yr2019\mo1\dy10\hr14\min49}{\version8}{\edmins14}{\nofpages1} -{\nofwords165}{\nofchars947}{\*\company Microsoft IT}{\nofcharsws1110}{\vern2819}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect -\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen -\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1 -\jexpand\viewkind1\viewscale232\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct -\asianbrkrule\rsidroot3804850\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 -{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang -{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang -{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} -\pard\plain \ltrpar\s24\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3364025\contextualspace \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 -\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \b\f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid2438441 PowerShell 6}{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \b\f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3804850 - -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \b\f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 Copyright (c) Microsoft Corporation}{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 All rights reserved.\~}{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 MIT License}{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 Permission is h -ereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:}{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 - -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.}{\rtlch\fcs1 -\af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 -\par }{\rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20\cf19\lang9\langfe1033\langnp9\insrsid3364025\charrsid93983 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850\charrsid93983 -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL T -HE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.}{\rtlch\fcs1 -\af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid3804850 -\par }{\rtlch\fcs1 \af2\afs18 \ltrch\fcs0 \f2\fs18\cf19\lang9\langfe1033\langnp9\insrsid6173475 -\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a -9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad -5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 -b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 -0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 -a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f -c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 -0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 -a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 -6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b -4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b -4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210007b740aaca0600008f1a0000160000007468656d652f7468656d652f -7468656d65312e786d6cec595b8bdb46147e2ff43f08bd3bbe49be2cf1065bb69336bb49889d943cceda636bb2238dd18c776342a0244f7d2914d2d28706fad6 -87521a68a0a12ffd310b1bdaf447f4cc489667ec71f6420aa1640d8b34face996fce39face48ba7aed51449d239c70c2e2965bbe52721d1c8fd898c4d3967b6f -d82f345c870b148f1165316eb90bccdd6bbb9f7e7215ed881047d801fb98efa0961b0a31db2916f9088611bfc26638866b13964448c069322d8e13740c7e235a -ac944ab5628448ec3a318ac0ededc9848cb033942edddda5f31e85d358703930a2c940bac68685c28e0fcb12c1173ca089738468cb8579c6ec78881f09d7a188 -0bb8d0724beacf2dee5e2da29dcc888a2db69a5d5ffd657699c1f8b0a2e64ca607f9a49ee77bb576ee5f01a8d8c4f5eabd5aaf96fb5300341ac14a532eba4fbf -d3ec74fd0cab81d2438bef6ebd5b2d1b78cd7f758373db973f03af40a97f6f03dfef07104503af4029dedfc07b5ebd1278065e81527c6d035f2fb5bb5eddc02b -5048497cb8812ef9b56ab05c6d0e99307ac30a6ffa5ebf5ec99caf50500d7975c929262c16db6a2d420f59d2078004522448ec88c50c4fd008aa3840941c24c4 -d923d3100a6f8662c661b85429f54b55f82f7f9e3a5211413b1869d6921730e11b43928fc34709998996fb39787535c8e9ebd7274f5f9d3cfdfde4d9b393a7bf -66732b5786dd0d144f75bbb73f7df3cf8b2f9dbf7ffbf1edf36fd3a9d7f15cc7bff9e5ab377ffcf92ef7b0e255284ebf7bf9e6d5cbd3efbffeebe7e716efed04 -1de8f0218930776ee163e72e8b608116fef820b998c5304444b768c7538e622467b1f8ef89d040df5a208a2cb80e36e3783f01a9b101afcf1f1a8407613217c4 -e2f1661819c07dc6688725d628dc947369611ecee3a97df264aee3ee2274649b3b40b191e5de7c061a4b6c2e83101b34ef50140b34c531168ebcc60e31b6acee -0121465cf7c928619c4d84f380381d44ac21199203a39a56463748047959d80842be8dd8ecdf773a8cda56ddc5472612ee0d442de487981a61bc8ee602453697 -4314513de07b48843692834532d2713d2e20d3534c99d31b63ce6d36b71358af96f49b2033f6b4efd345642213410e6d3ef710633ab2cb0e831045331b7640e2 -50c77ec60fa144917387091b7c9f9977883c873ca0786bbaef136ca4fb6c35b8070aab535a1588bc324f2cb9bc8e9951bf83059d20aca4061a80a1eb1189cf14 -f93579f7ff3b7907113dfde1856545ef47d2ed8e8d7c5c50ccdb09b1de4d37d6247c1b6e5db803968cc987afdb5d348fef60b855369bd747d9fe28dbeeff5eb6 -b7ddcfef5fac57fa0cd22db7ade9765d6ddea3ad7bf709a174201614ef71b57de7d095c67d189476eab915e7cf72b3100ee59d0c1318b86982948d9330f10511 -e1204433d8e3975de964ca33d753eecc1887adbf1ab6fa96783a8ff6d9387d642d97e5e3692a1e1c89d578c9cfc7e17143a4e85a7df51896bb576ca7ea717949 -40da5e8484369949a26a21515f0eca20a98773089a85845ad97b61d1b4b06848f7cb546db0006a795660dbe4c066abe5fa1e9880113c55218ac7324f69aa97d9 -55c97c9f99de164ca302600fb1ac8055a69b92ebd6e5c9d5a5a5768e4c1b24b4723349a8c8a81ec64334c65975cad1f3d0b868ae9bab941af46428d47c505a2b -1af5c6bb585c36d760b7ae0d34d69582c6ce71cbad557d2899119ab5dc093cfac3613483dae172bb8be814de9f8d4492def097519659c24517f1300db8129d54 -0d222270e25012b55cb9fc3c0d34561aa2b8952b20081f2cb926c8ca87460e926e26194f267824f4b46b2332d2e929287caa15d6abcafcf26069c9e690ee4138 -3e760ee83cb98ba0c4fc7a5906704c38bc012aa7d11c1378a5990bd9aafed61a5326bbfa3b455543e938a2b310651d4517f314aea43ca7a3cef2186867d99a21 -a05a48b2467830950d560faad14df3ae9172d8da75cf369291d34473d5330d55915dd3ae62c60ccb36b016cbcb35798dd532c4a0697a874fa57b5d729b4bad5b -db27e45d02029ec7cfd275cfd110346aabc90c6a92f1a60c4bcdce46cddeb15ce019d4ced32434d5af2dddaec52def11d6e960f0529d1fecd6ab168626cb7da5 -8ab4faf6a17f9e60070f413cbaf022784e0557a9848f0f09820dd140ed4952d9805be491c86e0d3872e60969b98f4b7edb0b2a7e502835fc5ec1ab7aa542c36f -570b6ddfaf967b7eb9d4ed549e4063116154f6d3ef2e7d780d4517d9d71735bef105265abe69bb32625191a92f2c45455c7d812957b67f81710888cee35aa5df -ac363bb542b3daee17bc6ea7516806b54ea15b0beadd7e37f01bcdfe13d7395260af5d0dbc5aaf51a89583a0e0d54a927ea359a87b954adbabb71b3daffd24db -c6c0ca53f9c86201e155bc76ff050000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f7468656d652f5f72 -656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c08 -2e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd0 -8a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa -4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c0200001300000000000000000000000000000000005b436f -6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000000000000000300100005f72 -656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000190200007468656d652f746865 -6d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210007b740aaca0600008f1a00001600000000000000000000000000d60200 -007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027000000000000000000000000 -00d40900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000cf0a00000000} -{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d -617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 -6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 -656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} -{\*\latentstyles\lsdstimax375\lsdlockeddef0\lsdsemihiddendef0\lsdunhideuseddef0\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;\lsdqformat1 \lsdlocked0 heading 1; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 2;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 3;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 4; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 5;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 6;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 7; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 8;\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdlocked0 heading 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 2; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 6; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 7;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 8;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index 9;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 1; -\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 2;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 3;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 4; -\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 5;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 6;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 7; -\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 8;\lsdsemihidden1 \lsdunhideused1 \lsdpriority39 \lsdlocked0 toc 9;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote text; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 header;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footer;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 index heading; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of figures;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope address; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 envelope return;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 footnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 line number; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 page number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote reference;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 endnote text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 table of authorities; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 macro;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 toa heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 4; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 4; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Bullet 5;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 4; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Number 5;\lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Closing;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Signature; -\lsdsemihidden1 \lsdunhideused1 \lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 4;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 List Continue 5; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Message Header;\lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Salutation;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Date; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text First Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Note Heading;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 2; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 2;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Body Text Indent 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Block Text; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 FollowedHyperlink;\lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Document Map;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Plain Text;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 E-mail Signature;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Top of Form; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Bottom of Form;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Normal (Web);\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Acronym;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Address; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Cite;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Code;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Definition;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Keyboard; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Preformatted;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Sample;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Typewriter;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 HTML Variable; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 annotation subject;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 No List;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 1;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 2; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Outline List 3;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Balloon Text;\lsdpriority39 \lsdlocked0 Table Grid;\lsdsemihidden1 \lsdlocked0 Placeholder Text;\lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; -\lsdpriority60 \lsdlocked0 Light Shading;\lsdpriority61 \lsdlocked0 Light List;\lsdpriority62 \lsdlocked0 Light Grid;\lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdpriority65 \lsdlocked0 Medium List 1; -\lsdpriority66 \lsdlocked0 Medium List 2;\lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdpriority70 \lsdlocked0 Dark List;\lsdpriority71 \lsdlocked0 Colorful Shading; -\lsdpriority72 \lsdlocked0 Colorful List;\lsdpriority73 \lsdlocked0 Colorful Grid;\lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdpriority62 \lsdlocked0 Light Grid Accent 1; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdsemihidden1 \lsdlocked0 Revision;\lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph; -\lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; -\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 1; -\lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2; -\lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; -\lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdpriority60 \lsdlocked0 Light Shading Accent 3; -\lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 3; -\lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdpriority70 \lsdlocked0 Dark List Accent 3; -\lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdpriority61 \lsdlocked0 Light List Accent 4; -\lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 4; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; -\lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdpriority62 \lsdlocked0 Light Grid Accent 5; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 5; -\lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdpriority62 \lsdlocked0 Light Grid Accent 6; -\lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdpriority66 \lsdlocked0 Medium List 2 Accent 6; -\lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdpriority71 \lsdlocked0 Colorful Shading Accent 6; -\lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; -\lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdsemihidden1 \lsdunhideused1 \lsdpriority37 \lsdlocked0 Bibliography; -\lsdsemihidden1 \lsdunhideused1 \lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;\lsdpriority41 \lsdlocked0 Plain Table 1;\lsdpriority42 \lsdlocked0 Plain Table 2;\lsdpriority43 \lsdlocked0 Plain Table 3;\lsdpriority44 \lsdlocked0 Plain Table 4; -\lsdpriority45 \lsdlocked0 Plain Table 5;\lsdpriority40 \lsdlocked0 Grid Table Light;\lsdpriority46 \lsdlocked0 Grid Table 1 Light;\lsdpriority47 \lsdlocked0 Grid Table 2;\lsdpriority48 \lsdlocked0 Grid Table 3;\lsdpriority49 \lsdlocked0 Grid Table 4; -\lsdpriority50 \lsdlocked0 Grid Table 5 Dark;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 1; -\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 1;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 1;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 1; -\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 1;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 2;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 2; -\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 2;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 2; -\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 3;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 3;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 3;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 3; -\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 3;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 4; -\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 4;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 4;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 4;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 4; -\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 4;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 5; -\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 5;\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 5;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 5; -\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 5;\lsdpriority46 \lsdlocked0 Grid Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 Grid Table 2 Accent 6;\lsdpriority48 \lsdlocked0 Grid Table 3 Accent 6; -\lsdpriority49 \lsdlocked0 Grid Table 4 Accent 6;\lsdpriority50 \lsdlocked0 Grid Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 Grid Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 Grid Table 7 Colorful Accent 6; -\lsdpriority46 \lsdlocked0 List Table 1 Light;\lsdpriority47 \lsdlocked0 List Table 2;\lsdpriority48 \lsdlocked0 List Table 3;\lsdpriority49 \lsdlocked0 List Table 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark; -\lsdpriority51 \lsdlocked0 List Table 6 Colorful;\lsdpriority52 \lsdlocked0 List Table 7 Colorful;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 1;\lsdpriority47 \lsdlocked0 List Table 2 Accent 1;\lsdpriority48 \lsdlocked0 List Table 3 Accent 1; -\lsdpriority49 \lsdlocked0 List Table 4 Accent 1;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 1;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 1;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 1; -\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 2;\lsdpriority47 \lsdlocked0 List Table 2 Accent 2;\lsdpriority48 \lsdlocked0 List Table 3 Accent 2;\lsdpriority49 \lsdlocked0 List Table 4 Accent 2; -\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 2;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 2;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 2;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 3; -\lsdpriority47 \lsdlocked0 List Table 2 Accent 3;\lsdpriority48 \lsdlocked0 List Table 3 Accent 3;\lsdpriority49 \lsdlocked0 List Table 4 Accent 3;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 3; -\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 3;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 3;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 4;\lsdpriority47 \lsdlocked0 List Table 2 Accent 4; -\lsdpriority48 \lsdlocked0 List Table 3 Accent 4;\lsdpriority49 \lsdlocked0 List Table 4 Accent 4;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 4;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 4; -\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 4;\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 5;\lsdpriority47 \lsdlocked0 List Table 2 Accent 5;\lsdpriority48 \lsdlocked0 List Table 3 Accent 5; -\lsdpriority49 \lsdlocked0 List Table 4 Accent 5;\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 5;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 5;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 5; -\lsdpriority46 \lsdlocked0 List Table 1 Light Accent 6;\lsdpriority47 \lsdlocked0 List Table 2 Accent 6;\lsdpriority48 \lsdlocked0 List Table 3 Accent 6;\lsdpriority49 \lsdlocked0 List Table 4 Accent 6; -\lsdpriority50 \lsdlocked0 List Table 5 Dark Accent 6;\lsdpriority51 \lsdlocked0 List Table 6 Colorful Accent 6;\lsdpriority52 \lsdlocked0 List Table 7 Colorful Accent 6;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Mention; -\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Smart Hyperlink;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Hashtag;\lsdsemihidden1 \lsdunhideused1 \lsdlocked0 Unresolved Mention;}}{\*\datastore }} From 05e682aed19fe6e16904fc2dfd31499306777429 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Thu, 21 May 2020 13:45:57 -0700 Subject: [PATCH 210/275] Update to dotnet SDK 5.0.0-preview.5.20268.9 (#12740) # PR Summary Update to dotnet SDK 5.0.0-preview.5.20268.9 ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [ ] N/A or can only be tested interactively - **OR** - [x] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- assets/files.wxs | 6 +++++- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 12 files changed, 31 insertions(+), 27 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 29ff69ec5d1..f8dc14ed60e 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3099,7 +3099,10 @@ - + + + + @@ -4100,6 +4103,7 @@ + diff --git a/global.json b/global.json index 26ded6964c0..825fd8b39de 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.4.20258.7" + "version": "5.0.100-preview.5.20269.29" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index a2f57e8a79b..89eb4de65e7 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 62552f73fae..77d2cfc6745 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index c3422a7f0a9..6a4f922bba7 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 085e2229fd4..2618770c7bf 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 61dbd6a742d..57f145cd524 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 3bd6e0d07c8..23f085db79f 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index f25da4e1618..7a90dbabf33 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 43added706f..1eae389e738 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index a7006bb8da5..f063fbe7f6b 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 65fb08d96fe..82291890cc2 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 0e435a51432121f6c71fde081e2d18e0038b0e8a Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 21 May 2020 18:47:54 -0700 Subject: [PATCH 211/275] Add GitHub action for PR creation and `Wix` file generation logic (#12748) --- .github/workflows/daily.yml | 54 +++++++++++++++ tools/UpdateDotnetRuntime.ps1 | 120 ++++++++++++++++++++++++--------- tools/packaging/packaging.psm1 | 1 + 3 files changed, 143 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/daily.yml diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 00000000000..a8e5e563425 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1,54 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +name: PowerShell Daily +on: + schedule: + # At 13:00 UTC every day. + - cron: '0 13 * * *' + +defaults: + run: + shell: pwsh + +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + +jobs: + update-dotnet-preview: + name: Update .NET preview + timeout-minutes: 15 + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Sync tags + run: | + git fetch --prune --unshallow --tags + - name: Execute Update .NET script + run: | + $currentVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version + Write-Verbose "name=OLD_VERSION::$currentVersion" -Verbose + Write-Host "::set-env name=OLD_VERSION::$currentVersion" + + ./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging + $newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version + Write-Verbose "name=NEW_VERSION::$newVersion" -Verbose + Write-Host "::set-env name=NEW_VERSION::$newVersion" + + if ($currentVersion -ne $newVersion) { + Write-Verbose "name=CREATE_PR::true" -Verbose + Write-Host "::set-env name=CREATE_PR::true" + } + - name: Create Pull Request + uses: peter-evans/create-pull-request@v2 + id: cpr + if: env.CREATE_PR == 'true' + with: + commit-message: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`" + title: "Update .NET SDK version from `${{ env.OLD_VERSION }}` to `${{ env.NEW_VERSION }}`" + base: master + branch: dotnet_update + + diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1 index dd1b168d91c..b9ea0add9b9 100644 --- a/tools/UpdateDotnetRuntime.ps1 +++ b/tools/UpdateDotnetRuntime.ps1 @@ -4,7 +4,10 @@ [CmdletBinding()] param ( [Parameter()] - [string]$SDKVersionOverride + [string]$SDKVersionOverride, + + [Parameter()] + [switch]$UpdateMSIPackaging ) <# @@ -61,7 +64,7 @@ function Update-PackageVersion { "$PSScriptRoot/../test/tools/" ) - Get-ChildItem -Path $paths -Recurse -Filter "*.csproj" -Exclude 'PSGalleryModules.csproj','PSGalleryTestModules.csproj' | ForEach-Object { + Get-ChildItem -Path $paths -Recurse -Filter "*.csproj" -Exclude 'PSGalleryModules.csproj', 'PSGalleryTestModules.csproj' | ForEach-Object { Write-Verbose -Message "Reading - $($_.FullName)" -Verbose $prj = [xml] (Get-Content $_.FullName -Raw) $pkgRef = $prj.Project.ItemGroup.PackageReference @@ -70,8 +73,7 @@ function Update-PackageVersion { if ($null -ne $p -and -not $skipModules.Contains($p.Include)) { if (-not $packages.ContainsKey($p.Include)) { $packages.Add($p.Include, @([PkgVer]::new($p.Include, $p.Version, $null, $_.FullName))) - } - else { + } else { $packages[$p.Include] += [PkgVer]::new($p.Include, $p.Version, $null, $_.FullName) } } @@ -127,49 +129,103 @@ function Update-CsprojFile([string] $path, $values) { } } -$dotnetMetadataPath = "$PSScriptRoot/../DotnetRuntimeMetadata.json" -$dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json +function Get-DotnetUpdate { + try { + $dotnetMetadataPath = "$PSScriptRoot/../DotnetRuntimeMetadata.json" + $nextChannel = (Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json).sdk.nextChannel + $latestSDKversion = [System.Management.Automation.SemanticVersion] (Invoke-RestMethod -Uri "http://aka.ms/dotnet/$nextChannel/Sdk/productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }) + $currentVersion = [System.Management.Automation.SemanticVersion] (( Get-Content -Path "$PSScriptRoot/../global.json" -Raw | ConvertFrom-Json).sdk.version) + + if ($latestSDKversion -gt $currentVersion) { + $shouldUpdate = $true + $newVersion = $latestSDKversion + } else { + $shouldUpdate = $false + $newVersion = $null + } + } catch { + Write-Verbose -Verbose "Error occured: $_.message" + $shouldUpdate = $false + $newVersion = $null + Write-Error "Error while checking .NET SDK update: $($_.message)" + } -# Channel is like: $Channel = "5.0.1xx-preview2" -$Channel = $dotnetMetadataJson.sdk.channel + return @{ + ShouldUpdate = $shouldUpdate + NewVersion = $newVersion + Message = $Message + } +} -Import-Module "$PSScriptRoot/../build.psm1" -Force +$dotnetUpdate = Get-DotnetUpdate -Find-Dotnet +if ($dotnetUpdate.ShouldUpdate) { -if(-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue)) -{ - $nugetFeed = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet5' } | Select-Object -ExpandProperty Value - Register-PackageSource -Name 'dotnet5' -Location $nugetFeed -ProviderName NuGet - Write-Verbose -Message "Register new package source 'dotnet5'" -Verbose -} + $dotnetMetadataPath = "$PSScriptRoot/../DotnetRuntimeMetadata.json" + $dotnetMetadataJson = Get-Content $dotnetMetadataPath -Raw | ConvertFrom-Json -## Install latest version from the channel + # Channel is like: $Channel = "5.0.1xx-preview2" + $Channel = $dotnetMetadataJson.sdk.channel -$sdkVersion = if ($SDKVersionOverride) { $SDKVersionOverride } else { "latest" } + Import-Module "$PSScriptRoot/../build.psm1" -Force -Install-Dotnet -Channel "$Channel" -Version $sdkVersion + Find-Dotnet -Write-Verbose -Message "Installing .NET SDK completed." -Verbose + if (-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue)) { + $nugetFeed = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add | Where-Object { $_.Key -eq 'dotnet5' } | Select-Object -ExpandProperty Value + Register-PackageSource -Name 'dotnet5' -Location $nugetFeed -ProviderName NuGet + Write-Verbose -Message "Register new package source 'dotnet5'" -verbose + } -$isWindowsEnv = [System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Win32NT + ## Install latest version from the channel -$dotnetPath = if ($IsWindowsEnv) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } + $sdkVersion = if ($SDKVersionOverride) { $SDKVersionOverride } else { $dotnetUpdate.NewVersion } -$pathSep = [System.IO.Path]::PathSeparator + Install-Dotnet -Channel "$Channel" -Version $sdkVersion -if (-not (($ENV:PATH -split $pathSep) -contains "$dotnetPath")) { - $env:PATH = "$dotnetPath" + $pathSep + "$ENV:PATH" -} + Write-Verbose -Message "Installing .NET SDK completed." -Verbose + + $environment = Get-EnvironmentInformation -$latestSdkVersion = (dotnet --list-sdks | Select-Object -Last 1 ).Split() | Select-Object -First 1 + $dotnetPath = if ($environment.IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } -Write-Verbose -Message "Installing .NET SDK completed, version - $latestSdkVersion" -Verbose + $pathSep = [System.IO.Path]::PathSeparator -Update-GlobalJson -Version $latestSdkVersion + if (-not (($ENV:PATH -split $pathSep) -contains "$dotnetPath")) { + $env:PATH = "$dotnetPath" + $pathSep + "$ENV:PATH" + } + + $latestSdkVersion = (dotnet --list-sdks | Select-Object -Last 1 ).Split() | Select-Object -First 1 + + Write-Verbose -Message "Installing .NET SDK completed, version - $latestSdkVersion" -Verbose -Write-Verbose -Message "Updating global.json completed." -Verbose + Update-GlobalJson -Version $latestSdkVersion -Update-PackageVersion + Write-Verbose -Message "Updating global.json completed." -Verbose -Write-Verbose -Message "Updating project files completed." -Verbose + Update-PackageVersion + + Write-Verbose -Message "Updating project files completed." -Verbose + + if ($UpdateMSIPackaging) { + if (-not $environment.IsWindows) { + throw "UpdateMSIPackaging can only be done on Windows" + } + + Import-Module "$PSScriptRoot/../build.psm1" -Force + Import-Module "$PSScriptRoot/packaging" -Force + Start-PSBootstrap -Package + Start-PSBuild -Clean -Configuration Release -CrossGen + + try { + Start-PSPackage -Type msi -SkipReleaseChecks -InformationVariable wxsData + } catch { + if ($_.Exception.Message -like "Current files to not match *") { + Copy-Item -Path $($wxsData.MessageData.NewFile) -Destination ($wxsData.MessageData.FilesWxsPath) + Write-Verbose -Message "Updating files.wxs file completed." -Verbose + } else { + throw $_ + } + } + } +} diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 507d8fe902b..1673abf4095 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -3383,6 +3383,7 @@ function Test-FileWxs $newXml | Out-File -FilePath $newXmlFileName -Encoding ascii Write-Log -message "Updated xml saved to $newXmlFileName." Write-Log -message "If component files were intentionally changed, such as due to moving to a newer .NET Core runtime, update '$FilesWxsPath' with the content from '$newXmlFileName'." + Write-Information -MessageData @{FilesWxsPath = $FilesWxsPath; NewFile = $newXmlFileName} -Tags 'PackagingWxs' if ($env:TF_BUILD) { Write-Host "##vso[artifact.upload containerfolder=wix;artifactname=wix]$newXmlFileName" From ea6f6c9ac3c2cd6bd449ef7bdb2769de7098280f Mon Sep 17 00:00:00 2001 From: "Christoph Bergmeister [MVP]" Date: Fri, 22 May 2020 17:54:29 +0100 Subject: [PATCH 212/275] Prevent GitHub workflow for daily dotnet build updates from running in forks (#12763) --- .github/workflows/daily.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index a8e5e563425..3447bf1803d 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -20,6 +20,7 @@ jobs: name: Update .NET preview timeout-minutes: 15 runs-on: windows-latest + if: github.repository == 'PowerShell/PowerShell' steps: - name: Checkout uses: actions/checkout@v2 From e132e8b1c12e8262440c494f5f1f96d2f440d4b7 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 22 May 2020 18:33:36 +0100 Subject: [PATCH 213/275] Rethrow to preserve stack details for better maintainability (#12723) --- .../NewCimSessionOptionCommand.cs | 2 +- .../commands/utility/New-Object.cs | 2 +- src/Microsoft.WSMan.Management/WsManHelper.cs | 4 ++-- .../engine/InitialSessionState.cs | 8 ++++---- .../engine/remoting/server/serverremotesession.cs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index d53403d5e81..809f31df0fa 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -654,7 +654,7 @@ internal WSManSessionOptions CreateWSMANSessionOptions() catch (Exception ex) { DebugHelper.WriteLogEx(ex.ToString(), 1); - throw ex; + throw; } } } 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 a571c72be11..b2dd03762cb 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/New-Object.cs @@ -168,7 +168,7 @@ protected override void BeginProcessing() targetObject: null)); } - throw e; + throw; } Diagnostics.Assert(type != null, "LanguagePrimitives.TryConvertTo failed but returned true"); diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 23593d68628..a1ce8af4214 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -1108,9 +1108,9 @@ internal static void LoadResourceData() } } } - catch (IOException e) + catch (IOException) { - throw (e); + throw; } } diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 80fbfcc4b5f..a26573b1cfa 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -1517,9 +1517,9 @@ public static InitialSessionState CreateDefault() { ss.ImportPSSnapIn(si, out warning); } - catch (PSSnapInException pse) + catch (PSSnapInException) { - throw pse; + throw; } #if DEBUG // NOTE: @@ -3826,9 +3826,9 @@ internal PSSnapInInfo ImportCorePSSnapIn() PSSnapInException warning; this.ImportPSSnapIn(coreSnapin, out warning); } - catch (PSSnapInException pse) + catch (PSSnapInException) { - throw pse; + throw; } return coreSnapin; diff --git a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs index 1c239133313..a5e018408de 100644 --- a/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs +++ b/src/System.Management.Automation/engine/remoting/server/serverremotesession.cs @@ -634,9 +634,9 @@ internal void ExecuteConnect(byte[] connectData, out byte[] connectResponseData) { RunServerNegotiationAlgorithm(clientCapability, true); } - catch (PSRemotingDataStructureException ex) + catch (PSRemotingDataStructureException) { - throw ex; + throw; } // validate client connect_runspacepool request From 122bd752fa4b9413b7c327c7d64522864633246c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 22 May 2020 10:34:11 -0700 Subject: [PATCH 214/275] Bump NJsonSchema from 10.1.16 to 10.1.17 (#12761) --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 77d2cfc6745..820fb1886b7 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 62bb436e718d4dd79577d81514bef7f3ed5dab4f Mon Sep 17 00:00:00 2001 From: Thomas Larsen <2789725+thlac@users.noreply.github.com> Date: Fri, 22 May 2020 21:56:47 +0200 Subject: [PATCH 215/275] Change CimCmdlets to use AliasAttribute (#12617) --- .../CimCmdletModuleInitialize.cs | 118 ------------------ .../GetCimAssociatedInstanceCommand.cs | 1 + .../GetCimClassCommand.cs | 1 + .../GetCimInstanceCommand.cs | 1 + .../GetCimSessionCommand.cs | 2 +- .../InvokeCimMethodCommand.cs | 2 +- .../NewCimInstanceCommand.cs | 1 + .../NewCimSessionCommand.cs | 1 + .../NewCimSessionOptionCommand.cs | 1 + .../RegisterCimIndicationCommand.cs | 1 + .../RemoveCimInstanceCommand.cs | 1 + .../RemoveCimSessionCommand.cs | 2 +- .../SetCimInstanceCommand.cs | 1 + .../engine/Basic/DefaultCommands.Tests.ps1 | 26 +++- 14 files changed, 37 insertions(+), 122 deletions(-) delete mode 100644 src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs deleted file mode 100644 index 72f6f0e28e4..00000000000 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -#region Using directives - -using System; -using System.Globalization; -using System.Management.Automation; -using System.Management.Automation.Runspaces; - -#endregion - -namespace Microsoft.Management.Infrastructure.CimCmdlets -{ - /// - /// - /// Initialize the cimcmdlets. - /// - /// - /// - /// Provide a hook to the engine for startup initialization - /// w.r.t compiled assembly loading. - /// - public sealed class CimCmdletsAssemblyInitializer : IModuleAssemblyInitializer - { - /// - /// - /// The constructor. - /// - /// - public CimCmdletsAssemblyInitializer() - { - } - - /// - /// PowerShell engine will call this method when the cimcmdlets module - /// is loaded. - /// - public void OnImport() - { - DebugHelper.WriteLogEx(); - using (System.Management.Automation.PowerShell invoker = System.Management.Automation.PowerShell.Create(RunspaceMode.CurrentRunspace)) - { - foreach (CimCmdletAliasEntry alias in Aliases) - { - invoker.AddScript(string.Format(CultureInfo.CurrentUICulture, "Set-Alias -Name {0} -Value {1} -Option {2} -ErrorAction SilentlyContinue", alias.Name, alias.Value, alias.Options)); - DebugHelper.WriteLog(@"Add commands {0} of {1} with option {2} to current runspace.", 1, alias.Name, alias.Value, alias.Options); - } - - System.Collections.ObjectModel.Collection psObjects = invoker.Invoke(); - DebugHelper.WriteLog(@"Invoke results {0}.", 1, psObjects.Count); - } - } - - #region readonly string - - /// - /// - /// CimCmdlet alias entry. - /// - /// - internal sealed class CimCmdletAliasEntry - { - /// - /// - /// The constructor. - /// - /// - /// The entry name. - /// The entry value. - internal CimCmdletAliasEntry(string name, string value) - { - this._name = name; - this._value = value; - } - - /// - /// The string defining the name of this alias. - /// - internal string Name { get { return this._name; } } - - private string _name; - - /// - /// The string defining real cmdlet name. - /// - internal string Value { get { return this._value; } } - - private string _value = string.Empty; - - /// - /// The string defining real cmdlet name. - /// - internal ScopedItemOptions Options { get { return this._options; } } - - private ScopedItemOptions _options = ScopedItemOptions.AllScope | ScopedItemOptions.ReadOnly; - } - - /// - /// Returns a new array of alias entries everytime it's called. - /// - internal static CimCmdletAliasEntry[] Aliases = new CimCmdletAliasEntry[] { - new CimCmdletAliasEntry("gcim", "Get-CimInstance"), - new CimCmdletAliasEntry("scim", "Set-CimInstance"), - new CimCmdletAliasEntry("ncim", "New-CimInstance "), - new CimCmdletAliasEntry("rcim", "Remove-cimInstance"), - new CimCmdletAliasEntry("icim", "Invoke-CimMethod"), - new CimCmdletAliasEntry("gcai", "Get-CimAssociatedInstance"), - new CimCmdletAliasEntry("rcie", "Register-CimIndicationEvent"), - new CimCmdletAliasEntry("ncms", "New-CimSession"), - new CimCmdletAliasEntry("rcms", "Remove-cimSession"), - new CimCmdletAliasEntry("gcms", "Get-CimSession"), - new CimCmdletAliasEntry("ncso", "New-CimSessionOption"), - new CimCmdletAliasEntry("gcls", "Get-CimClass"), - }; - #endregion - } -} diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 06754aae168..680693aab4b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -22,6 +22,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// Association parameter. /// /// + [Alias("gcai")] [Cmdlet(VerbsCommon.Get, GetCimAssociatedInstanceCommand.Noun, DefaultParameterSetName = CimBaseCommand.ComputerSetName, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index 0c2032720a0..a1a33d1eddd 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -23,6 +23,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// Should the class remember what Session it came from? No. /// /// + [Alias("gcls")] [Cmdlet(VerbsCommon.Get, GetCimClassCommand.Noun, DefaultParameterSetName = ComputerSetName, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227959")] [OutputType(typeof(CimClass))] public class GetCimClassCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs index ba5f6125a7f..4eb43d9b65c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -18,6 +18,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// specified in the Property parameter, KeysOnly parameter or the Select clause /// of the Query parameter. /// + [Alias("gcim")] [Cmdlet(VerbsCommon.Get, "CimInstance", DefaultParameterSetName = CimBaseCommand.ClassNameComputerSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227961")] [OutputType(typeof(CimInstance))] public class GetCimInstanceCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs index 459c777c817..ada9019068a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs @@ -14,7 +14,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// The command returns zero, one or more CimSession objects that represent /// connections with remote computers established from the current PS Session. /// - + [Alias("gcms")] [Cmdlet(VerbsCommon.Get, "CimSession", DefaultParameterSetName = ComputerNameSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227966")] [OutputType(typeof(CimSession))] public sealed class GetCimSessionCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index b4d58032739..914c4d00334 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -15,7 +15,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// This cmdlet enables the user to invoke a static method on a CIM class using /// the arguments passed as a list of name value pair dictionary. /// - + [Alias("icim")] [Cmdlet( "Invoke", "CimMethod", diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index 444dcd1f32c..c15a8da548d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -21,6 +21,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// on the server, otherwise just create client in-memory instance /// /// + [Alias("ncim")] [Cmdlet(VerbsCommon.New, "CimInstance", DefaultParameterSetName = CimBaseCommand.ClassNameComputerSet, SupportsShouldProcess = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227963")] [OutputType(typeof(CimInstance))] public class NewCimInstanceCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs index f2d520eef2c..eeb4cba4c4d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs @@ -18,6 +18,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// The CimSession object returned by the Cmdlet is used by all other CIM /// cmdlets. /// + [Alias("ncms")] [Cmdlet(VerbsCommon.New, "CimSession", DefaultParameterSetName = CredentialParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227967")] [OutputType(typeof(CimSession))] public sealed class NewCimSessionCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index 809f31df0fa..be3d9aeb350 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -35,6 +35,7 @@ public enum ProtocolType /// DComSessionOptions or WSManSessionOptions, which derive from /// CimSessionOptions. /// + [Alias("ncso")] [Cmdlet(VerbsCommon.New, "CimSessionOption", DefaultParameterSetName = ProtocolNameParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227969")] [OutputType(typeof(CimSessionOptions))] public sealed class NewCimSessionOptionCommand : CimBaseCommand diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs index e34ad952d50..56214e627b7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs @@ -19,6 +19,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// cancel the subscription /// Should we have the second parameter set with a -Query? /// + [Alias("rcie")] [Cmdlet(VerbsLifecycle.Register, "CimIndicationEvent", DefaultParameterSetName = CimBaseCommand.ClassNameComputerSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227960")] public class RegisterCimIndicationCommand : ObjectEventRegistrationBase { diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index c7f2ab4c6a3..7ab67b83cc2 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -15,6 +15,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// Enables the user to remove a CimInstance. /// + [Alias("rcim")] [Cmdlet( VerbsCommon.Remove, "CimInstance", diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs index 20fae29b593..fe7b7643b2a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs @@ -19,7 +19,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// This Cmdlet allows the to remove, or terminate, one or more CimSession(s). /// - + [Alias("rcms")] [Cmdlet(VerbsCommon.Remove, "CimSession", SupportsShouldProcess = true, DefaultParameterSetName = CimSessionSet, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index 714a192081a..5b1e6bc154d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -17,6 +17,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// CimInstance must have values of all [KEY] properties. /// /// + [Alias("scim")] [Cmdlet( VerbsCommon.Set, "CimInstance", diff --git a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 index 93af196b22c..e970d5a06a8 100644 --- a/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 +++ b/test/powershell/engine/Basic/DefaultCommands.Tests.ps1 @@ -68,9 +68,13 @@ Describe "Verify approved aliases list" -Tags "CI" { "Alias", "gal", "Get-Alias", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "gbp", "Get-PSBreakpoint", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "gc", "Get-Content", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" +"Alias", "gcai", "Get-CimAssociatedInstance", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "gcb", "Get-Clipboard", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "gci", "Get-ChildItem", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" +"Alias", "gcim", "Get-CimInstance", $($FullCLR -or $CoreWindows ), "", "", "" +"Alias", "gcls", "Get-CimClass", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "gcm", "Get-Command", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" +"Alias", "gcms", "Get-CimSession", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "gcs", "Get-PSCallStack", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "gdr", "Get-PSDrive", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "gerr", "Get-Error", $( $CoreWindows -or $CoreUnix), "ReadOnly", "", "" @@ -94,6 +98,7 @@ Describe "Verify approved aliases list" -Tags "CI" { "Alias", "gwmi", "Get-WmiObject", $($FullCLR ), "ReadOnly", "", "" "Alias", "h", "Get-History", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "history", "Get-History", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" +"Alias", "icim", "Invoke-CimMethod", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "icm", "Invoke-Command", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "iex", "Invoke-Expression", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "ihy", "Invoke-History", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" @@ -118,6 +123,9 @@ Describe "Verify approved aliases list" -Tags "CI" { "Alias", "mp", "Move-ItemProperty", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "mv", "Move-Item", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "nal", "New-Alias", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" +"Alias", "ncim", "New-CimInstance", $($FullCLR -or $CoreWindows ), "", "", "" +"Alias", "ncms", "New-CimSession", $($FullCLR -or $CoreWindows ), "", "", "" +"Alias", "ncso", "New-CimSessionOption", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "ndr", "New-PSDrive", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "ni", "New-Item", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "nmo", "New-Module", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" @@ -133,7 +141,10 @@ Describe "Verify approved aliases list" -Tags "CI" { "Alias", "pwd", "Get-Location", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "r", "Invoke-History", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "rbp", "Remove-PSBreakpoint", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" +"Alias", "rcie", "Register-CimIndicationEvent", $($FullCLR -or $CoreWindows ), "", "", "" +"Alias", "rcim", "Remove-CimInstance", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "rcjb", "Receive-Job", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" +"Alias", "rcms", "Remove-CimSession", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "rcsn", "Receive-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "rd", "Remove-Item", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "rdr", "Remove-PSDrive", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" @@ -159,6 +170,7 @@ Describe "Verify approved aliases list" -Tags "CI" { "Alias", "sbp", "Set-PSBreakpoint", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", "" "Alias", "sc", "Set-Content", $($FullCLR ), "ReadOnly", "", "" "Alias", "scb", "Set-Clipboard", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" +"Alias", "scim", "Set-CimInstance", $($FullCLR -or $CoreWindows ), "", "", "" "Alias", "select", "Select-Object", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "AllScope", "" "Alias", "set", "Set-Variable", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "" "Alias", "shcm", "Show-Command", $($FullCLR -or $CoreWindows ), "ReadOnly", "", "" @@ -259,6 +271,10 @@ Describe "Verify approved aliases list" -Tags "CI" { "Cmdlet", "Get-Alias", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Get-AuthenticodeSignature", "", $($FullCLR -or $CoreWindows ), "", "", "None" "Cmdlet", "Get-ChildItem", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" +"Cmdlet", "Get-CimAssociatedInstance", "", $($FullCLR -or $CoreWindows ), "", "", "None" +"Cmdlet", "Get-CimClass", "", $($FullCLR -or $CoreWindows ), "", "", "None" +"Cmdlet", "Get-CimInstance", "", $($FullCLR -or $CoreWindows ), "", "", "None" +"Cmdlet", "Get-CimSession", "", $($FullCLR -or $CoreWindows ), "", "", "None" "Cmdlet", "Get-Clipboard", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Get-CmsMessage", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Get-Command", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" @@ -327,6 +343,7 @@ Describe "Verify approved aliases list" -Tags "CI" { "Cmdlet", "Import-Module", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Import-PowerShellDataFile", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Import-PSSession", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" +"Cmdlet", "Invoke-CimMethod", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" "Cmdlet", "Invoke-Command", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Invoke-Expression", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Invoke-History", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" @@ -343,6 +360,9 @@ Describe "Verify approved aliases list" -Tags "CI" { "Cmdlet", "Move-Item", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "Move-ItemProperty", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "New-Alias", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Low" +"Cmdlet", "New-CimInstance", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" +"Cmdlet", "New-CimSession", "", $($FullCLR -or $CoreWindows ), "", "", "None" +"Cmdlet", "New-CimSessionOption", "", $($FullCLR -or $CoreWindows ), "", "", "None" "Cmdlet", "New-Event", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "New-EventLog", "", $($FullCLR ), "", "", "" "Cmdlet", "New-FileCatalog", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" @@ -381,11 +401,14 @@ Describe "Verify approved aliases list" -Tags "CI" { "Cmdlet", "Receive-Job", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Receive-PSSession", "", $($FullCLR -or $CoreWindows ), "", "", "Low" "Cmdlet", "Register-ArgumentCompleter", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" +"Cmdlet", "Register-CimIndicationEvent", "", $($FullCLR -or $CoreWindows ), "", "", "None" "Cmdlet", "Register-EngineEvent", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Register-ObjectEvent", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "None" "Cmdlet", "Register-PSSessionConfiguration", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" "Cmdlet", "Register-WmiEvent", "", $($FullCLR ), "", "", "" "Cmdlet", "Remove-Alias", "", $( $CoreWindows -or $CoreUnix), "", "", "None" +"Cmdlet", "Remove-CimInstance", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" +"Cmdlet", "Remove-CimSession", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" "Cmdlet", "Remove-Computer", "", $($FullCLR ), "", "", "" "Cmdlet", "Remove-Event", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "Remove-EventLog", "", $($FullCLR ), "", "", "" @@ -420,6 +443,7 @@ Describe "Verify approved aliases list" -Tags "CI" { "Cmdlet", "Set-Acl", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" "Cmdlet", "Set-Alias", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "Set-AuthenticodeSignature", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" +"Cmdlet", "Set-CimInstance", "", $($FullCLR -or $CoreWindows ), "", "", "Medium" "Cmdlet", "Set-Clipboard", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "Set-Content", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" "Cmdlet", "Set-Date", "", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", "Medium" @@ -496,7 +520,7 @@ Describe "Verify approved aliases list" -Tags "CI" { # We control only default engine aliases (Source -eq "") and aliases from following default loaded modules # We control only default engine Cmdlets (Source -eq "") and Cmdlets from following default loaded modules - $moduleList = @("Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Management", "Microsoft.PowerShell.Security", "Microsoft.PowerShell.Host", "Microsoft.PowerShell.Diagnostics", "Microsoft.WSMan.Management", "Microsoft.PowerShell.Core") + $moduleList = @("Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Management", "Microsoft.PowerShell.Security", "Microsoft.PowerShell.Host", "Microsoft.PowerShell.Diagnostics", "Microsoft.WSMan.Management", "Microsoft.PowerShell.Core", "CimCmdlets") $getAliases = { param($moduleList) From ac40e020aa6f18f125b62680fb897e23a076e1e2 Mon Sep 17 00:00:00 2001 From: PRASOON KARUNAN V <12897753+kvprasoon@users.noreply.github.com> Date: Sat, 23 May 2020 16:13:43 +0530 Subject: [PATCH 216/275] Fixing "Double "period" (..) in message for System.InvalidOperationException" (#12758) # PR Summary Fix for issue: Double "period" (..) in message for System.InvalidOperationException ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] Issue filed: #12497 - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../resources/ProcessResources.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Management/resources/ProcessResources.resx b/src/Microsoft.PowerShell.Commands.Management/resources/ProcessResources.resx index 0c1151be6b7..65513e55f5f 100644 --- a/src/Microsoft.PowerShell.Commands.Management/resources/ProcessResources.resx +++ b/src/Microsoft.PowerShell.Commands.Management/resources/ProcessResources.resx @@ -175,7 +175,7 @@ This command stopped operation because process "{0} ({1})" is not stopped in the specified time-out. - This command cannot be run due to the error: {0}. + This command cannot be run due to the error: {0} This command cannot be run because the input "{0}" is not a valid Application. Give a valid application and run your command again. From 12e0adc57aaed696b8ca501e0cfeba363afae473 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 23 May 2020 13:12:09 +0000 Subject: [PATCH 217/275] Update .NET SDK version from `5.0.100-preview.5.20269.29` to `5.0.100-preview.5.20272.6` (#12759) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action --- assets/files.wxs | 8 ++++---- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 4 ++-- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index f8dc14ed60e..ad082d06aa5 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3098,12 +3098,12 @@ - - - + + + @@ -4102,8 +4102,8 @@ - + diff --git a/global.json b/global.json index 825fd8b39de..ef8ee015b1a 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.5.20269.29" + "version": "5.0.100-preview.5.20272.6" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 89eb4de65e7..10b046fd478 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 820fb1886b7..d48f94b3b86 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 6a4f922bba7..4f59435e1fe 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 2618770c7bf..4e5fd9751d2 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 57f145cd524..10b27af53e2 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 23f085db79f..821bec296dc 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index 7a90dbabf33..acaa25fd2de 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 1eae389e738..502691b2275 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index f063fbe7f6b..757208ce5bf 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 82291890cc2..2aedbca4c63 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From 1f252f8bbaef5fafe534f611283fac5ad9d08a10 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sat, 23 May 2020 14:24:53 +0100 Subject: [PATCH 218/275] Wrap tests in pester blocks (#12700) # PR Summary Wrap tests in pester blocks to prepare for pesterv5 ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- test/packaging/windows/msi.tests.ps1 | 96 +++++------ .../scripting.Classes.NestedModules.tests.ps1 | 163 +++++++++--------- .../ConvertFrom-Csv.Tests.ps1 | 3 +- .../engine/Basic/PropertyAccessor.Tests.ps1 | 149 ++++++++-------- .../powershell/engine/COM/COM.Basic.Tests.ps1 | 110 ++++++------ .../engine/ETS/CimAdapter.Tests.ps1 | 133 +++++++------- 6 files changed, 323 insertions(+), 331 deletions(-) diff --git a/test/packaging/windows/msi.tests.ps1 b/test/packaging/windows/msi.tests.ps1 index 17ffebd3e66..ec488f6cf57 100644 --- a/test/packaging/windows/msi.tests.ps1 +++ b/test/packaging/windows/msi.tests.ps1 @@ -1,57 +1,57 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -function Test-Elevated { - [CmdletBinding()] - [OutputType([bool])] - Param() - - # if the current Powershell session was called with administrator privileges, - # the Administrator Group's well-known SID will show up in the Groups for the current identity. - # Note that the SID won't show up unless the process is elevated. - return (([Security.Principal.WindowsIdentity]::GetCurrent()).Groups -contains "S-1-5-32-544") -} - -function Invoke-Msiexec { - param( - [Parameter(ParameterSetName = 'Install', Mandatory)] - [Switch]$Install, - - [Parameter(ParameterSetName = 'Uninstall', Mandatory)] - [Switch]$Uninstall, - - [Parameter(Mandatory)] - [ValidateScript({Test-Path -Path $_})] - [String]$MsiPath, - - [Parameter(ParameterSetName = 'Install')] - [HashTable] $Properties - - ) - $action = "$($PSCmdlet.ParameterSetName)ing" - if ($Install.IsPresent) { - $switch = '/I' - } else { - $switch = '/x' - } - - $additionalOptions = @() - if ($Properties) { - foreach ($key in $Properties.Keys) { - $additionalOptions += "$key=$($Properties.$key)" +Describe -Name "Windows MSI" -Fixture { + BeforeAll { + function Test-Elevated { + [CmdletBinding()] + [OutputType([bool])] + Param() + + # if the current Powershell session was called with administrator privileges, + # the Administrator Group's well-known SID will show up in the Groups for the current identity. + # Note that the SID won't show up unless the process is elevated. + return (([Security.Principal.WindowsIdentity]::GetCurrent()).Groups -contains "S-1-5-32-544") } - } - $argumentList = "$switch $MsiPath /quiet /l*vx $msiLog $additionalOptions" - $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList $argumentList -NoNewWindow -PassThru - if ($msiExecProcess.ExitCode -ne 0) { - $exitCode = $msiExecProcess.ExitCode - throw "$action MSI failed and returned error code $exitCode." - } -} + function Invoke-Msiexec { + param( + [Parameter(ParameterSetName = 'Install', Mandatory)] + [Switch]$Install, + + [Parameter(ParameterSetName = 'Uninstall', Mandatory)] + [Switch]$Uninstall, + + [Parameter(Mandatory)] + [ValidateScript({Test-Path -Path $_})] + [String]$MsiPath, + + [Parameter(ParameterSetName = 'Install')] + [HashTable] $Properties + + ) + $action = "$($PSCmdlet.ParameterSetName)ing" + if ($Install.IsPresent) { + $switch = '/I' + } else { + $switch = '/x' + } + + $additionalOptions = @() + if ($Properties) { + foreach ($key in $Properties.Keys) { + $additionalOptions += "$key=$($Properties.$key)" + } + } + + $argumentList = "$switch $MsiPath /quiet /l*vx $msiLog $additionalOptions" + $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList $argumentList -NoNewWindow -PassThru + if ($msiExecProcess.ExitCode -ne 0) { + $exitCode = $msiExecProcess.ExitCode + throw "$action MSI failed and returned error code $exitCode." + } + } -Describe -Name "Windows MSI" -Fixture { - BeforeAll { $msiX64Path = $env:PsMsiX64Path # Get any existing powershell in the path diff --git a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 index a2260a6f164..97f69982e21 100644 --- a/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.NestedModules.tests.ps1 @@ -1,43 +1,42 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe 'NestedModules' -Tags "CI" { - - function New-TestModule { - param( - [string]$Name, - [string]$Content, - [string[]]$NestedContents - ) - New-Item -type directory -Force "TestDrive:\$Name" > $null - $manifestParams = @{ - Path = "TestDrive:\$Name\$Name.psd1" - } +Describe 'NestedModules' -Tags "CI" { + BeforeAll { + function New-TestModule { + param( + [string]$Name, + [string]$Content, + [string[]]$NestedContents + ) + + New-Item -type directory -Force "TestDrive:\$Name" > $null + $manifestParams = @{ + Path = "TestDrive:\$Name\$Name.psd1" + } - if ($Content) { - Set-Content -Path "${TestDrive}\$Name\$Name.psm1" -Value $Content - $manifestParams['RootModule'] = "$Name.psm1" - } + if ($Content) { + Set-Content -Path "${TestDrive}\$Name\$Name.psm1" -Value $Content + $manifestParams['RootModule'] = "$Name.psm1" + } - if ($NestedContents) { - $manifestParams['NestedModules'] = 1..$NestedContents.Count | ForEach-Object { - $null = New-Item -type directory TestDrive:\$Name\Nested$_ - $null = Set-Content -Path "${TestDrive}\$Name\Nested$_\Nested$_.psm1" -Value $NestedContents[$_ - 1] - "Nested$_" + if ($NestedContents) { + $manifestParams['NestedModules'] = 1..$NestedContents.Count | ForEach-Object { + $null = New-Item -type directory TestDrive:\$Name\Nested$_ + $null = Set-Content -Path "${TestDrive}\$Name\Nested$_\Nested$_.psm1" -Value $NestedContents[$_ - 1] + "Nested$_" + } } - } - New-ModuleManifest @manifestParams + New-ModuleManifest @manifestParams - $resolvedTestDrivePath = Split-Path ((Get-ChildItem TestDrive:\)[0].FullName) - if (-not ($env:PSModulePath -like "*$resolvedTestDrivePath*")) { - $env:PSModulePath += "$([System.IO.Path]::PathSeparator)$resolvedTestDrivePath" + $resolvedTestDrivePath = Split-Path ((Get-ChildItem TestDrive:\)[0].FullName) + if (-not ($env:PSModulePath -like "*$resolvedTestDrivePath*")) { + $env:PSModulePath += "$([System.IO.Path]::PathSeparator)$resolvedTestDrivePath" + } } - } - $originalPSModulePath = $env:PSModulePath - - try { + $originalPSModulePath = $env:PSModulePath # Create modules in TestDrive:\ New-TestModule -Name NoRoot -NestedContents @( @@ -54,72 +53,74 @@ Describe 'NestedModules' -Tags "CI" { 'class A { [string] foo() { return "A"} }', 'class B { [string] foo() { return "B"} }' ) -Content 'class C { [string] foo() { return "C"} }' + } + + AfterAll { + $env:PSModulePath = $originalPSModulePath + Get-Module @('ABC', 'NoRoot', 'WithRoot') | Remove-Module + } - It 'Get-Module is able to find types' { - $module = Get-Module NoRoot -ListAvailable - $module.GetExportedTypeDefinitions().Count | Should -Be 1 - $module = Get-Module WithRoot -ListAvailable - $module.GetExportedTypeDefinitions().Count | Should -Be 1 + It 'Get-Module is able to find types' { + $module = Get-Module NoRoot -ListAvailable + $module.GetExportedTypeDefinitions().Count | Should -Be 1 - $module = Get-Module ABC -ListAvailable - $module.GetExportedTypeDefinitions().Count | Should -Be 3 - } + $module = Get-Module WithRoot -ListAvailable + $module.GetExportedTypeDefinitions().Count | Should -Be 1 - It 'Import-Module pick the right type' { - $module = Import-Module ABC -PassThru - $module.GetExportedTypeDefinitions().Count | Should -Be 3 - $module = Import-Module ABC -PassThru -Force - $module.GetExportedTypeDefinitions().Count | Should -Be 3 - - $module = Import-Module NoRoot -PassThru - $module.GetExportedTypeDefinitions().Count | Should -Be 1 - $module = Import-Module NoRoot -PassThru -Force - $module.GetExportedTypeDefinitions().Count | Should -Be 1 - [scriptblock]::Create(@' + $module = Get-Module ABC -ListAvailable + $module.GetExportedTypeDefinitions().Count | Should -Be 3 + } + + It 'Import-Module pick the right type' { + $module = Import-Module ABC -PassThru + $module.GetExportedTypeDefinitions().Count | Should -Be 3 + $module = Import-Module ABC -PassThru -Force + $module.GetExportedTypeDefinitions().Count | Should -Be 3 + + $module = Import-Module NoRoot -PassThru + $module.GetExportedTypeDefinitions().Count | Should -Be 1 + $module = Import-Module NoRoot -PassThru -Force + $module.GetExportedTypeDefinitions().Count | Should -Be 1 + [scriptblock]::Create(@' using module NoRoot [A]::new().foo() '@ ).Invoke() | Should -Be A2 - $module = Import-Module WithRoot -PassThru - $module.GetExportedTypeDefinitions().Count | Should -Be 1 - $module = Import-Module WithRoot -PassThru -Force - $module.GetExportedTypeDefinitions().Count | Should -Be 1 - [scriptblock]::Create(@' + $module = Import-Module WithRoot -PassThru + $module.GetExportedTypeDefinitions().Count | Should -Be 1 + $module = Import-Module WithRoot -PassThru -Force + $module.GetExportedTypeDefinitions().Count | Should -Be 1 + [scriptblock]::Create(@' using module WithRoot [A]::new().foo() '@ ).Invoke() | Should -Be A0 - } - - Context 'execute type creation in the module context' { - - # let's define types to make it more fun - class A { [string] foo() { return "local"} } - class B { [string] foo() { return "local"} } - class C { [string] foo() { return "local"} } - - # We need to think about it: should it work or not. - # Currently, types are resolved in compile-time to the 'local' versions - # So at runtime we don't call the module versions. - It 'Can execute type creation in the module context with new()' -Pending { - & (Get-Module ABC) { [C]::new().foo() } | Should -Be C - & (Get-Module NoRoot) { [A]::new().foo() } | Should -Be A2 - & (Get-Module WithRoot) { [A]::new().foo() } | Should -Be A0 - & (Get-Module ABC) { [A]::new().foo() } | Should -Be A - } + } - It 'Can execute type creation in the module context with New-Object' { - & (Get-Module ABC) { (New-Object C).foo() } | Should -Be C - & (Get-Module NoRoot) { (New-Object A).foo() } | Should -Be A2 - & (Get-Module WithRoot) { (New-Object A).foo() } | Should -Be A0 - & (Get-Module ABC) { (New-Object A).foo() } | Should -Be A - } + Context 'execute type creation in the module context' { + + # let's define types to make it more fun + class A { [string] foo() { return "local"} } + class B { [string] foo() { return "local"} } + class C { [string] foo() { return "local"} } + + # We need to think about it: should it work or not. + # Currently, types are resolved in compile-time to the 'local' versions + # So at runtime we don't call the module versions. + It 'Can execute type creation in the module context with new()' -Pending { + & (Get-Module ABC) { [C]::new().foo() } | Should -Be C + & (Get-Module NoRoot) { [A]::new().foo() } | Should -Be A2 + & (Get-Module WithRoot) { [A]::new().foo() } | Should -Be A0 + & (Get-Module ABC) { [A]::new().foo() } | Should -Be A } - } finally { - $env:PSModulePath = $originalPSModulePath - Get-Module @('ABC', 'NoRoot', 'WithRoot') | Remove-Module + It 'Can execute type creation in the module context with New-Object' { + & (Get-Module ABC) { (New-Object C).foo() } | Should -Be C + & (Get-Module NoRoot) { (New-Object A).foo() } | Should -Be A2 + & (Get-Module WithRoot) { (New-Object A).foo() } | Should -Be A0 + & (Get-Module ABC) { (New-Object A).foo() } | Should -Be A + } } } 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 827238eb9ef..b5573609fbf 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/ConvertFrom-Csv.Tests.ps1 @@ -1,12 +1,11 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -$here = Split-Path -Parent $MyInvocation.MyCommand.Path Describe "ConvertFrom-Csv" -Tags "CI" { BeforeAll { $testObject = "a", "1" - $testcsv = Join-Path -Path (Join-Path -Path $here -ChildPath assets) -ChildPath TestCsv2.csv + $testcsv = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath TestCsv2.csv $testName = "Zaphod BeebleBrox" $testColumns = @" a,b,c diff --git a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 index 3955d47ef9a..ac0c445a8a3 100644 --- a/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 +++ b/test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 @@ -6,95 +6,92 @@ # Windows so that file IO can be verified using supported cmdlets. # -try { - # Skip these tests when run against "InBox" PowerShell - $IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) - $productName = "PowerShell" - - #skip all tests on non-windows platform - $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() - $IsNotSkipped = ($IsWindows -and !$IsInbox) # Only execute for PowerShell on Windows - $PSDefaultParameterValues["it:skip"] = !$IsNotSkipped - - Describe "User-Specific powershell.config.json Modifications" -Tags "CI" { - - BeforeAll { - if ($IsNotSkipped) { - # Discover the user-specific powershell.config.json file - $userSettingsDir = [System.IO.Path]::Combine($env:USERPROFILE, "Documents", $productName) - $userPropertiesFile = Join-Path $userSettingsDir "powershell.config.json" - - # Save the file for restoration after the tests are complete - $backupPropertiesFile = "" - if (Test-Path $userPropertiesFile) { - $backupPropertiesFile = Join-Path $userSettingsDir "ORIGINAL_powershell.config.json" - Copy-Item -Path $userPropertiesFile -Destination $backupPropertiesFile -Force -ErrorAction Continue - } - elseif (-not (Test-Path $userSettingsDir)) { - # create the directory if it does not already exist - $null = New-Item -Type Directory -Path $userSettingsDir -Force -ErrorAction SilentlyContinue - } - - # Save the original Process ExecutionPolicy. The tests assume that it is Undefined - $processExecutionPolicy = Get-ExecutionPolicy -Scope Process - Set-ExecutionPolicy -Scope Process -ExecutionPolicy Undefined +Describe "User-Specific powershell.config.json Modifications" -Tags "CI" { + + BeforeAll { + # Skip these tests when run against "InBox" PowerShell + $IsInbox = $PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreCase) + $productName = "PowerShell" + + #skip all tests on non-windows platform + $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() + $IsNotSkipped = ($IsWindows -and !$IsInbox) # Only execute for PowerShell on Windows + $PSDefaultParameterValues["it:skip"] = !$IsNotSkipped + + if ($IsNotSkipped) { + # Discover the user-specific powershell.config.json file + $userSettingsDir = [System.IO.Path]::Combine($env:USERPROFILE, "Documents", $productName) + $userPropertiesFile = Join-Path $userSettingsDir "powershell.config.json" + + # Save the file for restoration after the tests are complete + $backupPropertiesFile = "" + if (Test-Path $userPropertiesFile) { + $backupPropertiesFile = Join-Path $userSettingsDir "ORIGINAL_powershell.config.json" + Copy-Item -Path $userPropertiesFile -Destination $backupPropertiesFile -Force -ErrorAction Continue } + elseif (-not (Test-Path $userSettingsDir)) { + # create the directory if it does not already exist + $null = New-Item -Type Directory -Path $userSettingsDir -Force -ErrorAction SilentlyContinue + } + + # Save the original Process ExecutionPolicy. The tests assume that it is Undefined + $processExecutionPolicy = Get-ExecutionPolicy -Scope Process + Set-ExecutionPolicy -Scope Process -ExecutionPolicy Undefined } + } - BeforeEach { - if ($IsNotSkipped) { - Set-Content -Path $userPropertiesFile -Value '{"Microsoft.PowerShell:ExecutionPolicy":"RemoteSigned"}' - } + BeforeEach { + if ($IsNotSkipped) { + Set-Content -Path $userPropertiesFile -Value '{"Microsoft.PowerShell:ExecutionPolicy":"RemoteSigned"}' } + } - AfterAll { - if ($IsNotSkipped) { - if (-not $backupPropertiesFile) - { - # Remove powershell.config.json if it did not exist before the tests - Remove-Item -Path $userPropertiesFile -Force -ErrorAction SilentlyContinue - } - else - { - # Restore the original powershell.config.json file if it existed before the test pass. - Move-Item -Path $backupPropertiesFile -Destination $userPropertiesFile -Force -ErrorAction Continue - } - - # Restore the original Process ExecutionPolicy - Set-ExecutionPolicy -Scope Process -ExecutionPolicy $processExecutionPolicy + AfterAll { + if ($IsNotSkipped) { + if (-not $backupPropertiesFile) + { + # Remove powershell.config.json if it did not exist before the tests + Remove-Item -Path $userPropertiesFile -Force -ErrorAction SilentlyContinue } + else + { + # Restore the original powershell.config.json file if it existed before the test pass. + Move-Item -Path $backupPropertiesFile -Destination $userPropertiesFile -Force -ErrorAction Continue + } + + # Restore the original Process ExecutionPolicy + Set-ExecutionPolicy -Scope Process -ExecutionPolicy $processExecutionPolicy } - It "Verify Queries to Missing File Return Default Value" { - Remove-Item $userPropertiesFile -Force + $global:PSDefaultParameterValues = $originalDefaultParameterValues + } - Get-ExecutionPolicy -Scope CurrentUser | Should -Be "Undefined" + It "Verify Queries to Missing File Return Default Value" { + Remove-Item $userPropertiesFile -Force - # Verify the file was not created during the test - { $propFile = Get-Item $userPropertiesFile -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand" - } + Get-ExecutionPolicy -Scope CurrentUser | Should -Be "Undefined" - It "Verify Queries for Non-Existant Properties Return Default Value" { - # Create a valid file with no values - Set-Content -Path $userPropertiesFile -Value "{}" + # Verify the file was not created during the test + { $propFile = Get-Item $userPropertiesFile -ErrorAction Stop } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand" + } - Get-ExecutionPolicy -Scope CurrentUser | Should -Be "Undefined" - } + It "Verify Queries for Non-Existant Properties Return Default Value" { + # Create a valid file with no values + Set-Content -Path $userPropertiesFile -Value "{}" - It "Verify Writes Update Properties" { - Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"RemoteSigned"}' - Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass - Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"Bypass"}' - } + Get-ExecutionPolicy -Scope CurrentUser | Should -Be "Undefined" + } - It "Verify Writes Create the File if Not Present" { - Remove-Item $userPropertiesFile -Force - Test-Path $userPropertiesFile | Should -BeFalse - Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass - Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"Bypass"}' - } + It "Verify Writes Update Properties" { + Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"RemoteSigned"}' + Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass + Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"Bypass"}' + } + + It "Verify Writes Create the File if Not Present" { + Remove-Item $userPropertiesFile -Force + Test-Path $userPropertiesFile | Should -BeFalse + Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass + Get-Content -Path $userPropertiesFile | Should -Be '{"Microsoft.PowerShell:ExecutionPolicy":"Bypass"}' } -} -finally { - $global:PSDefaultParameterValues = $originalDefaultParameterValues } diff --git a/test/powershell/engine/COM/COM.Basic.Tests.ps1 b/test/powershell/engine/COM/COM.Basic.Tests.ps1 index 496c5dbcc21..28974e15420 100644 --- a/test/powershell/engine/COM/COM.Basic.Tests.ps1 +++ b/test/powershell/engine/COM/COM.Basic.Tests.ps1 @@ -1,71 +1,74 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -try { - $defaultParamValues = $PSDefaultParameterValues.Clone() - $PSDefaultParameterValues["it:skip"] = ![System.Management.Automation.Platform]::IsWindowsDesktop +Describe 'Basic COM Tests' -Tags "CI" { + BeforeAll { + $defaultParamValues = $PSDefaultParameterValues.Clone() + $PSDefaultParameterValues["it:skip"] = ![System.Management.Automation.Platform]::IsWindowsDesktop + } - Describe 'Basic COM Tests' -Tags "CI" { - BeforeAll { - $null = New-Item -Path $TESTDRIVE/file1 -ItemType File - $null = New-Item -Path $TESTDRIVE/file2 -ItemType File - $null = New-Item -Path $TESTDRIVE/file3 -ItemType File - } + AfterAll { + $global:PSDefaultParameterValues = $defaultParamValues + } - It "Should enumerate files from a folder" { - $shell = New-Object -ComObject "Shell.Application" - $folder = $shell.Namespace("$TESTDRIVE") - $items = $folder.Items() + BeforeAll { + $null = New-Item -Path $TESTDRIVE/file1 -ItemType File + $null = New-Item -Path $TESTDRIVE/file2 -ItemType File + $null = New-Item -Path $TESTDRIVE/file3 -ItemType File + } - ## $items is a collection of all items belong to the folder, and it should be enumerated. - $items.Count | Should -Be 3 - $items | Measure-Object | ForEach-Object Count | Should -Be $items.Count + It "Should enumerate files from a folder" { + $shell = New-Object -ComObject "Shell.Application" + $folder = $shell.Namespace("$TESTDRIVE") + $items = $folder.Items() - $names = $items | ForEach-Object { $_.Name } - $names -join "," | Should -Be "file1,file2,file3" - } + ## $items is a collection of all items belong to the folder, and it should be enumerated. + $items.Count | Should -Be 3 + $items | Measure-Object | ForEach-Object Count | Should -Be $items.Count - It "Should enumerate IEnumVariant interface object without exception" { - $shell = New-Object -ComObject "Shell.Application" - $folder = $shell.Namespace("$TESTDRIVE") - $items = $folder.Items() + $names = $items | ForEach-Object { $_.Name } + $names -join "," | Should -Be "file1,file2,file3" + } - ## $enumVariant is an IEnumVariant interface of all items belong to the folder, and it should be enumerated. - $enumVariant = $items._NewEnum() - $items.Count | Should -Be 3 - $enumVariant | Measure-Object | ForEach-Object Count | Should -Be $items.Count - } + It "Should enumerate IEnumVariant interface object without exception" { + $shell = New-Object -ComObject "Shell.Application" + $folder = $shell.Namespace("$TESTDRIVE") + $items = $folder.Items() - It "Should enumerate drives" { - $fileSystem = New-Object -ComObject scripting.filesystemobject - $drives = $fileSystem.Drives - - ## $drives is a read-only collection of all available drives, and it should be enumerated. - $drives | Measure-Object | ForEach-Object Count | Should -Be $drives.Count - ## $element should be the first drive from the enumeration. It shouldn't be the same as $drives, - ## but it should be the same as '$drives.Item($element.DriveLetter)' - $element = $drives | Select-Object -First 1 - [System.Object]::ReferenceEquals($element, $drives) | Should -BeFalse - $element | Should -Be $drives.Item($element.DriveLetter) - } + ## $enumVariant is an IEnumVariant interface of all items belong to the folder, and it should be enumerated. + $enumVariant = $items._NewEnum() + $items.Count | Should -Be 3 + $enumVariant | Measure-Object | ForEach-Object Count | Should -Be $items.Count + } - It "Should be able to enumerate 'IADsMembers' object" { - $group = [ADSI]"WinNT://./Users,Group" - $members = $group.Invoke('Members') - $names = $members | ForEach-Object { $_.GetType().InvokeMember('Name', 'GetProperty', $null, $_, $null) } - $names | Should -Contain 'INTERACTIVE' - } + It "Should enumerate drives" { + $fileSystem = New-Object -ComObject scripting.filesystemobject + $drives = $fileSystem.Drives + + ## $drives is a read-only collection of all available drives, and it should be enumerated. + $drives | Measure-Object | ForEach-Object Count | Should -Be $drives.Count + ## $element should be the first drive from the enumeration. It shouldn't be the same as $drives, + ## but it should be the same as '$drives.Item($element.DriveLetter)' + $element = $drives | Select-Object -First 1 + [System.Object]::ReferenceEquals($element, $drives) | Should -BeFalse + $element | Should -Be $drives.Item($element.DriveLetter) + } - It "ToString() should return method paramter names" { - $shell = New-Object -ComObject "Shell.Application" - $fullSignature = $shell.AddToRecent.ToString() + It "Should be able to enumerate 'IADsMembers' object" { + $group = [ADSI]"WinNT://./Users,Group" + $members = $group.Invoke('Members') + $names = $members | ForEach-Object { $_.GetType().InvokeMember('Name', 'GetProperty', $null, $_, $null) } + $names | Should -Contain 'INTERACTIVE' + } - $fullSignature | Should -BeExactly "void AddToRecent (Variant varFile, string bstrCategory)" - } + It "ToString() should return method paramter names" { + $shell = New-Object -ComObject "Shell.Application" + $fullSignature = $shell.AddToRecent.ToString() + $fullSignature | Should -BeExactly "void AddToRecent (Variant varFile, string bstrCategory)" } - Describe 'GetMember/SetMember/InvokeMember binders should have more restricted rule for COM object' -Tags "CI" { + Context 'GetMember/SetMember/InvokeMember binders should have more restricted rule for COM object' { BeforeAll { if ([System.Management.Automation.Platform]::IsWindowsDesktop) { $null = New-Item -Path $TESTDRIVE/bar -ItemType Directory -Force @@ -110,7 +113,4 @@ try { $str.Windows() | Should -Be "Windows" } } - -} finally { - $global:PSdefaultParameterValues = $defaultParamValues } diff --git a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 index 7e383b6f198..1e71bc28b95 100644 --- a/test/powershell/engine/ETS/CimAdapter.Tests.ps1 +++ b/test/powershell/engine/ETS/CimAdapter.Tests.ps1 @@ -1,25 +1,23 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -function getIndex -{ - param([string[]]$strings,[string]$pattern) - for ($i = 0; $i -lt $strings.Count; $i++) { - if ($strings[$i] -like $pattern) { - return $i - } - } - return -1 -} -try { - if ( ! $IsWindows ) { - $PSDefaultParameterValues["it:pending"] = $true - } - Describe "CIM Objects are adapted properly" -Tag @("CI") { - BeforeAll { - if ( ! $IsWindows ) { - return +Describe "CIM Objects are adapted properly" -Tag @("CI") { + BeforeAll { + function getIndex + { + param([string[]]$strings,[string]$pattern) + for ($i = 0; $i -lt $strings.Count; $i++) { + if ($strings[$i] -like $pattern) { + return $i + } } + return -1 + } + + if ( ! $IsWindows ) { + $PSDefaultParameterValues["it:pending"] = $true + } + else { $p = Get-CimInstance win32_process |Select-Object -First 1 $indexOf_namespaceQualified_Win32Process = getIndex $p.PSTypeNames "*root?cimv2?Win32_Process" @@ -32,61 +30,58 @@ try { $indexOf_className_CimLogicalElement = getIndex $p.PSTypeNames "*#CIM_LogicalElement" $indexOf_className_CimManagedSystemElement = getIndex $p.PSTypeNames "*#CIM_ManagedSystemElement" } - AfterAll { - $PSDefaultParameterValues.Remove("it:pending") - } + } + AfterAll { + $PSDefaultParameterValues.Remove("it:pending") + } - It "Namespace-qualified Win32_Process is present" -Skip:(!$IsWindows) { - $indexOf_namespaceQualified_Win32Process | Should -Not -Be (-1) - } - It "Namespace-qualified CIM_Process is present" { - $indexOf_namespaceQualified_CimProcess | Should -Not -Be (-1) - } - It "Namespace-qualified CIM_LogicalElement is present" { - $indexOf_namespaceQualified_CimLogicalElement | Should -Not -Be (-1) - } - It "Namespace-qualified CIM_ManagedSystemElement is present" { - $indexOf_namespaceQualified_CimManagedSystemElement | Should -Not -Be (-1) - } + It "Namespace-qualified Win32_Process is present" -Skip:(!$IsWindows) { + $indexOf_namespaceQualified_Win32Process | Should -Not -Be (-1) + } + It "Namespace-qualified CIM_Process is present" { + $indexOf_namespaceQualified_CimProcess | Should -Not -Be (-1) + } + It "Namespace-qualified CIM_LogicalElement is present" { + $indexOf_namespaceQualified_CimLogicalElement | Should -Not -Be (-1) + } + It "Namespace-qualified CIM_ManagedSystemElement is present" { + $indexOf_namespaceQualified_CimManagedSystemElement | Should -Not -Be (-1) + } - It "Classname of Win32_Process is present" -Skip:(!$IsWindows) { - $indexOf_className_Win32Process | Should -Not -Be (-1) - } - It "Classname of CIM_Process is present" { - $indexOf_className_CimProcess | Should -Not -Be (-1) - } - It "Classname of CIM_LogicalElement is present" { - $indexOf_className_CimLogicalElement | Should -Not -Be (-1) - } - It "Classname of CIM_ManagedSystemElement is present" { - $indexOf_className_CimManagedSystemElement | Should -Not -Be (-1) - } + It "Classname of Win32_Process is present" -Skip:(!$IsWindows) { + $indexOf_className_Win32Process | Should -Not -Be (-1) + } + It "Classname of CIM_Process is present" { + $indexOf_className_CimProcess | Should -Not -Be (-1) + } + It "Classname of CIM_LogicalElement is present" { + $indexOf_className_CimLogicalElement | Should -Not -Be (-1) + } + It "Classname of CIM_ManagedSystemElement is present" { + $indexOf_className_CimManagedSystemElement | Should -Not -Be (-1) + } - It "Win32_Process comes after CIM_Process (namespace qualified)" -Skip:(!$IsWindows) { - $indexOf_namespaceQualified_Win32Process | Should -BeLessThan $indexOf_namespaceQualified_CimProcess - } - It "CIM_Process comes after CIM_LogicalElement (namespace qualified)" { - $indexOf_namespaceQualified_CimProcess | Should -BeLessThan $indexOf_namespaceQualified_CimLogicalElement - } - It "CIM_LogicalElement comes after CIM_ManagedSystemElement (namespace qualified)" { - $indexOf_namespaceQualified_CimLogicalElement | Should -BeLessThan $indexOf_namespaceQualified_CimManagedSystemElement - } + It "Win32_Process comes after CIM_Process (namespace qualified)" -Skip:(!$IsWindows) { + $indexOf_namespaceQualified_Win32Process | Should -BeLessThan $indexOf_namespaceQualified_CimProcess + } + It "CIM_Process comes after CIM_LogicalElement (namespace qualified)" { + $indexOf_namespaceQualified_CimProcess | Should -BeLessThan $indexOf_namespaceQualified_CimLogicalElement + } + It "CIM_LogicalElement comes after CIM_ManagedSystemElement (namespace qualified)" { + $indexOf_namespaceQualified_CimLogicalElement | Should -BeLessThan $indexOf_namespaceQualified_CimManagedSystemElement + } - It "Win32_Process comes after CIM_Process (classname only)" -Skip:(!$IsWindows) { - $indexOf_className_Win32Process | Should -BeLessThan $indexOf_className_CimProcess - } - It "CIM_Process comes after CIM_LogicalElement (classname only)" { - $indexOf_className_CimProcess | Should -BeLessThan $indexOf_className_CimLogicalElement - } - It "CIM_LogicalElement comes after CIM_ManagedSystemElement (classname only)" { - $indexOf_className_CimLogicalElement | Should -BeLessThan $indexOf_className_CimManagedSystemElement - } + It "Win32_Process comes after CIM_Process (classname only)" -Skip:(!$IsWindows) { + $indexOf_className_Win32Process | Should -BeLessThan $indexOf_className_CimProcess + } + It "CIM_Process comes after CIM_LogicalElement (classname only)" { + $indexOf_className_CimProcess | Should -BeLessThan $indexOf_className_CimLogicalElement + } + It "CIM_LogicalElement comes after CIM_ManagedSystemElement (classname only)" { + $indexOf_className_CimLogicalElement | Should -BeLessThan $indexOf_className_CimManagedSystemElement + } - It "Namespace qualified PSTypenames comes after class-only PSTypeNames" -Skip:(!$IsWindows) { - $indexOf_namespaceQualified_CimManagedSystemElement | Should -BeLessThan $indexOf_className_Win32Process - } + It "Namespace qualified PSTypenames comes after class-only PSTypeNames" -Skip:(!$IsWindows) { + $indexOf_namespaceQualified_CimManagedSystemElement | Should -BeLessThan $indexOf_className_Win32Process } } -finally { - $PSDefaultParameterValues.Remove("it:pending") -} From b2f5779a7bf7af721921885ad228ebb4d3997587 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 26 May 2020 17:53:49 +0100 Subject: [PATCH 219/275] Replace link to Slack with link to PowerShell Virtual User Group (#12786) # PR Summary ## PR Context MicrosoftDocs/feedback/issues/2776 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 70a5425bc80..03813155a85 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ To install a specific version, visit [releases](https://github.com/PowerShell/Po For more information on how and why we built this dashboard, check out this [blog post](https://devblogs.microsoft.com/powershell/powershell-open-source-community-dashboard/). -## Chat Room +## Chat Want to chat with other members of the PowerShell community? @@ -143,9 +143,9 @@ We have a Gitter Room which you can join below. [![Join the chat](https://img.shields.io/static/v1.svg?label=chat&message=on%20gitter&color=informational&logo=gitter)](https://gitter.im/PowerShell/PowerShell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -There is also the community driven PowerShell Slack Team which you can sign up for at [Slack]. - -[Slack]: http://slack.poshcode.org +There is also the community driven PowerShell Virtual User Group, which you can join on: +* [Slack](https://aka.ms/psslack) +* [Discord](https://aka.ms/psdiscord) ## Add-ons and libraries From 2ea7010dfee60d4bb9c08dad99be1a8dfa466cdc Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Wed, 27 May 2020 08:15:29 +0100 Subject: [PATCH 220/275] Clarify defaultRefAssemblies list capacity in AddType.cs (#12520) # PR Summary * Clarify calculation of `defaultRefAssemblies` initial list capacity. * Assert if list capacity is increased as a result of a resize. ## PR Context InitDefaultRefAssemblies may initialize a list too small to hold the reference assemblies distributed with netcoreapp5.0, which may result in an expensive reallocation of the internal array. ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../commands/utility/AddType.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 2e733802fa2..df96aba17a4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -668,14 +668,26 @@ private void LoadAssemblies(IEnumerable assemblies) /// private static IEnumerable InitDefaultRefAssemblies() { - // netcoreapp3.0 currently comes with 148 reference assemblies (maybe more in future), so we use a capacity of '150'. - var defaultRefAssemblies = new List(150); + // Define number of reference assemblies distributed with PowerShell. + // This number is accurate as of PowerShell v7.1.0-preview.1 built with .NET v5.0.100-preview.1.20155.7 + const int numberOfPowershellRefAssemblies = 151; + + const int capacity = numberOfPowershellRefAssemblies + 1; + var defaultRefAssemblies = new List(capacity); foreach (string file in Directory.EnumerateFiles(s_netcoreAppRefFolder, "*.dll", SearchOption.TopDirectoryOnly)) { defaultRefAssemblies.Add(MetadataReference.CreateFromFile(file)); } + + // Add System.Management.Automation.dll defaultRefAssemblies.Add(MetadataReference.CreateFromFile(typeof(PSObject).Assembly.Location)); + + // We want to avoid reallocating the internal array, so we assert if the list capacity has increased. + Diagnostics.Assert( + defaultRefAssemblies.Capacity <= capacity, + $"defaultRefAssemblies was resized because of insufficient initial capacity! A capacity of {defaultRefAssemblies.Count} is required."); + return defaultRefAssemblies; } From e7325f29cd3ba69d85288998e48293298fcb9f19 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 27 May 2020 16:12:11 +0500 Subject: [PATCH 221/275] Bump NJsonSchema from 10.1.17 to 10.1.18 (#12812) Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.17 to 10.1.18. - [Release notes](https://github.com/RicoSuter/NJsonSchema/releases) - [Commits](https://github.com/RicoSuter/NJsonSchema/commits) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- .../Microsoft.PowerShell.Commands.Utility.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index d48f94b3b86..a121806b9ff 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -34,7 +34,7 @@ - + From 281c471e7b491fe1dda0f351bf4d67a554839643 Mon Sep 17 00:00:00 2001 From: krishnayalavarthi Date: Wed, 27 May 2020 13:16:08 -0700 Subject: [PATCH 222/275] Adding more ETW logs to wsman plugin (#12798) --- .../engine/remoting/fanin/WSManPlugin.cs | 382 ++++++++++++++++-- .../remoting/fanin/WSManTransportManager.cs | 200 +++++++-- 2 files changed, 503 insertions(+), 79 deletions(-) diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs index 860dcb3ae32..c6dde82a90b 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs @@ -187,6 +187,15 @@ internal void CreateShell( WSManNativeApi.WSManShellStartupInfo_UnToMan startupInfo, WSManNativeApi.WSManData_UnToMan inboundShellInformation) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateRemoteSession, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + "null", + "CreateShell: Create a new shell in the plugin context", + string.Empty); + if (requestDetails == null) { // Nothing can be done because requestDetails are required to report operation complete @@ -228,6 +237,15 @@ internal void CreateShell( return; } + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateRemoteSession, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + requestDetails.ToString(), + "CreateShell: NULL checks being performed", + string.Empty); + if ((0 == startupInfo.inputStreamSet.streamIDsCount) || (0 == startupInfo.outputStreamSet.streamIDsCount)) { ReportOperationComplete( @@ -282,11 +300,12 @@ internal void CreateShell( serverTransportMgr = new WSManPluginServerTransportManager(BaseTransportManager.DefaultFragmentSize, null); } - PSEtwLog.LogAnalyticInformational(PSEventId.ServerCreateRemoteSession, + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateRemoteSession, PSOpcode.Connect, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, requestDetails.ToString(), senderInfo.UserInfo.Identity.Name, requestDetails.resourceUri); - ServerRemoteSession remoteShellSession = ServerRemoteSession.CreateServerRemoteSession(senderInfo, + ServerRemoteSession remoteShellSession = ServerRemoteSession.CreateServerRemoteSession(senderInfo, requestDetails.resourceUri, extraInfo, serverTransportMgr); @@ -334,7 +353,8 @@ internal void CreateShell( } // now report the shell context to WSMan. - PSEtwLog.LogAnalyticInformational(PSEventId.ReportContext, + PSEtwLog.LogAnalyticInformational( + PSEventId.ReportContext, PSOpcode.Connect, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, requestDetails.ToString(), requestDetails.ToString()); @@ -445,6 +465,15 @@ internal void CreateShell( return; } + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateRemoteSession, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + requestDetails.ToString(), + "CreateShell: Completed", + string.Empty); + return; } @@ -455,9 +484,11 @@ internal void CreateShell( internal void CloseShellOperation( WSManPluginOperationShutdownContext context) { - PSEtwLog.LogAnalyticInformational(PSEventId.ServerCloseOperation, - PSOpcode.Disconnect, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCloseOperation, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, ((IntPtr)context.shellContext).ToString(), ((IntPtr)context.commandContext).ToString(), context.isReceiveOperation.ToString()); @@ -478,13 +509,23 @@ internal void CloseShellOperation( System.Exception reasonForClose = new System.Exception(RemotingErrorIdStrings.WSManPluginOperationClose); mgdShellSession.CloseOperation(context, reasonForClose); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCloseOperation, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + "CloseShellOperation: Completed", + string.Empty); } internal void CloseCommandOperation( WSManPluginOperationShutdownContext context) { - PSEtwLog.LogAnalyticInformational(PSEventId.ServerCloseOperation, - PSOpcode.Disconnect, PSTask.None, + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCloseOperation, + PSOpcode.Disconnect, + PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, context.shellContext.ToString(), context.commandContext.ToString(), @@ -499,6 +540,14 @@ internal void CloseCommandOperation( } mgdShellSession.CloseCommandOperation(context); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCloseOperation, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + "CloseCommandOperation: Completed", + string.Empty); } /// @@ -598,7 +647,8 @@ private bool validateIncomingContexts( if (requestDetails == null) { // Nothing can be done because requestDetails are required to report operation complete - PSEtwLog.LogAnalyticInformational(PSEventId.ReportOperationComplete, + PSEtwLog.LogAnalyticInformational( + PSEventId.ReportOperationComplete, PSOpcode.Close, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, "null", @@ -643,6 +693,15 @@ internal void CreateCommand( string commandLine, WSManNativeApi.WSManCommandArgSet arguments) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateCommandSession, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "CreateCommand: Create a new command in the shell context", + string.Empty); + if (!validateIncomingContexts(requestDetails, shellContext, "WSManRunShellCommandEx")) { return; @@ -650,9 +709,10 @@ internal void CreateCommand( SetThreadProperties(requestDetails); - PSEtwLog.LogAnalyticInformational(PSEventId.ServerCreateCommandSession, - PSOpcode.Connect, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateCommandSession, + PSOpcode.Connect, PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, ((IntPtr)shellContext).ToString(), requestDetails.ToString()); WSManPluginShellSession mgdShellSession = GetFromActiveShellSessions(shellContext); @@ -667,6 +727,15 @@ internal void CreateCommand( } mgdShellSession.CreateCommand(pluginContext, requestDetails, flags, commandLine, arguments); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerCreateCommandSession, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "CreateCommand: Create a new command in the shell context completed", + string.Empty); } internal void StopCommand( @@ -677,7 +746,8 @@ internal void StopCommand( if (requestDetails == null) { // Nothing can be done because requestDetails are required to report operation complete - PSEtwLog.LogAnalyticInformational(PSEventId.ReportOperationComplete, + PSEtwLog.LogAnalyticInformational( + PSEventId.ReportOperationComplete, PSOpcode.Close, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, "null", @@ -692,12 +762,14 @@ internal void StopCommand( SetThreadProperties(requestDetails); - PSEtwLog.LogAnalyticInformational(PSEventId.ServerStopCommand, - PSOpcode.Disconnect, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, - ((IntPtr)shellContext).ToString(), - ((IntPtr)commandContext).ToString(), - requestDetails.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerStopCommand, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); WSManPluginShellSession mgdShellSession = GetFromActiveShellSessions(shellContext); if (mgdShellSession == null) @@ -722,13 +794,22 @@ internal void StopCommand( } mgdCommandSession.Stop(requestDetails); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerStopCommand, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + "StopCommand: completed", + string.Empty); } internal void Shutdown() { - PSEtwLog.LogAnalyticInformational(PSEventId.WSManPluginShutdown, - PSOpcode.ShuttingDown, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManPluginShutdown, + PSOpcode.ShuttingDown, PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic); // all active shells should be closed at this point Dbg.Assert(_activeShellSessions.Count == 0, "All active shells should be closed"); @@ -752,6 +833,15 @@ internal void ConnectShellOrCommand( IntPtr commandContext, WSManNativeApi.WSManData_UnToMan inboundConnectInformation) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "ConnectShellOrCommand: Connect", + string.Empty); + if (!validateIncomingContexts(requestDetails, shellContext, "ConnectShellOrCommand")) { return; @@ -759,10 +849,15 @@ internal void ConnectShellOrCommand( // TODO... What does this mean from a new client that has specified diff locale from original client? SetThreadProperties(requestDetails); - // TODO.. Add new ETW events and log - /*etwTracer.AnalyticChannel.WriteInformation(PSEventId.ServerReceivedData, - PSOpcode.Open, PSTask.None, - ((IntPtr)shellContext).ToString(), ((IntPtr)commandContext).ToString(), ((IntPtr)requestDetails).ToString());*/ + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); WSManPluginShellSession mgdShellSession = GetFromActiveShellSessions(shellContext); if (mgdShellSession == null) @@ -793,7 +888,25 @@ internal void ConnectShellOrCommand( return; } + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); + mgdCmdSession.ExecuteConnect(requestDetails, flags, inboundConnectInformation); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Connect, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "ConnectShellOrCommand: ExecuteConnect invoked", + string.Empty); } /// @@ -813,6 +926,15 @@ internal void SendOneItemToShellOrCommand( string stream, WSManNativeApi.WSManData_UnToMan inboundData) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "SendOneItemToShellOrCommand: Send data to the shell / command specified", + string.Empty); + if (!validateIncomingContexts(requestDetails, shellContext, "SendOneItemToShellOrCommand")) { return; @@ -820,10 +942,14 @@ internal void SendOneItemToShellOrCommand( SetThreadProperties(requestDetails); - PSEtwLog.LogAnalyticInformational(PSEventId.ServerReceivedData, - PSOpcode.Open, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, - ((IntPtr)shellContext).ToString(), ((IntPtr)commandContext).ToString(), requestDetails.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); WSManPluginShellSession mgdShellSession = GetFromActiveShellSessions(shellContext); if (mgdShellSession == null) @@ -856,7 +982,25 @@ internal void SendOneItemToShellOrCommand( return; } + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); + mgdCmdSession.SendOneItemToSession(requestDetails, flags, stream, inboundData); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "SendOneItemToShellOrCommand: SendOneItemToSession invoked", + string.Empty); } /// @@ -877,6 +1021,15 @@ internal void EnableShellOrCommandToSendDataToClient( IntPtr commandContext, WSManNativeApi.WSManStreamIDSet_UnToMan streamSet) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerClientReceiveRequest, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "EnableShellOrCommandToSendDataToClient: unlock the shell / command specified so that the shell / command starts sending data to the client.", + string.Empty); + if (!validateIncomingContexts(requestDetails, shellContext, "EnableShellOrCommandToSendDataToClient")) { return; @@ -884,12 +1037,14 @@ internal void EnableShellOrCommandToSendDataToClient( SetThreadProperties(requestDetails); - PSEtwLog.LogAnalyticInformational(PSEventId.ServerClientReceiveRequest, - PSOpcode.Open, PSTask.None, - PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, - ((IntPtr)shellContext).ToString(), - ((IntPtr)commandContext).ToString(), - requestDetails.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerClientReceiveRequest, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + ((IntPtr)shellContext).ToString(), + ((IntPtr)commandContext).ToString(), + requestDetails.ToString()); WSManPluginShellSession mgdShellSession = GetFromActiveShellSessions(shellContext); if (mgdShellSession == null) @@ -910,6 +1065,15 @@ internal void EnableShellOrCommandToSendDataToClient( return; } + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerClientReceiveRequest, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "EnableShellOrCommandToSendDataToClient: Instruction destined to shell or for command", + string.Empty); + if (IntPtr.Zero == commandContext) { // the instruction is destined for shell (runspace) session. so let shell handle it @@ -1135,6 +1299,15 @@ internal static void PerformWSManPluginShell( IntPtr startupInfo, // WSMAN_SHELL_STARTUP_INFO* IntPtr inboundShellInformation) // WSMAN_DATA* { + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginShell: static func to take care of unmanaged to managed transitions.", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(pluginContext); if (pluginToUse == null) @@ -1157,7 +1330,24 @@ internal static void PerformWSManPluginShell( WSManNativeApi.WSManShellStartupInfo_UnToMan startupInfoInstance = WSManNativeApi.WSManShellStartupInfo_UnToMan.UnMarshal(startupInfo); WSManNativeApi.WSManData_UnToMan inboundShellInfo = WSManNativeApi.WSManData_UnToMan.UnMarshal(inboundShellInformation); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + requestDetailsInstance.ToString(), + requestDetailsInstance.resourceUri); + pluginToUse.CreateShell(pluginContext, requestDetailsInstance, flags, extraInfo, startupInfoInstance, inboundShellInfo); + + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginShell: Completed", + string.Empty); } internal static void PerformWSManPluginCommand( @@ -1168,6 +1358,15 @@ internal static void PerformWSManPluginCommand( [MarshalAs(UnmanagedType.LPWStr)] string commandLine, IntPtr arguments) // WSMAN_COMMAND_ARG_SET* { + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginCommand: static func to take care of unmanaged to managed transitions.", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(pluginContext); if (pluginToUse == null) @@ -1184,7 +1383,24 @@ internal static void PerformWSManPluginCommand( WSManNativeApi.WSManPluginRequest request = WSManNativeApi.WSManPluginRequest.UnMarshal(requestDetails); WSManNativeApi.WSManCommandArgSet argSet = WSManNativeApi.WSManCommandArgSet.UnMarshal(arguments); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + request.ToString(), + request.resourceUri); + pluginToUse.CreateCommand(pluginContext, request, flags, shellContext, commandLine, argSet); + + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginCommand: Completed", + string.Empty); } internal static void PerformWSManPluginConnect( @@ -1195,6 +1411,15 @@ internal static void PerformWSManPluginConnect( IntPtr commandContext, IntPtr inboundConnectInformation) { + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginConnect: static func to take care of unmanaged to managed transitions.", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(pluginContext); if (pluginToUse == null) @@ -1211,7 +1436,24 @@ internal static void PerformWSManPluginConnect( WSManNativeApi.WSManPluginRequest request = WSManNativeApi.WSManPluginRequest.UnMarshal(requestDetails); WSManNativeApi.WSManData_UnToMan connectInformation = WSManNativeApi.WSManData_UnToMan.UnMarshal(inboundConnectInformation); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + request.ToString(), + request.resourceUri); + pluginToUse.ConnectShellOrCommand(request, flags, shellContext, commandContext, connectInformation); + + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginConnect: Completed", + string.Empty); } internal static void PerformWSManPluginSend( @@ -1223,6 +1465,15 @@ internal static void PerformWSManPluginSend( string stream, IntPtr inboundData) // WSMAN_DATA* { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginSend: Invoked", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(pluginContext); if (pluginToUse == null) @@ -1240,6 +1491,15 @@ internal static void PerformWSManPluginSend( WSManNativeApi.WSManData_UnToMan data = WSManNativeApi.WSManData_UnToMan.UnMarshal(inboundData); pluginToUse.SendOneItemToShellOrCommand(request, flags, shellContext, commandContext, stream, data); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginSend: Completed", + string.Empty); } internal static void PerformWSManPluginReceive( @@ -1250,6 +1510,15 @@ internal static void PerformWSManPluginReceive( IntPtr commandContext, IntPtr streamSet) // WSMAN_STREAM_ID_SET* { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginReceive: Invoked", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(pluginContext); if (pluginToUse == null) @@ -1266,7 +1535,24 @@ internal static void PerformWSManPluginReceive( WSManNativeApi.WSManPluginRequest request = WSManNativeApi.WSManPluginRequest.UnMarshal(requestDetails); WSManNativeApi.WSManStreamIDSet_UnToMan streamIdSet = WSManNativeApi.WSManStreamIDSet_UnToMan.UnMarshal(streamSet); + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + request.ToString(), + request.resourceUri); + pluginToUse.EnableShellOrCommandToSendDataToClient(pluginContext, request, flags, shellContext, commandContext, streamIdSet); + + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginReceive: Completed", + string.Empty); } internal static void PerformWSManPluginSignal( @@ -1277,6 +1563,15 @@ internal static void PerformWSManPluginSignal( IntPtr commandContext, // PVOID string code) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformWSManPluginSignal: Invoked", + string.Empty); + WSManNativeApi.WSManPluginRequest request = WSManNativeApi.WSManPluginRequest.UnMarshal(requestDetails); // Close Command @@ -1328,6 +1623,15 @@ internal static void PerformWSManPluginSignal( internal static void PerformCloseOperation( WSManPluginOperationShutdownContext context) { + PSEtwLog.LogAnalyticInformational( + PSEventId.ServerReceivedData, + PSOpcode.Open, + PSTask.None, + PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, + string.Empty, + "PerformCloseOperation: Invoked", + string.Empty); + WSManPluginInstance pluginToUse = GetFromActivePlugins(context.pluginContext); if (pluginToUse == null) @@ -1399,7 +1703,8 @@ internal static void ReportWSManOperationComplete( { Dbg.Assert(requestDetails != null, "requestDetails cannot be null in operation complete."); - PSEtwLog.LogAnalyticInformational(PSEventId.ReportOperationComplete, + PSEtwLog.LogAnalyticInformational( + PSEventId.ReportOperationComplete, PSOpcode.Close, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, (requestDetails.unmanagedHandle).ToString(), @@ -1432,7 +1737,8 @@ internal static void ReportWSManOperationComplete( stackTrace = reasonForClose.StackTrace; } - PSEtwLog.LogAnalyticInformational(PSEventId.ReportOperationComplete, + PSEtwLog.LogAnalyticInformational( + PSEventId.ReportOperationComplete, PSOpcode.Close, PSTask.None, PSKeyword.ManagedPlugin | PSKeyword.UseAlwaysAnalytic, requestDetails.ToString(), diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index 76319a5bc5a..b8e5b127f64 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -1005,7 +1005,8 @@ internal override void StartReceivingData() receiveDataInitiated = true; tracer.WriteLine("Client Session TM: Placing Receive request using WSManReceiveShellOutputEx"); - PSEtwLog.LogAnalyticInformational(PSEventId.WSManReceiveShellOutputEx, + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManReceiveShellOutputEx, PSOpcode.Receive, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, RunspacePoolInstanceId.ToString(), Guid.Empty.ToString()); @@ -1109,7 +1110,9 @@ internal override void CreateAsync() _createSessionCallbackGCHandle = GCHandle.Alloc(_createSessionCallback); } - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCreateShell, PSOpcode.Connect, + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShell, + PSOpcode.Connect, PSTask.CreateRunspace, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, RunspacePoolInstanceId.ToString()); @@ -1227,7 +1230,8 @@ internal override void CloseAsync() } // TODO - On unexpected failures on a reconstructed session... we dont want to close server session - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCloseShell, + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseShell, PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, RunspacePoolInstanceId.ToString()); _closeSessionCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(_sessionContextID), s_sessionCloseCallback); @@ -1306,9 +1310,13 @@ internal override void Redirect(Uri newUri, RunspaceConnectionInfo connectionInf { CloseSessionAndClearResources(); tracer.WriteLine("Redirecting to URI: {0}", newUri); - PSEtwLog.LogAnalyticInformational(PSEventId.URIRedirection, - PSOpcode.Connect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - RunspacePoolInstanceId.ToString(), newUri.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.URIRedirection, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + RunspacePoolInstanceId.ToString(), + newUri.ToString()); Initialize(newUri, (WSManConnectionInfo)connectionInfo); // reset startmode _startMode = WSManTransportManagerUtils.tmStartModes.None; @@ -1638,14 +1646,16 @@ internal override void RaiseErrorHandler(TransportErrorOccuredEventArgs eventArg } // Write errors into both Operational and Analytical channels - PSEtwLog.LogOperationalError(PSEventId.TransportError, PSOpcode.Open, PSTask.None, PSKeyword.UseAlwaysOperational, + PSEtwLog.LogOperationalError( + PSEventId.TransportError, PSOpcode.Open, PSTask.None, PSKeyword.UseAlwaysOperational, RunspacePoolInstanceId.ToString(), Guid.Empty.ToString(), eventArgs.Exception.ErrorCode.ToString(CultureInfo.InvariantCulture), eventArgs.Exception.Message, stackTrace); - PSEtwLog.LogAnalyticError(PSEventId.TransportError_Analytic, + PSEtwLog.LogAnalyticError( + PSEventId.TransportError_Analytic, PSOpcode.Open, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, RunspacePoolInstanceId.ToString(), @@ -1852,8 +1862,11 @@ private static void OnCreateSessionCallback(IntPtr operationContext, return; } - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCreateShellCallbackReceived, - PSOpcode.Connect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateShellCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, sessionTM.RunspacePoolInstanceId.ToString()); // TODO: 188098 wsManShellOperationHandle should be populated by WSManCreateShellEx, @@ -1965,9 +1978,13 @@ private static void OnCloseSessionCompleted(IntPtr operationContext, return; } - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCloseShellCallbackReceived, - PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - sessionTM.RunspacePoolInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseShellCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + sessionTM.RunspacePoolInstanceId.ToString(), + "OnCloseSessionCompleted"); if (IntPtr.Zero != error) { @@ -2013,6 +2030,13 @@ private static void OnRemoteSessionDisconnectCompleted(IntPtr operationContext, } // LOG ETW EVENTS + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseShellCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + sessionTM.RunspacePoolInstanceId.ToString(), + "OnRemoteSessionDisconnectCompleted"); // Dispose the OnDisconnect callback as it is not needed anymore if (sessionTM._disconnectSessionCompleted != null) @@ -2055,7 +2079,14 @@ private static void OnRemoteSessionDisconnectCompleted(IntPtr operationContext, sessionTM.EnqueueAndStartProcessingThread(null, null, new CompletionEventArgs(CompletionNotification.DisconnectCompleted)); - // Log ETW traces + // Log ETW traces + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseShellCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + sessionTM.RunspacePoolInstanceId.ToString(), + "OnRemoteSessionReconnectCompleted: DisconnectCompleted"); } return; @@ -2081,6 +2112,13 @@ private static void OnRemoteSessionReconnectCompleted(IntPtr operationContext, } // Add ETW events + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseShellCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + sessionTM.RunspacePoolInstanceId.ToString(), + "OnRemoteSessionReconnectCompleted"); // Dispose the OnCreate callback as it is not needed anymore if (sessionTM._reconnectSessionCompleted != null) @@ -2176,6 +2214,13 @@ private static void OnRemoteSessionConnectCallback(IntPtr operationContext, { tracer.WriteLine("Client Session TM: Connect callback received"); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSendShellInputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnRemoteSessionConnectCallback:Client Session TM: Connect callback received"); + long sessionTMHandle = 0; WSManClientSessionTransportManager sessionTM = null; if (!TryGetSessionTransportManager(operationContext, out sessionTM, out sessionTMHandle)) @@ -2269,9 +2314,13 @@ private static void OnRemoteSessionSendCompleted(IntPtr operationContext, } // do the logging for this send - PSEtwLog.LogAnalyticInformational(PSEventId.WSManSendShellInputExCallbackReceived, - PSOpcode.Connect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - sessionTM.RunspacePoolInstanceId.ToString(), Guid.Empty.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSendShellInputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + sessionTM.RunspacePoolInstanceId.ToString(), + Guid.Empty.ToString()); if (!shellOperationHandle.Equals(sessionTM._wsManShellOperationHandle)) { @@ -2981,9 +3030,13 @@ internal override void CreateAsync() _cmdContextId = GetNextCmdTMHandleId(); AddCmdTransportManager(_cmdContextId, this); - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCreateCommand, PSOpcode.Connect, - PSTask.CreateRunspace, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - RunspacePoolInstanceId.ToString(), powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateCommand, + PSOpcode.Connect, + PSTask.CreateRunspace, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + RunspacePoolInstanceId.ToString(), + powershellInstanceId.ToString()); _createCmdCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(_cmdContextId), s_cmdCreateCallback); _createCmdCompletedGCHandle = GCHandle.Alloc(_createCmdCompleted); @@ -3061,9 +3114,14 @@ internal override void SendStopSignal() _isStopSignalPending = false; tracer.WriteLine("Sending stop signal with command context: {0} Operation Context {1}", _cmdContextId, _wsManCmdOperationHandle); - PSEtwLog.LogAnalyticInformational(PSEventId.WSManSignal, - PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - RunspacePoolInstanceId.ToString(), powershellInstanceId.ToString(), StopSignal); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSignal, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + RunspacePoolInstanceId.ToString(), + powershellInstanceId.ToString(), + StopSignal); _signalCmdCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(_cmdContextId), s_cmdSignalCallback); WSManNativeApi.WSManSignalShellEx(_wsManShellOperationHandle, _wsManCmdOperationHandle, 0, @@ -3115,9 +3173,13 @@ internal override void CloseAsync() return; } - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCloseCommand, - PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - RunspacePoolInstanceId.ToString(), powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseCommand, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + RunspacePoolInstanceId.ToString(), + powershellInstanceId.ToString()); _closeCmdCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(_cmdContextId), s_cmdCloseCallback); Dbg.Assert((IntPtr)_closeCmdCompleted != IntPtr.Zero, "closeCmdCompleted callback is null in cmdTM.CloseAsync()"); WSManNativeApi.WSManCloseCommand(_wsManCmdOperationHandle, 0, _closeCmdCompleted); @@ -3292,9 +3354,13 @@ private static void OnCreateCmdCompleted(IntPtr operationContext, return; } - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCreateCommandCallbackReceived, - PSOpcode.Connect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - cmdTM.RunspacePoolInstanceId.ToString(), cmdTM.powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateCommandCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + cmdTM.RunspacePoolInstanceId.ToString(), + cmdTM.powershellInstanceId.ToString()); // dispose the cmdCompleted callback as it is not needed any more if (cmdTM._createCmdCompleted != null) @@ -3384,6 +3450,13 @@ private static void OnConnectCmdCompleted(IntPtr operationContext, { tracer.WriteLine("OnConnectCmdCompleted callback received"); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCreateCommandCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnConnectCmdCompleted: OnConnectCmdCompleted callback received"); + long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) @@ -3473,6 +3546,13 @@ private static void OnCloseCmdCompleted(IntPtr operationContext, { tracer.WriteLine("OnCloseCmdCompleted callback received for operation context {0}", commandOperationHandle); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseCommandCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnCloseCmdCompleted: OnCloseCmdCompleted callback received"); + long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) @@ -3483,9 +3563,13 @@ private static void OnCloseCmdCompleted(IntPtr operationContext, } tracer.WriteLine("Close completed callback received for command: {0}", cmdTM._cmdContextId); - PSEtwLog.LogAnalyticInformational(PSEventId.WSManCloseCommandCallbackReceived, - PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - cmdTM.RunspacePoolInstanceId.ToString(), cmdTM.powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManCloseCommandCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + cmdTM.RunspacePoolInstanceId.ToString(), + cmdTM.powershellInstanceId.ToString()); if (cmdTM._isDisconnectPending) { @@ -3505,6 +3589,13 @@ private static void OnRemoteCmdSendCompleted(IntPtr operationContext, { tracer.WriteLine("SendComplete callback received"); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSendShellInputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnRemoteCmdSendCompleted: SendComplete callback received"); + long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) @@ -3517,9 +3608,13 @@ private static void OnRemoteCmdSendCompleted(IntPtr operationContext, cmdTM._isSendingInput = false; // do the logging for this send - PSEtwLog.LogAnalyticInformational(PSEventId.WSManSendShellInputExCallbackReceived, - PSOpcode.Connect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - cmdTM.RunspacePoolInstanceId.ToString(), cmdTM.powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSendShellInputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + cmdTM.RunspacePoolInstanceId.ToString(), + cmdTM.powershellInstanceId.ToString()); if ((!shellOperationHandle.Equals(cmdTM._wsManShellOperationHandle)) || (!commandOperationHandle.Equals(cmdTM._wsManCmdOperationHandle))) @@ -3588,6 +3683,13 @@ private static void OnRemoteCmdDataReceived(IntPtr operationContext, { tracer.WriteLine("Remote Command DataReceived callback."); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManReceiveShellOutputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnRemoteCmdDataReceived: Remote Command DataReceived callback"); + long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) @@ -3672,6 +3774,14 @@ private static void OnReconnectCmdCompleted(IntPtr operationContext, { long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; + + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManReceiveShellOutputExCallbackReceived, + PSOpcode.Connect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + "OnReconnectCmdCompleted"); + if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) { // We dont have the command TM handle..just return. @@ -3731,6 +3841,8 @@ private static void OnRemoteCmdSignalCompleted(IntPtr operationContext, { tracer.WriteLine("Signal Completed callback received."); + PSEtwLog.LogAnalyticInformational(PSEventId.WSManSignalCallbackReceived, PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, "OnRemoteCmdSignalCompleted"); + long cmdContextId = 0; WSManClientCommandTransportManager cmdTM = null; if (!TryGetCmdTransportManager(operationContext, out cmdTM, out cmdContextId)) @@ -3741,9 +3853,13 @@ private static void OnRemoteCmdSignalCompleted(IntPtr operationContext, } // log the callback received event. - PSEtwLog.LogAnalyticInformational(PSEventId.WSManSignalCallbackReceived, - PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - cmdTM.RunspacePoolInstanceId.ToString(), cmdTM.powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManSignalCallbackReceived, + PSOpcode.Disconnect, + PSTask.None, + PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + cmdTM.RunspacePoolInstanceId.ToString(), + cmdTM.powershellInstanceId.ToString()); if ((!shellOperationHandle.Equals(cmdTM._wsManShellOperationHandle)) || (!commandOperationHandle.Equals(cmdTM._wsManCmdOperationHandle))) @@ -3920,9 +4036,11 @@ private void SendData(byte[] data, DataPriorityType priorityType) internal override void StartReceivingData() { - PSEtwLog.LogAnalyticInformational(PSEventId.WSManReceiveShellOutputEx, - PSOpcode.Receive, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, - RunspacePoolInstanceId.ToString(), powershellInstanceId.ToString()); + PSEtwLog.LogAnalyticInformational( + PSEventId.WSManReceiveShellOutputEx, + PSOpcode.Receive, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, + RunspacePoolInstanceId.ToString(), powershellInstanceId.ToString()); + // We should call Receive only once.. WSMan will call the callback multiple times. _shouldStartReceivingData = false; lock (syncObject) From 0137920d89b821040b370976c97dfc22fa3f3d69 Mon Sep 17 00:00:00 2001 From: Dan Thompson Date: Wed, 27 May 2020 15:43:01 -0700 Subject: [PATCH 223/275] Make module formatting not generate error with strict mode (#11943) --- .../PowerShellCore_format_ps1xml.cs | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) 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 90fa1490a39..f22ccc9725a 100644 --- a/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs +++ b/src/System.Management.Automation/FormatAndOutput/DefaultFormatters/PowerShellCore_format_ps1xml.cs @@ -1646,6 +1646,14 @@ private static IEnumerable ViewsOf_Microsoft_PowerShell_Co .EndTable()); } + private const string PreReleaseStringScriptBlock = @" + if ($_.PrivateData -and + $_.PrivateData.ContainsKey('PSData') -and + $_.PrivateData.PSData.ContainsKey('PreRelease')) + { + $_.PrivateData.PSData.PreRelease + }"; + private static IEnumerable ViewsOf_ModuleInfoGrouping(CustomControl[] sharedControls) { yield return new FormatViewDefinition("Module", @@ -1660,11 +1668,7 @@ private static IEnumerable ViewsOf_ModuleInfoGrouping(Cust .StartRowDefinition() .AddPropertyColumn("ModuleType") .AddPropertyColumn("Version") - .AddScriptBlockColumn(@" - if ($_.PrivateData -and $_.PrivateData.PSData) - { - $_.PrivateData.PSData.PreRelease - }") + .AddScriptBlockColumn(PreReleaseStringScriptBlock) .AddPropertyColumn("Name") .AddScriptBlockColumn(@" $result = [System.Collections.ArrayList]::new() @@ -1697,11 +1701,7 @@ private static IEnumerable ViewsOf_System_Management_Autom .StartRowDefinition() .AddPropertyColumn("ModuleType") .AddPropertyColumn("Version") - .AddScriptBlockColumn(@" - if ($_.PrivateData -and $_.PrivateData.PSData) - { - $_.PrivateData.PSData.PreRelease - }") + .AddScriptBlockColumn(PreReleaseStringScriptBlock) .AddPropertyColumn("Name") .AddScriptBlockColumn("$_.ExportedCommands.Keys") .EndRowDefinition() @@ -1721,11 +1721,7 @@ private static IEnumerable ViewsOf_System_Management_Autom .AddItemProperty(@"ModuleType") .AddItemProperty(@"Version") .AddItemScriptBlock( - @" - if ($_.PrivateData -and $_.PrivateData.PSData) - { - $_.PrivateData.PSData.PreRelease - }", + PreReleaseStringScriptBlock, label: "PreRelease") .AddItemProperty(@"NestedModules") .AddItemScriptBlock(@"$_.ExportedFunctions.Keys", label: "ExportedFunctions") From f7c701c9631182311a0692488c86c7f25adbf918 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 27 May 2020 15:45:11 -0700 Subject: [PATCH 224/275] Fix MSI upgrade and shortcut issues (#12792) Co-authored-by: Travis Plunk --- assets/Product.wxs | 84 +- assets/files.wxs | 2033 ++++++++++++++++---------------- tools/packaging/packaging.psm1 | 33 +- 3 files changed, 1071 insertions(+), 1079 deletions(-) diff --git a/assets/Product.wxs b/assets/Product.wxs index 6056a07ec20..699bffb5006 100644 --- a/assets/Product.wxs +++ b/assets/Product.wxs @@ -5,28 +5,36 @@ - - + + + + + + + - + + + + + + + - - - - + @@ -55,7 +63,7 @@ + Value=""[VersionFolder]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "[VersionFolder]RegisterManifest.ps1"" /> + Value=""[VersionFolder]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -Command "Enable-PSRemoting"" /> - - + + @@ -158,78 +166,83 @@ - - - - + + - + - + + + - + + - + ADD_PATH=1 - + + + + + - + ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL - - + + - + - + - + - + - + - + - + - + @@ -238,13 +251,12 @@ - + + Target="[VersionFolder]pwsh.exe" + Arguments="-WorkingDirectory ~" /> diff --git a/assets/files.wxs b/assets/files.wxs index ad082d06aa5..3eeac67d2e8 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -1,1930 +1,1929 @@ - - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1932,26 +1931,26 @@ - + - + - + - + - + @@ -1959,1155 +1958,1155 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + @@ -3646,7 +3645,10 @@ + + + @@ -4096,14 +4098,11 @@ - - - - - - - - + + + + + diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1673abf4095..7383167548f 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -191,7 +191,7 @@ function Start-PSPackage { throw $Script:Options.RootInfo.Warning } - # If ReleaseTag is specified, use the given tag to calculate Vesrion + # If ReleaseTag is specified, use the given tag to calculate Version if ($PSCmdlet.ParameterSetName -eq "ReleaseTag") { $Version = $ReleaseTag -Replace '^v' } @@ -337,8 +337,6 @@ function Start-PSPackage { ProductSourcePath = $Source ProductVersion = $Version AssetsPath = "$RepoRoot\assets" - # Product Code needs to be unique for every PowerShell version since it is a unique identifier for the particular product release - ProductCode = New-Guid ProductTargetArchitecture = $TargetArchitecture Force = $Force } @@ -2914,7 +2912,7 @@ function New-MSIPatch # This example shows how to produce a Debug-x64 installer for development purposes. cd $RootPathOfPowerShellRepo Import-Module .\build.psm1; Import-Module .\tools\packaging\packaging.psm1 - New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + New-MSIPackage -Verbose -ProductSourcePath '.\src\powershell-win-core\bin\Debug\net5.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIPackage { @@ -2933,11 +2931,6 @@ function New-MSIPackage [ValidateNotNullOrEmpty()] [string] $ProductVersion, - # The ProductCode property is a unique identifier for the particular product release - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $ProductCode, - # Source Path to the Product Files - required to package the contents into an MSI [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -2971,15 +2964,15 @@ function New-MSIPackage $wixPaths = Get-WixPath $ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion - $simpleProductVersion = '7' + $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion + + $simpleProductVersion = [string]([Version]$ProductVersion).Major $isPreview = Test-IsPreview -Version $ProductSemanticVersion if ($isPreview) { $simpleProductVersion += '-preview' } - $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion - $assetsInSourcePath = Join-Path $ProductSourcePath 'assets' $staging = "$PSScriptRoot/staging" @@ -2994,35 +2987,23 @@ function New-MSIPackage $productVersionWithName = $ProductName + '_' + $ProductVersion $productSemanticVersionWithName = $ProductName + '-' + $ProductSemanticVersion - $productDirectoryName = 'PowerShell_6' Write-Verbose "Create MSI for Product $productSemanticVersionWithName" [Environment]::SetEnvironmentVariable("ProductSourcePath", $staging, "Process") # These variables are used by Product.wxs in assets directory - [Environment]::SetEnvironmentVariable("ProductDirectoryName", $productDirectoryName, "Process") [Environment]::SetEnvironmentVariable("ProductName", $ProductName, "Process") - [Environment]::SetEnvironmentVariable("ProductCode", $ProductCode, "Process") [Environment]::SetEnvironmentVariable("ProductVersion", $ProductVersion, "Process") [Environment]::SetEnvironmentVariable("SimpleProductVersion", $simpleProductVersion, "Process") [Environment]::SetEnvironmentVariable("ProductSemanticVersion", $ProductSemanticVersion, "Process") [Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process") if (!$isPreview) { - [Environment]::SetEnvironmentVariable("PwshPath", "[$productDirectoryName]", "Process") - [Environment]::SetEnvironmentVariable("UpgradeCodeX64", '31ab5147-9a97-4452-8443-d9709f0516e1', "Process") - [Environment]::SetEnvironmentVariable("UpgradeCodeX86", '1d00683b-0f84-4db8-a64f-2f98ad42fe06', "Process") [Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_black.ico', "Process") - # The ApplicationProgramsMenuShortcut GUID should be changed when bumping the major version because the installation directory changes - [Environment]::SetEnvironmentVariable("ApplicationProgramsMenuShortcut", '6a69de6c-183d-4bf4-a40e-83007d6293bf', "Process") } else { - [Environment]::SetEnvironmentVariable("PwshPath", "[$productDirectoryName]preview", "Process") - [Environment]::SetEnvironmentVariable("UpgradeCodeX64", '39243d76-adaf-42b1-94fb-16ecf83237c8', "Process") - [Environment]::SetEnvironmentVariable("UpgradeCodeX86", '86abcfbd-1ccc-4a88-b8b2-0facfde29094', "Process") [Environment]::SetEnvironmentVariable("IconPath", 'assets\Powershell_av_colors.ico', "Process") - [Environment]::SetEnvironmentVariable("ApplicationProgramsMenuShortcut", 'ab727c4f-2311-474c-9ade-f2c6fd7f7322', "Process") } $fileArchitecture = 'amd64' $ProductProgFilesDir = "ProgramFiles64Folder" @@ -3056,7 +3037,7 @@ function New-MSIPackage } Write-Log "verifying no new files have been added or removed..." - Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixHeatExePath dir $staging -dr $productDirectoryName -cg $productDirectoryName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} + Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixHeatExePath dir $staging -dr VersionFolder -cg ApplicationFiles -ag -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v} # We are verifying that the generated $wixFragmentPath and $FilesWxsPath are functionally the same Test-FileWxs -FilesWxsPath $FilesWxsPath -HeatFilesWxsPath $wixFragmentPath @@ -3076,7 +3057,7 @@ function New-MSIPackage } Write-Log "running candle..." - Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixCandleExePath "$ProductWxsPath" "$FilesWxsPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch $ProductTargetArchitecture -v} + Start-NativeExecution -VerboseOutputOnError { & $wixPaths.wixCandleExePath "$ProductWxsPath" "$FilesWxsPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch $ProductTargetArchitecture -dIsPreview="$isPreview" -v} Write-Log "running light..." # suppress ICE61, because we allow same version upgrades From fdb2b2adccdb9cabab22cd5ed871267c3e240bf0 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 28 May 2020 01:59:47 +0100 Subject: [PATCH 225/275] Fix broken `docs.microsoft.com` link (#12776) --- docs/learning-powershell/README.md | 4 ++-- docs/learning-powershell/debugging-from-commandline.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/learning-powershell/README.md b/docs/learning-powershell/README.md index 30dd84cafdf..6ce2c8832ff 100644 --- a/docs/learning-powershell/README.md +++ b/docs/learning-powershell/README.md @@ -48,14 +48,14 @@ You can use your favorite editor to write scripts. We use Visual Studio Code (VS Code) which works on Windows, Linux, and macOS. Click on the following link to create your first PowerShell script. -- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode) +- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/dev-cross-plat/vscode/using-vscode) ### PowerShell Debugger Debugging can help you find bugs and fix problems in your PowerShell scripts. Click on the link below to learn more about debugging: -- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode#debugging-with-visual-studio-code) +- [Using Visual Studio Code (VS Code)](https://docs.microsoft.com/powershell/scripting/dev-cross-plat/vscode/using-vscode#debugging-with-visual-studio-code) - [PowerShell Command-line Debugging][cli-debugging] [cli-debugging]:./debugging-from-commandline.md diff --git a/docs/learning-powershell/debugging-from-commandline.md b/docs/learning-powershell/debugging-from-commandline.md index 489f79c5dbc..1d56513d9d3 100644 --- a/docs/learning-powershell/debugging-from-commandline.md +++ b/docs/learning-powershell/debugging-from-commandline.md @@ -1,6 +1,6 @@ # Debugging in PowerShell Command-line -As we know, we can debug PowerShell code via GUI tools like [Visual Studio Code](https://docs.microsoft.com/powershell/scripting/components/vscode/using-vscode#debugging-with-visual-studio-code). In addition, we can +As we know, we can debug PowerShell code via GUI tools like [Visual Studio Code](https://docs.microsoft.com/powershell/scripting/dev-cross-plat/vscode/using-vscode#debugging-with-visual-studio-code). In addition, we can directly perform debugging within the PowerShell command-line session by using the PowerShell debugger cmdlets. This document demonstrates how to use the cmdlets for the PowerShell command-line debugging. We will cover the following topics: setting a debug breakpoint on a line of code and on a variable. From 921d36d9f47bc6bbc5060da9b2d327b8ca95d690 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 28 May 2020 09:29:56 +0100 Subject: [PATCH 226/275] Fix markdown ordered lists (#12657) # PR Summary * Replace an ordered list with sections * Fix an ordered list to continue numbering in each item ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../debugging-from-commandline.md | 4 +- .../powershell-beginners-guide.md | 262 +++++++++--------- 2 files changed, 133 insertions(+), 133 deletions(-) diff --git a/docs/learning-powershell/debugging-from-commandline.md b/docs/learning-powershell/debugging-from-commandline.md index 1d56513d9d3..1aaab218256 100644 --- a/docs/learning-powershell/debugging-from-commandline.md +++ b/docs/learning-powershell/debugging-from-commandline.md @@ -20,7 +20,7 @@ $result =[int](ConvertFahrenheitToCelsius($fahrenheit)) Write-Host "$result Celsius" ``` - 1. **Setting a Breakpoint on a Line** +## Setting a Breakpoint on a Line - Open a [PowerShell editor](README.md#powershell-editor) - Save the above code snippet to a file. For example, "test.ps1" @@ -103,7 +103,7 @@ PS /home/jen/debug> ``` -1. **Setting a Breakpoint on a Variable** +## Setting a Breakpoint on a Variable - Clear existing breakpoints if there are any ```powershell diff --git a/docs/learning-powershell/powershell-beginners-guide.md b/docs/learning-powershell/powershell-beginners-guide.md index 13ab9be2526..ce49a4b9bfe 100644 --- a/docs/learning-powershell/powershell-beginners-guide.md +++ b/docs/learning-powershell/powershell-beginners-guide.md @@ -26,205 +26,205 @@ It is shown as `PS C:\>` on Windows. 1. `Get-Process`: Gets the processes that are running on the local computer or a remote computer. -By default, you will get data back similar to the following: + By default, you will get data back similar to the following: -```powershell -PS /> Get-Process + ```powershell + PS /> Get-Process -Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName -------- ------ ----- ----- ------ -- ----------- - - - - 1 0.012 12 bash - - - - 21 20.220 449 powershell - - - - 11 61.630 8620 code - - - - 74 403.150 1209 firefox + Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName + ------- ------ ----- ----- ------ -- ----------- + - - - 1 0.012 12 bash + - - - 21 20.220 449 powershell + - - - 11 61.630 8620 code + - - - 74 403.150 1209 firefox -… -``` + … + ``` -Only interested in the instance of Firefox process that is running on your computer? + Only interested in the instance of Firefox process that is running on your computer? -Try this: + Try this: -```powershell -PS /> Get-Process -Name firefox + ```powershell + PS /> Get-Process -Name firefox -Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName -------- ------ ----- ----- ------ -- ----------- - - - - 74 403.150 1209 firefox + Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName + ------- ------ ----- ----- ------ -- ----------- + - - - 74 403.150 1209 firefox -``` + ``` -Want to get back more than one process? -Then just specify process names and separate them with commas. + Want to get back more than one process? + Then just specify process names and separate them with commas. -```powershell -PS /> Get-Process -Name firefox, powershell -Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName -------- ------ ----- ----- ------ -- ----------- - - - - 74 403.150 1209 firefox - - - - 21 20.220 449 powershell + ```powershell + PS /> Get-Process -Name firefox, powershell + Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName + ------- ------ ----- ----- ------ -- ----------- + - - - 74 403.150 1209 firefox + - - - 21 20.220 449 powershell -``` + ``` 1. `Clear-Host`: Clears the display in the host program. -```powershell -PS /> Get-Process -PS /> Clear-Host -``` + ```powershell + PS /> Get-Process + PS /> Clear-Host + ``` -Type too much just for clearing the screen? + Type too much just for clearing the screen? -Here is how the alias can help. + Here is how the alias can help. 1. `Get-Alias`: Gets the aliases for the current session. -```powershell -Get-Alias - -CommandType Name ------------ ---- -… - -Alias cd -> Set-Location -Alias cls -> Clear-Host -Alias clear -> Clear-Host -Alias copy -> Copy-Item -Alias dir -> Get-ChildItem -Alias gc -> Get-Content -Alias gmo -> Get-Module -Alias ri -> Remove-Item -Alias type -> Get-Content -… -``` + ```powershell + Get-Alias -As you can see `cls` or `clear` is an alias of `Clear-Host`. + CommandType Name + ----------- ---- + … -Now try it: + Alias cd -> Set-Location + Alias cls -> Clear-Host + Alias clear -> Clear-Host + Alias copy -> Copy-Item + Alias dir -> Get-ChildItem + Alias gc -> Get-Content + Alias gmo -> Get-Module + Alias ri -> Remove-Item + Alias type -> Get-Content + … + ``` -```powershell -PS /> Get-Process -PS /> cls -``` + As you can see `cls` or `clear` is an alias of `Clear-Host`. + + Now try it: + + ```powershell + PS /> Get-Process + PS /> cls + ``` 1. `cd -> Set-Location`: Sets the current working location to a specified location. -```powershell -PS /> Set-Location /home -PS /home> -``` + ```powershell + PS /> Set-Location /home + PS /home> + ``` 1. `dir -> Get-ChildItem`: Gets the items and child items in one or more specified locations. -```powershell -# Get all files under the current directory: -PS /> Get-ChildItem + ```powershell + # Get all files under the current directory: + PS /> Get-ChildItem -# Get all files under the current directory as well as its subdirectories: -PS /> cd $home -PS /home/jen> dir -Recurse + # Get all files under the current directory as well as its subdirectories: + PS /> cd $home + PS /home/jen> dir -Recurse -# List all files with "txt" file extension. -PS /> cd $home -PS /home/jen> dir –Path *.txt -Recurse -``` + # List all files with "txt" file extension. + PS /> cd $home + PS /home/jen> dir –Path *.txt -Recurse + ``` -*6. `New-Item`: Creates a new item. +1. `New-Item`: Creates a new item. -```powershell -# An empty file is created if you type the following: -PS /home/jen> New-Item -Path ./test.txt + ```powershell + # An empty file is created if you type the following: + PS /home/jen> New-Item -Path ./test.txt - Directory: /home/jen + Directory: /home/jen -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 7/7/2016 7:17 PM 0 test.txt -``` + Mode LastWriteTime Length Name + ---- ------------- ------ ---- + -a---- 7/7/2016 7:17 PM 0 test.txt + ``` -You can use the `-Value` parameter to add some data to your file. + You can use the `-Value` parameter to add some data to your file. -For example, the following command adds the phrase `Hello world!` as a file content to the `test.txt`. + For example, the following command adds the phrase `Hello world!` as a file content to the `test.txt`. -Because the test.txt file exists already, we use `-Force` parameter to replace the existing content. + Because the test.txt file exists already, we use `-Force` parameter to replace the existing content. -```powershell -PS /home/jen> New-Item -Path ./test.txt -Value "Hello world!" -Force + ```powershell + PS /home/jen> New-Item -Path ./test.txt -Value "Hello world!" -Force - Directory: /home/jen + Directory: /home/jen -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 7/7/2016 7:19 PM 24 test.txt + Mode LastWriteTime Length Name + ---- ------------- ------ ---- + -a---- 7/7/2016 7:19 PM 24 test.txt -``` + ``` -There are other ways to add some data to a file. + There are other ways to add some data to a file. -For example, you can use `Set-Content` to set the file contents: + For example, you can use `Set-Content` to set the file contents: -```powershell -PS /home/jen>Set-Content -Path ./test.txt -Value "Hello world again!" -``` + ```powershell + PS /home/jen>Set-Content -Path ./test.txt -Value "Hello world again!" + ``` -Or simply use `>` as below: + Or simply use `>` as below: -```powershell -# create an empty file -"" > test.txt + ```powershell + # create an empty file + "" > test.txt -# set "Hello world!" as content of test.txt file -"Hello world!!!" > test.txt + # set "Hello world!" as content of test.txt file + "Hello world!!!" > test.txt -``` + ``` -The pound sign `#` above is used for comments in PowerShell. + The pound sign `#` above is used for comments in PowerShell. 1. `type -> Get-Content`: Gets the content of the item at the specified location. -```powershell -PS /home/jen> Get-Content -Path ./test.txt -PS /home/jen> type -Path ./test.txt + ```powershell + PS /home/jen> Get-Content -Path ./test.txt + PS /home/jen> type -Path ./test.txt -Hello world again! -``` + Hello world again! + ``` 1. `del -> Remove-Item`: Deletes the specified items. -This cmdlet will delete the file `/home/jen/test.txt`: + This cmdlet will delete the file `/home/jen/test.txt`: -```powershell -PS /home/jen> Remove-Item ./test.txt -``` + ```powershell + PS /home/jen> Remove-Item ./test.txt + ``` 1. `$PSVersionTable`: Displays the version of PowerShell you are currently using. -Type `$PSVersionTable` in your PowerShell session, you will see something like below. -"PSVersion" indicates the PowerShell version that you are using. + Type `$PSVersionTable` in your PowerShell session, you will see something like below. + "PSVersion" indicates the PowerShell version that you are using. -```powershell -Name Value ----- ----- -PSVersion 6.0.0-alpha -PSEdition Core -PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} -BuildVersion 3.0.0.0 -GitCommitId v6.0.0-alpha.12 -CLRVersion -WSManStackVersion 3.0 -PSRemotingProtocolVersion 2.3 -SerializationVersion 1.1.0.1 + ```powershell + Name Value + ---- ----- + PSVersion 6.0.0-alpha + PSEdition Core + PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} + BuildVersion 3.0.0.0 + GitCommitId v6.0.0-alpha.12 + CLRVersion + WSManStackVersion 3.0 + PSRemotingProtocolVersion 2.3 + SerializationVersion 1.1.0.1 -``` + ``` 1. `Exit`: To exit the PowerShell session, type `exit`. -```powershell -exit -``` + ```powershell + exit + ``` ## Need Help? From d26e8c081936084cddfdd530456423f71c4ab583 Mon Sep 17 00:00:00 2001 From: Sotiris Nanopoulos Date: Thu, 28 May 2020 11:08:23 -0700 Subject: [PATCH 227/275] Adds Mask Input Parameter to `Read-Host` (#10908) Co-authored-by: Sotiris Nanopoulos --- .../commands/utility/ReadConsoleCmdlet.cs | 23 ++++++++-- .../host/msh/CommandLineParameterParser.cs | 11 +++++ .../host/msh/ConsoleHostUserInterface.cs | 43 ++++++++++++++++-- .../hostifaces/InternalHostUserInterface.cs | 45 ++++++++++++++++++- .../engine/hostifaces/MshHostUserInterface.cs | 24 ++++++++++ .../server/ServerRemoteHostUserInterface.cs | 11 +++++ .../Read-Host.Tests.ps1 | 11 +++++ .../Modules/HelpersHostCS/HelpersHostCS.psm1 | 5 +++ 8 files changed, 164 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs index 949d45ba1c4..23b4bac873a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ReadConsoleCmdlet.cs @@ -17,7 +17,7 @@ namespace Microsoft.PowerShell.Commands /// Retrieves input from the host virtual console and writes it to the pipeline output. /// - [Cmdlet(VerbsCommunications.Read, "Host", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096610")] + [Cmdlet(VerbsCommunications.Read, "Host", DefaultParameterSetName = "AsString", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096610")] [OutputType(typeof(string), typeof(SecureString))] public sealed class ReadHostCommand : PSCmdlet { @@ -55,10 +55,9 @@ public sealed class ReadHostCommand : PSCmdlet } /// - /// Set to no echo the input as is is typed. + /// Gets or sets to no echo the input as is is typed. If set then the cmdlet returns a secure string. /// - - [Parameter] + [Parameter(ParameterSetName = "AsSecureString")] public SwitchParameter AsSecureString @@ -73,6 +72,18 @@ public sealed class ReadHostCommand : PSCmdlet _safe = value; } } + + /// + /// Gets or sets whether the console will echo the input as is is typed. If set then the cmdlet returns a regular string. + /// + [Parameter(ParameterSetName = "AsString")] + public + SwitchParameter + MaskInput + { + get; + set; + } #endregion Parameters #region Cmdlet Overrides @@ -149,6 +160,10 @@ protected override void BeginProcessing() { result = Host.UI.ReadLineAsSecureString(); } + else if (MaskInput) + { + result = Host.UI.ReadLineMaskedAsString(); + } else { result = Host.UI.ReadLine(); diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 9907e43c4b0..5e020c9ac65 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -96,6 +96,17 @@ public override string ReadLine() throw new PSNotImplementedException(); } + /// + /// Null implementation of ReadLineMaskedAsString. + /// + /// + /// It throws an exception. + /// + public override string ReadLineMaskedAsString() + { + throw new PSNotImplementedException(); + } + /// /// ReadLineAsSecureString. /// diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index 402a3a19a25..dc80be26017 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -29,6 +29,12 @@ namespace Microsoft.PowerShell [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal partial class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInterface { + + /// + /// This is the char that is echoed to the console when the input is masked. This not localizable. + /// + private const char PrintToken = '*'; + /// /// Command completion implementation object. /// @@ -174,6 +180,39 @@ public override string ReadLine() return ReadLine(false, string.Empty, out unused, true, true); } + /// + /// See base class. + /// + /// + /// The characters typed by the user. + /// + /// + /// If obtaining a handle to the active screen buffer failed + /// OR + /// Win32's setting input buffer mode to disregard window and mouse input failed. + /// OR + /// Win32's ReadConsole failed. + /// + /// + /// If Ctrl-C is entered by user. + /// + public override string ReadLineMaskedAsString() + { + HandleThrowOnReadAndPrompt(); + + // we lock here so that multiple threads won't interleave the various reads and writes here. + object result = null; + lock (_instanceLock) + { + result = ReadLineSafe(false, PrintToken); + } + + StringBuilder resultSb = result as StringBuilder; + Dbg.Assert(resultSb != null, "ReadLineMaskedAsString did not return a stringBuilder"); + + return resultSb.ToString(); + } + /// /// See base class. /// @@ -193,14 +232,12 @@ public override SecureString ReadLineAsSecureString() { HandleThrowOnReadAndPrompt(); - const char printToken = '*'; // This is not localizable - // we lock here so that multiple threads won't interleave the various reads and writes here. object result = null; lock (_instanceLock) { - result = ReadLineSafe(true, printToken); + result = ReadLineSafe(true, PrintToken); } SecureString secureResult = result as SecureString; diff --git a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs index 1e61ca236bd..1e2478d7bd2 100644 --- a/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/InternalHostUserInterface.cs @@ -88,7 +88,7 @@ public override bool SupportsVirtualTerminal /// /// /// if the UI property of the external host is null, possibly because the PSHostUserInterface is not - /// implemented by the external host + /// implemented by the external host. /// public override string @@ -120,12 +120,53 @@ public override return result; } + /// + /// See base class. + /// + /// + /// The characters typed by the user. + /// + /// + /// If the UI property of the external host is null, possibly because the PSHostUserInterface is not + /// implemented by the external host. + /// + public override + string + ReadLineMaskedAsString() + { + if (_externalUI == null) + { + ThrowNotInteractive(); + } + + string result = null; + + try + { + result = _externalUI.ReadLineMaskedAsString(); + } + catch (PipelineStoppedException) + { + // PipelineStoppedException is thrown by host when it wants + // to stop the pipeline. + LocalPipeline lpl = (LocalPipeline)((RunspaceBase)_parent.Context.CurrentRunspace).GetCurrentlyRunningPipeline(); + if (lpl == null) + { + throw; + } + + lpl.Stopper.Stop(); + } + + return result; + } + /// /// See base class. /// /// /// if the UI property of the external host is null, possibly because the PSHostUserInterface is not - /// implemented by the external host + /// implemented by the external host. /// public override diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 1f3b857af21..0add6221a5a 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -59,6 +59,30 @@ public abstract System.Management.Automation.Host.PSHostRawUserInterface RawUI /// /// public abstract string ReadLine(); + + /// + /// Same as ReadLine except that the input is not echoed to the user while it is collected + /// or is echoed in some obfuscated way, such as showing a dot for each character. + /// + /// + /// The characters typed by the user. + /// + /// + /// Note that credentials (a user name and password) should be gathered with + /// + /// + /// + /// + /// + /// + /// + /// + public virtual string ReadLineMaskedAsString() + { + // Default implementation of the function to maintain backwards compatibility of the base class. + throw new PSNotImplementedException(); + } + /// /// Same as ReadLine, except that the result is a SecureString, and that the input is not echoed to the user while it is /// collected (or is echoed in some obfuscated way, such as showing a dot for each character). diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs index 89a5ef97569..6b69bb07b84 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemoteHostUserInterface.cs @@ -197,6 +197,17 @@ public override void WriteWarningLine(string message) _serverMethodExecutor.ExecuteVoidMethod(RemoteHostMethodId.WriteWarningLine, new object[] { message }); } + /// + /// Read line as string masked. + /// + /// + /// Not implemented. It throws an exception. + /// + public override string ReadLineMaskedAsString() + { + throw new PSNotImplementedException(); + } + /// /// Read line as secure string. /// 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 0edc0fcd4f8..4a6a272d6ec 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Read-Host.Tests.ps1 @@ -38,6 +38,17 @@ Describe "Read-Host Test" -Tag "CI" { [pscredential]::New("foo",$result).GetNetworkCredential().Password | Should -BeExactly TEST } + It "Read-Host returns a string when using -MaskInput parameter" { + $result = $ps.AddScript("Read-Host -MaskInput").Invoke() + $result | Should -Be $th.UI.ReadLineData + } + + It "Read-Host throws an error when both -AsSecureString parameter and -MaskInput parameter are used" { + # Contrary to the rest of the tests this does not need to be invoked through a runspace since it is going to throw an error. + $errorId = "AmbiguousParameterSet,Microsoft.PowerShell.Commands.ReadHostCommand" + {Read-Host -MaskInput -AsSecureString} | Should -Throw -ErrorId $errorId + } + It "Read-Host doesn't enter command prompt mode" { $result = "!1" | & "$PSHOME/pwsh" -NoProfile -c "Read-host -Prompt 'foo'" if ($IsWindows) { diff --git a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 index 02a66d4928f..0408cdcc494 100755 --- a/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 +++ b/test/tools/Modules/HelpersHostCS/HelpersHostCS.psm1 @@ -164,6 +164,11 @@ namespace TestHost return ReadLineData; } + public override string ReadLineMaskedAsString() + { + return ReadLineData; + } + public override SecureString ReadLineAsSecureString() { SecureString ss = new SecureString(); From 8a2d170de9d05090e310e0a177ae823215a352b8 Mon Sep 17 00:00:00 2001 From: Edward Douse Date: Thu, 28 May 2020 19:18:53 +0100 Subject: [PATCH 228/275] Correct 'review-for-comments' in `Governance.md` (#11035) As per https://github.com/PowerShell/powershell-rfc/blob/master/RFC0000-RFC-Process.md RFC is "request for comments", rather than "review for comment" --- docs/community/governance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/governance.md b/docs/community/governance.md index 4261b618b1a..5b93ddeec51 100644 --- a/docs/community/governance.md +++ b/docs/community/governance.md @@ -17,7 +17,7 @@ This veto power will be used with restraint since it is intended that the community drive the project. The Corporate Maintainer is determined by the Corporation both initially and in continuation. The initial Corporate Maintainer for PowerShell is Jeffrey Snover ([jpsnover](https://github.com/jpsnover)). -* [**RFC process**][RFC-repo]: The "review-for-comment" (RFC) process whereby design decisions get made. +* [**RFC process**][RFC-repo]: The "request-for-comments" (RFC) process whereby design decisions get made. ## PowerShell Committee From c602f8272ea0defa59b37754fe09bcca9dec8386 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 29 May 2020 01:19:56 +0500 Subject: [PATCH 229/275] Remove extra line before formatting group (#12163) --- .../common/BaseFormattingCommand.cs | 20 +++++++++++++++++++ .../common/BaseOutputtingCommand.cs | 2 -- .../Format-Custom.Tests.ps1 | 2 -- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs index bb6e6cb50aa..ffccf13f4e1 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseFormattingCommand.cs @@ -262,6 +262,9 @@ private void ProcessObject(PSObject so) } else if (transition == GroupTransition.startNew) { + // Add newline before each group except first + WriteNewLineObject(); + // double transition PopGroup(); // exit the current one PushGroup(so); // start a sibling group @@ -273,6 +276,23 @@ private void ProcessObject(PSObject so) } } + private void WriteNewLineObject() + { + FormatEntryData fed = new FormatEntryData(); + fed.outOfBand = true; + + ComplexViewEntry cve = new ComplexViewEntry(); + FormatEntry fe = new FormatEntry(); + cve.formatValueList.Add(fe); + + // Formating system writes newline before each object + // so no need to add newline here like: + // fe.formatValueList.Add(new FormatNewLine()); + fed.formatEntryInfo = cve; + + this.WriteObject(fed); + } + private bool ShouldProcessOutOfBand { get diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index 4467744a666..6420c845e91 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -476,8 +476,6 @@ private void ProcessGroupStart(FormatMessagesContextManager.OutputContext c) if (goc.Data.groupingEntry != null) { - _lo.WriteLine(string.Empty); - ComplexWriter writer = new ComplexWriter(); writer.Initialize(_lo, _lo.ColumnNumber); writer.WriteObject(goc.Data.groupingEntry.formatValueList); 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 08a17f6356a..4402d8bed74 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Format-Custom.Tests.ps1 @@ -397,7 +397,6 @@ Describe "Format-Custom with expression based EntrySelectedBy in a CustomControl $ps.Streams.Error.Clear() $expectedOutput = @' - Entry selected by property Name @@ -424,7 +423,6 @@ testing $ps.Streams.Error.Clear() $expectedOutput = @' - Entry selected by ScriptBlock Name From 9e0b940cfadc4994ed2a50ce9c1f74514faf2673 Mon Sep 17 00:00:00 2001 From: Krzysztof Bogacki Date: Fri, 29 May 2020 02:31:56 +0200 Subject: [PATCH 230/275] Allow use of build module on unknown Linux distros (#11146) --- build.psm1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index bf4a5fbc22e..b5759b671f1 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1,6 +1,11 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. +param( + # Skips a check that prevents building PowerShell on unsupported Linux distributions + [parameter(Mandatory = $false)][switch]$SkipLinuxDistroCheck = $false +) + Set-StrictMode -Version 3.0 # On Unix paths is separated by colon @@ -178,7 +183,11 @@ function Get-EnvironmentInformation $environment.IsSUSEFamily -or $environment.IsAlpine) ) { - throw "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell." + if ($SkipLinuxDistroCheck) { + Write-Warning "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell." + } else { + throw "The current OS : $($LinuxInfo.ID) is not supported for building PowerShell. Import this module with '-ArgumentList `$true' to bypass this check." + } } } From 05cab7fa5a3e229f2665ef9cb70fbb15b9fcc7c1 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 29 May 2020 05:56:33 +0100 Subject: [PATCH 231/275] Formatting: Add empty line between declarations (#12824) # PR Summary Automated fixes: * RCS0013: Add empty line between single-line declarations of different kind * RCS010: Add empty line between declarations ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../CimCommandBase.cs | 1 + .../CimSessionProxy.cs | 3 + .../NewCimSessionOptionCommand.cs | 2 + .../Utils.cs | 2 + .../FilterCore/ValidatingSelectorValue.cs | 1 + .../ManagementList/PropertyValueGetter.cs | 1 + .../GetCounterCommand.cs | 2 + .../NewWinEventCommand.cs | 1 + .../cimSupport/cmdletization/cim/QueryJob.cs | 1 + .../cmdletization/cim/cimChildJobBase.cs | 7 +++ .../cim/cimCmdletDefinitionContext.cs | 4 ++ .../cmdletization/cim/cimWrapper.cs | 1 + .../cmdletization/cim/clientSideQuery.cs | 2 + .../commands/management/Clipboard.cs | 1 + .../commands/management/Computer.cs | 1 + .../commands/management/Process.cs | 3 + .../commands/utility/AddMember.cs | 1 + .../commands/utility/AddType.cs | 2 + .../commands/utility/Compare-Object.cs | 3 + .../utility/ConvertFromMarkdownCommand.cs | 1 + .../OutGridView/OutGridViewCommand.cs | 1 + .../OutGridView/OutWindowProxy.cs | 1 + .../FormatAndOutput/format-hex/Format-Hex.cs | 1 + .../commands/utility/GetRandomCommand.cs | 1 + .../utility/ImplicitRemotingCommands.cs | 8 +++ .../commands/utility/ImportAliasCommand.cs | 1 + .../commands/utility/Join-String.cs | 1 + .../utility/MarkdownOptionCommands.cs | 1 + .../commands/utility/Select-Object.cs | 1 + .../commands/utility/Update-TypeData.cs | 1 + .../utility/WebCmdlet/ConvertToJsonCommand.cs | 2 + .../WebCmdlet/CoreCLR/HttpKnownHeaderNames.cs | 1 + .../WindowsTaskbarJumpList/ComInterfaces.cs | 24 ++++++++ .../host/msh/ConsoleControl.cs | 2 + .../host/msh/ConsoleHostUserInterface.cs | 2 + .../msh/ConsoleHostUserInterfaceProgress.cs | 2 + .../host/msh/PendingProgress.cs | 1 + .../DotNetCode/Eventing/EventDescriptor.cs | 6 ++ .../DotNetCode/Eventing/EventProvider.cs | 4 ++ .../Eventing/EventProviderTraceListener.cs | 3 + .../Eventing/UnsafeNativeMethods.cs | 37 ++++++++++++ .../ListItemBlockRenderer.cs | 1 + .../VT100EscapeSequences.cs | 2 + .../security/CertificateProvider.cs | 3 + .../ConfigProvider.cs | 1 + .../WSManInstance.cs | 1 + .../CoreCLR/CorePsAssemblyLoadContext.cs | 1 + .../DscSupport/CimDSCParser.cs | 2 + .../common/BaseOutputtingCommand.cs | 2 + .../displayDescriptionData_Table.cs | 1 + .../displayDescriptionData_Wide.cs | 1 + .../common/DisplayDatabase/typeDataManager.cs | 1 + .../FormatAndOutput/common/TableWriter.cs | 2 + .../common/Utilities/MshParameter.cs | 1 + .../cimSupport/cmdletization/ScriptWriter.cs | 1 + .../engine/COM/ComInvoker.cs | 25 ++++++++ .../CommandCompletion/CommandCompletion.cs | 1 + .../CommandCompletion/CompletionCompleters.cs | 4 ++ .../engine/CommandMetadata.cs | 1 + .../engine/CommandProcessor.cs | 1 + .../engine/CommandProcessorBase.cs | 2 + .../engine/CoreAdapter.cs | 9 +++ .../engine/DataStoreAdapter.cs | 1 + .../engine/DataStoreAdapterProvider.cs | 1 + .../engine/ErrorPackage.cs | 1 + .../engine/EventManager.cs | 2 + .../engine/InitialSessionState.cs | 3 + .../engine/InternalCommands.cs | 1 + .../engine/LanguagePrimitives.cs | 4 ++ .../engine/Modules/ImportModuleCommand.cs | 1 + .../engine/Modules/RemoteDiscoveryHelper.cs | 2 + .../engine/Modules/ScriptAnalysis.cs | 1 + .../engine/MshCommandRuntime.cs | 1 + .../engine/MshMemberInfo.cs | 1 + .../engine/MshObject.cs | 2 + .../engine/NativeCommand.cs | 1 + .../engine/NativeCommandProcessor.cs | 4 ++ .../engine/PSVersionInfo.cs | 3 + .../engine/ParameterBinderBase.cs | 3 + .../engine/ReflectionParameterBinder.cs | 1 + .../engine/ScriptCommandProcessor.cs | 1 + .../engine/SessionStateScope.cs | 1 + .../engine/ShellVariable.cs | 1 + .../engine/SpecialVariables.cs | 58 +++++++++++++++++++ .../engine/TypeTable_Types_Ps1Xml.cs | 1 + .../engine/Utils.cs | 3 + .../engine/debugger/debugger.cs | 3 + .../engine/hostifaces/Connection.cs | 1 + .../engine/hostifaces/InformationalRecord.cs | 1 + .../engine/hostifaces/LocalPipeline.cs | 1 + .../engine/hostifaces/MshHost.cs | 1 + .../engine/hostifaces/MshHostUserInterface.cs | 5 ++ .../engine/hostifaces/RunspacePool.cs | 1 + .../interpreter/ControlFlowInstructions.cs | 1 + .../engine/interpreter/InterpretedFrame.cs | 1 + .../engine/interpreter/Interpreter.cs | 1 + .../engine/interpreter/Utilities.cs | 1 + .../engine/lang/parserutils.cs | 3 + .../engine/parser/Compiler.cs | 13 +++++ .../engine/parser/PSType.cs | 3 + .../engine/parser/Parser.cs | 2 + .../engine/parser/SafeValues.cs | 1 + .../engine/parser/SemanticChecks.cs | 3 + .../engine/parser/VariableAnalysis.cs | 4 ++ .../engine/parser/ast.cs | 14 +++++ .../engine/parser/tokenizer.cs | 2 + .../engine/pipeline.cs | 2 + .../engine/regex.cs | 1 + .../remoting/client/ClientRemotePowerShell.cs | 2 + .../engine/remoting/client/Job.cs | 1 + .../engine/remoting/client/Job2.cs | 5 ++ .../remoting/client/RemotingProtocol2.cs | 1 + .../engine/remoting/client/ThrottlingJob.cs | 6 ++ .../engine/remoting/client/remoterunspace.cs | 1 + .../client/remotingprotocolimplementation.cs | 1 + .../remoting/commands/CustomShellCommands.cs | 10 ++++ .../remoting/commands/InvokeCommandCommand.cs | 1 + .../NewPSSessionConfigurationOptionCommand.cs | 10 ++++ .../remoting/commands/PSRemotingCmdlet.cs | 1 + .../engine/remoting/commands/ReceiveJob.cs | 1 + .../engine/remoting/commands/RemoveJob.cs | 1 + .../engine/remoting/commands/StopJob.cs | 1 + .../remoting/commands/newrunspacecommand.cs | 1 + .../remoting/common/RunspaceConnectionInfo.cs | 4 ++ .../engine/remoting/common/fragmentor.cs | 1 + .../fanin/InitialSessionStateProvider.cs | 3 + .../fanin/OutOfProcTransportManager.cs | 4 ++ .../engine/remoting/fanin/WSManNativeAPI.cs | 28 +++++++++ .../remoting/fanin/WSManPluginFacade.cs | 1 + .../remoting/fanin/WSManPluginShellSession.cs | 1 + .../remoting/fanin/WSManTransportManager.cs | 9 +++ .../server/ServerRemotingProtocol2.cs | 1 + .../server/ServerRunspacePoolDriver.cs | 1 + .../server/serverremotesessionstatemachine.cs | 1 + .../engine/runtime/Binding/Binders.cs | 3 + .../engine/runtime/CompiledScriptBlock.cs | 5 ++ .../engine/runtime/MutableTuple.cs | 2 + .../engine/scriptparameterbinder.cs | 1 + .../engine/serialization.cs | 2 + .../help/HelpCommentsParser.cs | 1 + .../help/UpdatableHelpSystem.cs | 1 + .../namespaces/FileSystemContentStream.cs | 3 + .../namespaces/FileSystemProvider.cs | 19 ++++++ .../namespaces/RegistryWrapper.cs | 2 + .../security/SecuritySupport.cs | 1 + .../security/nativeMethods.cs | 20 +++++++ .../security/wldpNativeMethods.cs | 1 + .../config/MshConsoleLoadException.cs | 1 + .../utils/EncodingUtils.cs | 1 + .../utils/IObjectWriter.cs | 3 + .../utils/MshInvalidOperationException.cs | 1 + .../utils/ParserException.cs | 1 + .../utils/PlatformInvokes.cs | 5 ++ .../utils/PsUtils.cs | 2 + .../utils/ResourceManagerCache.cs | 1 + .../utils/RuntimeException.cs | 1 + .../utils/StringUtil.cs | 4 ++ .../utils/tracing/TracingGen.cs | 1 + test/xUnit/csharp/test_PSConfiguration.cs | 1 + 159 files changed, 547 insertions(+) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs index 6420fe28909..d39bbc6c4ce 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs @@ -703,6 +703,7 @@ protected virtual void DisposeInternal() /// Whether at begin process time, false means in processrecord. /// private bool atBeginProcess = true; + internal bool AtBeginProcess { get diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs index a8e4fcd977f..cd319d242d3 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs @@ -1066,6 +1066,7 @@ private static void AddShowComputerNameMarker(object o) #if DEBUG private static bool isCliXmlTestabilityHookActive = GetIsCliXmlTestabilityHookActive(); + private static bool GetIsCliXmlTestabilityHookActive() { return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("CDXML_CLIXML_TEST")); @@ -1514,6 +1515,7 @@ internal CimInstance TargetCimInstance /// Flag controls whether session object should be closed or not. /// private bool isTemporaryCimSession; + internal bool IsTemporaryCimSession { get @@ -2260,6 +2262,7 @@ protected override bool PreNewActionEvent(CmdletActionEventArgs args) #region private members private CimNewCimInstance newCimInstance = null; + internal CimNewCimInstance NewCimInstanceOperation { get diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index be3d9aeb350..6184e7cb9ab 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -18,8 +18,10 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets public enum ProtocolType { Default, + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] Dcom, + [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] Wsman }; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs index 03bf6ce61d4..76ba5c12a49 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs @@ -141,6 +141,7 @@ internal static class DebugHelper /// Flag used to control generating log message into file. /// private static bool generateLog = true; + internal static bool GenerateLog { get { return generateLog; } @@ -157,6 +158,7 @@ internal static bool GenerateLog /// Flag used to control generating message into powershell. /// private static bool generateVerboseMessage = true; + internal static bool GenerateVerboseMessage { get { return generateVerboseMessage; } diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs index 89c1484cbc1..ed5389668e6 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/ValidatingSelectorValue.cs @@ -47,6 +47,7 @@ public IList AvailableValues #region SelectedIndex private const string SelectedIndexPropertyName = "SelectedIndex"; + private int selectedIndex; /// diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs index 6875198704d..61a1a71938c 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/ManagementList/PropertyValueGetter.cs @@ -14,6 +14,7 @@ namespace Microsoft.Management.UI.Internal public class PropertyValueGetter : IPropertyValueGetter { private const string PropertyDescriptorColumnId = "PropertyDescriptor"; + private DataTable cachedProperties; /// diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index 566ae6d1d22..1c5da218afc 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -90,6 +90,7 @@ public string[] Counter @"\memory\cache faults/sec", @"\physicaldisk(_total)\% disk time", @"\physicaldisk(_total)\current disk queue length"}; + private bool _defaultCounters = true; private List _accumulatedCounters = new List(); @@ -117,6 +118,7 @@ public int SampleInterval // MaxSamples parameter // private const Int64 KEEP_ON_SAMPLING = -1; + [Parameter( ParameterSetName = "GetCounterSet", ValueFromPipeline = false, diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index 1c0acb7f45a..216e9bca7ea 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -27,6 +27,7 @@ public sealed class NewWinEventCommand : PSCmdlet private const string TemplateTag = "template"; private const string DataTag = "data"; + private ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); /// 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 2570f13cdf5..4297c00616c 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/QueryJob.cs @@ -18,6 +18,7 @@ internal class QueryInstancesJob : QueryJobBase { private readonly string _wqlQuery; private readonly bool _useEnumerateInstances; + internal QueryInstancesJob(CimJobContext jobContext, CimQuery cimQuery, string wqlCondition) : base(jobContext, cimQuery) { 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 c09ed5287ad..3743d1965f0 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimChildJobBase.cs @@ -27,6 +27,7 @@ internal abstract class CimChildJobBase : { private static long s_globalJobNumberCounter; private readonly long _myJobNumber = Interlocked.Increment(ref s_globalJobNumberCounter); + private const string CIMJobType = "CimJob"; internal CimJobContext JobContext @@ -57,6 +58,7 @@ internal CimChildJobBase(CimJobContext jobContext) } private readonly CimSensitiveValueConverter _cimSensitiveValueConverter = new CimSensitiveValueConverter(); + internal CimSensitiveValueConverter CimSensitiveValueConverter { get { return _cimSensitiveValueConverter; } } internal abstract IObservable GetCimOperation(); @@ -161,9 +163,12 @@ public virtual void OnCompleted() private readonly Random _random; private int _sleepAndRetryDelayRangeMs = 1000; private int _sleepAndRetryExtraDelayMs = 0; + private const int MaxRetryDelayMs = 15 * 1000; private const int MinRetryDelayMs = 100; + private Timer _sleepAndRetryTimer; + private void SleepAndRetry_OnWakeup(object state) { this.ExceptionSafeWrapper( @@ -527,7 +532,9 @@ internal CimOperationOptions CreateOperationOptions() } private readonly Lazy _jobSpecificCustomOptions; + internal abstract CimCustomOptionsDictionary CalculateJobSpecificCustomOptions(); + private CimCustomOptionsDictionary GetJobSpecificCustomOptions() { return _jobSpecificCustomOptions.Value; 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 082a7597425..6fa40516322 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimCmdletDefinitionContext.cs @@ -37,7 +37,9 @@ internal CimCmdletDefinitionContext( private readonly IDictionary _privateData; private const string QueryLanguageKey = "QueryDialect"; + private bool? _useEnumerateInstancesInsteadOfWql; + public bool UseEnumerateInstancesInsteadOfWql { get @@ -112,6 +114,7 @@ public bool ClientSideShouldProcess private Uri _resourceUri; private bool _resourceUriHasBeenCalculated; + public Uri ResourceUri { get @@ -140,6 +143,7 @@ public bool SkipTestConnection } private CimOperationFlags? _schemaConformanceLevel; + public CimOperationFlags SchemaConformanceLevel { get 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 d78c8d631e9..a667e6da2f5 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimWrapper.cs @@ -369,6 +369,7 @@ internal override CimSession GetSessionOfOriginFromInstance(CimInstance instance #region Handling of dynamic parameters private RuntimeDefinedParameterDictionary _dynamicParameters; + private const string CimNamespaceParameter = "CimNamespace"; private string GetDynamicNamespace() 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 47c538ccb6a..6b454ad8b7e 100644 --- a/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs +++ b/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/clientSideQuery.cs @@ -154,6 +154,7 @@ public virtual IEnumerable GetNotFoundErrors_IfThisIsTheOnlyFilte private abstract class CimInstancePropertyBasedFilter : CimInstanceFilterBase { private readonly List _propertyValueFilters = new List(); + protected IEnumerable PropertyValueFilters { get { return _propertyValueFilters; } } protected void AddPropertyValueFilter(PropertyValueFilter propertyValueFilter) @@ -357,6 +358,7 @@ public BehaviorOnNoMatch BehaviorOnNoMatch } protected abstract BehaviorOnNoMatch GetDefaultBehaviorWhenNoMatchesFound(object cimTypedExpectedPropertyValue); + private BehaviorOnNoMatch _behaviorOnNoMatch; public string PropertyName { get; } diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs index 77701a1bb70..38a1b5c48a6 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Clipboard.cs @@ -197,6 +197,7 @@ public static void SetRtf(string plainText, string rtfText) private const uint CF_TEXT = 1; private const uint CF_UNICODETEXT = 13; + private static uint s_CF_RTF; private static bool GetTextImpl(out string text) diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs index ece9d77e511..d8f0b96fade 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs @@ -1123,6 +1123,7 @@ public sealed class StopComputerCommand : PSCmdlet, IDisposable #region Private Members private readonly CancellationTokenSource _cancel = new CancellationTokenSource(); + private const int forcedShutdown = 5; // See https://msdn.microsoft.com/library/aa394058(v=vs.85).aspx #endregion diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index b17dfa02058..3a23322fff2 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -2776,6 +2776,7 @@ internal class SECURITY_ATTRIBUTES public int nLength; public SafeLocalMemHandle lpSecurityDescriptor; public bool bInheritHandle; + public SECURITY_ATTRIBUTES() { this.nLength = 12; @@ -2801,6 +2802,7 @@ internal SafeLocalMemHandle(IntPtr existingHandle, bool ownsHandle) [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), DllImport(PinvokeDllNames.LocalFreeDllName)] private static extern IntPtr LocalFree(IntPtr hMem); + protected override bool ReleaseHandle() { return (LocalFree(base.handle) == IntPtr.Zero); @@ -2828,6 +2830,7 @@ internal class STARTUPINFO public SafeFileHandle hStdInput; public SafeFileHandle hStdOutput; public SafeFileHandle hStdError; + public STARTUPINFO() { this.lpReserved = IntPtr.Zero; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs index 9bbde6cac81..2ea6d6e20ae 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddMember.cs @@ -21,6 +21,7 @@ namespace Microsoft.PowerShell.Commands public class AddMemberCommand : PSCmdlet { private static readonly object s_notSpecified = new object(); + private static bool HasBeenSpecified(object obj) { return !System.Object.ReferenceEquals(obj, s_notSpecified); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index df96aba17a4..d504a43a46d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -634,7 +634,9 @@ protected override void EndProcessing() private static readonly Dictionary s_sourceAssemblyCache = new Dictionary(); private static readonly string s_defaultSdkDirectory = Utils.DefaultPowerShellAppBase; + private const ReportDiagnostic defaultDiagnosticOption = ReportDiagnostic.Error; + private static readonly string[] s_writeInformationTags = new string[] { "PSHOST" }; private int _syntaxTreesHash; 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 ae6e48180e5..5a1b944792d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Compare-Object.cs @@ -99,10 +99,13 @@ public SwitchParameter PassThru #region Internal private List _referenceEntries; + private readonly List _referenceEntryBacklog = new List(); + private readonly List _differenceEntryBacklog = new List(); + private OrderByProperty _orderByProperty = null; private OrderByPropertyComparer _comparer = null; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs index efd61a6922a..dfa6bd6c4b0 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ConvertFromMarkdownCommand.cs @@ -58,6 +58,7 @@ public class ConvertFromMarkdownCommand : PSCmdlet private const string PathParameterSet = "PathParamSet"; private const string LiteralPathParameterSet = "LiteralParamSet"; private const string InputObjParamSet = "InputObjParamSet"; + private MarkdownConversionType _conversionType = MarkdownConversionType.HTML; private PSMarkdownOptionInfo _mdOption = null; 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 8ae81bedd24..b95e9968c5c 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 @@ -43,6 +43,7 @@ public class OutGridViewCommand : PSCmdlet, IDisposable private const string DataNotQualifiedForGridView = "DataNotQualifiedForGridView"; private const string RemotingNotSupported = "RemotingNotSupported"; + private TypeInfoDataBase _typeInfoDataBase; private PSPropertyExpressionFactory _expressionFactory; private OutWindowProxy _windowProxy; 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 871b1a1bb62..55158034368 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 @@ -20,6 +20,7 @@ internal class OutWindowProxy : IDisposable internal const string OriginalObjectPropertyName = "OutGridViewOriginalObject"; private const string ToStringValuePropertyName = "ToStringValue"; private const string IndexPropertyName = "IndexValue"; + private int _index; /// Columns definition of the underlying Management List 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 3a4a43fa205..a0225c8ea6a 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 @@ -280,6 +280,7 @@ private void ProcessString(string originalString) } private static readonly Random _idGenerator = new Random(); + private static string GetGroupLabel(Type inputType) => string.Format("{0} ({1}) <{2:X8}>", inputType.Name, inputType.FullName, _idGenerator.Next()); diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs index 6e4445ba28e..01cf6534c48 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/GetRandomCommand.cs @@ -29,6 +29,7 @@ public class GetRandomCommand : PSCmdlet private const string RandomNumberParameterSet = "RandomNumberParameterSet"; private const string RandomListItemParameterSet = "RandomListItemParameterSet"; private const string ShuffleParameterSet = "ShuffleParameterSet"; + private static readonly object[] _nullInArray = new object[] { null }; private enum MyParameterSet diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs index a1bc3762fcb..2e1d8988496 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImplicitRemotingCommands.cs @@ -794,6 +794,7 @@ private ErrorRecord GetErrorNoResultsFromRemoteEnd(string commandName) } private List _commandsSkippedBecauseOfShadowing = new List(); + private void ReportSkippedCommands() { if (_commandsSkippedBecauseOfShadowing.Count != 0) @@ -825,6 +826,7 @@ private bool IsCommandNameMatchingParameters(string commandName) } private Dictionary _existingCommands; + private Dictionary ExistingCommands { get @@ -2119,6 +2121,7 @@ function Write-PSImplicitRemotingMessage try { & $script:WriteHost -Object $message -ErrorAction SilentlyContinue } catch { } } "; + private void GenerateHelperFunctionsWriteMessage(TextWriter writer) { if (writer == null) @@ -2173,6 +2176,7 @@ function Set-PSImplicitRemotingSession if ($PSSessionOverride) {{ Set-PSImplicitRemotingSession $PSSessionOverride }} "; + private void GenerateHelperFunctionsSetImplicitRunspace(TextWriter writer) { if (writer == null) @@ -2204,6 +2208,7 @@ function Get-PSImplicitRemotingSessionOption }} }} "; + private void GenerateHelperFunctionsGetSessionOption(TextWriter writer) { if (writer == null) @@ -2434,6 +2439,7 @@ private void GenerateHelperFunctionsGetImplicitRunspace(TextWriter writer) }} -ErrorAction SilentlyContinue }} catch {{ }} "; + private string GenerateReimportingOfModules() { StringBuilder result = new StringBuilder(); @@ -2543,6 +2549,7 @@ private string GenerateNewRunspaceExpression() private const string ComputerNameParameterTemplate = @"-ComputerName '{0}' ` -ApplicationName '{1}' {2} {3} "; + private const string VMIdParameterTemplate = @"-VMId '{0}' "; private const string ContainerIdParameterTemplate = @"-ContainerId '{0}' "; @@ -2748,6 +2755,7 @@ function Get-PSImplicitRemotingClientSideParameters return $clientSideParameters } "; + private void GenerateHelperFunctionsClientSideParameters(TextWriter writer) { if (writer == null) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs index c4b4a9d3d4e..3da62e88d25 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/ImportAliasCommand.cs @@ -225,6 +225,7 @@ protected override void ProcessRecord() } private Dictionary _existingCommands; + private Dictionary ExistingCommands { get diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs index abc8fddc6f9..652e32652ce 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Join-String.cs @@ -22,6 +22,7 @@ public sealed class JoinStringCommand : PSCmdlet { /// A bigger default to not get re-allocations in common use cases. private const int DefaultOutputStringCapacity = 256; + private readonly StringBuilder _outputBuilder = new StringBuilder(DefaultOutputStringCapacity); private CultureInfo _cultureInfo = CultureInfo.InvariantCulture; private string _separator; diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs index d6cecf471bc..0ee80712123 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/MarkdownOptionCommands.cs @@ -272,6 +272,7 @@ protected override void EndProcessing() internal static class PSMarkdownOptionInfoCache { private static ConcurrentDictionary markdownOptionInfoCache; + private const string MarkdownOptionInfoVariableName = "PSMarkdownOptionInfo"; static PSMarkdownOptionInfoCache() 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 7614278b602..bba2ac2873d 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Select-Object.cs @@ -329,6 +329,7 @@ internal UniquePSObjectHelper(PSObject o, int notePropertyCount) } internal readonly PSObject WrittenObject; + internal int NotePropertyCount { get; } } 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 817c4306b44..de7d2590176 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Update-TypeData.cs @@ -29,6 +29,7 @@ public class UpdateTypeDataCommand : UpdateData private const string TypeDataSet = "TypeDataSet"; private static object s_notSpecified = new object(); + private static bool HasBeenSpecified(object obj) { return !System.Object.ReferenceEquals(obj, s_notSpecified); 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 6c191fcb6e9..92e67f5681a 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/ConvertToJsonCommand.cs @@ -26,7 +26,9 @@ public class ConvertToJsonCommand : PSCmdlet public object InputObject { get; set; } private int _depth = 2; + private const int maxDepthAllowed = 100; + private readonly CancellationTokenSource _cancellationSource = new CancellationTokenSource(); /// 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 30ad227c7aa..80d07a54ddf 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 @@ -79,6 +79,7 @@ internal static class HttpKnownHeaderNames #endregion Known_HTTP_Header_Names private static HashSet s_contentHeaderSet = null; + internal static HashSet ContentHeaders { get diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs index 82b3756d32b..761c6f6e26f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/ComInterfaces.cs @@ -56,39 +56,52 @@ void GetPath( int cchMaxPath, IntPtr pfd, uint fFlags); + void GetIDList(out IntPtr ppidl); void SetIDList(IntPtr pidl); + void GetDescription( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxName); + void SetDescription( [MarshalAs(UnmanagedType.LPWStr)] string pszName); + void GetWorkingDirectory( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath ); + void SetWorkingDirectory( [MarshalAs(UnmanagedType.LPWStr)] string pszDir); + void GetArguments( [Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath); + void SetArguments( [MarshalAs(UnmanagedType.LPWStr)] string pszArgs); + void GetHotKey(out short wHotKey); void SetHotKey(short wHotKey); void GetShowCmd(out uint iShowCmd); void SetShowCmd(uint iShowCmd); + void GetIconLocation( [Out(), MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pszIconPath, int cchIconPath, out int iIcon); + void SetIconLocation( [MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); + void SetRelativePath( [MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, uint dwReserved); + void Resolve(IntPtr hwnd, uint fFlags); + void SetPath( [MarshalAs(UnmanagedType.LPWStr)] string pszFile); } @@ -151,26 +164,34 @@ internal interface ICustomDestinationList { void SetAppID( [MarshalAs(UnmanagedType.LPWStr)] string pszAppID); + [PreserveSig] HResult BeginList( out uint cMaxSlots, ref Guid riid, [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject); + [PreserveSig] HResult AppendCategory( [MarshalAs(UnmanagedType.LPWStr)] string pszCategory, [MarshalAs(UnmanagedType.Interface)] IObjectArray poa); + void AppendKnownCategory( [MarshalAs(UnmanagedType.I4)] KnownDestinationCategory category); + [PreserveSig] HResult AddUserTasks( [MarshalAs(UnmanagedType.Interface)] IObjectArray poa); + void CommitList(); + void GetRemovedDestinations( ref Guid riid, [Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject); + void DeleteList( [MarshalAs(UnmanagedType.LPWStr)] string pszAppID); + void AbortList(); } @@ -186,6 +207,7 @@ internal enum KnownDestinationCategory internal interface IObjectArray { void GetCount(out uint cObjects); + void GetAt( uint iIndex, ref Guid riid, @@ -208,8 +230,10 @@ void GetAt( // IObjectCollection void AddObject( [MarshalAs(UnmanagedType.Interface)] object pvObject); + void AddFromArray( [MarshalAs(UnmanagedType.Interface)] IObjectArray poaSource); + void RemoveObject(uint uiIndex); void Clear(); } diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs index 2229dbb63f1..6159e349497 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleControl.cs @@ -136,6 +136,7 @@ internal struct CONSOLE_FONT_INFO_EX internal short FontHeight; internal int FontFamily; internal int FontWeight; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] internal string FontFace; } @@ -3005,6 +3006,7 @@ internal static void MimicKeyPress(INPUT[] inputs) internal static class NativeMethods { internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // WinBase.h + internal const int FontTypeMask = 0x06; internal const int TrueTypeFont = 0x04; diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index dc80be26017..cec08818f50 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1423,6 +1423,7 @@ public override void WriteErrorLine(string value) // We use System.Environment.NewLine because we are platform-agnostic internal static string Crlf = System.Environment.NewLine; + private const string Tab = "\x0009"; internal enum ReadLineResult @@ -2166,6 +2167,7 @@ private CommandCompletion GetNewCompletionResults(string input) } private const string CustomReadlineCommand = "PSConsoleHostReadLine"; + private bool TryInvokeUserDefinedReadLine(out string input) { // We're using GetCommands instead of GetCommand so we don't auto-load a module should the command exist, but isn't loaded. diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs index f055001239f..ffc5735f35f 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs @@ -192,7 +192,9 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt private PendingProgress _pendingProgress = null; // The timer set up 'progPaneUpdateFlag' every 'UpdateTimerThreshold' milliseconds to update 'ProgressPane' private Timer _progPaneUpdateTimer = null; + private const int UpdateTimerThreshold = 200; + private int progPaneUpdateFlag = 0; } } // namespace diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs index 0d4638cdb6f..ce4b6d95acb 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs @@ -1019,6 +1019,7 @@ internal static private ArrayList _topLevelNodes = new ArrayList(); private int _nodeCount; + private const int maxNodeCount = 128; } } // namespace diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs index 7cfef28f7e5..34fa9105085 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventDescriptor.cs @@ -12,16 +12,22 @@ public struct EventDescriptor { [FieldOffset(0)] private ushort _id; + [FieldOffset(2)] private byte _version; + [FieldOffset(3)] private byte _channel; + [FieldOffset(4)] private byte _level; + [FieldOffset(5)] private byte _opcode; + [FieldOffset(6)] private ushort _task; + [FieldOffset(8)] private long _keywords; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs index 1d2038b5bf1..a1eba143e28 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs @@ -14,6 +14,7 @@ public class EventProvider : IDisposable { [SecurityCritical] private UnsafeNativeMethods.EtwEnableCallback _etwCallback; // Trace Callback function + private long _regHandle; // Trace Registration Handle private byte _level; // Tracing Level private long _anyKeywordMask; // Trace Enable Flags @@ -24,6 +25,7 @@ public class EventProvider : IDisposable [ThreadStatic] private static WriteEventErrorCode t_returnCode; // thread slot to keep last error + [ThreadStatic] private static Guid t_activityId; @@ -48,8 +50,10 @@ private struct EventData { [FieldOffset(0)] internal ulong DataPointer; + [FieldOffset(8)] internal uint Size; + [FieldOffset(12)] internal int Reserved; } diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs index 27b24de945e..97c10d167ef 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProviderTraceListener.cs @@ -20,10 +20,13 @@ public class EventProviderTraceListener : TraceListener // // private EventProvider _provider; + private const string s_nullStringValue = "null"; private const string s_nullStringComaValue = "null,"; private const string s_nullCStringValue = ": null"; + private string _delimiter = ";"; + private const uint s_keyWordMask = 0xFFFFFF00; private const int s_defaultPayloadSize = 512; diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs index a902f0def73..5da8809897d 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs @@ -14,6 +14,7 @@ internal static class UnsafeNativeMethods private const string FormatMessageDllName = "api-ms-win-core-localization-l1-2-0.dll"; private const string EventProviderDllName = "api-ms-win-eventing-provider-l1-1-0.dll"; private const string WEVTAPI = "wevtapi.dll"; + private static readonly IntPtr s_NULL = IntPtr.Zero; // WinError.h codes: @@ -239,18 +240,25 @@ internal struct SystemTime { [MarshalAs(UnmanagedType.U2)] public short Year; + [MarshalAs(UnmanagedType.U2)] public short Month; + [MarshalAs(UnmanagedType.U2)] public short DayOfWeek; + [MarshalAs(UnmanagedType.U2)] public short Day; + [MarshalAs(UnmanagedType.U2)] public short Hour; + [MarshalAs(UnmanagedType.U2)] public short Minute; + [MarshalAs(UnmanagedType.U2)] public short Second; + [MarshalAs(UnmanagedType.U2)] public short Milliseconds; } @@ -261,50 +269,73 @@ internal struct EvtVariant { [FieldOffset(0)] public UInt32 UInteger; + [FieldOffset(0)] public Int32 Integer; + [FieldOffset(0)] public byte UInt8; + [FieldOffset(0)] public short Short; + [FieldOffset(0)] public ushort UShort; + [FieldOffset(0)] public UInt32 Bool; + [FieldOffset(0)] public byte ByteVal; + [FieldOffset(0)] public byte SByte; + [FieldOffset(0)] public UInt64 ULong; + [FieldOffset(0)] public Int64 Long; + [FieldOffset(0)] public Single Single; + [FieldOffset(0)] public double Double; + [FieldOffset(0)] public IntPtr StringVal; + [FieldOffset(0)] public IntPtr AnsiString; + [FieldOffset(0)] public IntPtr SidVal; + [FieldOffset(0)] public IntPtr Binary; + [FieldOffset(0)] public IntPtr Reference; + [FieldOffset(0)] public IntPtr Handle; + [FieldOffset(0)] public IntPtr GuidReference; + [FieldOffset(0)] public UInt64 FileTime; + [FieldOffset(0)] public IntPtr SystemTime; + [FieldOffset(0)] public IntPtr SizeT; + [FieldOffset(8)] public UInt32 Count; // number of elements (not length) in bytes. + [FieldOffset(12)] public UInt32 Type; } @@ -493,12 +524,16 @@ internal struct EvtRpcLogin { [MarshalAs(UnmanagedType.LPWStr)] public string Server; + [MarshalAs(UnmanagedType.LPWStr)] public string User; + [MarshalAs(UnmanagedType.LPWStr)] public string Domain; + [SecurityCritical] public CoTaskMemUnicodeSafeHandle Password; + public int Flags; } @@ -825,8 +860,10 @@ internal struct EvtStringVariant { [MarshalAs(UnmanagedType.LPWStr), FieldOffset(0)] public string StringVal; + [FieldOffset(8)] public UInt32 Count; + [FieldOffset(12)] public UInt32 Type; }; diff --git a/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs b/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs index c680d9c973b..281cec47d54 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/ListItemBlockRenderer.cs @@ -61,6 +61,7 @@ private void RenderWithIndent(VT100Renderer renderer, MarkdownObject block, char // Typical padding is at most a screen's width, any more than that and we won't bother caching. private const int IndentCacheMax = 120; + private static readonly string[] IndentCache = new string[IndentCacheMax]; internal static string Padding(int countOfSpaces) diff --git a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs index 8e6d5ba9967..0827fdf049f 100644 --- a/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs +++ b/src/Microsoft.PowerShell.MarkdownRender/VT100EscapeSequences.cs @@ -273,10 +273,12 @@ private void SetCodeColor(bool isDarkTheme) public class VT100EscapeSequences { private const char Esc = (char)0x1B; + private string endSequence = Esc + "[0m"; // For code blocks, [500@ make sure that the whole line has background color. private const string LongBackgroundCodeBlock = "[500@"; + private PSMarkdownOptionInfo options; /// diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index cde06e0ed65..6e524eff3de 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -565,6 +565,7 @@ public sealed class CertificateProvider : NavigationCmdletProvider, ICmdletProvi /// this property. /// private static Regex s_certPathRegex = null; + private static Regex CertPathRegex { get @@ -3093,6 +3094,7 @@ public static void WriteSendAsTrustedIssuerProperty(X509Certificate2 cert, strin } private static readonly char[] s_separators = new char[] { '/', '\\' }; + private static string[] GetPathElements(string path) { string[] allElts = path.Split(s_separators); @@ -3177,6 +3179,7 @@ public sealed class DnsNameProperty { private List _dnsList = new List(); private System.Globalization.IdnMapping idnMapping = new System.Globalization.IdnMapping(); + private const string dnsNamePrefix = "DNS Name="; private const string distinguishedNamePrefix = "CN="; diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 9ded9e76f04..a5b62bc6cb9 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -5446,6 +5446,7 @@ enum WsManElementObjectTypes #region def private static readonly string[] WinrmRootName = new string[] { "winrm/Config" }; + private static readonly string[] WinRmRootConfigs = new string[] { "Client", "Service", diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index fabac20ec78..e740fc45632 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -398,6 +398,7 @@ public SwitchParameter UseSSL # region private WSManHelper helper; + private string GetFilter() { string name; diff --git a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs index ef210304ae9..293c3599267 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsAssemblyLoadContext.cs @@ -113,6 +113,7 @@ private PowerShellAssemblyLoadContext(string basePaths) // - Value: strong name of the TPA that contains the type represented by Key. private readonly Dictionary _coreClrTypeCatalog; private readonly Lazy> _availableDotNetAssemblyNames; + private readonly HashSet _denyListedAssemblies = new HashSet(StringComparer.OrdinalIgnoreCase){ "System.Windows.Forms" }; diff --git a/src/System.Management.Automation/DscSupport/CimDSCParser.cs b/src/System.Management.Automation/DscSupport/CimDSCParser.cs index 908025c14e2..be547213afa 100644 --- a/src/System.Management.Automation/DscSupport/CimDSCParser.cs +++ b/src/System.Management.Automation/DscSupport/CimDSCParser.cs @@ -656,6 +656,7 @@ private static HashSet ScriptKeywordFileCache /// [ThreadStatic] private static bool t_cacheResourcesFromMultipleModuleVersions; + private static bool CacheResourcesFromMultipleModuleVersions { get @@ -3712,6 +3713,7 @@ private static ScriptBlock CimKeywordImplementationFunction } private static ScriptBlock s_cimKeywordImplementationFunction; + private const string CimKeywordImplementationFunctionText = @" param ( [Parameter(Mandatory)] diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index 6420c845e91..2eea9f50c46 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -948,7 +948,9 @@ private sealed class TableOutputContext : TableOutputContextBase private int _rowCount = 0; private int _consoleHeight = -1; private int _consoleWidth = -1; + private const int WhitespaceAndPagerLineCount = 2; + private bool _repeatHeader = false; /// 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 ddd8446b065..b9d1e897068 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Table.cs @@ -547,6 +547,7 @@ public TableControlBuilder EndRowDefinition() public sealed class TableControlBuilder { internal readonly TableControl _table; + internal TableControlBuilder(TableControl table) { _table = table; 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 0e140fa5eea..05e3e79923b 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayDescriptionData_Wide.cs @@ -259,6 +259,7 @@ internal bool CompatibleWithOldPowerShell() public sealed class WideControlBuilder { private readonly WideControl _control; + internal WideControlBuilder(WideControl control) { _control = control; diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs index 21a180baf62..985561670f8 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/typeDataManager.cs @@ -473,6 +473,7 @@ private static void LoadFormatDataHelper( } private delegate IEnumerable TypeGenerator(); + private static Dictionary> s_builtinGenerators; private static Tuple GetBuiltin(bool isForHelp, TypeGenerator generator) diff --git a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs index 7eaeef24c26..e01be6f5b8c 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/TableWriter.cs @@ -40,8 +40,10 @@ private class ScreenInfo } private ScreenInfo _si; + private const char ESC = '\u001b'; private const string ResetConsoleVt100Code = "\u001b[m"; + private List _header; internal static int ComputeWideViewBestItemsPerRowFit(int stringLen, int screenColumns) diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index 15aecfacc8f..c9d509abeef 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -32,6 +32,7 @@ internal object GetEntry(string key) internal class NameEntryDefinition : HashtableEntryDefinition { internal const string NameEntryKey = "name"; + internal NameEntryDefinition() : base(NameEntryKey, new string[] { FormatParameterDefinitionKeys.LabelEntryKey }, new Type[] { typeof(string) }, false) { diff --git a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs index f14eae396f8..3757319c9ab 100644 --- a/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs +++ b/src/System.Management.Automation/cimSupport/cmdletization/ScriptWriter.cs @@ -2101,6 +2101,7 @@ private void WriteGetCmdlet(TextWriter output) } private static object s_enumCompilationLock = new object(); + private static void CompileEnum(EnumMetadataEnum enumMetadata) { try diff --git a/src/System.Management.Automation/engine/COM/ComInvoker.cs b/src/System.Management.Automation/engine/COM/ComInvoker.cs index 4e0d083c118..3834be3de8e 100644 --- a/src/System.Management.Automation/engine/COM/ComInvoker.cs +++ b/src/System.Management.Automation/engine/COM/ComInvoker.cs @@ -352,12 +352,16 @@ internal struct TypeUnion { [FieldOffset(0)] internal ushort _vt; + [FieldOffset(2)] internal ushort _wReserved1; + [FieldOffset(4)] internal ushort _wReserved2; + [FieldOffset(6)] internal ushort _wReserved3; + [FieldOffset(8)] internal UnionTypes _unionTypes; } @@ -374,46 +378,67 @@ internal struct UnionTypes { [FieldOffset(0)] internal sbyte _i1; + [FieldOffset(0)] internal Int16 _i2; + [FieldOffset(0)] internal Int32 _i4; + [FieldOffset(0)] internal Int64 _i8; + [FieldOffset(0)] internal byte _ui1; + [FieldOffset(0)] internal UInt16 _ui2; + [FieldOffset(0)] internal UInt32 _ui4; + [FieldOffset(0)] internal UInt64 _ui8; + [FieldOffset(0)] internal Int32 _int; + [FieldOffset(0)] internal UInt32 _uint; + [FieldOffset(0)] internal Int16 _bool; + [FieldOffset(0)] internal Int32 _error; + [FieldOffset(0)] internal Single _r4; + [FieldOffset(0)] internal double _r8; + [FieldOffset(0)] internal Int64 _cy; + [FieldOffset(0)] internal double _date; + [FieldOffset(0)] internal IntPtr _bstr; + [FieldOffset(0)] internal IntPtr _unknown; + [FieldOffset(0)] internal IntPtr _dispatch; + [FieldOffset(0)] internal IntPtr _pvarVal; + [FieldOffset(0)] internal IntPtr _byref; + [FieldOffset(0)] internal Record _record; } diff --git a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs index e4c253e9ddd..7af3fb62fb4 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs @@ -56,6 +56,7 @@ public CommandCompletion(Collection matches, int currentMatchI public Collection CompletionMatches { get; set; } internal static readonly IList EmptyCompletionResult = Array.Empty(); + private static readonly CommandCompletion s_emptyCommandCompletion = new CommandCompletion( new Collection(EmptyCompletionResult), -1, -1, -1); diff --git a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs index 7ff17435001..e00302a1eb4 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs @@ -208,6 +208,7 @@ List ExecuteGetCommandCommand(bool useModulePrefix) private static readonly HashSet s_keywordsToExcludeFromAddingAmpersand = new HashSet(StringComparer.OrdinalIgnoreCase) { nameof(TokenKind.InlineScript), nameof(TokenKind.Configuration) }; + internal static CompletionResult GetCommandNameCompletionResult(string name, object command, bool addAmpersandIfNecessary, string quote) { string syntax = name, listItem = name; @@ -4505,6 +4506,7 @@ private struct SHARE_INFO_1 private const int ERROR_MORE_DATA = 234; private const int STYPE_DISKTREE = 0; private const int STYPE_MASK = 0x000000FF; + private static System.IO.EnumerationOptions _enumerationOptions = new System.IO.EnumerationOptions { MatchCasing = MatchCasing.CaseInsensitive, @@ -4580,6 +4582,7 @@ public static IEnumerable CompleteVariable(string variableName } private static readonly string[] s_variableScopes = new string[] { "Global:", "Local:", "Script:", "Private:" }; + private static readonly char[] s_charactersRequiringQuotes = new char[] { '-', '`', '&', '@', '\'', '"', '#', '{', '}', '(', ')', '$', ',', ';', '|', '<', '>', ' ', '.', '\\', '/', '\t', '^', }; @@ -5720,6 +5723,7 @@ private class TypeCompletionMapping } private static TypeCompletionMapping[][] s_typeCache; + private static TypeCompletionMapping[][] InitializeTypeCache() { #region Process_TypeAccelerators diff --git a/src/System.Management.Automation/engine/CommandMetadata.cs b/src/System.Management.Automation/engine/CommandMetadata.cs index 5ad657b037f..edcd9a9cd66 100644 --- a/src/System.Management.Automation/engine/CommandMetadata.cs +++ b/src/System.Management.Automation/engine/CommandMetadata.cs @@ -647,6 +647,7 @@ internal uint DefaultParameterSetFlag // The CommandType for a script cmdlet is not CommandTypes.Cmdlet, yet // proxy generation needs to know the difference between script and script cmdlet. private bool _wrappedAnyCmdlet; + internal bool WrappedAnyCmdlet { get { return _wrappedAnyCmdlet; } diff --git a/src/System.Management.Automation/engine/CommandProcessor.cs b/src/System.Management.Automation/engine/CommandProcessor.cs index 48abebc7a17..4433d75ca99 100644 --- a/src/System.Management.Automation/engine/CommandProcessor.cs +++ b/src/System.Management.Automation/engine/CommandProcessor.cs @@ -667,6 +667,7 @@ private bool ProcessInputPipelineObject(object inputObject) } private static readonly ConcurrentDictionary> s_constructInstanceCache; + private static Cmdlet ConstructInstance(Type type) { // Call the default constructor if type derives from Cmdlet. diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index e2c8ad46e5c..87fd4606c9f 100644 --- a/src/System.Management.Automation/engine/CommandProcessorBase.cs +++ b/src/System.Management.Automation/engine/CommandProcessorBase.cs @@ -156,6 +156,7 @@ internal virtual ObsoleteAttribute ObsoleteAttribute /// The command runtime used for this instance of a command processor. /// protected MshCommandRuntime commandRuntime; + internal MshCommandRuntime CommandRuntime { get { return commandRuntime; } @@ -230,6 +231,7 @@ protected static void ValidateCompatibleLanguageMode( /// The execution context used by the system. /// protected ExecutionContext _context; + internal ExecutionContext Context { get { return _context; } diff --git a/src/System.Management.Automation/engine/CoreAdapter.cs b/src/System.Management.Automation/engine/CoreAdapter.cs index 44361ffa04f..2fd5e1868c5 100644 --- a/src/System.Management.Automation/engine/CoreAdapter.cs +++ b/src/System.Management.Automation/engine/CoreAdapter.cs @@ -2080,6 +2080,7 @@ internal class MethodInformation { internal MethodBase method; private string _cachedMethodDefinition; + internal string methodDefinition { get @@ -2101,7 +2102,9 @@ internal string methodDefinition internal bool isGeneric; private bool _useReflection; + private delegate object MethodInvoker(object target, object[] arguments); + private MethodInvoker _methodInvoker; /// @@ -2555,8 +2558,10 @@ internal class DotNetAdapter : Adapter private const BindingFlags instanceBindingFlags = (BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.Instance); + private const BindingFlags staticBindingFlags = (BindingFlags.FlattenHierarchy | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.Static); + private bool _isStatic; internal DotNetAdapter() { } @@ -2626,6 +2631,7 @@ internal MethodInformation this[int i] } private bool? _isHidden; + internal override bool IsHidden { get @@ -2980,6 +2986,7 @@ internal SetterDelegate setterDelegate internal Type propertyType; private bool? _isHidden; + internal override bool IsHidden { get @@ -2994,6 +3001,7 @@ internal override bool IsHidden } private AttributeCollection _attributes; + internal AttributeCollection Attributes { get @@ -4749,6 +4757,7 @@ protected override T GetFirstMemberOrDefault(object obj, MemberNamePredicate internal class DotNetAdapterWithComTypeName : DotNetAdapter { private ComTypeInfo _comTypeInfo; + internal DotNetAdapterWithComTypeName(ComTypeInfo comTypeInfo) { _comTypeInfo = comTypeInfo; diff --git a/src/System.Management.Automation/engine/DataStoreAdapter.cs b/src/System.Management.Automation/engine/DataStoreAdapter.cs index 6b9a77f45f7..c7db11bf081 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapter.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapter.cs @@ -817,6 +817,7 @@ public override int GetHashCode() } private PSNoteProperty _noteProperty; + internal PSNoteProperty GetNotePropertyForProviderCmdlets(string name) { if (_noteProperty == null) diff --git a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs index cfc7528b90b..f1e798c0edf 100644 --- a/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs +++ b/src/System.Management.Automation/engine/DataStoreAdapterProvider.cs @@ -673,6 +673,7 @@ internal void GetOutputTypes(string cmdletname, List listToAppend) private Dictionary> _providerOutputType; private PSNoteProperty _noteProperty; + internal PSNoteProperty GetNotePropertyForProviderCmdlets(string name) { if (_noteProperty == null) diff --git a/src/System.Management.Automation/engine/ErrorPackage.cs b/src/System.Management.Automation/engine/ErrorPackage.cs index 1f308dc2ecd..fc346e2ee96 100644 --- a/src/System.Management.Automation/engine/ErrorPackage.cs +++ b/src/System.Management.Automation/engine/ErrorPackage.cs @@ -1470,6 +1470,7 @@ public Exception Exception public object TargetObject { get => _target; } private object _target /* = null */; + internal void SetTargetObject(object target) { _target = target; diff --git a/src/System.Management.Automation/engine/EventManager.cs b/src/System.Management.Automation/engine/EventManager.cs index c524e3646c5..a962f745eac 100644 --- a/src/System.Management.Automation/engine/EventManager.cs +++ b/src/System.Management.Automation/engine/EventManager.cs @@ -641,6 +641,7 @@ private void EnableTimer() #endregion OnIdleProcessing private static Dictionary s_generatedEventHandlers = new Dictionary(); + private void ProcessNewSubscriber(PSEventSubscriber subscriber, object source, string eventName, string sourceIdentifier, PSObject data, bool supportEvent, bool forwardEvent) { Delegate handlerDelegate = null; @@ -2349,6 +2350,7 @@ public class PSEventArgsCollection : IEnumerable /// The event generated when a new event is received. /// public event PSEventReceivedEventHandler PSEventReceived; + private List _eventCollection = new List(); /// diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index a26573b1cfa..6032259bea6 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -4771,9 +4771,11 @@ internal static SessionStateAliasEntry[] BuiltInAliases "; internal const string DefaultSetDriveFunctionText = "Set-Location $MyInvocation.MyCommand.Name"; + internal static ScriptBlock SetDriveScriptBlock = ScriptBlock.CreateDelayParsedScriptBlock(DefaultSetDriveFunctionText, isProductCode: true); private static PSLanguageMode systemLanguageMode = (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Enforce) ? PSLanguageMode.ConstrainedLanguage : PSLanguageMode.FullLanguage; + internal static SessionStateFunctionEntry[] BuiltInFunctions = new SessionStateFunctionEntry[] { // Functions that don't require full language mode @@ -4871,6 +4873,7 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt { "Microsoft.PowerShell.Diagnostics", "Microsoft.PowerShell.Commands.Diagnostics"}, { "Microsoft.PowerShell.Host", "Microsoft.PowerShell.ConsoleHost"}, }; + internal static Dictionary NestedModuleEngineModuleMapping = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "Microsoft.PowerShell.Commands.Utility", "Microsoft.PowerShell.Utility"}, diff --git a/src/System.Management.Automation/engine/InternalCommands.cs b/src/System.Management.Automation/engine/InternalCommands.cs index 348f4b33277..7c37cc4f0eb 100644 --- a/src/System.Management.Automation/engine/InternalCommands.cs +++ b/src/System.Management.Automation/engine/InternalCommands.cs @@ -1963,6 +1963,7 @@ public SwitchParameter Not private readonly CallSite> _toBoolSite = CallSite>.Create(PSConvertBinder.Get(typeof(bool))); + private Func _operationDelegate; private static Func GetCallSiteDelegate(ExpressionType expressionType, bool ignoreCase) diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 039761b4118..83690003bf7 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -413,6 +413,7 @@ private static IEnumerable GetEnumerableFromIEnumerableT(object obj) } private delegate IEnumerable GetEnumerableDelegate(object obj); + private static Dictionary s_getEnumerableCache = new Dictionary(32); private static GetEnumerableDelegate GetOrCalculateEnumerable(Type type) @@ -1922,6 +1923,7 @@ internal EnumHashEntry(string[] names, Array values, UInt64 allValues, bool hasN // This static is thread safe based on the lock in GetEnumHashEntry // It can be shared by Runspaces in different MiniShells private static readonly Dictionary s_enumTable = new Dictionary(); + private const int maxEnumTableSize = 100; private static EnumHashEntry GetEnumHashEntry(Type enumType) @@ -3656,6 +3658,7 @@ private class PSMethodToDelegateConverter private readonly int _matchIndex; // Size of the cache. It's rare to have more than 10 overloads for a method. private const int CacheSize = 10; + private static readonly PSMethodToDelegateConverter[] s_converterCache = new PSMethodToDelegateConverter[CacheSize]; private PSMethodToDelegateConverter(int matchIndex) @@ -5732,6 +5735,7 @@ internal static IConversionData FigureConversion(Type fromType, Type toType) } internal class Null { }; + private static IConversionData FigureConversionFromNull(Type toType) { IConversionData data = GetConversionData(typeof(Null), toType); diff --git a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs index bec87e9a35a..1521edfc702 100644 --- a/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs +++ b/src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs @@ -1709,6 +1709,7 @@ private PSModuleInfo ImportModule_RemotelyViaCimModuleData( #region Cancellation support private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); + private CancellationToken CancellationToken { get diff --git a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs index fce9c2e58c8..4a1c50186eb 100644 --- a/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs +++ b/src/System.Management.Automation/engine/Modules/RemoteDiscoveryHelper.cs @@ -841,12 +841,14 @@ internal static Hashtable RewriteManifest(Hashtable originalManifest) "Description", "HelpInfoURI", }; + private static readonly string[] s_manifestEntriesToKeepAsStringArray = new[] { "FunctionsToExport", "VariablesToExport", "AliasesToExport", "CmdletsToExport", }; + internal static Hashtable RewriteManifest( Hashtable originalManifest, IEnumerable nestedModules, diff --git a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs index 870c564244b..6ec64a4cf0f 100644 --- a/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs +++ b/src/System.Management.Automation/engine/Modules/ScriptAnalysis.cs @@ -158,6 +158,7 @@ static ExportVisitor() } private readonly bool _forCompletion; + internal List DiscoveredExports { get; set; } internal List DiscoveredModules { get; set; } internal Dictionary DiscoveredFunctions { get; set; } diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 27c3af3fc60..2c4396de1c4 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -926,6 +926,7 @@ private bool InitShouldLogPipelineExecutionDetail() /// the cmdlet. Semantically this is equivalent to : cmd | % { $pipelineVariable = $_; (...) } /// internal string PipelineVariable { get; set; } + private PSVariable _pipelineVarReference = null; internal void SetupOutVariable() diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index 4079669d94b..6a51580922f 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -173,6 +173,7 @@ public abstract class PSMemberInfo { internal object instance; internal string name; + internal bool ShouldSerialize { get; set; } internal virtual void ReplicateInstance(object particularInstance) diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index 79824980475..12a677bdd72 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -424,6 +424,7 @@ private void CommonInitialization(object obj) #region Adapter Mappings private static readonly ConcurrentDictionary s_adapterMapping = new ConcurrentDictionary(); + private static readonly List> s_adapterSetMappers = new List> { MappedInternalAdapterSet @@ -647,6 +648,7 @@ internal static PSObject ConstructPSObjectFromSerializationInfo(SerializationInf private static readonly AdapterSet s_dotNetInstanceAdapterSet = new AdapterSet(DotNetInstanceAdapter, null); private static readonly AdapterSet s_mshMemberSetAdapter = new AdapterSet(new PSMemberSetAdapter(), null); private static readonly AdapterSet s_mshObjectAdapter = new AdapterSet(new PSObjectAdapter(), null); + private static readonly PSObject.AdapterSet s_cimInstanceAdapter = new PSObject.AdapterSet(new ThirdPartyAdapter(typeof(Microsoft.Management.Infrastructure.CimInstance), new Microsoft.PowerShell.Cim.CimInstanceAdapter()), diff --git a/src/System.Management.Automation/engine/NativeCommand.cs b/src/System.Management.Automation/engine/NativeCommand.cs index 417e257f548..822d4cf82d9 100644 --- a/src/System.Management.Automation/engine/NativeCommand.cs +++ b/src/System.Management.Automation/engine/NativeCommand.cs @@ -11,6 +11,7 @@ namespace System.Management.Automation internal sealed class NativeCommand : InternalCommand { private NativeCommandProcessor _myCommandProcessor; + internal NativeCommandProcessor MyCommandProcessor { get { return _myCommandProcessor; } diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index ef9053faf8f..f4ef83bab88 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -817,6 +817,7 @@ internal struct ProcessWithParentId { public Process OriginalProcessInstance; private int _parentId; + public int ParentId { get @@ -1407,8 +1408,10 @@ private struct SHFILEINFO public IntPtr hIcon; public int iIcon; public uint dwAttributes; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string szDisplayName; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szTypeName; }; @@ -2139,6 +2142,7 @@ protected RemoteException(SerializationInfo info, StreamingContext context) [NonSerialized] private PSObject _serializedRemoteException; + [NonSerialized] private PSObject _serializedRemoteInvocationInfo; diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 78e907af5c0..b1cbdf2a1cb 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -39,6 +39,7 @@ public class PSVersionInfo internal const string PSOSName = "OS"; internal const string SerializationVersionName = "SerializationVersion"; internal const string WSManStackVersionName = "WSManStackVersion"; + private static readonly PSVersionHashTable s_psVersionTable; /// @@ -350,6 +351,7 @@ internal static SemanticVersion PSCurrentVersion public sealed class PSVersionHashTable : Hashtable, IEnumerable { private static readonly PSVersionTableComparer s_keysComparer = new PSVersionTableComparer(); + internal PSVersionHashTable(IEqualityComparer equalityComparer) : base(equalityComparer) { } @@ -429,6 +431,7 @@ public sealed class SemanticVersion : IComparable, IComparable, private const string PreLabelPropertyName = "PSSemVerPreReleaseLabel"; private const string BuildLabelPropertyName = "PSSemVerBuildLabel"; private const string TypeNameForVersionWithLabel = "System.Version#IncludeLabel"; + private string versionString; /// diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index d6ecd705a30..9823c090c48 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -904,6 +904,7 @@ private bool ShouldContinueUncoercedBind( /// The invocation information for the code that is being bound. /// private InvocationInfo _invocationInfo; + internal InvocationInfo InvocationInfo { get @@ -916,6 +917,7 @@ internal InvocationInfo InvocationInfo /// The context of the currently running engine. /// private ExecutionContext _context; + internal ExecutionContext Context { get @@ -928,6 +930,7 @@ internal ExecutionContext Context /// An instance of InternalCommand that the binder is binding to. /// private InternalCommand _command; + internal InternalCommand Command { get diff --git a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs index ed6421ea77d..3e5dcab2502 100644 --- a/src/System.Management.Automation/engine/ReflectionParameterBinder.cs +++ b/src/System.Management.Automation/engine/ReflectionParameterBinder.cs @@ -216,6 +216,7 @@ static ReflectionParameterBinder() private static readonly ConcurrentDictionary, Func> s_getterMethods = new ConcurrentDictionary, Func>(); + private static readonly ConcurrentDictionary, Action> s_setterMethods = new ConcurrentDictionary, Action>(); diff --git a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs index cdba3bad0a2..89e898a5532 100644 --- a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs +++ b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs @@ -66,6 +66,7 @@ protected ScriptCommandProcessorBase(IScriptCommandInfo commandInfo, ExecutionCo protected ScriptBlock _scriptBlock; private ScriptParameterBinderController _scriptParameterBinderController; + internal ScriptParameterBinderController ScriptParameterBinderController { get diff --git a/src/System.Management.Automation/engine/SessionStateScope.cs b/src/System.Management.Automation/engine/SessionStateScope.cs index 382df13dd1d..434d1e0d929 100644 --- a/src/System.Management.Automation/engine/SessionStateScope.cs +++ b/src/System.Management.Automation/engine/SessionStateScope.cs @@ -1711,6 +1711,7 @@ private Dictionary GetAutomountedDrives() private Dictionary _automountedDrives; private Dictionary _variables; + private Dictionary GetPrivateVariables() { if (_variables == null) diff --git a/src/System.Management.Automation/engine/ShellVariable.cs b/src/System.Management.Automation/engine/ShellVariable.cs index fd2b8b34a6d..4be5a96f52b 100644 --- a/src/System.Management.Automation/engine/ShellVariable.cs +++ b/src/System.Management.Automation/engine/ShellVariable.cs @@ -688,6 +688,7 @@ internal virtual void SetValueRaw(object newValue, bool preserveValueTypeSemanti private readonly CallSite> _copyMutableValueSite = CallSite>.Create(PSVariableAssignmentBinder.Get()); + internal object CopyMutableValues(object o) { // The variable assignment binder copies mutable values and returns other values as is. diff --git a/src/System.Management.Automation/engine/SpecialVariables.cs b/src/System.Management.Automation/engine/SpecialVariables.cs index fb6a762dfe6..5c4c4ba2f49 100644 --- a/src/System.Management.Automation/engine/SpecialVariables.cs +++ b/src/System.Management.Automation/engine/SpecialVariables.cs @@ -21,190 +21,247 @@ namespace System.Management.Automation internal static class SpecialVariables { internal const string HistorySize = "MaximumHistoryCount"; + internal static readonly VariablePath HistorySizeVarPath = new VariablePath(HistorySize); internal const string MyInvocation = "MyInvocation"; + internal static readonly VariablePath MyInvocationVarPath = new VariablePath(MyInvocation); internal const string OFS = "OFS"; + internal static readonly VariablePath OFSVarPath = new VariablePath(OFS); internal const string OutputEncoding = "OutputEncoding"; + internal static readonly VariablePath OutputEncodingVarPath = new VariablePath(OutputEncoding); internal const string VerboseHelpErrors = "VerboseHelpErrors"; + internal static readonly VariablePath VerboseHelpErrorsVarPath = new VariablePath(VerboseHelpErrors); #region Logging Variables internal const string LogEngineHealthEvent = "LogEngineHealthEvent"; + internal static readonly VariablePath LogEngineHealthEventVarPath = new VariablePath(LogEngineHealthEvent); internal const string LogEngineLifecycleEvent = "LogEngineLifecycleEvent"; + internal static readonly VariablePath LogEngineLifecycleEventVarPath = new VariablePath(LogEngineLifecycleEvent); internal const string LogCommandHealthEvent = "LogCommandHealthEvent"; + internal static readonly VariablePath LogCommandHealthEventVarPath = new VariablePath(LogCommandHealthEvent); internal const string LogCommandLifecycleEvent = "LogCommandLifecycleEvent"; + internal static readonly VariablePath LogCommandLifecycleEventVarPath = new VariablePath(LogCommandLifecycleEvent); internal const string LogProviderHealthEvent = "LogProviderHealthEvent"; + internal static readonly VariablePath LogProviderHealthEventVarPath = new VariablePath(LogProviderHealthEvent); internal const string LogProviderLifecycleEvent = "LogProviderLifecycleEvent"; + internal static readonly VariablePath LogProviderLifecycleEventVarPath = new VariablePath(LogProviderLifecycleEvent); internal const string LogSettingsEvent = "LogSettingsEvent"; + internal static readonly VariablePath LogSettingsEventVarPath = new VariablePath(LogSettingsEvent); internal const string PSLogUserData = "PSLogUserData"; + internal static readonly VariablePath PSLogUserDataPath = new VariablePath(PSLogUserData); #endregion Logging Variables internal const string NestedPromptLevel = "NestedPromptLevel"; + internal static readonly VariablePath NestedPromptCounterVarPath = new VariablePath("global:" + NestedPromptLevel); internal const string CurrentlyExecutingCommand = "CurrentlyExecutingCommand"; + internal static readonly VariablePath CurrentlyExecutingCommandVarPath = new VariablePath(CurrentlyExecutingCommand); internal const string PSBoundParameters = "PSBoundParameters"; + internal static readonly VariablePath PSBoundParametersVarPath = new VariablePath(PSBoundParameters); internal const string Matches = "Matches"; + internal static readonly VariablePath MatchesVarPath = new VariablePath(Matches); internal const string LastExitCode = "LASTEXITCODE"; + internal static readonly VariablePath LastExitCodeVarPath = new VariablePath("global:" + LastExitCode); internal const string PSDebugContext = "PSDebugContext"; + internal static readonly VariablePath PSDebugContextVarPath = new VariablePath(PSDebugContext); internal const string StackTrace = "StackTrace"; + internal static readonly VariablePath StackTraceVarPath = new VariablePath("global:" + StackTrace); internal const string FirstToken = "^"; + internal static readonly VariablePath FirstTokenVarPath = new VariablePath("global:" + FirstToken); internal const string LastToken = "$"; + internal static readonly VariablePath LastTokenVarPath = new VariablePath("global:" + LastToken); internal static bool IsUnderbar(string name) { return name.Length == 1 && name[0] == '_'; } internal const string PSItem = "PSItem"; // simple alias for $_ internal const string Underbar = "_"; + internal static readonly VariablePath UnderbarVarPath = new VariablePath(Underbar); internal const string Question = "?"; + internal static readonly VariablePath QuestionVarPath = new VariablePath(Question); internal const string Args = "args"; + internal static readonly VariablePath ArgsVarPath = new VariablePath("local:" + Args); internal const string This = "this"; + internal static readonly VariablePath ThisVarPath = new VariablePath("this"); internal const string Input = "input"; + internal static readonly VariablePath InputVarPath = new VariablePath("local:" + Input); internal const string PSCmdlet = "PSCmdlet"; + internal static readonly VariablePath PSCmdletVarPath = new VariablePath("PSCmdlet"); internal const string Error = "error"; + internal static readonly VariablePath ErrorVarPath = new VariablePath("global:" + Error); internal const string EventError = "error"; + internal static readonly VariablePath EventErrorVarPath = new VariablePath("script:" + EventError); #if !UNIX internal const string PathExt = "env:PATHEXT"; + internal static readonly VariablePath PathExtVarPath = new VariablePath(PathExt); #endif internal const string PSEmailServer = "PSEmailServer"; + internal static readonly VariablePath PSEmailServerVarPath = new VariablePath(PSEmailServer); internal const string PSDefaultParameterValues = "PSDefaultParameterValues"; + internal static readonly VariablePath PSDefaultParameterValuesVarPath = new VariablePath(PSDefaultParameterValues); internal const string PSScriptRoot = "PSScriptRoot"; + internal static readonly VariablePath PSScriptRootVarPath = new VariablePath(PSScriptRoot); internal const string PSCommandPath = "PSCommandPath"; + internal static readonly VariablePath PSCommandPathVarPath = new VariablePath(PSCommandPath); internal const string PSSenderInfo = "PSSenderInfo"; + internal static readonly VariablePath PSSenderInfoVarPath = new VariablePath(PSSenderInfo); internal const string @foreach = "foreach"; + internal static readonly VariablePath foreachVarPath = new VariablePath("local:" + @foreach); internal const string @switch = "switch"; + internal static readonly VariablePath switchVarPath = new VariablePath("local:" + @switch); internal const string pwd = "PWD"; + internal static VariablePath PWDVarPath = new VariablePath("global:" + pwd); internal const string Null = "null"; + internal static VariablePath NullVarPath = new VariablePath("null"); internal const string True = "true"; + internal static VariablePath TrueVarPath = new VariablePath("true"); internal const string False = "false"; + internal static VariablePath FalseVarPath = new VariablePath("false"); internal const string PSModuleAutoLoading = "PSModuleAutoLoadingPreference"; + internal static VariablePath PSModuleAutoLoadingPreferenceVarPath = new VariablePath("global:" + PSModuleAutoLoading); #region Platform Variables internal const string IsLinux = "IsLinux"; + internal static VariablePath IsLinuxPath = new VariablePath("IsLinux"); internal const string IsMacOS = "IsMacOS"; + internal static VariablePath IsMacOSPath = new VariablePath("IsMacOS"); internal const string IsWindows = "IsWindows"; + internal static VariablePath IsWindowsPath = new VariablePath("IsWindows"); internal const string IsCoreCLR = "IsCoreCLR"; + internal static VariablePath IsCoreCLRPath = new VariablePath("IsCoreCLR"); #endregion #region Preference Variables internal const string DebugPreference = "DebugPreference"; + internal static readonly VariablePath DebugPreferenceVarPath = new VariablePath(DebugPreference); internal const string ErrorActionPreference = "ErrorActionPreference"; + internal static readonly VariablePath ErrorActionPreferenceVarPath = new VariablePath(ErrorActionPreference); internal const string ProgressPreference = "ProgressPreference"; + internal static readonly VariablePath ProgressPreferenceVarPath = new VariablePath(ProgressPreference); internal const string VerbosePreference = "VerbosePreference"; + internal static readonly VariablePath VerbosePreferenceVarPath = new VariablePath(VerbosePreference); internal const string WarningPreference = "WarningPreference"; + internal static readonly VariablePath WarningPreferenceVarPath = new VariablePath(WarningPreference); internal const string WhatIfPreference = "WhatIfPreference"; + internal static readonly VariablePath WhatIfPreferenceVarPath = new VariablePath(WhatIfPreference); internal const string ConfirmPreference = "ConfirmPreference"; + internal static readonly VariablePath ConfirmPreferenceVarPath = new VariablePath(ConfirmPreference); internal const string InformationPreference = "InformationPreference"; + internal static readonly VariablePath InformationPreferenceVarPath = new VariablePath(InformationPreference); #endregion Preference Variables internal const string ErrorView = "ErrorView"; + internal static readonly VariablePath ErrorViewVarPath = new VariablePath(ErrorView); /// /// Shell environment variable. /// internal const string PSSessionConfigurationName = "PSSessionConfigurationName"; + internal static readonly VariablePath PSSessionConfigurationNameVarPath = new VariablePath("global:" + PSSessionConfigurationName); /// @@ -212,6 +269,7 @@ internal static class SpecialVariables /// application name for the connection uri. /// internal const string PSSessionApplicationName = "PSSessionApplicationName"; + internal static readonly VariablePath PSSessionApplicationNameVarPath = new VariablePath("global:" + PSSessionApplicationName); #region AllScope variables created in every session diff --git a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs index 6dbf181051a..3867f4773b3 100644 --- a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs @@ -12,6 +12,7 @@ namespace System.Management.Automation.Runspaces public sealed partial class TypeTable { private const int ValueFactoryCacheCount = 6; + private static readonly Func>[] s_valueFactoryCache; private static Func> GetValueFactoryBasedOnInitCapacity(int capacity) diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index a188a091e34..14b7f9d55bf 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -485,6 +485,7 @@ internal static string GetWindowsPowerShellVersionFromRegistry() #endif internal static string DefaultPowerShellAppBase => GetApplicationBase(DefaultPowerShellShellID); + internal static string GetApplicationBase(string shellId) { // Use the location of SMA.dll as the application base. @@ -1826,6 +1827,7 @@ private static void WriteVerbose(PowerShell ps, string msg) } private const string WhereObjectCommandAlias = "?"; + private static bool TryGetCommandInfoList(PowerShell ps, HashSet commandNames, out Collection cmdInfoList) { if (commandNames.Count == 0) @@ -1877,6 +1879,7 @@ internal class PipelineForBatchingChecker : AstVisitor { internal readonly HashSet ValidVariables = new HashSet(StringComparer.OrdinalIgnoreCase); internal readonly HashSet Commands = new HashSet(StringComparer.OrdinalIgnoreCase); + internal ScriptBlockAst ScriptBeingConverted { get; set; } public override AstVisitAction VisitVariableExpression(VariableExpressionAst variableExpressionAst) diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index 0bc4595c390..6355b0d83e5 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -1072,6 +1072,7 @@ internal override bool IsDebuggerSteppingEnabled } private bool? _isLocalSession; + private bool IsLocalSession { get @@ -1723,8 +1724,10 @@ internal void Clear() // Runspace debugger integration. private Dictionary _runningRunspaces; + private const int _jobCallStackOffset = 2; private const int _runspaceCallStackOffset = 1; + private bool _preserveUnhandledDebugStopEvent; private ManualResetEventSlim _preserveDebugStopEvent; diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index fef195ac1a2..a57b2d4a626 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -1672,6 +1672,7 @@ internal SessionStateProxy() } private RunspaceBase _runspace; + internal SessionStateProxy(RunspaceBase runspace) { Dbg.Assert(runspace != null, "Caller should validate the parameter"); diff --git a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs index c8d997d0808..9325f95ccad 100644 --- a/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs +++ b/src/System.Management.Automation/engine/hostifaces/InformationalRecord.cs @@ -158,6 +158,7 @@ internal virtual void ToPSObjectForRemoting(PSObject psObject) [DataMember()] private string _message; + private InvocationInfo _invocationInfo; private ReadOnlyCollection _pipelineIterationInfo; private bool _serializeExtendedInfo; diff --git a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs index da0877747de..93cd99d92b6 100644 --- a/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs +++ b/src/System.Management.Automation/engine/hostifaces/LocalPipeline.cs @@ -1320,6 +1320,7 @@ internal PipelineStopper(LocalPipeline localPipeline) /// This is set true when stop is called. /// private bool _stopping; + internal bool IsStopping { get diff --git a/src/System.Management.Automation/engine/hostifaces/MshHost.cs b/src/System.Management.Automation/engine/hostifaces/MshHost.cs index 356e2adb03f..0c5ef87436f 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHost.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHost.cs @@ -41,6 +41,7 @@ public abstract class PSHost /// The powershell spec states that 128 is the maximum nesting depth. /// internal const int MaximumNestedPromptLevel = 128; + internal static bool IsStdOutputRedirected; /// diff --git a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs index 0add6221a5a..2efd4d3c154 100644 --- a/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs +++ b/src/System.Management.Automation/engine/hostifaces/MshHostUserInterface.cs @@ -415,12 +415,16 @@ internal void IgnoreCommand(string commandText, InvocationInfo invocation) /// make it to the actual host. /// internal bool TranscribeOnly => Interlocked.CompareExchange(ref _transcribeOnlyCount, 0, 0) != 0; + private int _transcribeOnlyCount = 0; + internal IDisposable SetTranscribeOnly() => new TranscribeOnlyCookie(this); + private sealed class TranscribeOnlyCookie : IDisposable { private PSHostUserInterface _ui; private bool _disposed = false; + public TranscribeOnlyCookie(PSHostUserInterface ui) { _ui = ui; @@ -974,6 +978,7 @@ internal static TranscriptionOption GetSystemTranscriptOption(TranscriptionOptio internal static TranscriptionOption systemTranscript = null; private static object s_systemTranscriptLock = new object(); + private static Lazy s_transcriptionSettingCache = new Lazy( () => Utils.GetPolicySetting(Utils.SystemWideThenCurrentUserConfig), isThreadSafe: true); diff --git a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs index 58268db59e5..ae97cd8e334 100644 --- a/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs +++ b/src/System.Management.Automation/engine/hostifaces/RunspacePool.cs @@ -506,6 +506,7 @@ public sealed class RunspacePool : IDisposable private RunspacePoolInternal _internalPool; private object _syncObject = new object(); + private event EventHandler InternalStateChanged = null; private event EventHandler InternalForwardEvent = null; private event EventHandler InternalRunspaceCreated = null; diff --git a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs index 1c2523874c1..56aca65df37 100644 --- a/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs +++ b/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs @@ -253,6 +253,7 @@ public override string ToString() internal sealed class GotoInstruction : IndexedBranchInstruction { private const int Variants = 4; + private static readonly GotoInstruction[] s_cache = new GotoInstruction[Variants * CacheSize]; private readonly bool _hasResult; diff --git a/src/System.Management.Automation/engine/interpreter/InterpretedFrame.cs b/src/System.Management.Automation/engine/interpreter/InterpretedFrame.cs index 3e15b1fbba4..d4d6923da81 100644 --- a/src/System.Management.Automation/engine/interpreter/InterpretedFrame.cs +++ b/src/System.Management.Automation/engine/interpreter/InterpretedFrame.cs @@ -35,6 +35,7 @@ internal sealed class InterpretedFrame [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] private int[] _continuations; + private int _continuationIndex; private int _pendingContinuation; private object _pendingValue; diff --git a/src/System.Management.Automation/engine/interpreter/Interpreter.cs b/src/System.Management.Automation/engine/interpreter/Interpreter.cs index 622364184e0..8afdfe69b3d 100644 --- a/src/System.Management.Automation/engine/interpreter/Interpreter.cs +++ b/src/System.Management.Automation/engine/interpreter/Interpreter.cs @@ -31,6 +31,7 @@ namespace System.Management.Automation.Interpreter internal sealed class Interpreter { internal static readonly object NoValue = new object(); + internal const int RethrowOnReturn = Int32.MaxValue; // zero: sync compilation diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index 2ea3258120f..baba0a41fa4 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -375,6 +375,7 @@ internal class HybridReferenceDictionary where TKey : class private KeyValuePair[] _keysAndValues; private Dictionary _dict; private int _count; + private const int _arraySize = 10; public HybridReferenceDictionary() diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index d2203f8b90e..44eed05e518 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -278,6 +278,7 @@ static ParserOps() private const int _MinCache = -100; private const int _MaxCache = 1000; + private static readonly object[] s_integerCache = new object[_MaxCache - _MinCache]; private static readonly string[] s_chars = new string[255]; internal static readonly object _TrueObject = (object)true; @@ -1639,12 +1640,14 @@ internal static object CallMethod( internal class RangeEnumerator : IEnumerator { private int _lowerBound; + internal int LowerBound { get { return _lowerBound; } } private int _upperBound; + internal int UpperBound { get { return _upperBound; } diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index e787c9e9f9b..07e36bcdf75 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -169,6 +169,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo ExceptionHandlingOps_ConvertToMethodInvocationException = typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.ConvertToMethodInvocationException), StaticFlags); + internal static readonly MethodInfo ExceptionHandlingOps_FindMatchingHandler = typeof(ExceptionHandlingOps).GetMethod(nameof(ExceptionHandlingOps.FindMatchingHandler), StaticFlags); @@ -221,14 +222,19 @@ internal static class CachedReflectionInfo internal static readonly FieldInfo FunctionContext__currentSequencePointIndex = typeof(FunctionContext).GetField(nameof(FunctionContext._currentSequencePointIndex), InstanceFlags); + internal static readonly FieldInfo FunctionContext__executionContext = typeof(FunctionContext).GetField(nameof(FunctionContext._executionContext), InstanceFlags); + internal static readonly FieldInfo FunctionContext__functionName = typeof(FunctionContext).GetField(nameof(FunctionContext._functionName), InstanceFlags); + internal static readonly FieldInfo FunctionContext__localsTuple = typeof(FunctionContext).GetField(nameof(FunctionContext._localsTuple), InstanceFlags); + internal static readonly FieldInfo FunctionContext__outputPipe = typeof(FunctionContext).GetField(nameof(FunctionContext._outputPipe), InstanceFlags); + internal static readonly MethodInfo FunctionContext_PopTrapHandlers = typeof(FunctionContext).GetMethod(nameof(FunctionContext.PopTrapHandlers), InstanceFlags); @@ -275,13 +281,16 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo InterpreterError_NewInterpreterException = typeof(InterpreterError).GetMethod(nameof(InterpreterError.NewInterpreterException), StaticFlags); + internal static readonly MethodInfo InterpreterError_NewInterpreterExceptionWithInnerException = typeof(InterpreterError).GetMethod(nameof(InterpreterError.NewInterpreterExceptionWithInnerException), StaticFlags); internal static readonly MethodInfo LanguagePrimitives_GetInvalidCastMessages = typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.GetInvalidCastMessages), StaticFlags); + internal static readonly MethodInfo LanguagePrimitives_IsNull = typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.IsNull), StaticFlags); + internal static readonly MethodInfo LanguagePrimitives_ThrowInvalidCastException = typeof(LanguagePrimitives).GetMethod(nameof(LanguagePrimitives.ThrowInvalidCastException), StaticFlags); @@ -455,6 +464,7 @@ internal static class CachedReflectionInfo internal static readonly MethodInfo PSScriptProperty_InvokeGetter = typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeGetter), InstanceFlags); + internal static readonly MethodInfo PSScriptProperty_InvokeSetter = typeof(PSScriptProperty).GetMethod(nameof(PSScriptProperty.InvokeSetter), InstanceFlags); @@ -658,6 +668,7 @@ internal static class ExpressionCache internal static readonly Expression CatchAllType = Expression.Constant(typeof(ExceptionHandlingOps.CatchAll), typeof(Type)); // Empty expression is used at the end of blocks to give them the void expression result internal static readonly Expression Empty = Expression.Empty(); + internal static Expression GetExecutionContextFromTLS = Expression.Call(CachedReflectionInfo.LocalPipeline_GetExecutionContextFromTLS); @@ -804,8 +815,10 @@ internal class Compiler : ICustomAstVisitor2 private static readonly CatchBlock[] s_stmtCatchHandlers; internal static readonly Type DottedLocalsTupleType = MutableTuple.MakeTupleType(SpecialVariables.AutomaticVariableTypes); + internal static readonly Dictionary DottedLocalsNameIndexMap = new Dictionary(SpecialVariables.AutomaticVariableTypes.Length, StringComparer.OrdinalIgnoreCase); + internal static readonly Dictionary DottedScriptCmdletLocalsNameIndexMap = new Dictionary( SpecialVariables.AutomaticVariableTypes.Length + SpecialVariables.PreferenceVariableTypes.Length, diff --git a/src/System.Management.Automation/engine/parser/PSType.cs b/src/System.Management.Automation/engine/parser/PSType.cs index 1feb951d7b4..1064e7a0d10 100644 --- a/src/System.Management.Automation/engine/parser/PSType.cs +++ b/src/System.Management.Automation/engine/parser/PSType.cs @@ -20,11 +20,13 @@ internal class TypeDefiner internal const string DynamicClassAssemblyFullNamePrefix = "PowerShell Class Assembly,"; private static int s_globalCounter = 0; + private static readonly CustomAttributeBuilder s_hiddenCustomAttributeBuilder = new CustomAttributeBuilder(typeof(HiddenAttribute).GetConstructor(Type.EmptyTypes), Array.Empty()); private static readonly string s_sessionStateKeeperFieldName = "__sessionStateKeeper"; internal static readonly string SessionStateFieldName = "__sessionState"; + private static readonly MethodInfo s_sessionStateKeeper_GetSessionState = typeof(SessionStateKeeper).GetMethod("GetSessionState", BindingFlags.Instance | BindingFlags.Public); @@ -1298,6 +1300,7 @@ private static IEnumerable GetAssemblyAttributeBuilders( } private static int counter = 0; + internal static Assembly DefineTypes(Parser parser, Ast rootAst, TypeDefinitionAst[] typeDefinitions) { Diagnostics.Assert(rootAst.Parent == null, "Caller should only define types from the root ast"); diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index 845b7f89e47..df95f478075 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -39,6 +39,7 @@ public sealed class Parser private ParseMode _parseMode; internal string _fileName; + internal bool ProduceV2Tokens { get; set; } internal const string VERBATIM_ARGUMENT = "--%"; @@ -8083,6 +8084,7 @@ public override string ToString() internal class ParserEventSource : EventSource { internal static ParserEventSource Log = new ParserEventSource(); + internal const int MaxScriptLengthToLog = 50; public void ParseStart(string FileName, int Length) { WriteEvent(1, FileName, Length); } diff --git a/src/System.Management.Automation/engine/parser/SafeValues.cs b/src/System.Management.Automation/engine/parser/SafeValues.cs index d91ec35356d..37320de83d1 100644 --- a/src/System.Management.Automation/engine/parser/SafeValues.cs +++ b/src/System.Management.Automation/engine/parser/SafeValues.cs @@ -64,6 +64,7 @@ internal bool IsAstSafe(Ast ast) // This is a check of the number of visits private uint _visitCount = 0; + private const uint MaxVisitCount = 5000; private const int MaxHashtableKeyCount = 500; diff --git a/src/System.Management.Automation/engine/parser/SemanticChecks.cs b/src/System.Management.Automation/engine/parser/SemanticChecks.cs index 9068a60722b..b7d3bdb8bc8 100644 --- a/src/System.Management.Automation/engine/parser/SemanticChecks.cs +++ b/src/System.Management.Automation/engine/parser/SemanticChecks.cs @@ -18,15 +18,18 @@ namespace System.Management.Automation.Language internal class SemanticChecks : AstVisitor2, IAstPostVisitHandler { private readonly Parser _parser; + private static readonly IsConstantValueVisitor s_isConstantAttributeArgVisitor = new IsConstantValueVisitor { CheckingAttributeArgument = true, }; + private static readonly IsConstantValueVisitor s_isConstantAttributeArgForClassVisitor = new IsConstantValueVisitor { CheckingAttributeArgument = true, CheckingClassAttributeArguments = true }; + private readonly Stack _memberScopeStack; private readonly Stack _scopeStack; diff --git a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs index 4cae1d361d2..8b0ab3249df 100644 --- a/src/System.Management.Automation/engine/parser/VariableAnalysis.cs +++ b/src/System.Management.Automation/engine/parser/VariableAnalysis.cs @@ -37,6 +37,7 @@ internal VariableAnalysisDetails() internal class FindAllVariablesVisitor : AstVisitor { private static readonly HashSet s_hashOfPessimizingCmdlets = new HashSet(StringComparer.OrdinalIgnoreCase); + private static readonly string[] s_pessimizingCmdlets = new string[] { "New-Variable", @@ -107,6 +108,7 @@ internal static Dictionary Visit(IParameterMeta } private bool _disableOptimizations; + private readonly Dictionary _variables = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -251,6 +253,7 @@ public override AstVisitAction VisitVariableExpression(VariableExpressionAst var } private int _runtimeUsingIndex; + public override AstVisitAction VisitUsingExpression(UsingExpressionAst usingExpressionAst) { // On the local machine, we may have set the index because of a call to ScriptBlockToPowerShell or Invoke-Command. @@ -353,6 +356,7 @@ private class Block internal object _visitData; internal bool _throws; internal bool _returns; + internal bool _unreachable { get; private set; } // Only Entry block, that can be constructed via NewEntryBlock() is reachable initially. diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index 8877109a51c..be4bfc6b1bc 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -58,6 +58,7 @@ internal interface IParameterMetadataProvider IEnumerable GetExperimentalAttributes(); bool UsesCmdletBinding(); + ReadOnlyCollection Parameters { get; } ScriptBlockAst Body { get; } @@ -66,6 +67,7 @@ internal interface IParameterMetadataProvider PowerShell GetPowerShell(ExecutionContext context, Dictionary variables, bool isTrustedInput, bool filterNonUsingVariables, bool? createLocalScope, params object[] args); + string GetWithInputHandlingForInvokeCommand(); /// @@ -693,10 +695,13 @@ public class ScriptRequirements { internal static readonly ReadOnlyCollection EmptySnapinCollection = Utils.EmptyReadOnlyCollection(); + internal static readonly ReadOnlyCollection EmptyAssemblyCollection = Utils.EmptyReadOnlyCollection(); + internal static readonly ReadOnlyCollection EmptyModuleCollection = Utils.EmptyReadOnlyCollection(); + internal static readonly ReadOnlyCollection EmptyEditionCollection = Utils.EmptyReadOnlyCollection(); @@ -760,6 +765,7 @@ public class ScriptBlockAst : Ast, IParameterMetadataProvider { private static readonly ReadOnlyCollection s_emptyAttributeList = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyUsingStatementList = Utils.EmptyReadOnlyCollection(); @@ -1603,6 +1609,7 @@ public class ParamBlockAst : Ast { private static readonly ReadOnlyCollection s_emptyAttributeList = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyParameterList = Utils.EmptyReadOnlyCollection(); @@ -2000,6 +2007,7 @@ public class AttributeAst : AttributeBaseAst { private static readonly ReadOnlyCollection s_emptyPositionalArguments = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyNamedAttributeArguments = Utils.EmptyReadOnlyCollection(); @@ -2514,8 +2522,10 @@ public class TypeDefinitionAst : StatementAst { private static readonly ReadOnlyCollection s_emptyAttributeList = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyMembersCollection = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyBaseTypesCollection = Utils.EmptyReadOnlyCollection(); @@ -3187,6 +3197,7 @@ public class FunctionMemberAst : MemberAst, IParameterMetadataProvider { private static readonly ReadOnlyCollection s_emptyAttributeList = Utils.EmptyReadOnlyCollection(); + private static readonly ReadOnlyCollection s_emptyParameterList = Utils.EmptyReadOnlyCollection(); @@ -6751,6 +6762,7 @@ private static IEnumerable ConfigurationBuildInParameters } private static List s_configurationBuildInParameters; + private static IEnumerable ConfigurationBuildInParameterAttribAsts { get @@ -6931,6 +6943,7 @@ internal DynamicKeyword Keyword } private DynamicKeyword _keyword; + internal Token LCurly { get; set; } internal Token FunctionName { get; set; } internal ExpressionAst InstanceName { get; set; } @@ -6939,6 +6952,7 @@ internal DynamicKeyword Keyword internal string ElementName { get; set; } private PipelineAst _commandCallPipelineAst; + internal PipelineAst GenerateCommandCallPipelineAst() { if (_commandCallPipelineAst != null) diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index ba8fdeac87d..3d15ebf4d81 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -590,6 +590,7 @@ internal class Tokenizer { private static readonly Dictionary s_keywordTable = new Dictionary(StringComparer.OrdinalIgnoreCase); + private static readonly Dictionary s_operatorTable = new Dictionary(StringComparer.OrdinalIgnoreCase); @@ -724,6 +725,7 @@ internal Tokenizer(Parser parser) // TODO: use auto-properties when making 'ternary operator' an official feature. private bool _forceEndNumberOnTernaryOpChars; + internal bool ForceEndNumberOnTernaryOpChars { get { return _forceEndNumberOnTernaryOpChars; } diff --git a/src/System.Management.Automation/engine/pipeline.cs b/src/System.Management.Automation/engine/pipeline.cs index e118bce374d..f6c779282a9 100644 --- a/src/System.Management.Automation/engine/pipeline.cs +++ b/src/System.Management.Automation/engine/pipeline.cs @@ -156,6 +156,7 @@ internal void LogExecutionError(InvocationInfo invocationInfo, ErrorRecord error } private bool _terminatingErrorLogged = false; + internal void LogExecutionException(Exception exception) { _executionFailed = true; @@ -1559,6 +1560,7 @@ internal bool Stopping } private LocalPipeline _localPipeline; + internal LocalPipeline LocalPipeline { get { return _localPipeline; } diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index d04c3a98fba..c867f355158 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -752,6 +752,7 @@ internal class WildcardPatternToRegexParser : WildcardPatternParser private RegexOptions _regexOptions; private const string regexChars = "()[.?*{}^$+|\\"; // ']' is missing on purpose + private static bool IsRegexChar(char ch) { for (int i = 0; i < regexChars.Length; i++) diff --git a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs index 5ae081bc3a7..092eb224e04 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs @@ -924,10 +924,12 @@ private void HandleRobustConnectionNotification( protected bool stopCalled = false; protected PSHost hostToUse; protected RemoteRunspacePoolInternal runspacePool; + protected const string WRITE_DEBUG_LINE = "WriteDebugLine"; protected const string WRITE_VERBOSE_LINE = "WriteVerboseLine"; protected const string WRITE_WARNING_LINE = "WriteWarningLine"; protected const string WRITE_PROGRESS = "WriteProgress"; + protected bool initialized = false; /// /// This queue is for the state change events that resulted in closing the underlying diff --git a/src/System.Management.Automation/engine/remoting/client/Job.cs b/src/System.Management.Automation/engine/remoting/client/Job.cs index 1c8daf5630e..814b547b3df 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job.cs @@ -831,6 +831,7 @@ internal virtual void WriteInformation(InformationRecord informationRecord) } private Lazy _parentActivityId; + internal void SetParentActivityIdGetter(Func parentActivityIdGetter) { Dbg.Assert(parentActivityIdGetter != null, "Caller should verify parentActivityIdGetter != null"); diff --git a/src/System.Management.Automation/engine/remoting/client/Job2.cs b/src/System.Management.Automation/engine/remoting/client/Job2.cs index 7b972cf5a1a..ed9e133059e 100644 --- a/src/System.Management.Automation/engine/remoting/client/Job2.cs +++ b/src/System.Management.Automation/engine/remoting/client/Job2.cs @@ -502,9 +502,11 @@ public sealed class ContainerParentJob : Job2 #region Private Members private const string TraceClassName = "ContainerParentJob"; + private bool _moreData = true; private readonly object _syncObject = new object(); private int _isDisposed = 0; + private const int DisposedTrue = 1; private const int DisposedFalse = 0; // This variable is set to true if atleast one child job failed. @@ -531,6 +533,7 @@ public sealed class ContainerParentJob : Job2 private readonly PSDataCollection _executionError = new PSDataCollection(); private PSEventManager _eventManager; + internal PSEventManager EventManager { get { return _eventManager; } @@ -543,6 +546,7 @@ internal PSEventManager EventManager } private ManualResetEvent _jobRunning; + private ManualResetEvent JobRunning { get @@ -567,6 +571,7 @@ private ManualResetEvent JobRunning } private ManualResetEvent _jobSuspendedOrAborted; + private ManualResetEvent JobSuspendedOrAborted { get diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs index 852579e0c88..99a21bd90eb 100644 --- a/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/client/RemotingProtocol2.cs @@ -876,6 +876,7 @@ private void HandleSessionCreateCompleted(object sender, CreateCompleteEventArgs private int _maxRunspaces; private PSHost _host; private PSPrimitiveDictionary _applicationArguments; + private Dictionary _associatedPowerShellDSHandlers = new Dictionary(); // data structure handlers of all ClientRemotePowerShell which are diff --git a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs index a6ad69843cc..eb3ad0d20f8 100644 --- a/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs +++ b/src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs @@ -201,6 +201,7 @@ internal enum ChildJobFlags private bool _ownerWontSubmitNewChildJobs = false; private readonly HashSet _setOfChildJobsThatCanAddMoreChildJobs = new HashSet(); + private bool IsEndOfChildJobs { get @@ -232,6 +233,7 @@ private bool IsThrottlingJobCompleted private int _countOfFailedChildJobs; private int _countOfStoppedChildJobs; private int _countOfSuccessfullyCompletedChildJobs; + private int CountOfFinishedChildJobs { get @@ -318,6 +320,7 @@ internal void AddChildJobAndPotentiallyBlock( } private bool _alreadyDisabledFlowControlForPendingJobsQueue = false; + internal void DisableFlowControlForPendingJobsQueue() { if (!_cmdletMode || _alreadyDisabledFlowControlForPendingJobsQueue) @@ -343,6 +346,7 @@ internal void DisableFlowControlForPendingJobsQueue() } private bool _alreadyDisabledFlowControlForPendingCmdletActionsQueue = false; + internal void DisableFlowControlForPendingCmdletActionsQueue() { if (!_cmdletMode || _alreadyDisabledFlowControlForPendingCmdletActionsQueue) @@ -448,6 +452,7 @@ private void childJob_ResultsAdded(object sender, DataAddedEventArgs e) private readonly object _alreadyWroteFlowControlBuffersHighMemoryUsageWarningLock = new object(); private bool _alreadyWroteFlowControlBuffersHighMemoryUsageWarning; + private const long FlowControlBuffersHighMemoryUsageThreshold = 30000; private void WriteWarningAboutHighUsageOfFlowControlBuffers(long currentCount) @@ -1153,6 +1158,7 @@ private void ForwardResults(Cmdlet cmdlet) } private bool _stoppedMonitoringAllJobs; + private void StopMonitoringAllJobs() { _cancellationTokenSource.Cancel(); diff --git a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs index 61be515408f..751969d6f82 100644 --- a/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs +++ b/src/System.Management.Automation/engine/remoting/client/remoterunspace.cs @@ -2946,6 +2946,7 @@ private void CheckRemoteBreakpointManagementSupport(string breakpointCommandName internal class RemoteSessionStateProxy : SessionStateProxy { private RemoteRunspace _runspace; + internal RemoteSessionStateProxy(RemoteRunspace runspace) { Dbg.Assert(runspace != null, "Caller should validate the parameter"); diff --git a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs index 42c50b42035..bfabb23b7b7 100644 --- a/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs +++ b/src/System.Management.Automation/engine/remoting/client/remotingprotocolimplementation.cs @@ -17,6 +17,7 @@ internal class ClientRemoteSessionDSHandlerImpl : ClientRemoteSessionDataStructu { [TraceSourceAttribute("CRSDSHdlerImpl", "ClientRemoteSessionDSHandlerImpl")] private static PSTraceSource s_trace = PSTraceSource.GetTracer("CRSDSHdlerImpl", "ClientRemoteSessionDSHandlerImpl"); + private const string resBaseName = "remotingerroridstrings"; private BaseClientSessionTransportManager _transportManager; diff --git a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs index 3a7d1e5a9e4..dde4422de45 100644 --- a/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs +++ b/src/System.Management.Automation/engine/remoting/commands/CustomShellCommands.cs @@ -271,6 +271,7 @@ function Register-PSSessionConfiguration Register-PSSessionConfiguration -filepath $args[0] -pluginName $args[1] -shouldShowUI $args[2] -force $args[3] -whatif:$args[4] -confirm:$args[5] -restartWSManTarget $args[6] -restartWSManAction $args[7] -restartWSManRequired $args[8] -runAsUserName $args[9] -runAsPassword $args[10] -accessMode $args[11] -isSddlSpecified $args[12] -configTableSddl $args[13] -erroraction $args[14] }} "; + private static readonly ScriptBlock s_newPluginSb; private const string pluginXmlFormat = @" @@ -293,6 +294,7 @@ function Register-PSSessionConfiguration {11} "; + private const string architectureAttribFormat = @" Architecture='{0}'"; @@ -310,6 +312,7 @@ function Register-PSSessionConfiguration private const string initParamFormat = @" {2}"; + private const string privateDataFormat = @"{0}"; private const string securityElementFormat = ""; private const string SessionConfigDataFormat = @"{0}"; @@ -1658,6 +1661,7 @@ internal static string UpdateSDDLUsersWithGroupConditional( } private const string DACLPrefix = "D:"; + private static Collection ParseDACLACEs( string sddl, out string prologue, @@ -2518,6 +2522,7 @@ function Unregister-PSSessionConfiguration Unregister-PSSessionConfiguration -filter $args[0] -whatif:$args[1] -confirm:$args[2] -action $args[3] -targetTemplate $args[4] -shellNotErrMsgFormat $args[5] -force $args[6] -erroraction $args[7] }} "; + private static readonly ScriptBlock s_removePluginSb; private bool _isErrorReported; @@ -2787,6 +2792,7 @@ function ExtractPluginProperties([string]$pluginDir, $objectToWriteTo) "; private const string MODULEPATH = "ModulesToImport"; + private static readonly ScriptBlock s_getPluginSb; #endregion @@ -2913,6 +2919,7 @@ public sealed class SetPSSessionConfigurationCommand : PSSessionConfigurationCom 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"; private const string getSessionConfigurationDataSbFormat = @"(Get-Item 'WSMan:\localhost\Plugin\{0}\InitializationParameters\SessionConfigurationData').Value"; + private const string setSessionConfigurationDataSbFormat = @" function Set-SessionConfigurationData([string] $scd) {{ if (test-path 'WSMan:\localhost\Plugin\{0}\InitializationParameters\" + ConfigurationDataFromXML.SESSIONCONFIGTOKEN + @"') @@ -3178,6 +3185,7 @@ function Set-RunAsCredential{{ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5] $args[6] $args[7] $args[8] $args[9] $args[10] $args[11] "; + private const string initParamFormat = @""; private const string privateDataFormat = @"{0}"; @@ -4496,6 +4504,7 @@ function Disable-PSSessionConfiguration $_ | Disable-PSSessionConfiguration -force $args[0] -whatif:$args[1] -confirm:$args[2] -restartWinRMMessage $args[3] -setEnabledTarget $args[4] -setEnabledAction $args[5] -noServiceRestart $args[6] "; + private static ScriptBlock s_disablePluginSb; #endregion @@ -5126,6 +5135,7 @@ function Disable-PSRemoting Disable-PSRemoting -force:$args[0] -queryForSet $args[1] -captionForSet $args[2] -restartWinRMMessage $args[3] -whatif:$args[4] -confirm:$args[5] "; + private static ScriptBlock s_disableRemotingSb; #endregion Private Data diff --git a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs index 86734f85fc4..bd7729acbd4 100644 --- a/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs @@ -2003,6 +2003,7 @@ private void PreProcessStreamObject(PSStreamObject streamObject) private bool _inputStreamClosed = false; private const string InProcParameterSet = "InProcess"; + private PSDataCollection _input = new PSDataCollection(); private bool _needToCollect = false; private bool _needToStartSteppablePipelineOnServer = false; diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs index 963259b91ff..c96f974763d 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs @@ -18,42 +18,52 @@ public class WSManConfigurationOption : PSTransportOption private const string QuotasToken = ""; internal const string AttribOutputBufferingMode = "OutputBufferingMode"; + internal static System.Management.Automation.Runspaces.OutputBufferingMode? DefaultOutputBufferingMode = System.Management.Automation.Runspaces.OutputBufferingMode.Block; private System.Management.Automation.Runspaces.OutputBufferingMode? _outputBufferingMode = null; private const string AttribProcessIdleTimeout = "ProcessIdleTimeoutSec"; + internal static readonly int? DefaultProcessIdleTimeout_ForPSRemoting = 0; // in seconds private int? _processIdleTimeoutSec = null; internal const string AttribMaxIdleTimeout = "MaxIdleTimeoutms"; + internal static readonly int? DefaultMaxIdleTimeout = int.MaxValue; private int? _maxIdleTimeoutSec = null; internal const string AttribIdleTimeout = "IdleTimeoutms"; + internal static readonly int? DefaultIdleTimeout = 7200; // 2 hours in seconds private int? _idleTimeoutSec = null; private const string AttribMaxConcurrentUsers = "MaxConcurrentUsers"; + internal static readonly int? DefaultMaxConcurrentUsers = int.MaxValue; private int? _maxConcurrentUsers = null; private const string AttribMaxProcessesPerSession = "MaxProcessesPerShell"; + internal static readonly int? DefaultMaxProcessesPerSession = int.MaxValue; private int? _maxProcessesPerSession = null; private const string AttribMaxMemoryPerSessionMB = "MaxMemoryPerShellMB"; + internal static readonly int? DefaultMaxMemoryPerSessionMB = int.MaxValue; private int? _maxMemoryPerSessionMB = null; private const string AttribMaxSessions = "MaxShells"; + internal static readonly int? DefaultMaxSessions = int.MaxValue; private int? _maxSessions = null; private const string AttribMaxSessionsPerUser = "MaxShellsPerUser"; + internal static readonly int? DefaultMaxSessionsPerUser = int.MaxValue; private int? _maxSessionsPerUser = null; private const string AttribMaxConcurrentCommandsPerSession = "MaxConcurrentCommandsPerShell"; + internal static readonly int? DefaultMaxConcurrentCommandsPerSession = int.MaxValue; private int? _maxConcurrentCommandsPerSession = null; diff --git a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs index ef9236f5bfd..0abb3c24837 100644 --- a/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs +++ b/src/System.Management.Automation/engine/remoting/commands/PSRemotingCmdlet.cs @@ -673,6 +673,7 @@ public virtual PSSessionOption SessionOption } private PSSessionOption _sessionOption; + internal const string DEFAULT_SESSION_OPTION = "PSSessionOption"; // Quota related variables. diff --git a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs index d6deb965849..aa804f68691 100644 --- a/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/ReceiveJob.cs @@ -1493,6 +1493,7 @@ private void WriteResultsForJobsInCollection(List jobs, bool checkForRecurs } private readonly Dictionary _eventArgsWritten = new Dictionary(); + private void WriteJobStateInformation(Job job, JobStateEventArgs args = null) { // at any point there will be only one thread which will have diff --git a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs index c63e4548e6a..2eed427a6ff 100644 --- a/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/RemoveJob.cs @@ -1013,6 +1013,7 @@ private void HandleStopJobCompleted(object sender, AsyncCompletedEventArgs event private HashSet _pendingJobs = new HashSet(); private readonly ManualResetEvent _waitForJobs = new ManualResetEvent(false); + private readonly Dictionary> _cleanUpActions = new Dictionary>(); diff --git a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs index cdb1da81ed9..7890bdc54f0 100644 --- a/src/System.Management.Automation/engine/remoting/commands/StopJob.cs +++ b/src/System.Management.Automation/engine/remoting/commands/StopJob.cs @@ -253,6 +253,7 @@ var e in private readonly HashSet _pendingJobs = new HashSet(); private readonly ManualResetEvent _waitForJobs = new ManualResetEvent(false); + private readonly Dictionary> _cleanUpActions = new Dictionary>(); diff --git a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs index 16f4af800f7..a20b6163495 100644 --- a/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/newrunspacecommand.cs @@ -1379,6 +1379,7 @@ internal override void StopOperation() // any exceptions thrown on this thread. (ThrottleManager will not respond if it doesn't // get a start/stop complete callback). private List> _internalCallbacks = new List>(); + internal override event EventHandler OperationComplete { add diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 1ae89dfd4ef..2485b857752 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -232,6 +232,7 @@ public int OpenTimeout } private int _openTimeout = DefaultOpenTimeout; + internal const int DefaultOpenTimeout = 3 * 60 * 1000; // 3 minutes internal const int DefaultTimeout = -1; internal const int InfiniteTimeout = 0; @@ -1645,6 +1646,7 @@ public sealed class NamedPipeConnectionInfo : RunspaceConnectionInfo private PSCredential _credential; private AuthenticationMechanism _authMechanism; private string _appDomainName = string.Empty; + private const int _defaultOpenTimeout = 60000; /* 60 seconds. */ #endregion @@ -2704,6 +2706,7 @@ public sealed class VMConnectionInfo : RunspaceConnectionInfo private AuthenticationMechanism _authMechanism; private PSCredential _credential; + private const int _defaultOpenTimeout = 20000; /* 20 seconds. */ #endregion @@ -2833,6 +2836,7 @@ public sealed class ContainerConnectionInfo : RunspaceConnectionInfo private AuthenticationMechanism _authMechanism; private PSCredential _credential; + private const int _defaultOpenTimeout = 20000; /* 20 seconds. */ #endregion diff --git a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs index 72feecefdc9..2ebe434ea04 100644 --- a/src/System.Management.Automation/engine/remoting/common/fragmentor.cs +++ b/src/System.Management.Automation/engine/remoting/common/fragmentor.cs @@ -467,6 +467,7 @@ internal class SerializedDataStream : Stream, IDisposable /// true if data represents EndFragment of an object. /// internal delegate void OnDataAvailableCallback(byte[] data, bool isEndFragment); + private OnDataAvailableCallback _onDataAvailableCallback; #endregion diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 555bc974d1b..9f938ac3d4a 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -784,8 +784,10 @@ private static string private const string configProvidersKeyName = "PSConfigurationProviders"; private const string configProviderApplicationBaseKeyName = "ApplicationBase"; private const string configProviderAssemblyNameKeyName = "AssemblyName"; + private static Dictionary s_ssnStateProviders = new Dictionary(StringComparer.OrdinalIgnoreCase); + private static object s_syncObject = new object(); #endregion @@ -1786,6 +1788,7 @@ private void MergeRoleRulesIntoConfigHash(Func roleVerifier) // Takes the "RoleCapabilities" node in the config hash, and merges its values into the base configuration. private const string PSRCExtension = ".psrc"; + private void MergeRoleCapabilitiesIntoConfigHash() { List psrcFiles = new List(); diff --git a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs index eefe68521b7..4c3961748eb 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/OutOfProcTransportManager.cs @@ -1309,6 +1309,7 @@ internal abstract class HyperVSocketClientSessionTransportManagerBase : OutOfPro #region Data protected RemoteSessionHyperVSocketClient _client; + private const string _threadName = "HyperVSocketTransport Reader Thread"; #endregion @@ -1576,6 +1577,7 @@ internal sealed class SSHClientSessionTransportManager : OutOfProcessClientSessi private StreamReader _stdOutReader; private StreamReader _stdErrReader; private bool _connectionEstablished; + private const string _threadName = "SSHTransport Reader Thread"; #endregion @@ -1986,6 +1988,7 @@ internal sealed class NamedPipeClientSessionTransportManager : NamedPipeClientSe #region Private Data private NamedPipeConnectionInfo _connectionInfo; + private const string _threadName = "NamedPipeTransport Reader Thread"; #endregion @@ -2053,6 +2056,7 @@ internal sealed class ContainerNamedPipeClientSessionTransportManager : NamedPip #region Private Data private ContainerConnectionInfo _connectionInfo; + private const string _threadName = "ContainerNamedPipeTransport Reader Thread"; #endregion diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs index fca6eb12a51..1b1fe2b2163 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs @@ -23,7 +23,9 @@ internal static class WSManNativeApi internal const string ResourceURIPrefix = @"http://schemas.microsoft.com/powershell/"; internal const string NoProfile = "WINRS_NOPROFILE"; internal const string CodePage = "WINRS_CODEPAGE"; + internal static readonly Version WSMAN_STACK_VERSION = new Version(3, 0); + internal const int WSMAN_FLAG_REQUESTED_API_VERSION_1_1 = 1; // WSMan's default max env size in V2 internal const int WSMAN_DEFAULT_MAX_ENVELOPE_SIZE_KB_V2 = 150; @@ -623,6 +625,7 @@ internal class WSManDataStruct internal class WSManBinaryOrTextDataStruct { internal int bufferLength; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] internal IntPtr data; } @@ -633,8 +636,10 @@ internal class WSManBinaryOrTextDataStruct internal class WSManData_ManToUn : IDisposable { private WSManDataStruct _internalData; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _marshalledObject = IntPtr.Zero; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _marshalledBuffer = IntPtr.Zero; @@ -766,6 +771,7 @@ internal class WSManData_UnToMan /// Gets the type of data. /// private uint _type; + internal uint Type { get { return _type; } @@ -777,6 +783,7 @@ internal uint Type /// Gets the buffer length of data. /// private int _bufferLength; + internal int BufferLength { get { return _bufferLength; } @@ -785,6 +792,7 @@ internal int BufferLength } private string _text; + internal string Text { get @@ -797,6 +805,7 @@ internal string Text } private byte[] _data; + internal byte[] Data { get @@ -927,6 +936,7 @@ private struct WSManDWordDataInternal internal struct WSManStreamIDSetStruct { internal int streamIDsCount; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] internal IntPtr streamIDs; } @@ -1081,6 +1091,7 @@ internal struct WSManOptionSetStruct /// [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] internal IntPtr options; + internal bool optionsMustUnderstand; } @@ -1215,11 +1226,13 @@ internal struct WSManCommandArgSet : IDisposable internal struct WSManCommandArgSetInternal { internal int argsCount; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] internal IntPtr args; } private WSManCommandArgSetInternal _internalData; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private MarshalledObject _data; @@ -1547,6 +1560,7 @@ internal struct WSManEnvironmentVariableInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string name; + [MarshalAs(UnmanagedType.LPWStr)] internal string value; } @@ -1722,6 +1736,7 @@ internal struct WSManShellAsyncCallback { // GC handle which prevents garbage collector from collecting this delegate. private GCHandle _gcHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _asyncCallback; @@ -1959,9 +1974,12 @@ private struct WSManReceiveDataResultInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string streamId; + internal WSManDataStruct data; + [MarshalAs(UnmanagedType.LPWStr)] internal string commandState; + internal int exitCode; } @@ -2066,8 +2084,10 @@ private struct WSManPluginRequestInternal /// WSManSenderDetails. /// internal IntPtr senderDetails; + [MarshalAs(UnmanagedType.LPWStr)] internal string locale; + [MarshalAs(UnmanagedType.LPWStr)] internal string resourceUri; /// @@ -2119,6 +2139,7 @@ private struct WSManSenderDetailsInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string senderName; + [MarshalAs(UnmanagedType.LPWStr)] internal string authenticationMechanism; /// @@ -2126,6 +2147,7 @@ private struct WSManSenderDetailsInternal /// internal IntPtr certificateDetails; internal IntPtr clientToken; + [MarshalAs(UnmanagedType.LPWStr)] internal string httpUrl; } @@ -2168,10 +2190,13 @@ private struct WSManCertificateDetailsInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string subject; + [MarshalAs(UnmanagedType.LPWStr)] internal string issuerName; + [MarshalAs(UnmanagedType.LPWStr)] internal string issuerThumbprint; + [MarshalAs(UnmanagedType.LPWStr)] internal string subjectName; } @@ -2228,6 +2253,7 @@ internal struct WSManFragmentInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string path; + [MarshalAs(UnmanagedType.LPWStr)] internal string dialect; } @@ -2240,6 +2266,7 @@ internal struct WSManFilterInternal { [MarshalAs(UnmanagedType.LPWStr)] internal string filter; + [MarshalAs(UnmanagedType.LPWStr)] internal string dialect; } @@ -2299,6 +2326,7 @@ internal struct WSManKeyStruct { [MarshalAs(UnmanagedType.LPWStr)] internal string key; + [MarshalAs(UnmanagedType.LPWStr)] internal string value; } diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs index cd77ccedb82..727c8e231ff 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs @@ -170,6 +170,7 @@ internal sealed class WSManPluginEntryDelegates : IDisposable // Holds the delegate pointers in a structure that has identical layout to the native structure. private WSManPluginEntryDelegatesInternal _unmanagedStruct = new WSManPluginEntryDelegatesInternal(); + internal WSManPluginEntryDelegatesInternal UnmanagedStruct { get { return _unmanagedStruct; } diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs index 9574301f415..035288443a2 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginShellSession.cs @@ -386,6 +386,7 @@ internal void ReportSendOperationComplete() #region Pure virtual methods internal abstract void CloseOperation(WSManPluginOperationShutdownContext context, Exception reasonForClose); + internal abstract void ExecuteConnect( WSManNativeApi.WSManPluginRequest requestDetails, // in int flags, // in diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs index b8e5b127f64..39999788162 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs @@ -321,10 +321,13 @@ internal CompletionEventArgs(CompletionNotification notification) // operation handles are owned by WSMan [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManSessionHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManShellOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManReceiveOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManSendOperationHandle; // this is used with WSMan callbacks to represent a session transport manager. @@ -451,6 +454,7 @@ private void ProcessShellData(string data) // callbacks. private static Dictionary s_sessionTMHandles = new Dictionary(); + private static long s_sessionTMSeed; // generate unique session id private static long GetNextSessionTMHandleId() @@ -2779,12 +2783,16 @@ internal sealed class WSManClientCommandTransportManager : BaseClientCommandTran // operation handles private IntPtr _wsManShellOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManCmdOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _cmdSignalOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManReceiveOperationHandle; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private IntPtr _wsManSendOperationHandle; // this is used with WSMan callbacks to represent a command transport manager. @@ -4110,6 +4118,7 @@ internal override void Dispose(bool isDisposing) // callbacks. private static Dictionary s_cmdTMHandles = new Dictionary(); + private static long s_cmdTMSeed; // Generate command transport manager unique id diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs index 56d41812a55..5c63ab47008 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRemotingProtocol2.cs @@ -414,6 +414,7 @@ private void HandleRemoveAssociation(object sender, EventArgs e) // runspace pool driver handles all client // communication private AbstractServerSessionTransportManager _transportManager; + private Dictionary _associatedShells = new Dictionary(); // powershell data structure handlers associated with this diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index 04f7da23555..13223ae1a41 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -955,6 +955,7 @@ private void HandleCreateAndInvokePowerShell(object _, RemoteDataEventArgs _processPendingEventsQueue = new Queue(); // whether some thread is actively processing events diff --git a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs index fddf9235bd6..cc5dcad1805 100644 --- a/src/System.Management.Automation/engine/runtime/Binding/Binders.cs +++ b/src/System.Management.Automation/engine/runtime/Binding/Binders.cs @@ -1306,6 +1306,7 @@ internal static PSGetDynamicMemberBinder Get(TypeDefinitionAst classScope, bool private readonly bool _static; private readonly Type _classScope; + private PSGetDynamicMemberBinder(Type classScope, bool @static) { _static = @static; @@ -4969,6 +4970,7 @@ static PSGetMemberBinder() internal int _version; private bool _hasInstanceMember; + internal bool HasInstanceMember { get { return _hasInstanceMember; } } internal static void SetHasInstanceMember(string memberName) @@ -5023,6 +5025,7 @@ internal static void SetHasInstanceMember(string memberName) } private bool _hasTypeTableMember; + internal static void TypeTableMemberAdded(string memberName) { var binderList = s_binderCacheIgnoringCase.GetOrAdd(memberName, _ => new List()); diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index 5ffa9cf1af4..6f69be4eb49 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -283,6 +283,7 @@ bool IsScriptBlockInFactASafeHashtable() // We delay parsing scripts loaded on startup, so we save the text. private string _scriptText; + internal IParameterMetadataProvider Ast { get => _ast ?? DelayParseScriptText(); } private IParameterMetadataProvider _ast; @@ -324,6 +325,7 @@ private IParameterMetadataProvider DelayParseScriptText() internal Action UnoptimizedEndBlock { get; set; } internal IScriptExtent[] SequencePoints { get; set; } + private RuntimeDefinedParameterDictionary _runtimeDefinedParameterDictionary; private Attribute[] _attributes; private bool _usesCmdletBinding; @@ -331,6 +333,7 @@ private IParameterMetadataProvider DelayParseScriptText() private bool _compiledUnoptimized; private bool _hasSuspiciousContent; private bool? _isProductCode; + internal bool DebuggerHidden { get; set; } internal bool DebuggerStepThrough { get; set; } internal Guid Id { get; private set; } @@ -555,6 +558,7 @@ protected ScriptBlock(SerializationInfo info, StreamingContext context) private static readonly ConcurrentDictionary, ScriptBlock> s_cachedScripts = new ConcurrentDictionary, ScriptBlock>(); + internal static ScriptBlock TryGetCachedScriptBlock(string fileName, string fileContents) { if (InternalTestHooks.IgnoreScriptBlockCache) @@ -1717,6 +1721,7 @@ private static bool GetAndValidateEncryptionRecipients( private static string s_lastSeenCertificate = string.Empty; private static bool s_hasProcessedCertificate = false; private static CmsMessageRecipient[] s_encryptionRecipients = null; + private static Lazy s_sbLoggingSettingCache = new Lazy( () => Utils.GetPolicySetting(Utils.SystemWideThenCurrentUserConfig), isThreadSafe: true); diff --git a/src/System.Management.Automation/engine/runtime/MutableTuple.cs b/src/System.Management.Automation/engine/runtime/MutableTuple.cs index 2982cdf53d6..de923e2df8b 100644 --- a/src/System.Management.Automation/engine/runtime/MutableTuple.cs +++ b/src/System.Management.Automation/engine/runtime/MutableTuple.cs @@ -30,6 +30,7 @@ namespace System.Management.Automation internal abstract class MutableTuple { private const int MaxSize = 128; + private static readonly Dictionary s_sizeDict = new Dictionary(); private int _size; @@ -307,6 +308,7 @@ public static int GetSize(Type tupleType) private static readonly ConcurrentDictionary> s_tupleCreators = new ConcurrentDictionary>(concurrencyLevel: 3, capacity: 100); + public static Func TupleCreator(Type type) { return s_tupleCreators.GetOrAdd(type, diff --git a/src/System.Management.Automation/engine/scriptparameterbinder.cs b/src/System.Management.Automation/engine/scriptparameterbinder.cs index 35480a96d3e..c9944678ad8 100644 --- a/src/System.Management.Automation/engine/scriptparameterbinder.cs +++ b/src/System.Management.Automation/engine/scriptparameterbinder.cs @@ -48,6 +48,7 @@ internal ScriptParameterBinder( private readonly CallSite> _copyMutableValueSite = CallSite>.Create(PSVariableAssignmentBinder.Get()); + internal object CopyMutableValues(object o) { // The variable assignment binder copies mutable values and returns other values as is. diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index 1b17a39a4a7..95af575cc5f 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -1888,6 +1888,7 @@ int depth } private Collection> _extendedMembersCollection; + private Collection> ExtendedMembersCollection { get @@ -1899,6 +1900,7 @@ private Collection> ExtendedMembersCollection } private Collection> _allPropertiesCollection; + private Collection> AllPropertiesCollection { get diff --git a/src/System.Management.Automation/help/HelpCommentsParser.cs b/src/System.Management.Automation/help/HelpCommentsParser.cs index 62cbfdd9557..77347527ab4 100644 --- a/src/System.Management.Automation/help/HelpCommentsParser.cs +++ b/src/System.Management.Automation/help/HelpCommentsParser.cs @@ -70,6 +70,7 @@ private HelpCommentsParser(CommandInfo commandInfo, List parameterDescri internal static readonly string mamlURI = "http://schemas.microsoft.com/maml/2004/10"; internal static readonly string commandURI = "http://schemas.microsoft.com/maml/dev/command/2004/10"; internal static readonly string devURI = "http://schemas.microsoft.com/maml/dev/2004/10"; + private const string directive = @"^\s*\.(\w+)(\s+(\S.*))?\s*$"; private const string blankline = @"^\s*$"; // Although "http://msh" is the default namespace, it still must be explicitly qualified with non-empty prefix, diff --git a/src/System.Management.Automation/help/UpdatableHelpSystem.cs b/src/System.Management.Automation/help/UpdatableHelpSystem.cs index 6bdac0afaf8..0a45b9a7605 100644 --- a/src/System.Management.Automation/help/UpdatableHelpSystem.cs +++ b/src/System.Management.Automation/help/UpdatableHelpSystem.cs @@ -510,6 +510,7 @@ private string ResolveUri(string baseUri, bool verbose) "; + private const string HelpInfoXmlNamespace = "http://schemas.microsoft.com/powershell/help/2010/05"; private const string HelpInfoXmlValidationFailure = "HelpInfoXmlValidationFailure"; diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index fc60be64a41..5ee65158233 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -56,7 +56,9 @@ internal class FileSystemContentReaderWriter : IContentReader, IContentWriter private StreamReader _reader; private StreamWriter _writer; private bool _usingByteEncoding; + private const char DefaultDelimiter = '\n'; + private string _delimiter = $"{DefaultDelimiter}"; private int[] _offsetDictionary; private bool _usingDelimiter; @@ -1156,6 +1158,7 @@ internal FileStreamBackReader(FileStream fileStream, Encoding encoding) private readonly Encoding _defaultAnsiEncoding; private const int BuffSize = 4096; + private readonly byte[] _byteBuff = new byte[BuffSize]; private readonly char[] _charBuff = new char[BuffSize]; private int _byteCount = 0; diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 081e51228b6..67cd105fc40 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -83,6 +83,7 @@ public FileSystemProvider() } private Collection _excludeMatcher = null; + private static System.IO.EnumerationOptions _enumerationOptions = new System.IO.EnumerationOptions { MatchType = MatchType.Win32, @@ -7307,12 +7308,16 @@ private struct NetResource public int Type; public int DisplayType; public int Usage; + [MarshalAs(UnmanagedType.LPWStr)] public string LocalName; + [MarshalAs(UnmanagedType.LPWStr)] public string RemoteName; + [MarshalAs(UnmanagedType.LPWStr)] public string Comment; + [MarshalAs(UnmanagedType.LPWStr)] public string Provider; } @@ -7855,6 +7860,7 @@ private struct REPARSE_DATA_BUFFER_SYMBOLICLINK public ushort PrintNameOffset; public ushort PrintNameLength; public uint Flags; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3FF0)] public byte[] PathBuffer; } @@ -7869,6 +7875,7 @@ private struct REPARSE_DATA_BUFFER_MOUNTPOINT public ushort SubstituteNameLength; public ushort PrintNameOffset; public ushort PrintNameLength; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3FF0)] public byte[] PathBuffer; } @@ -7880,6 +7887,7 @@ private struct REPARSE_DATA_BUFFER_APPEXECLINK public ushort ReparseDataLength; public ushort Reserved; public uint StringCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3FF0)] public byte[] StringList; } @@ -7905,6 +7913,7 @@ private struct GUID public uint Data1; public ushort Data2; public ushort Data3; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public char[] Data4; } @@ -7916,6 +7925,7 @@ private struct REPARSE_GUID_DATA_BUFFER public ushort ReparseDataLength; public ushort Reserved; public GUID ReparseGuid; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_REPARSE_SIZE)] public char[] DataBuffer; } @@ -8679,6 +8689,7 @@ internal static void SetZoneOfOrigin(string path, SecurityZone securityZone) internal static class NativeMethods { internal const int ERROR_HANDLE_EOF = 38; + internal enum StreamInfoLevels { FindStreamInfoStandard = 0 } [DllImport(PinvokeDllNames.CreateFileDllName, CharSet = CharSet.Unicode, SetLastError = true)] @@ -8750,9 +8761,11 @@ internal static class CopyFileRemoteUtils #region PSCopyToSessionHelper internal const string PSCopyToSessionHelperName = @"PSCopyToSessionHelper"; + private static string s_driveMaxSizeErrorFormatString = FileSystemProviderStrings.DriveMaxSizeError; private static string s_PSCopyToSessionHelperDefinition = StringUtil.Format(PSCopyToSessionHelperDefinitionFormat, @"[ValidateNotNullOrEmpty()]", s_driveMaxSizeErrorFormatString); private static string s_PSCopyToSessionHelperDefinitionRestricted = StringUtil.Format(PSCopyToSessionHelperDefinitionFormat, @"[ValidateUserDrive()]", s_driveMaxSizeErrorFormatString); + private const string PSCopyToSessionHelperDefinitionFormat = @" param ( [Parameter(ParameterSetName=""PSCopyFileToRemoteSession"")] @@ -9216,8 +9229,10 @@ function PSCreateDirectoryOnRemoteSession #region PSCopyFromSessionHelper internal const string PSCopyFromSessionHelperName = @"PSCopyFromSessionHelper"; + private static string s_PSCopyFromSessionHelperDefinition = StringUtil.Format(PSCopyFromSessionHelperDefinitionFormat, @"[ValidateNotNullOrEmpty()]"); private static string s_PSCopyFromSessionHelperDefinitionRestricted = StringUtil.Format(PSCopyFromSessionHelperDefinitionFormat, @"[ValidateUserDrive()]"); + private const string PSCopyFromSessionHelperDefinitionFormat = @" param ( [Parameter(ParameterSetName=""PSCopyFileFromRemoteSession"", Mandatory=$true)] @@ -9705,8 +9720,10 @@ PSGetPathDirAndFiles @params #region PSCopyRemoteUtils internal const string PSCopyRemoteUtilsName = @"PSCopyRemoteUtils"; + internal static string PSCopyRemoteUtilsDefinition = StringUtil.Format(PSCopyRemoteUtilsDefinitionFormat, @"[ValidateNotNullOrEmpty()]", PSValidatePathFunction); private static string s_PSCopyRemoteUtilsDefinitionRestricted = StringUtil.Format(PSCopyRemoteUtilsDefinitionFormat, @"[ValidateUserDrive()]", PSValidatePathFunction); + private const string PSCopyRemoteUtilsDefinitionFormat = @" param ( [Parameter(ParameterSetName=""PSRemoteDirectoryExist"", Mandatory=$true)] @@ -9875,6 +9892,7 @@ function SafeGetDriveRoot #endregion internal static string AllCopyToRemoteScripts = s_PSCopyToSessionHelper + PSCopyRemoteUtils; + internal static IEnumerable GetAllCopyToRemoteScriptFunctions() { yield return s_PSCopyToSessionHelperFunction; @@ -9882,6 +9900,7 @@ internal static IEnumerable GetAllCopyToRemoteScriptFunctions() } internal static string AllCopyFromRemoteScripts = PSCopyFromSessionHelper + PSCopyRemoteUtils; + internal static IEnumerable GetAllCopyFromRemoteScriptFunctions() { yield return s_PSCopyFromSessionHelperFunction; diff --git a/src/System.Management.Automation/namespaces/RegistryWrapper.cs b/src/System.Management.Automation/namespaces/RegistryWrapper.cs index 13f451a539c..6f0c3e3d66f 100644 --- a/src/System.Management.Automation/namespaces/RegistryWrapper.cs +++ b/src/System.Management.Automation/namespaces/RegistryWrapper.cs @@ -30,11 +30,13 @@ internal interface IRegistryWrapper object GetValue(string name); object GetValue(string name, object defaultValue, RegistryValueOptions options); RegistryValueKind GetValueKind(string name); + object RegistryKey { get; } void SetAccessControl(ObjectSecurity securityDescriptor); ObjectSecurity GetAccessControl(AccessControlSections includeSections); void Close(); + string Name { get; } int SubKeyCount { get; } diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 556e1aa236d..22e553d3002 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -1559,6 +1559,7 @@ internal static void CurrentDomain_ProcessExit(object sender, EventArgs e) [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private static IntPtr s_amsiContext = IntPtr.Zero; + [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private static IntPtr s_amsiSession = IntPtr.Zero; diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index e109e000719..7cda5b88260 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -524,6 +524,7 @@ int NCryptOpenKey(IntPtr hProv, string strKeyName, uint dwLegacySpec, uint dwFlags); + [DllImport("ncrypt.dll", CharSet = CharSet.Unicode)] internal static extern unsafe int NCryptSetProperty(IntPtr hProv, string pszProperty, void* pbInput, int cbInput, int dwFlags); @@ -565,12 +566,16 @@ internal struct CRYPTUI_WIZ_DIGITAL_SIGN_INFO { internal DWORD dwSize; internal DWORD dwSubjectChoice; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszFileName; + internal DWORD dwSigningCertChoice; internal IntPtr pSigningCertContext; // PCCERT_CONTEXT + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszTimestampURL; + internal DWORD dwAdditionalCertChoice; internal IntPtr pSignExtInfo; // PCCRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO }; @@ -602,10 +607,13 @@ internal struct CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO { internal DWORD dwSize; internal DWORD dwAttrFlagsNotUsed; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszDescription; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszMoreInfoLocation; + [MarshalAs(UnmanagedType.LPStr)] internal string pszHashAlg; @@ -794,8 +802,10 @@ IntPtr pWinTrustData // WINTRUST_DATA* internal struct WINTRUST_FILE_INFO { internal DWORD cbStruct; // = sizeof(WINTRUST_FILE_INFO) + [MarshalAs(UnmanagedType.LPWStr)] internal string pcwszFilePath; // LPCWSTR + internal IntPtr hFileNotUsed; // optional, HANDLE to pcwszFilePath internal IntPtr pgKnownSubjectNotUsed; // optional: GUID* : fill if the // subject type is known @@ -1935,6 +1945,7 @@ internal struct CRYPT_ATTRIBUTE_TYPE_VALUE { [MarshalAs(UnmanagedType.LPStr)] internal string pszObjId; + internal CRYPT_ATTR_BLOB Value; } @@ -1954,8 +1965,10 @@ internal struct CRYPTCATCDF private DWORD _dwCurFilePos; private DWORD _dwLastMemberOffset; private BOOL _fEOF; + [MarshalAs(UnmanagedType.LPWStr)] private string _pwszResultDir; + private IntPtr _hCATStore; }; @@ -1963,10 +1976,13 @@ internal struct CRYPTCATCDF internal struct CRYPTCATMEMBER { internal DWORD cbStruct; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszReferenceTag; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszFileName; + internal Guid gSubjectType; internal DWORD fdwMemberFlags; internal IntPtr pIndirectData; @@ -1981,8 +1997,10 @@ internal struct CRYPTCATMEMBER internal struct CRYPTCATATTRIBUTE { private DWORD _cbStruct; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszReferenceTag; + private DWORD _dwAttrTypeAndAction; internal DWORD cbValue; internal System.IntPtr pbValue; @@ -1994,8 +2012,10 @@ internal struct CRYPTCATSTORE { private DWORD _cbStruct; internal DWORD dwPublicVersion; + [MarshalAs(UnmanagedType.LPWStr)] internal string pwszP7File; + private IntPtr _hProv; private DWORD _dwEncodingType; private DWORD _fdwStoreFlags; diff --git a/src/System.Management.Automation/security/wldpNativeMethods.cs b/src/System.Management.Automation/security/wldpNativeMethods.cs index 974392424eb..608503b932f 100644 --- a/src/System.Management.Automation/security/wldpNativeMethods.cs +++ b/src/System.Management.Automation/security/wldpNativeMethods.cs @@ -176,6 +176,7 @@ private static SystemEnforcementMode GetWldpPolicy(string path, SafeHandle handl private const string AppLockerTestFileName = "__PSScriptPolicyTest_"; private const string AppLockerTestFileContents = "# PowerShell test file to determine AppLocker lockdown mode "; + private static SystemEnforcementMode GetAppLockerPolicy(string path, SafeHandle handle) { SaferPolicy result = SaferPolicy.Disallowed; diff --git a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs index cbd4d8836cf..9e8c2585215 100644 --- a/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs +++ b/src/System.Management.Automation/singleshell/config/MshConsoleLoadException.cs @@ -87,6 +87,7 @@ private void CreateErrorRecord() } private Collection _PSSnapInExceptions = new Collection(); + internal Collection PSSnapInExceptions { get diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index 161ac75866e..af3c1c04a86 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -25,6 +25,7 @@ internal static class EncodingConversion internal const string Utf32 = "utf32"; internal const string Default = "default"; internal const string OEM = "oem"; + internal static readonly string[] TabCompletionResults = { Ascii, BigEndianUnicode, BigEndianUtf32, OEM, Unicode, Utf7, Utf8, Utf8Bom, Utf8NoBom, Utf32 }; diff --git a/src/System.Management.Automation/utils/IObjectWriter.cs b/src/System.Management.Automation/utils/IObjectWriter.cs index eb011e4f3b8..5a6afad9514 100644 --- a/src/System.Management.Automation/utils/IObjectWriter.cs +++ b/src/System.Management.Automation/utils/IObjectWriter.cs @@ -125,18 +125,21 @@ public abstract int MaxCapacity internal class DiscardingPipelineWriter : PipelineWriter { private ManualResetEvent _waitHandle = new ManualResetEvent(true); + public override WaitHandle WaitHandle { get { return _waitHandle; } } private bool _isOpen = true; + public override bool IsOpen { get { return _isOpen; } } private int _count = 0; + public override int Count { get { return _count; } diff --git a/src/System.Management.Automation/utils/MshInvalidOperationException.cs b/src/System.Management.Automation/utils/MshInvalidOperationException.cs index 75d7094432e..0889fee33df 100644 --- a/src/System.Management.Automation/utils/MshInvalidOperationException.cs +++ b/src/System.Management.Automation/utils/MshInvalidOperationException.cs @@ -132,6 +132,7 @@ public ErrorRecord ErrorRecord private ErrorRecord _errorRecord; private string _errorId = "InvalidOperation"; + internal void SetErrorId(string errorId) { _errorId = errorId; diff --git a/src/System.Management.Automation/utils/ParserException.cs b/src/System.Management.Automation/utils/ParserException.cs index 098617d0fdd..22010873d9f 100644 --- a/src/System.Management.Automation/utils/ParserException.cs +++ b/src/System.Management.Automation/utils/ParserException.cs @@ -15,6 +15,7 @@ namespace System.Management.Automation public class ParseException : RuntimeException { private const string errorIdString = "Parse"; + private ParseError[] _errors; /// diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs index de45d6303da..4ffdeb41415 100644 --- a/src/System.Management.Automation/utils/PlatformInvokes.cs +++ b/src/System.Management.Automation/utils/PlatformInvokes.cs @@ -99,6 +99,7 @@ internal class SecurityAttributes internal int nLength; internal SafeLocalMemHandle lpSecurityDescriptor; internal bool bInheritHandle; + internal SecurityAttributes() { this.nLength = 12; @@ -124,6 +125,7 @@ internal SafeLocalMemHandle(IntPtr existingHandle, bool ownsHandle) [DllImport(PinvokeDllNames.LocalFreeDllName), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern IntPtr LocalFree(IntPtr hMem); + protected override bool ReleaseHandle() { return (LocalFree(base.handle) == IntPtr.Zero); @@ -602,6 +604,7 @@ internal class STARTUPINFO public SafeFileHandle hStdInput; public SafeFileHandle hStdOutput; public SafeFileHandle hStdError; + public STARTUPINFO() { this.lpReserved = IntPtr.Zero; @@ -650,6 +653,7 @@ internal class SECURITY_ATTRIBUTES public int nLength; public SafeLocalMemHandle lpSecurityDescriptor; public bool bInheritHandle; + public SECURITY_ATTRIBUTES() { this.nLength = 12; @@ -674,6 +678,7 @@ internal static extern bool CreateProcess( [DllImport(PinvokeDllNames.ResumeThreadDllName, CharSet = CharSet.Unicode, SetLastError = true)] public static extern uint ResumeThread(IntPtr threadHandle); + internal static uint RESUME_THREAD_FAILED = System.UInt32.MaxValue; // (DWORD)-1 [DllImport(PinvokeDllNames.CreateFileDllName, CharSet = CharSet.Unicode, SetLastError = true)] diff --git a/src/System.Management.Automation/utils/PsUtils.cs b/src/System.Management.Automation/utils/PsUtils.cs index b27f6f7e149..5866e3d52f9 100644 --- a/src/System.Management.Automation/utils/PsUtils.cs +++ b/src/System.Management.Automation/utils/PsUtils.cs @@ -404,6 +404,7 @@ internal static Hashtable EvaluatePowerShellDataFile( internal static readonly string[] ManifestModuleVersionPropertyName = new[] { "ModuleVersion" }; internal static readonly string[] ManifestGuidPropertyName = new[] { "GUID" }; internal static readonly string[] ManifestPrivateDataPropertyName = new[] { "PrivateData" }; + internal static readonly string[] FastModuleManifestAnalysisPropertyNames = new[] { "AliasesToExport", @@ -566,6 +567,7 @@ internal class CRC32Hash { // CRC-32C polynomial representations private const uint polynomial = 0x1EDC6F41; + private static uint[] table; static CRC32Hash() diff --git a/src/System.Management.Automation/utils/ResourceManagerCache.cs b/src/System.Management.Automation/utils/ResourceManagerCache.cs index c1e463f5ad9..302fd0c48cf 100644 --- a/src/System.Management.Automation/utils/ResourceManagerCache.cs +++ b/src/System.Management.Automation/utils/ResourceManagerCache.cs @@ -113,6 +113,7 @@ internal static ResourceManager GetResourceManager( /// Design For Testability -- assert on failed resource lookup. /// private static bool s_DFT_monitorFailingResourceLookup = true; + internal static bool DFT_DoMonitorFailingResourceLookup { get { return ResourceManagerCache.s_DFT_monitorFailingResourceLookup; } diff --git a/src/System.Management.Automation/utils/RuntimeException.cs b/src/System.Management.Automation/utils/RuntimeException.cs index 3b9d6ae3d73..fe5a6c3b4be 100644 --- a/src/System.Management.Automation/utils/RuntimeException.cs +++ b/src/System.Management.Automation/utils/RuntimeException.cs @@ -305,6 +305,7 @@ internal bool SuppressPromptInInterpreter #endregion Internal private Token _errorToken; + internal Token ErrorToken { get diff --git a/src/System.Management.Automation/utils/StringUtil.cs b/src/System.Management.Automation/utils/StringUtil.cs index 5b87d106f5c..9b3cf3447cb 100644 --- a/src/System.Management.Automation/utils/StringUtil.cs +++ b/src/System.Management.Automation/utils/StringUtil.cs @@ -66,7 +66,9 @@ internal static // Typical padding is at most a screen's width, any more than that and we won't bother caching. private const int IndentCacheMax = 120; + private static readonly string[] IndentCache = new string[IndentCacheMax]; + internal static string Padding(int countOfSpaces) { if (countOfSpaces >= IndentCacheMax) @@ -84,7 +86,9 @@ internal static string Padding(int countOfSpaces) } private const int DashCacheMax = 120; + private static readonly string[] DashCache = new string[DashCacheMax]; + internal static string DashPadding(int count) { if (count >= DashCacheMax) diff --git a/src/System.Management.Automation/utils/tracing/TracingGen.cs b/src/System.Management.Automation/utils/tracing/TracingGen.cs index 09b712714ae..ea369e4513a 100644 --- a/src/System.Management.Automation/utils/tracing/TracingGen.cs +++ b/src/System.Management.Automation/utils/tracing/TracingGen.cs @@ -36,6 +36,7 @@ public sealed partial class Tracer : System.Management.Automation.Tracing.EtwAct /// Keyword all. /// public const long KeywordAll = 0xFFFFFFFF; + private static Guid providerId = Guid.Parse("a0c1853b-5c40-4b15-8766-3cf1c58f985a"); private static EventDescriptor WriteTransferEventEvent; private static EventDescriptor DebugMessageEvent; diff --git a/test/xUnit/csharp/test_PSConfiguration.cs b/test/xUnit/csharp/test_PSConfiguration.cs index 4bc38bdcfb4..45e057bea75 100644 --- a/test/xUnit/csharp/test_PSConfiguration.cs +++ b/test/xUnit/csharp/test_PSConfiguration.cs @@ -18,6 +18,7 @@ namespace PSTests.Sequential public class PowerShellPolicyFixture : IDisposable { private const string ConfigFileName = "powershell.config.json"; + private readonly string systemWideConfigFile; private readonly string currentUserConfigFile; From 7b6e84d517b8d2a2dd219939facc7fb88545172f Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 29 May 2020 13:44:38 +0100 Subject: [PATCH 232/275] Use `t_` naming convention for ThreadStatic members (#12826) # PR Summary ## PR Context Violations of naming convention were found during #12820 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../CommandCompletion/PseudoParameterBinder.cs | 10 +++++----- .../engine/parser/TypeResolver.cs | 16 ++++++++-------- .../utils/tracing/PSSysLogProvider.cs | 8 ++++---- .../utils/tracing/SysLogProvider.cs | 18 +++++++++--------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index b8ed6df5042..c1b3f16adcb 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -332,17 +332,17 @@ public static StaticBindingResult BindCommand(CommandAst commandAst, bool resolv { // Handle static binding from a non-PowerShell / C# application // DefaultRunspace is a thread static field, so race condition will not happen because different threads will access different instances of "DefaultRunspace" - if (s_bindCommandRunspace == null) + if (t_bindCommandRunspace == null) { // Create a mini runspace by remove the types and formats InitialSessionState minimalState = InitialSessionState.CreateDefault2(); minimalState.Types.Clear(); minimalState.Formats.Clear(); - s_bindCommandRunspace = RunspaceFactory.CreateRunspace(minimalState); - s_bindCommandRunspace.Open(); + t_bindCommandRunspace = RunspaceFactory.CreateRunspace(minimalState); + t_bindCommandRunspace.Open(); } - Runspace.DefaultRunspace = s_bindCommandRunspace; + Runspace.DefaultRunspace = t_bindCommandRunspace; // Static binding always does argument binding (not argument or parameter completion). pseudoBinding = new PseudoParameterBinder().DoPseudoParameterBinding(commandAst, null, null, PseudoParameterBinder.BindingType.ArgumentBinding); Runspace.DefaultRunspace = null; @@ -357,7 +357,7 @@ public static StaticBindingResult BindCommand(CommandAst commandAst, bool resolv } [ThreadStatic] - static Runspace s_bindCommandRunspace = null; + static Runspace t_bindCommandRunspace = null; } /// diff --git a/src/System.Management.Automation/engine/parser/TypeResolver.cs b/src/System.Management.Automation/engine/parser/TypeResolver.cs index ad771750e60..a0ae173907c 100644 --- a/src/System.Management.Automation/engine/parser/TypeResolver.cs +++ b/src/System.Management.Automation/engine/parser/TypeResolver.cs @@ -221,7 +221,7 @@ private static Type ResolveTypeNameWorker(TypeName typeName, /// This set should be used directly only in the method CallResolveTypeNameWorkerHelper. /// [ThreadStatic] - private static HashSet s_searchedAssemblies = null; + private static HashSet t_searchedAssemblies = null; /// /// A helper method to call ResolveTypeNameWorker in steps. @@ -233,21 +233,21 @@ private static Type CallResolveTypeNameWorkerHelper(TypeName typeName, TypeResolutionState typeResolutionState, out Exception exception) { - if (s_searchedAssemblies == null) + if (t_searchedAssemblies == null) { - s_searchedAssemblies = new HashSet(); + t_searchedAssemblies = new HashSet(); } else { // Clear the set before starting a full search to make sure we have a clean start. - s_searchedAssemblies.Clear(); + t_searchedAssemblies.Clear(); } try { exception = null; var currentScope = context != null ? context.EngineSessionState.CurrentScope : null; - Type result = ResolveTypeNameWorker(typeName, currentScope, typeResolutionState.assemblies, s_searchedAssemblies, typeResolutionState, + Type result = ResolveTypeNameWorker(typeName, currentScope, typeResolutionState.assemblies, t_searchedAssemblies, typeResolutionState, /*onlySearchInGivenAssemblies*/ false, /* reportAmbiguousException */ true, out exception); if (exception == null && result == null) { @@ -256,14 +256,14 @@ private static Type CallResolveTypeNameWorkerHelper(TypeName typeName, // If the assemblies to search from is not specified by the caller of 'ResolveTypeNameWithContext', // then we search our assembly cache first, so as to give preference to resolving the type against // assemblies explicitly loaded by powershell, for example, via importing module/snapin. - result = ResolveTypeNameWorker(typeName, currentScope, context.AssemblyCache.Values, s_searchedAssemblies, typeResolutionState, + result = ResolveTypeNameWorker(typeName, currentScope, context.AssemblyCache.Values, t_searchedAssemblies, typeResolutionState, /*onlySearchInGivenAssemblies*/ true, /* reportAmbiguousException */ false, out exception); } if (result == null) { // Search from the assembly list passed in. - result = ResolveTypeNameWorker(typeName, currentScope, assemblies, s_searchedAssemblies, typeResolutionState, + result = ResolveTypeNameWorker(typeName, currentScope, assemblies, t_searchedAssemblies, typeResolutionState, /*onlySearchInGivenAssemblies*/ true, /* reportAmbiguousException */ false, out exception); } } @@ -273,7 +273,7 @@ private static Type CallResolveTypeNameWorkerHelper(TypeName typeName, finally { // Clear the set after a full search, so dynamic assemblies can get reclaimed as needed. - s_searchedAssemblies.Clear(); + t_searchedAssemblies.Clear(); } } diff --git a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs index d80705b38e4..5f698f1b912 100755 --- a/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs @@ -42,19 +42,19 @@ static PSSysLogProvider() /// property to ensure correct thread initialization; otherwise, a null reference can occur. /// [ThreadStatic] - private static StringBuilder _payloadBuilder; + private static StringBuilder t_payloadBuilder; private static StringBuilder PayloadBuilder { get { - if (_payloadBuilder == null) + if (t_payloadBuilder == null) { // NOTE: Thread static fields must be explicitly initialized for each thread. - _payloadBuilder = new StringBuilder(200); + t_payloadBuilder = new StringBuilder(200); } - return _payloadBuilder; + return t_payloadBuilder; } } diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index 379f9f69b42..f3a899acb7d 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -123,19 +123,19 @@ public SysLogProvider(string applicationId, PSLevel level, PSKeyword keywords, P /// property to ensure correct thread initialization; otherwise, a null reference can occur. /// [ThreadStatic] - private static StringBuilder _messageBuilder; + private static StringBuilder t_messageBuilder; private static StringBuilder MessageBuilder { get { - if (_messageBuilder == null) + if (t_messageBuilder == null) { // NOTE: Thread static fields must be explicitly initialized for each thread. - _messageBuilder = new StringBuilder(200); + t_messageBuilder = new StringBuilder(200); } - return _messageBuilder; + return t_messageBuilder; } } @@ -147,24 +147,24 @@ private static StringBuilder MessageBuilder /// to ensure correct thread initialization. /// [ThreadStatic] - static Guid? _activity; + static Guid? t_activity; private static Guid Activity { get { - if (_activity.HasValue == false) + if (t_activity.HasValue == false) { // NOTE: Thread static fields must be explicitly initialized for each thread. - _activity = Guid.NewGuid(); + t_activity = Guid.NewGuid(); } - return _activity.Value; + return t_activity.Value; } set { - _activity = value; + t_activity = value; } } From 99da1093120af1b27edd317cae5770484ac69f7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 May 2020 09:36:12 -0700 Subject: [PATCH 233/275] Update .NET SDK version from `5.0.100-preview.5.20272.6` to `5.0.100-preview.5.20278.13` (#12772) --- assets/files.wxs | 6 +++--- global.json | 2 +- ...soft.PowerShell.Commands.Management.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 4 ++-- ...crosoft.PowerShell.CoreCLR.Eventing.csproj | 2 +- .../Microsoft.PowerShell.SDK.csproj | 8 ++++---- .../Microsoft.WSMan.Management.csproj | 2 +- .../System.Management.Automation.csproj | 20 +++++++++---------- test/tools/TestService/TestService.csproj | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- ...crosoft.PowerShell.Commands.Utility.csproj | 2 +- .../System.Management.Automation.csproj | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/assets/files.wxs b/assets/files.wxs index 3eeac67d2e8..2420352c008 100644 --- a/assets/files.wxs +++ b/assets/files.wxs @@ -3100,8 +3100,8 @@ - - + + @@ -4101,8 +4101,8 @@ - + diff --git a/global.json b/global.json index ef8ee015b1a..f43350f97b0 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.5.20272.6" + "version": "5.0.100-preview.5.20278.13" } } diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj index 10b046fd478..979225ef3ec 100644 --- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj +++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj @@ -47,7 +47,7 @@ - + diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index a121806b9ff..e3fda43a1f8 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj index 4f59435e1fe..3230ef91d5f 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj index 4e5fd9751d2..000efa63316 100644 --- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj +++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj @@ -18,9 +18,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj index 10b27af53e2..835e26b2cf0 100644 --- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj +++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj index 821bec296dc..9a036a28249 100644 --- a/src/System.Management.Automation/System.Management.Automation.csproj +++ b/src/System.Management.Automation/System.Management.Automation.csproj @@ -16,16 +16,16 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj index acaa25fd2de..e16c9fe3fdd 100644 --- a/test/tools/TestService/TestService.csproj +++ b/test/tools/TestService/TestService.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 502691b2275..6bbf47d68c5 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj index 757208ce5bf..ba7733e3df0 100644 --- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj +++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj @@ -14,6 +14,6 @@ - + diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj index 2aedbca4c63..761095c071b 100644 --- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj +++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj @@ -9,7 +9,7 @@ - - + + From b80375f4979b554d6ad56b1f125ae2ad2efce80e Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 29 May 2020 10:01:29 -0700 Subject: [PATCH 234/275] Update the CI builds (#12830) Include the following changes: - Use stages for Linux & macOS CI - Change windows-daily to run tests in one agent --- .vsts-ci/linux.yml | 101 +++++++++++++++++++------------------ .vsts-ci/mac.yml | 85 ++++++++++++++++--------------- .vsts-ci/windows-daily.yml | 89 +++++++++++++++++++++++++------- 3 files changed, 167 insertions(+), 108 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 6c7a94e0216..8b9bccb36ae 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -40,59 +40,62 @@ variables: resources: - repo: self clean: true -jobs: -- template: templates/ci-build.yml - parameters: - pool: ubuntu-16.04 - jobName: linux_build - displayName: linux Build -- template: templates/nix-test.yml - parameters: - name: Linux - pool: ubuntu-16.04 - purpose: UnelevatedPesterTests - tagSet: CI - parentJobs: - - linux_build +stages: +- stage: BuildLinux + displayName: Build for Linux + jobs: + - template: templates/ci-build.yml + parameters: + pool: ubuntu-16.04 + jobName: linux_build + displayName: linux Build -- template: templates/nix-test.yml - parameters: - name: Linux - pool: ubuntu-16.04 - purpose: ElevatedPesterTests - tagSet: CI - parentJobs: - - linux_build +- stage: TestLinux + displayName: Test for Linux + jobs: + - template: templates/nix-test.yml + parameters: + name: Linux + pool: ubuntu-16.04 + purpose: UnelevatedPesterTests + tagSet: CI -- template: templates/nix-test.yml - parameters: - name: Linux - pool: ubuntu-16.04 - purpose: UnelevatedPesterTests - tagSet: Others - parentJobs: - - linux_build + - template: templates/nix-test.yml + parameters: + name: Linux + pool: ubuntu-16.04 + purpose: ElevatedPesterTests + tagSet: CI -- template: templates/nix-test.yml - parameters: - name: Linux - pool: ubuntu-16.04 - purpose: ElevatedPesterTests - tagSet: Others - parentJobs: - - linux_build + - template: templates/nix-test.yml + parameters: + name: Linux + pool: ubuntu-16.04 + purpose: UnelevatedPesterTests + tagSet: Others -- template: templates/verify-xunit.yml - parameters: - pool: ubuntu-16.04 - parentJobs: - - linux_build + - template: templates/nix-test.yml + parameters: + name: Linux + pool: ubuntu-16.04 + purpose: ElevatedPesterTests + tagSet: Others -- job: CodeCovTestPackage + - template: templates/verify-xunit.yml + parameters: + pool: ubuntu-16.04 + +- stage: CodeCovTestPackage displayName: CodeCoverage and Test Packages - steps: - - powershell: | - Import-Module .\tools\ci.psm1 - New-CodeCoverageAndTestPackage - displayName: CodeCoverage and Test Package + dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it + jobs: + - job: CodeCovTestPackage + displayName: CodeCoverage and Test Packages + pool: + vmImage: ubuntu-16.04 + steps: + - pwsh: | + Import-Module .\tools\ci.psm1 + New-CodeCoverageAndTestPackage + displayName: CodeCoverage and Test Package diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index ca4a66fc7e6..f41f4863d69 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -42,51 +42,54 @@ variables: resources: - repo: self clean: true -jobs: -- template: templates/ci-build.yml - parameters: - pool: macOS-latest - jobName: mac_build - displayName: macOS Build -- template: templates/nix-test.yml - parameters: - purpose: UnelevatedPesterTests - tagSet: CI - parentJobs: - - mac_build +stages: +- stage: BuildMac + displayName: Build for macOS + jobs: + - template: templates/ci-build.yml + parameters: + pool: macOS-latest + jobName: mac_build + displayName: macOS Build -- template: templates/nix-test.yml - parameters: - purpose: ElevatedPesterTests - tagSet: CI - parentJobs: - - mac_build +- stage: TestMac + displayName: Test for macOS + jobs: + - template: templates/nix-test.yml + parameters: + purpose: UnelevatedPesterTests + tagSet: CI -- template: templates/nix-test.yml - parameters: - purpose: UnelevatedPesterTests - tagSet: Others - parentJobs: - - mac_build + - template: templates/nix-test.yml + parameters: + purpose: ElevatedPesterTests + tagSet: CI -- template: templates/nix-test.yml - parameters: - purpose: ElevatedPesterTests - tagSet: Others - parentJobs: - - mac_build + - template: templates/nix-test.yml + parameters: + purpose: UnelevatedPesterTests + tagSet: Others -- template: templates/verify-xunit.yml - parameters: - pool: macOS-latest - parentJobs: - - mac_build + - template: templates/nix-test.yml + parameters: + purpose: ElevatedPesterTests + tagSet: Others -- job: CodeCovTestPackage + - template: templates/verify-xunit.yml + parameters: + pool: macOS-latest + +- stage: CodeCovTestPackage displayName: CodeCoverage and Test Packages - steps: - - powershell: | - Import-Module .\tools\ci.psm1 - New-CodeCoverageAndTestPackage - displayName: CodeCoverage and Test Package + dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it + jobs: + - job: CodeCovTestPackage + displayName: CodeCoverage and Test Packages + pool: + vmImage: macOS-latest + steps: + - pwsh: | + Import-Module .\tools\ci.psm1 + New-CodeCoverageAndTestPackage + displayName: CodeCoverage and Test Package diff --git a/.vsts-ci/windows-daily.yml b/.vsts-ci/windows-daily.yml index c05b5735cb1..80a8723f920 100644 --- a/.vsts-ci/windows-daily.yml +++ b/.vsts-ci/windows-daily.yml @@ -49,31 +49,84 @@ stages: - stage: TestWin displayName: Test for Windows jobs: - - template: templates/windows-test.yml - parameters: - purpose: UnelevatedPesterTests - tagSet: CI + - job: win_test + pool: + vmImage: vs2017-win2016 + displayName: Windows Test - - template: templates/windows-test.yml - parameters: - purpose: ElevatedPesterTests - tagSet: CI + steps: + - pwsh: | + Get-ChildItem -Path env: + displayName: 'Capture Environment' + condition: succeededOrFailed() - - template: templates/windows-test.yml - parameters: - purpose: UnelevatedPesterTests - tagSet: Others + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts' + inputs: + downloadType: specific + itemPattern: | + build/**/* + xunit/**/* + downloadPath: '$(System.ArtifactsDirectory)' - - template: templates/windows-test.yml - parameters: - purpose: ElevatedPesterTests - tagSet: Others + - pwsh: | + Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse + displayName: 'Capture Artifacts Directory' + continueOnError: true - - template: templates/verify-xunit.yml + # must be run frow Windows PowerShell + - powershell: | + Import-Module .\tools\ci.psm1 + Invoke-CIInstall + displayName: Bootstrap + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + $path = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) + $rootPath = Split-Path -Path $path + Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force + displayName: 'Unzip Build' + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI + displayName: Test - UnelevatedPesterTests - CI + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI + displayName: Test - ElevatedPesterTests - CI + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others + displayName: Test - UnelevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others + displayName: Test - ElevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + displayName: Verify xUnit Test Results + condition: succeededOrFailed() - stage: PackagingWin displayName: Packaging for Windows jobs: # Unlike daily builds, we do not upload nuget package to MyGet so we do not wait on tests to finish. - template: templates/windows-packaging.yml - From 2fe34993c3fa9a0e665c265f97a709a1d2bec61b Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 29 May 2020 10:26:30 -0700 Subject: [PATCH 235/275] Sign the `MSIX` files for the store (#12582) Co-authored-by: Aditya Patwardhan --- .vsts-ci/linux.yml | 4 ++-- .vsts-ci/mac.yml | 3 ++- .vsts-ci/windows.yml | 2 ++ assets/AppxManifest.xml | 2 +- tools/packaging/packaging.psm1 | 16 ++++++++++------ .../azureDevOps/templates/upload.yml | 2 +- .../templates/windows-package-signing.yml | 6 +++++- tools/releaseBuild/generatePackgeSigning.ps1 | 14 +++++++++++++- tools/releaseBuild/setReleaseTag.ps1 | 7 +++++++ 9 files changed, 43 insertions(+), 13 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 8b9bccb36ae..3b934fccb4a 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -11,7 +11,6 @@ trigger: include: - '*' exclude: - - /tools/releaseBuild/**/* - /.vsts-ci/misc-analysis.yml - /.github/ISSUE_TEMPLATE/* - /.dependabot/config.yml @@ -25,7 +24,8 @@ pr: include: - '*' exclude: - - /tools/releaseBuild/**/* + - tools/releaseBuild/* + - tools/releaseBuild/azureDevOps/templates/* - /.vsts-ci/misc-analysis.yml - /.github/ISSUE_TEMPLATE/* - /.dependabot/config.yml diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index f41f4863d69..445c0e3f463 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -25,10 +25,11 @@ pr: include: - '*' exclude: - - /tools/releaseBuild/**/* - /.vsts-ci/misc-analysis.yml - /.github/ISSUE_TEMPLATE/* - /.dependabot/config.yml + - tools/releaseBuild/* + - tools/releaseBuild/azureDevOps/templates/* variables: DOTNET_CLI_TELEMETRY_OPTOUT: 1 diff --git a/.vsts-ci/windows.yml b/.vsts-ci/windows.yml index 81e74dcbc77..11bccbbbfa6 100644 --- a/.vsts-ci/windows.yml +++ b/.vsts-ci/windows.yml @@ -27,6 +27,8 @@ pr: - /.vsts-ci/misc-analysis.yml - /.github/ISSUE_TEMPLATE/* - /.dependabot/config.yml + - tools/releaseBuild/* + - tools/releaseBuild/azureDevOps/templates/* variables: GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'" diff --git a/assets/AppxManifest.xml b/assets/AppxManifest.xml index 8b245a3b25d..83df8c31b41 100644 --- a/assets/AppxManifest.xml +++ b/assets/AppxManifest.xml @@ -9,7 +9,7 @@ xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"> - + $DISPLAYNAME$ diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 7383167548f..a9c56d19534 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -3183,9 +3183,18 @@ function New-MSIXPackage Write-Verbose "Version: $productversion" -Verbose + $isPreview = Test-IsPreview -Version $ProductSemanticVersion + if ($isPreview) { + Write-Verbose "Using Preview assets" -Verbose + } + # Appx manifest needs to be in root of source path, but the embedded version needs to be updated + # cp-459155 is 'CN=Microsoft Windows Store Publisher (Store EKU), O=Microsoft Corporation, L=Redmond, S=Washington, C=US' + # authenticodeFormer is 'CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US' + $releasePublisher = 'CN=Microsoft Windows Store Publisher (Store EKU), O=Microsoft Corporation, L=Redmond, S=Washington, C=US' + $appxManifest = Get-Content "$RepoRoot\assets\AppxManifest.xml" -Raw - $appxManifest = $appxManifest.Replace('$VERSION$', $ProductVersion).Replace('$ARCH$', $Architecture).Replace('$PRODUCTNAME$', $productName).Replace('$DISPLAYNAME$', $displayName) + $appxManifest = $appxManifest.Replace('$VERSION$', $ProductVersion).Replace('$ARCH$', $Architecture).Replace('$PRODUCTNAME$', $productName).Replace('$DISPLAYNAME$', $displayName).Replace('$PUBLISHER$', $releasePublisher) Set-Content -Path "$ProductSourcePath\AppxManifest.xml" -Value $appxManifest -Force # Necessary image assets need to be in source assets folder $assets = @( @@ -3200,11 +3209,6 @@ function New-MSIXPackage $null = New-Item -ItemType Directory -Path "$ProductSourcePath\assets" } - $isPreview = Test-IsPreview -Version $ProductSemanticVersion - if ($isPreview) { - Write-Verbose "Using Preview assets" -Verbose - } - $assets | ForEach-Object { if ($isPreview) { Copy-Item -Path "$RepoRoot\assets\$_-Preview.png" -Destination "$ProductSourcePath\assets\$_.png" diff --git a/tools/releaseBuild/azureDevOps/templates/upload.yml b/tools/releaseBuild/azureDevOps/templates/upload.yml index 6316ddf6169..bef92c2cd4b 100644 --- a/tools/releaseBuild/azureDevOps/templates/upload.yml +++ b/tools/releaseBuild/azureDevOps/templates/upload.yml @@ -61,5 +61,5 @@ steps: azureSubscription: '$(AzureFileCopySubscription)' Destination: AzureBlob storage: '$(StorageAccount)' - ContainerName: '$(AzureVersion)' + ContainerName: '$(AzureVersion)-private' condition: and(succeeded(), eq('${{ parameters.msix }}', 'yes'), eq(variables['SHOULD_SIGN'], 'true')) diff --git a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml index d8f95928bc3..473762bda10 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml @@ -38,12 +38,16 @@ jobs: $authenticodefiles = @( "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x64.msi" "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x86.msi" + ) + + $msixFiles = @( "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x86.msix" "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x64.msix" "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-arm32.msix" "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-arm64.msix" ) - tools/releaseBuild/generatePackgeSigning.ps1 -AuthenticodeFiles $authenticodeFiles -path "$(System.ArtifactsDirectory)\package.xml" + + tools/releaseBuild/generatePackgeSigning.ps1 -AuthenticodeFiles $authenticodeFiles -path "$(System.ArtifactsDirectory)\package.xml" -MsixCertType $env:MSIX_TYPE -MsixFiles $msixFiles displayName: 'Generate Package Signing Xml' - powershell: | diff --git a/tools/releaseBuild/generatePackgeSigning.ps1 b/tools/releaseBuild/generatePackgeSigning.ps1 index a217280c44e..288b18d3499 100644 --- a/tools/releaseBuild/generatePackgeSigning.ps1 +++ b/tools/releaseBuild/generatePackgeSigning.ps1 @@ -8,7 +8,10 @@ param( [string[]] $NuPkgFiles, [string[]] $MacDeveloperFiles, [string[]] $LinuxFiles, - [string[]] $ThirdPartyFiles + [string[]] $ThirdPartyFiles, + [string[]] $MsixFiles, + [ValidateSet('release','preview')] + [string] $MsixCertType = 'preview' ) if ((!$AuthenticodeDualFiles -or $AuthenticodeDualFiles.Count -eq 0) -and @@ -16,6 +19,7 @@ if ((!$AuthenticodeDualFiles -or $AuthenticodeDualFiles.Count -eq 0) -and (!$NuPkgFiles -or $NuPkgFiles.Count -eq 0) -and (!$MacDeveloperFiles -or $MacDeveloperFiles.Count -eq 0) -and (!$LinuxFiles -or $LinuxFiles.Count -eq 0) -and + (!$MsixFiles -or $MsixFiles.Count -eq 0) -and (!$ThirdPartyFiles -or $ThirdPartyFiles.Count -eq 0)) { throw "At least one file must be specified" @@ -95,6 +99,14 @@ foreach ($file in $ThirdPartyFiles) { New-FileElement -File $file -SignType 'ThirdParty' -XmlDoc $signingXml -Job $job } +foreach ($file in $MsixFiles) { + # 'CP-459155' signs for the store only + # AuthenticodeFormer works only for sideloading + # ---------------------------------------------- + # update releasePublisher in packaging.psm1 when this is changed + New-FileElement -File $file -SignType 'CP-459155' -XmlDoc $signingXml -Job $job +} + $signingXml.Save($path) $updateScriptPath = Join-Path -Path $PSScriptRoot -ChildPath 'updateSigning.ps1' & $updateScriptPath -SigningXmlPath $path diff --git a/tools/releaseBuild/setReleaseTag.ps1 b/tools/releaseBuild/setReleaseTag.ps1 index 35266c8c3df..1927eb7ae60 100644 --- a/tools/releaseBuild/setReleaseTag.ps1 +++ b/tools/releaseBuild/setReleaseTag.ps1 @@ -58,6 +58,8 @@ function New-BuildInfoJson { $branchOnly = $Branch -replace '^refs/heads/'; $branchOnly = $branchOnly -replace '[_\-]' +$msixType = 'preview' + $isDaily = $false if($ReleaseTag -eq 'fromBranch' -or !$ReleaseTag) @@ -65,6 +67,7 @@ if($ReleaseTag -eq 'fromBranch' -or !$ReleaseTag) # Branch is named release- if($Branch -match '^.*(release[-/])') { + $msixType = 'release' Write-Verbose "release branch:" -Verbose $releaseTag = $Branch -replace '^.*(release[-/])' $vstsCommandString = "vso[task.setvariable variable=$Variable]$releaseTag" @@ -127,4 +130,8 @@ $vstsCommandString = "vso[task.setvariable variable=IS_DAILY]$($isDaily.ToString Write-Verbose -Message "$vstsCommandString" -Verbose Write-Host -Object "##$vstsCommandString" +$vstsCommandString = "vso[task.setvariable variable=MSIX_TYPE]$msixType" +Write-Verbose -Message "$vstsCommandString" -Verbose +Write-Host -Object "##$vstsCommandString" + Write-Output $releaseTag From c7455fd4d88feacadd945e6b46023723a1335619 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 29 May 2020 23:33:49 +0500 Subject: [PATCH 236/275] Add `CommandLine` property to Process (#12288) --- .../engine/TypeTable_Types_Ps1Xml.cs | 18 ++++++++++++++++++ .../Get-Process.Tests.ps1 | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs index 3867f4773b3..8e199e18cc5 100644 --- a/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs +++ b/src/System.Management.Automation/engine/TypeTable_Types_Ps1Xml.cs @@ -1139,6 +1139,24 @@ private void Process_Types_Ps1Xml(string filePath, ConcurrentBag errors) typeMembers, isOverride: false); + newMembers.Add(@"CommandLine"); + AddMember( + errors, + typeName, + new PSScriptProperty( + @"CommandLine", + GetScriptBlock(@" + if ($IsWindows) { + (Get-CimInstance Win32_Process -Filter ""ProcessId = $($this.Id)"").CommandLine + } elseif ($IsLinux) { + Get-Content -LiteralPath ""/proc/$($this.Id)/cmdline"" + } + "), + setterScript: null, + shouldCloneOnAccess: true), + typeMembers, + isOverride: false); + newMembers.Add(@"Parent"); AddMember( errors, 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 cd3f115fbec..ef6fd1dbe5d 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -89,6 +89,12 @@ Describe "Get-Process" -Tags "CI" { It "Should fail to run Get-Process with -FileVersionInfo without admin" -Skip:(!$IsWindows) { { Get-Process -FileVersionInfo -ErrorAction Stop } | Should -Throw -ErrorId "CouldNotEnumerateFileVer,Microsoft.PowerShell.Commands.GetProcessCommand" } + + It "Should return CommandLine property" -Skip:($IsMacOS) { + $command = "(Get-Process -Id `$pid).CommandLine" + $result = & "$PSHOME/pwsh" -NoProfile -NonInteractive -Command $command + $result | Should -BeLike "*$command*" + } } Describe "Get-Process Formatting" -Tags "Feature" { From 55b9041a40791e15a333ebffa5cce9619a87434c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 May 2020 10:31:44 -0700 Subject: [PATCH 237/275] Update .NET SDK version from `5.0.100-preview.5.20278.13` to `5.0.100-preview.5.20279.10` (#12844) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- global.json | 2 +- test/tools/WebListener/WebListener.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index f43350f97b0..12a373c1e90 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "5.0.100-preview.5.20278.13" + "version": "5.0.100-preview.5.20279.10" } } diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj index 6bbf47d68c5..bf51e748867 100644 --- a/test/tools/WebListener/WebListener.csproj +++ b/test/tools/WebListener/WebListener.csproj @@ -7,7 +7,7 @@ - + From 0f16d0ec6ea7524ccdcf61669b84812474d1d25b Mon Sep 17 00:00:00 2001 From: corbob <30301021+corbob@users.noreply.github.com> Date: Sat, 30 May 2020 10:33:27 -0700 Subject: [PATCH 238/275] Minor typo corrections in Distribution Request Issue Templates (#12744) Fix a few misspellings in the Issue Template. --- .github/ISSUE_TEMPLATE/Distribution_Request.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Distribution_Request.md b/.github/ISSUE_TEMPLATE/Distribution_Request.md index fee19c92b71..28751062336 100644 --- a/.github/ISSUE_TEMPLATE/Distribution_Request.md +++ b/.github/ISSUE_TEMPLATE/Distribution_Request.md @@ -1,6 +1,6 @@ --- name: Distribution Support Request -about: Requests suppoort for a new distribution +about: Requests support for a new distribution title: "Distribution Support Request" labels: Distribution-Request assignees: '' @@ -22,7 +22,7 @@ assignees: '' - [ ] The version and architecture of the Distribution is [supported by .NET Core](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux). - The following are requirements for supporting a distribution. Please write a justification for any exception where these criteria are not met and - the PowerShell comittee will review the request. + the PowerShell committee will review the request. - [ ] The version of the Distribution is supported for at least one year. - [ ] The version of the Distribution is not an [interim release](https://ubuntu.com/about/release-cycle) or equivalent. From 0d5b7f5e6f686194c9a7a41697137a7704db996e Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 31 May 2020 05:46:24 +0100 Subject: [PATCH 239/275] Add missing assessibility modifiers (#12820) # PR Summary Automated fix of [RCS1018](https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1018.md) ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../GetCimAssociatedInstanceCommand.cs | 8 ++++---- .../GetCimClassCommand.cs | 8 ++++---- .../GetCimInstanceCommand.cs | 8 ++++---- .../GetCimSessionCommand.cs | 4 ++-- .../InvokeCimMethodCommand.cs | 8 ++++---- .../NewCimInstanceCommand.cs | 8 ++++---- .../NewCimSessionOptionCommand.cs | 4 ++-- .../RegisterCimIndicationCommand.cs | 4 ++-- .../RemoveCimInstanceCommand.cs | 8 ++++---- .../RemoveCimSessionCommand.cs | 4 ++-- .../SetCimInstanceCommand.cs | 8 ++++---- .../PdhHelper.cs | 2 +- .../WindowsTaskbarJumpList/PropVariant.cs | 4 ++-- src/Microsoft.WSMan.Management/ConfigProvider.cs | 10 +++++----- src/Microsoft.WSMan.Management/CredSSP.cs | 2 +- src/Microsoft.WSMan.Management/Interop.cs | 2 +- src/Microsoft.WSMan.Management/InvokeWSManAction.cs | 6 +++--- src/Microsoft.WSMan.Management/WSManInstance.cs | 8 ++++---- .../engine/CommandCompletion/PseudoParameterBinder.cs | 2 +- .../engine/LanguagePrimitives.cs | 2 +- .../engine/MshMemberInfo.cs | 2 +- .../engine/NativeCommandProcessor.cs | 2 +- .../engine/ProcessCodeMethods.cs | 6 +++--- .../engine/parser/AstVisitor.cs | 4 ++-- .../engine/parser/TypeInferenceVisitor.cs | 4 ++-- .../engine/runtime/CompiledScriptBlock.cs | 4 ++-- .../logging/LogProvider.cs | 2 +- 27 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 680693aab4b..21d61b78b5e 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -278,7 +278,7 @@ protected override void EndProcessing() /// used to delegate all Get-CimAssociatedInstance operations. /// /// - CimGetAssociatedInstance GetOperationAgent() + private CimGetAssociatedInstance GetOperationAgent() { return this.AsyncOperation as CimGetAssociatedInstance; } @@ -290,7 +290,7 @@ CimGetAssociatedInstance GetOperationAgent() /// /// /// - CimGetAssociatedInstance CreateOperationAgent() + private CimGetAssociatedInstance CreateOperationAgent() { this.AsyncOperation = new CimGetAssociatedInstance(); return GetOperationAgent(); @@ -319,7 +319,7 @@ CimGetAssociatedInstance CreateOperationAgent() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameComputerName, new HashSet { @@ -348,7 +348,7 @@ CimGetAssociatedInstance CreateOperationAgent() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.SessionSetName, new ParameterSetEntry(2, false) }, { CimBaseCommand.ComputerSetName, new ParameterSetEntry(1, true) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index a1a33d1eddd..71785c5db73 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -252,7 +252,7 @@ protected override void EndProcessing() /// used to delegate all New-CimInstance operations. /// /// - CimGetCimClass GetOperationAgent() + private CimGetCimClass GetOperationAgent() { return (this.AsyncOperation as CimGetCimClass); } @@ -264,7 +264,7 @@ CimGetCimClass GetOperationAgent() /// /// /// - CimGetCimClass CreateOperationAgent() + private CimGetCimClass CreateOperationAgent() { CimGetCimClass cimGetCimClass = new CimGetCimClass(); this.AsyncOperation = cimGetCimClass; @@ -292,7 +292,7 @@ CimGetCimClass CreateOperationAgent() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameCimSession, new HashSet { @@ -310,7 +310,7 @@ CimGetCimClass CreateOperationAgent() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.SessionSetName, new ParameterSetEntry(1) }, { CimBaseCommand.ComputerSetName, new ParameterSetEntry(0, true) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs index 4eb43d9b65c..d579dc36663 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -493,7 +493,7 @@ protected override void EndProcessing() /// as enumerate instances, get instance, query instance. /// /// - CimGetInstance GetOperationAgent() + private CimGetInstance GetOperationAgent() { return (this.AsyncOperation as CimGetInstance); } @@ -506,7 +506,7 @@ CimGetInstance GetOperationAgent() /// /// /// - CimGetInstance CreateOperationAgent() + private CimGetInstance CreateOperationAgent() { CimGetInstance cimGetInstance = new CimGetInstance(); this.AsyncOperation = cimGetInstance; @@ -553,7 +553,7 @@ private void CheckArgument() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameCimSession, new HashSet { @@ -657,7 +657,7 @@ private void CheckArgument() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.CimInstanceComputerSet, new ParameterSetEntry(1) }, { CimBaseCommand.CimInstanceSessionSet, new ParameterSetEntry(2) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs index ada9019068a..34d10b1d204 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs @@ -173,7 +173,7 @@ protected override void ProcessRecord() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameComputerName, new HashSet { @@ -200,7 +200,7 @@ protected override void ProcessRecord() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.ComputerNameSet, new ParameterSetEntry(0, true) }, { CimBaseCommand.SessionIdSet, new ParameterSetEntry(1) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index 914c4d00334..2363bf80b71 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -417,7 +417,7 @@ protected override void EndProcessing() /// used to delegate all Invoke-CimMethod operations. /// /// - CimInvokeCimMethod GetOperationAgent() + private CimInvokeCimMethod GetOperationAgent() { return this.AsyncOperation as CimInvokeCimMethod; } @@ -429,7 +429,7 @@ CimInvokeCimMethod GetOperationAgent() /// /// /// - CimInvokeCimMethod CreateOperationAgent() + private CimInvokeCimMethod CreateOperationAgent() { CimInvokeCimMethod cimInvokeMethod = new CimInvokeCimMethod(); this.AsyncOperation = cimInvokeMethod; @@ -473,7 +473,7 @@ private void CheckArgument() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameClassName, new HashSet { @@ -560,7 +560,7 @@ private void CheckArgument() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.ClassNameComputerSet, new ParameterSetEntry(2, true) }, { CimBaseCommand.ResourceUriSessionSet, new ParameterSetEntry(3) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index c15a8da548d..96cc061c3e7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -387,7 +387,7 @@ protected override void EndProcessing() /// used to delegate all New-CimInstance operations. /// /// - CimNewCimInstance GetOperationAgent() + private CimNewCimInstance GetOperationAgent() { return (this.AsyncOperation as CimNewCimInstance); } @@ -399,7 +399,7 @@ CimNewCimInstance GetOperationAgent() /// /// /// - CimNewCimInstance CreateOperationAgent() + private CimNewCimInstance CreateOperationAgent() { CimNewCimInstance cimNewCimInstance = new CimNewCimInstance(); this.AsyncOperation = cimNewCimInstance; @@ -441,7 +441,7 @@ private void CheckArgument() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameClassName, new HashSet { @@ -504,7 +504,7 @@ private void CheckArgument() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.ClassNameSessionSet, new ParameterSetEntry(2) }, { CimBaseCommand.ClassNameComputerSet, new ParameterSetEntry(1, true) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index 6184e7cb9ab..aba99d9401c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -712,7 +712,7 @@ internal WSManSessionOptions CreateWSMANSessionOptions() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameNoEncryption, new HashSet { @@ -813,7 +813,7 @@ internal WSManSessionOptions CreateWSMANSessionOptions() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.ProtocolNameParameterSet, new ParameterSetEntry(1, true) }, { CimBaseCommand.DcomParameterSet, new ParameterSetEntry(0) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs index 56214e627b7..8e2e6ae27fd 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs @@ -320,7 +320,7 @@ private void SetParameter(object value, string parameterName) /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameClassName, new HashSet { @@ -357,7 +357,7 @@ private void SetParameter(object value, string parameterName) /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.QueryExpressionSessionSet, new ParameterSetEntry(2) }, { CimBaseCommand.QueryExpressionComputerSet, new ParameterSetEntry(1) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index 7ab67b83cc2..8aeafe713b7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -287,7 +287,7 @@ protected override void EndProcessing() /// used to delegate all Remove-CimInstance operations. /// /// - CimRemoveCimInstance GetOperationAgent() + private CimRemoveCimInstance GetOperationAgent() { return (this.AsyncOperation as CimRemoveCimInstance); } @@ -299,7 +299,7 @@ CimRemoveCimInstance GetOperationAgent() /// /// /// - CimRemoveCimInstance CreateOperationAgent() + private CimRemoveCimInstance CreateOperationAgent() { CimRemoveCimInstance cimRemoveInstance = new CimRemoveCimInstance(); this.AsyncOperation = cimRemoveInstance; @@ -323,7 +323,7 @@ CimRemoveCimInstance CreateOperationAgent() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameCimSession, new HashSet { @@ -372,7 +372,7 @@ CimRemoveCimInstance CreateOperationAgent() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.CimInstanceComputerSet, new ParameterSetEntry(1, true) }, { CimBaseCommand.CimInstanceSessionSet, new ParameterSetEntry(2) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs index fe7b7643b2a..2fb4126a5b0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs @@ -199,7 +199,7 @@ protected override void ProcessRecord() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameCimSession, new HashSet { @@ -231,7 +231,7 @@ protected override void ProcessRecord() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.CimSessionSet, new ParameterSetEntry(1, true) }, { CimBaseCommand.ComputerNameSet, new ParameterSetEntry(1) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index 5b1e6bc154d..2ed4b3e093f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -344,7 +344,7 @@ protected override void EndProcessing() /// used to delegate all Set-CimInstance operations. /// /// - CimSetCimInstance GetOperationAgent() + private CimSetCimInstance GetOperationAgent() { return (this.AsyncOperation as CimSetCimInstance); } @@ -356,7 +356,7 @@ CimSetCimInstance GetOperationAgent() /// /// /// - CimSetCimInstance CreateOperationAgent() + private CimSetCimInstance CreateOperationAgent() { CimSetCimInstance cimSetCimInstance = new CimSetCimInstance(); this.AsyncOperation = cimSetCimInstance; @@ -381,7 +381,7 @@ CimSetCimInstance CreateOperationAgent() /// /// Static parameter definition entries. /// - static Dictionary> parameters = new Dictionary> + private static Dictionary> parameters = new Dictionary> { { nameCimSession, new HashSet { @@ -438,7 +438,7 @@ CimSetCimInstance CreateOperationAgent() /// /// Static parameter set entries. /// - static Dictionary parameterSets = new Dictionary + private static Dictionary parameterSets = new Dictionary { { CimBaseCommand.QuerySessionSet, new ParameterSetEntry(3) }, { CimBaseCommand.QueryComputerSet, new ParameterSetEntry(2) }, diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs index c6c1ddd8be8..40935f6c8e0 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs @@ -270,7 +270,7 @@ private struct PDH_TIME_INFO // We access those fields directly. The struct is here for reference only. // [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] - struct PDH_COUNTER_INFO + private struct PDH_COUNTER_INFO { [FieldOffset(0)] public UInt32 dwLength; [FieldOffset(4)] public UInt32 dwType; diff --git a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs index b877ab4e384..5c76d6051b8 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList/PropVariant.cs @@ -19,10 +19,10 @@ internal sealed class PropVariant : IDisposable { // This is actually a VarEnum value, but the VarEnum type requires 4 bytes instead of the expected 2. [FieldOffset(0)] - ushort _valueType; + private ushort _valueType; [FieldOffset(8)] - IntPtr _ptr; + private IntPtr _ptr; /// /// Set a string value. diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index a5b62bc6cb9..7384bacf026 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -38,17 +38,17 @@ public sealed class WSManConfigProvider : NavigationCmdletProvider, ICmdletProvi /// private bool clearItemIsCalled = false; - WSManHelper helper = new WSManHelper(); + private WSManHelper helper = new WSManHelper(); /// /// Object contains the cache of the enumerate results for the cmdlet to execute. /// - Dictionary enumerateMapping = new Dictionary(); + private Dictionary enumerateMapping = new Dictionary(); /// /// Mapping of ResourceURI with the XML returned by the Get call. /// - Dictionary getMapping = new Dictionary(); + private Dictionary getMapping = new Dictionary(); #region ICmdletProviderSupportsHelp Members @@ -5431,13 +5431,13 @@ private bool IsValueOfParamList(string name, string[] paramcontainer) #endregion Plugin private functions - enum ProviderMethods + private enum ProviderMethods { GetChildItems, GetChildNames }; - enum WsManElementObjectTypes + private enum WsManElementObjectTypes { WSManConfigElement, WSManConfigContainerElement, diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index 259bf4910ff..abb523f681e 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -751,7 +751,7 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate public class GetWSManCredSSPCommand : PSCmdlet, IDisposable { #region private - WSManHelper helper = null; + private WSManHelper helper = null; /// /// Method to get the values. /// diff --git a/src/Microsoft.WSMan.Management/Interop.cs b/src/Microsoft.WSMan.Management/Interop.cs index 663e1e35ec7..7df5d16fc93 100644 --- a/src/Microsoft.WSMan.Management/Interop.cs +++ b/src/Microsoft.WSMan.Management/Interop.cs @@ -1056,7 +1056,7 @@ public class GPClass [ComImport, Guid("EA502723-A23D-11d1-A7D3-0000F87571E3"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - interface IGroupPolicyObject + internal interface IGroupPolicyObject { void New( [MarshalAs(UnmanagedType.LPWStr)] string pszDomainName, diff --git a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs index f237a0f740b..71f8ae4c84d 100644 --- a/src/Microsoft.WSMan.Management/InvokeWSManAction.cs +++ b/src/Microsoft.WSMan.Management/InvokeWSManAction.cs @@ -245,9 +245,9 @@ public Uri ResourceURI private Uri resourceuri; private WSManHelper helper; - IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); - IWSManSession m_session = null; - string connectionStr = string.Empty; + private IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); + private IWSManSession m_session = null; + private string connectionStr = string.Empty; /// /// BeginProcessing method. diff --git a/src/Microsoft.WSMan.Management/WSManInstance.cs b/src/Microsoft.WSMan.Management/WSManInstance.cs index e740fc45632..00a824c6d66 100644 --- a/src/Microsoft.WSMan.Management/WSManInstance.cs +++ b/src/Microsoft.WSMan.Management/WSManInstance.cs @@ -397,7 +397,7 @@ public SwitchParameter UseSSL #endregion parameter # region private - WSManHelper helper; + private WSManHelper helper; private string GetFilter() { @@ -1475,9 +1475,9 @@ public Hashtable ValueSet private Hashtable valueset; private WSManHelper helper; - IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); - IWSManSession m_session = null; - string connectionStr = string.Empty; + private IWSManEx m_wsmanObject = (IWSManEx)new WSManClass(); + private IWSManSession m_session = null; + private string connectionStr = string.Empty; /// /// BeginProcessing method. diff --git a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs index c1b3f16adcb..d19a4b9bddb 100644 --- a/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs +++ b/src/System.Management.Automation/engine/CommandCompletion/PseudoParameterBinder.cs @@ -357,7 +357,7 @@ public static StaticBindingResult BindCommand(CommandAst commandAst, bool resolv } [ThreadStatic] - static Runspace t_bindCommandRunspace = null; + private static Runspace t_bindCommandRunspace = null; } /// diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 83690003bf7..61a6512a027 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -5061,7 +5061,7 @@ private static IConversionData FigureLanguageConversion(Type fromType, Type toTy private struct SignatureComparator { - enum TypeMatchingContext + private enum TypeMatchingContext { ReturnType, ParameterType, diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index 6a51580922f..f60aa8f6f3e 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -2804,7 +2804,7 @@ public bool MoveNext() return MoveNext(_t, _currentIndex); } - bool MoveNext(Type type, int index) + private bool MoveNext(Type type, int index) { var genericTypeArguments = type.GenericTypeArguments; var length = genericTypeArguments.Length; diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index f4ef83bab88..9c1a92fcda2 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -1832,7 +1832,7 @@ internal void Start(Process process, NativeCommandIOFormat inputFormat) } } - bool _stopping = false; + private bool _stopping = false; /// /// Stop writing input to process. diff --git a/src/System.Management.Automation/engine/ProcessCodeMethods.cs b/src/System.Management.Automation/engine/ProcessCodeMethods.cs index 04487f923f8..604ac3787ad 100644 --- a/src/System.Management.Automation/engine/ProcessCodeMethods.cs +++ b/src/System.Management.Automation/engine/ProcessCodeMethods.cs @@ -13,7 +13,7 @@ namespace Microsoft.PowerShell /// public static class ProcessCodeMethods { - const int InvalidProcessId = -1; + private const int InvalidProcessId = -1; internal static Process GetParent(this Process process) { @@ -69,7 +69,7 @@ internal static int GetParentPid(Process process) } [StructLayout(LayoutKind.Sequential)] - struct PROCESS_BASIC_INFORMATION + private struct PROCESS_BASIC_INFORMATION { public IntPtr ExitStatus; public IntPtr PebBaseAddress; @@ -80,7 +80,7 @@ struct PROCESS_BASIC_INFORMATION } [DllImport("ntdll.dll", SetLastError = true)] - static extern int NtQueryInformationProcess( + private static extern int NtQueryInformationProcess( IntPtr processHandle, int processInformationClass, out PROCESS_BASIC_INFORMATION processInformation, diff --git a/src/System.Management.Automation/engine/parser/AstVisitor.cs b/src/System.Management.Automation/engine/parser/AstVisitor.cs index 28cc235140a..4d24dcf55a3 100644 --- a/src/System.Management.Automation/engine/parser/AstVisitor.cs +++ b/src/System.Management.Automation/engine/parser/AstVisitor.cs @@ -181,7 +181,7 @@ public interface ICustomAstVisitor2 : ICustomAstVisitor } #if DEBUG - class CheckAllParentsSet : AstVisitor2 + internal class CheckAllParentsSet : AstVisitor2 { internal CheckAllParentsSet(Ast root) { @@ -328,7 +328,7 @@ internal AstVisitAction CheckParent(Ast ast) /// /// Check if contains type. /// - class CheckTypeBuilder : AstVisitor2 + internal class CheckTypeBuilder : AstVisitor2 { public override AstVisitAction VisitTypeConstraint(TypeConstraintAst ast) { diff --git a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs index e09ece216ae..f49c1fe5cd3 100644 --- a/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs +++ b/src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs @@ -109,7 +109,7 @@ internal static IList InferTypeOf( } } - class PSTypeNameComparer : IEqualityComparer + internal class PSTypeNameComparer : IEqualityComparer { public bool Equals(PSTypeName x, PSTypeName y) { @@ -2347,7 +2347,7 @@ private static CommandBaseAst GetPreviousPipelineCommand(CommandAst commandAst) } } - static class TypeInferenceExtension + internal static class TypeInferenceExtension { public static bool EqualsOrdinalIgnoreCase(this string s, string t) { diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index 6f69be4eb49..d4bae986cdf 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -1779,7 +1779,7 @@ internal static string CheckSuspiciousContent(Ast scriptBlockAst) return null; } - class SuspiciousContentChecker + private class SuspiciousContentChecker { // Based on a (bad) random number generator, but good enough // for our simple needs. @@ -1794,7 +1794,7 @@ class SuspiciousContentChecker /// code - needed only to generate this switch statement below.) /// /// The string matching the hash, or null. - static string LookupHash(uint h) + private static string LookupHash(uint h) { switch (h) { diff --git a/src/System.Management.Automation/logging/LogProvider.cs b/src/System.Management.Automation/logging/LogProvider.cs index 19eed89d968..a46f181b262 100644 --- a/src/System.Management.Automation/logging/LogProvider.cs +++ b/src/System.Management.Automation/logging/LogProvider.cs @@ -228,7 +228,7 @@ protected static PSLevel GetPSLevelFromSeverity(string severity) // Estimated length of all Strings.* values // Rough estimate of values // max path for Command path - const int LogContextInitialSize = 30 * 16 + 13 * 20 + 255; + private const int LogContextInitialSize = 30 * 16 + 13 * 20 + 255; /// /// Converts log context to string. From 4e98011833869d0ec2b327b132ef4520e8672190 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 31 May 2020 06:01:08 +0100 Subject: [PATCH 240/275] cleanup: Use coalesce expression (#12829) --- .../GetCimAssociatedInstanceCommand.cs | 6 +--- .../GetCimClassCommand.cs | 6 +--- .../GetCimInstanceCommand.cs | 6 +--- .../InvokeCimMethodCommand.cs | 6 +--- .../NewCimInstanceCommand.cs | 6 +--- .../RemoveCimInstanceCommand.cs | 6 +--- .../SetCimInstanceCommand.cs | 6 +--- .../FilterRuleTemplateSelector.cs | 6 +--- .../commandHelpers/ShowCommandHelper.cs | 6 +--- .../commands/utility/AddType.cs | 6 +--- src/Microsoft.WSMan.Management/CredSSP.cs | 8 ++--- .../WSManConnections.cs | 6 +--- src/Microsoft.WSMan.Management/WsManHelper.cs | 6 +--- .../engine/PSConfiguration.cs | 31 +++++-------------- .../engine/SessionStateDriveAPIs.cs | 13 ++++---- .../engine/lang/parserutils.cs | 11 +++---- .../help/HelpProvider.cs | 12 ++----- 17 files changed, 35 insertions(+), 112 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 21d61b78b5e..36987d35bd9 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -248,11 +248,7 @@ protected override void BeginProcessing() protected override void ProcessRecord() { base.CheckParameterSet(); - CimGetAssociatedInstance operation = this.GetOperationAgent(); - if (operation == null) - { - operation = this.CreateOperationAgent(); - } + CimGetAssociatedInstance operation = this.GetOperationAgent() ?? this.CreateOperationAgent(); operation.GetCimAssociatedInstance(this); operation.ProcessActions(this.CmdletOperation); diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index 71785c5db73..a439e263f0d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -220,11 +220,7 @@ protected override void BeginProcessing() protected override void ProcessRecord() { base.CheckParameterSet(); - CimGetCimClass cimGetCimClass = this.GetOperationAgent(); - if (cimGetCimClass == null) - { - cimGetCimClass = CreateOperationAgent(); - } + CimGetCimClass cimGetCimClass = this.GetOperationAgent() ?? CreateOperationAgent(); cimGetCimClass.GetCimClass(this); cimGetCimClass.ProcessActions(this.CmdletOperation); diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs index d579dc36663..60c6e6bfa7e 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -460,11 +460,7 @@ protected override void ProcessRecord() { base.CheckParameterSet(); this.CheckArgument(); - CimGetInstance cimGetInstance = this.GetOperationAgent(); - if (cimGetInstance == null) - { - cimGetInstance = CreateOperationAgent(); - } + CimGetInstance cimGetInstance = this.GetOperationAgent() ?? CreateOperationAgent(); cimGetInstance.GetCimInstance(this); cimGetInstance.ProcessActions(this.CmdletOperation); diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index 2363bf80b71..e777987a87b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -373,11 +373,7 @@ public UInt32 OperationTimeoutSec /// protected override void BeginProcessing() { - CimInvokeCimMethod cimInvokeMethod = this.GetOperationAgent(); - if (cimInvokeMethod == null) - { - cimInvokeMethod = CreateOperationAgent(); - } + CimInvokeCimMethod cimInvokeMethod = this.GetOperationAgent() ?? CreateOperationAgent(); this.CmdletOperation = new CmdletOperationInvokeCimMethod(this, cimInvokeMethod); this.AtBeginProcess = false; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index 96cc061c3e7..31b860777ea 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -355,11 +355,7 @@ protected override void ProcessRecord() } } - CimNewCimInstance cimNewCimInstance = this.GetOperationAgent(); - if (cimNewCimInstance == null) - { - cimNewCimInstance = CreateOperationAgent(); - } + CimNewCimInstance cimNewCimInstance = this.GetOperationAgent() ?? CreateOperationAgent(); cimNewCimInstance.NewCimInstance(this); cimNewCimInstance.ProcessActions(this.CmdletOperation); diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index 8aeafe713b7..60b152055b9 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -244,11 +244,7 @@ public string QueryDialect /// protected override void BeginProcessing() { - CimRemoveCimInstance cimRemoveInstance = this.GetOperationAgent(); - if (cimRemoveInstance == null) - { - cimRemoveInstance = CreateOperationAgent(); - } + CimRemoveCimInstance cimRemoveInstance = this.GetOperationAgent() ?? CreateOperationAgent(); this.CmdletOperation = new CmdletOperationRemoveCimInstance(this, cimRemoveInstance); this.AtBeginProcess = false; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index 2ed4b3e093f..7237352b61a 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -301,11 +301,7 @@ public SwitchParameter PassThru /// protected override void BeginProcessing() { - CimSetCimInstance cimSetCimInstance = this.GetOperationAgent(); - if (cimSetCimInstance == null) - { - cimSetCimInstance = CreateOperationAgent(); - } + CimSetCimInstance cimSetCimInstance = this.GetOperationAgent() ?? CreateOperationAgent(); this.CmdletOperation = new CmdletOperationSetCimInstance(this, cimSetCimInstance); this.AtBeginProcess = false; diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs index e7e44ce8507..fc40c3c5768 100644 --- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs +++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterProviders/FilterRuleTemplateSelector.cs @@ -45,11 +45,7 @@ public override DataTemplate SelectTemplate(object item, System.Windows.Dependen return base.SelectTemplate(item, container); } - Type type = item as Type; - if (type == null) - { - type = item.GetType(); - } + Type type = item as Type ?? item.GetType(); DataTemplate template; diff --git a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs index bc15f1e76bd..2f66687d9e2 100644 --- a/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs +++ b/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs @@ -597,11 +597,7 @@ internal static List GetCommandList(object[] commandObje /// An array of objects out of . internal static object[] ObjectArrayFromObjectCollection(object commandObjects) { - object[] objectArray = commandObjects as object[]; - if (objectArray == null) - { - objectArray = ((System.Collections.ArrayList)commandObjects).ToArray(); - } + object[] objectArray = commandObjects as object[] ?? ((System.Collections.ArrayList)commandObjects).ToArray(); return objectArray; } diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index d504a43a46d..870c47b7ee2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -652,11 +652,7 @@ private void LoadAssemblies(IEnumerable assemblies) { // CoreCLR doesn't allow re-load TPA assemblies with different API (i.e. we load them by name and now want to load by path). // LoadAssemblyHelper helps us avoid re-loading them, if they already loaded. - Assembly assembly = LoadAssemblyHelper(assemblyName); - if (assembly == null) - { - assembly = Assembly.LoadFrom(ResolveAssemblyName(assemblyName, false)); - } + Assembly assembly = LoadAssemblyHelper(assemblyName) ?? Assembly.LoadFrom(ResolveAssemblyName(assemblyName, false)); if (PassThru) { diff --git a/src/Microsoft.WSMan.Management/CredSSP.cs b/src/Microsoft.WSMan.Management/CredSSP.cs index abb523f681e..aaa38a43bab 100644 --- a/src/Microsoft.WSMan.Management/CredSSP.cs +++ b/src/Microsoft.WSMan.Management/CredSSP.cs @@ -665,17 +665,13 @@ private void UpdateGPORegistrySettings(string applicationname, string[] delegate { string Registry_Path_Credentials_Delegation = Registry_Path + @"\CredentialsDelegation"; // open the registry key.If key is not present,create a new one - Credential_Delegation_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation, true); - if (Credential_Delegation_Key == null) - Credential_Delegation_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation, RegistryKeyPermissionCheck.ReadWriteSubTree); + Credential_Delegation_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation, true) ?? rootKey.CreateSubKey(Registry_Path_Credentials_Delegation, RegistryKeyPermissionCheck.ReadWriteSubTree); Credential_Delegation_Key.SetValue(helper.Key_Allow_Fresh_Credentials, 1, RegistryValueKind.DWord); Credential_Delegation_Key.SetValue(helper.Key_Concatenate_Defaults_AllowFresh, 1, RegistryValueKind.DWord); // add the delegate value - Allow_Fresh_Credential_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, true); - if (Allow_Fresh_Credential_Key == null) - Allow_Fresh_Credential_Key = rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, RegistryKeyPermissionCheck.ReadWriteSubTree); + Allow_Fresh_Credential_Key = rootKey.OpenSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, true) ?? rootKey.CreateSubKey(Registry_Path_Credentials_Delegation + @"\" + helper.Key_Allow_Fresh_Credentials, RegistryKeyPermissionCheck.ReadWriteSubTree); if (Allow_Fresh_Credential_Key != null) { diff --git a/src/Microsoft.WSMan.Management/WSManConnections.cs b/src/Microsoft.WSMan.Management/WSManConnections.cs index 103115fff98..4aeb283b81f 100644 --- a/src/Microsoft.WSMan.Management/WSManConnections.cs +++ b/src/Microsoft.WSMan.Management/WSManConnections.cs @@ -269,11 +269,7 @@ protected override void BeginProcessing() } } - string crtComputerName = computername; - if (crtComputerName == null) - { - crtComputerName = "localhost"; - } + string crtComputerName = computername ?? "localhost"; if (this.SessionState.Path.CurrentProviderLocation(WSManStringLiterals.rootpath).Path.StartsWith(this.SessionState.Drive.Current.Name + ":" + WSManStringLiterals.DefaultPathSeparator + crtComputerName, StringComparison.OrdinalIgnoreCase)) { diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index a1ce8af4214..7b0a8f4bf13 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -960,11 +960,7 @@ internal void CreateWsManConnection(string ParameterSetName, Uri connectionuri, IWSManSession m_session = CreateSessionObject(m_wsmanObject, authentication, sessionoption, credential, connectionStr, certificateThumbprint, usessl); m_session.Identify(0); - string key = computername; - if (key == null) - { - key = "localhost"; - } + string key = computername ?? "localhost"; AddtoDictionary(key, m_session); } diff --git a/src/System.Management.Automation/engine/PSConfiguration.cs b/src/System.Management.Automation/engine/PSConfiguration.cs index 6c585cc0a05..aacf5c50e32 100644 --- a/src/System.Management.Automation/engine/PSConfiguration.cs +++ b/src/System.Management.Automation/engine/PSConfiguration.cs @@ -219,38 +219,23 @@ internal void SetExperimentalFeatures(ConfigScope scope, string featureName, boo internal bool IsImplicitWinCompatEnabled() { - bool? settingValue = ReadValueFromFile(ConfigScope.CurrentUser, DisableImplicitWinCompatKey); - if (!settingValue.HasValue) - { - // if the setting is not mentioned in configuration files, then the default DisableImplicitWinCompat value is False - settingValue = ReadValueFromFile(ConfigScope.AllUsers, DisableImplicitWinCompatKey, defaultValue: false); - } + bool settingValue = ReadValueFromFile(ConfigScope.CurrentUser, DisableImplicitWinCompatKey) + ?? ReadValueFromFile(ConfigScope.AllUsers, DisableImplicitWinCompatKey) + ?? false; - return !settingValue.Value; + return !settingValue; } internal string[] GetWindowsPowerShellCompatibilityModuleDenyList() { - string[] settingValue = ReadValueFromFile(ConfigScope.CurrentUser, WindowsPowerShellCompatibilityModuleDenyListKey); - if (settingValue == null) - { - // if the setting is not mentioned in configuration files, then the default WindowsPowerShellCompatibilityModuleDenyList value is null - settingValue = ReadValueFromFile(ConfigScope.AllUsers, WindowsPowerShellCompatibilityModuleDenyListKey); - } - - return settingValue; + return ReadValueFromFile(ConfigScope.CurrentUser, WindowsPowerShellCompatibilityModuleDenyListKey) + ?? ReadValueFromFile(ConfigScope.AllUsers, WindowsPowerShellCompatibilityModuleDenyListKey); } internal string[] GetWindowsPowerShellCompatibilityNoClobberModuleList() { - string[] settingValue = ReadValueFromFile(ConfigScope.CurrentUser, WindowsPowerShellCompatibilityNoClobberModuleListKey); - if (settingValue == null) - { - // if the setting is not mentioned in configuration files, then the default WindowsPowerShellCompatibilityNoClobberModuleList value is null - settingValue = ReadValueFromFile(ConfigScope.AllUsers, WindowsPowerShellCompatibilityNoClobberModuleListKey); - } - - return settingValue; + return ReadValueFromFile(ConfigScope.CurrentUser, WindowsPowerShellCompatibilityNoClobberModuleListKey) + ?? ReadValueFromFile(ConfigScope.AllUsers, WindowsPowerShellCompatibilityNoClobberModuleListKey); } /// diff --git a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs index 91228e4dd1b..7c2eeb447c8 100644 --- a/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs +++ b/src/System.Management.Automation/engine/SessionStateDriveAPIs.cs @@ -473,13 +473,9 @@ private PSDriveInfo GetDrive(string name, bool automount) if (result == null && automount) { - // first try to automount as a file system drive - result = AutomountFileSystemDrive(name); - // if it didn't work, then try automounting as a BuiltIn drive (e.g. "Cert"/"Certificate"/"WSMan") - if (result == null) - { - result = AutomountBuiltInDrive(name); // internally this calls GetDrive(name, false) - } + // Attempt to automount as a file system drive + // or as a BuiltIn drive (e.g. "Cert"/"Certificate"/"WSMan") + result = AutomountFileSystemDrive(name) ?? AutomountBuiltInDrive(name); } if (result == null) @@ -744,6 +740,9 @@ private PSDriveInfo AutomountFileSystemDrive(System.IO.DriveInfo systemDriveInfo /// /// Auto-mounts a built-in drive. /// + /// + /// Calls GetDrive(name, false) internally. + /// /// The name of the drive to load. /// internal PSDriveInfo AutomountBuiltInDrive(string name) diff --git a/src/System.Management.Automation/engine/lang/parserutils.cs b/src/System.Management.Automation/engine/lang/parserutils.cs index 44eed05e518..6a3a533b121 100644 --- a/src/System.Management.Automation/engine/lang/parserutils.cs +++ b/src/System.Management.Automation/engine/lang/parserutils.cs @@ -1178,13 +1178,10 @@ internal static object MatchOperator(ExecutionContext context, IScriptExtent err // if passed an explicit regex, just use it // otherwise compile the expression. - Regex r = PSObject.Base(rval) as Regex; - if (r == null) - { - // In this situation, creation of Regex should not fail. We are not - // processing ArgumentException in this case. - r = NewRegex(PSObject.ToStringParser(context, rval), reOptions); - } + // In this situation, creation of Regex should not fail. We are not + // processing ArgumentException in this case. + Regex r = PSObject.Base(rval) as Regex + ?? NewRegex(PSObject.ToStringParser(context, rval), reOptions); IEnumerator list = LanguagePrimitives.GetEnumerator(lval); if (list == null) diff --git a/src/System.Management.Automation/help/HelpProvider.cs b/src/System.Management.Automation/help/HelpProvider.cs index 66a7ab1ab95..76ce3168432 100644 --- a/src/System.Management.Automation/help/HelpProvider.cs +++ b/src/System.Management.Automation/help/HelpProvider.cs @@ -225,15 +225,9 @@ internal string GetDefaultShellSearchPath() { string shellID = this.HelpSystem.ExecutionContext.ShellID; // Beginning in PowerShell 6.0.0.12, the $pshome is no longer registry specified, we search the application base instead. - string returnValue = Utils.GetApplicationBase(shellID); - - if (returnValue == null) - { - // use executing assemblies location in case registry entry not found - returnValue = Path.GetDirectoryName(PsUtils.GetMainModule(System.Diagnostics.Process.GetCurrentProcess()).FileName); - } - - return returnValue; + // We use executing assemblies location in case registry entry not found + return Utils.GetApplicationBase(shellID) + ?? Path.GetDirectoryName(PsUtils.GetMainModule(System.Diagnostics.Process.GetCurrentProcess()).FileName); } /// From e93381e73e16a0d55ceab879ccaa58456800371d Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 31 May 2020 06:10:22 +0100 Subject: [PATCH 241/275] Add readonly modifier to internal static members (#11777) # PR Summary * Add readonly modifier to internal static members. ## PR Context ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../CimSessionOperations.cs | 22 ++++---- .../Utils.cs | 52 +++++++++---------- .../commands/management/Navigation.cs | 2 +- .../commands/management/Process.cs | 16 +++--- .../host/msh/CommandLineParameterParser.cs | 2 +- .../host/msh/ConsoleHostUserInterface.cs | 2 +- .../security/CertificateProvider.cs | 2 +- src/Microsoft.WSMan.Management/WsManHelper.cs | 4 +- .../CoreCLR/CorePsPlatform.cs | 2 +- .../common/BaseOutputtingCommand.cs | 2 +- .../FormatAndOutput/common/OutputManager.cs | 2 +- .../common/Utilities/MshParameter.cs | 2 +- .../Utilities/MshParameterAssociation.cs | 2 +- .../out-console/ConsoleLineOutput.cs | 2 +- .../engine/CommandDiscovery.cs | 4 +- .../engine/ExecutionContext.cs | 2 +- .../engine/InitialSessionState.cs | 24 ++++----- .../engine/LanguagePrimitives.cs | 6 +-- .../engine/Modules/AnalysisCache.cs | 2 +- .../engine/Modules/ModuleCmdletBase.cs | 6 +-- .../engine/Modules/ModuleIntrinsics.cs | 6 +-- .../engine/Modules/PSModuleInfo.cs | 2 +- .../engine/MshCommandRuntime.cs | 2 +- .../engine/MshObject.cs | 3 +- .../engine/MshObjectTypeDescriptor.cs | 2 +- .../engine/ParameterBinderBase.cs | 2 +- .../engine/PseudoParameters.cs | 2 +- .../engine/SpecialVariables.cs | 18 +++---- .../engine/TypeTable.cs | 2 +- .../engine/Utils.cs | 10 ++-- .../engine/interpreter/Utilities.cs | 4 +- .../engine/parser/Compiler.cs | 2 +- .../engine/parser/Parser.cs | 2 +- .../engine/parser/TypeResolver.cs | 6 +-- .../engine/parser/ast.cs | 2 +- .../NewPSSessionConfigurationOptionCommand.cs | 2 +- .../remoting/common/RunspaceConnectionInfo.cs | 2 +- .../fanin/InitialSessionStateProvider.cs | 2 +- .../engine/remoting/fanin/WSManPlugin.cs | 2 +- .../remoting/fanin/WSManPluginFacade.cs | 2 +- .../engine/runtime/CompiledScriptBlock.cs | 2 +- .../engine/runtime/Operations/NumericOps.cs | 4 +- .../engine/serialization.cs | 2 +- .../help/CabinetAPI.cs | 2 +- .../help/DefaultCommandHelpObjectBuilder.cs | 2 +- .../namespaces/FileSystemProvider.cs | 12 ++--- .../namespaces/ProviderBase.cs | 2 +- .../security/SecureStringHelper.cs | 2 +- .../security/SecuritySupport.cs | 8 +-- .../utils/EncodingUtils.cs | 2 +- .../utils/PlatformInvokes.cs | 18 +++---- 51 files changed, 145 insertions(+), 144 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs index 28d93fc668a..fb6a5f5972e 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs @@ -180,44 +180,44 @@ internal class CimSessionState : IDisposable /// where is the next available session number. /// For example, CimSession1, CimSession2, etc... /// - internal static string CimSessionClassName = "CimSession"; + internal static readonly string CimSessionClassName = "CimSession"; /// /// CimSession object name. /// - internal static string CimSessionObject = "{CimSession Object}"; + internal static readonly string CimSessionObject = "{CimSession Object}"; /// /// /// CimSession object path, which is identifying a cimsession object /// /// - internal static string SessionObjectPath = @"CimSession id = {0}, name = {2}, ComputerName = {3}, instance id = {1}"; + internal static readonly string SessionObjectPath = @"CimSession id = {0}, name = {2}, ComputerName = {3}, instance id = {1}"; /// /// Id property name of cimsession wrapper object. /// - internal static string idPropName = "Id"; + internal static readonly string idPropName = "Id"; /// /// Instanceid property name of cimsession wrapper object. /// - internal static string instanceidPropName = "InstanceId"; + internal static readonly string instanceidPropName = "InstanceId"; /// /// Name property name of cimsession wrapper object. /// - internal static string namePropName = "Name"; + internal static readonly string namePropName = "Name"; /// /// Computer name property name of cimsession object. /// - internal static string computernamePropName = "ComputerName"; + internal static readonly string computernamePropName = "ComputerName"; /// /// Protocol name property name of cimsession object. /// - internal static string protocolPropName = "Protocol"; + internal static readonly string protocolPropName = "Protocol"; /// /// @@ -813,7 +813,7 @@ public CimSessionBase() /// can running parallelly under more than one runspace(s). /// /// - internal static ConcurrentDictionary cimSessions + internal static readonly ConcurrentDictionary cimSessions = new ConcurrentDictionary(); /// @@ -821,7 +821,7 @@ internal static ConcurrentDictionary cimSessions /// Default runspace Id. /// /// - internal static Guid defaultRunspaceId = Guid.Empty; + internal static readonly Guid defaultRunspaceId = Guid.Empty; /// /// @@ -1209,7 +1209,7 @@ internal class CimRemoveSession : CimSessionBase /// /// Remove session action string. /// - internal static string RemoveCimSessionActionName = "Remove CimSession"; + internal static readonly string RemoveCimSessionActionName = "Remove CimSession"; /// /// Constructor. diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs index 76ba5c12a49..f46793eb50b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs @@ -27,47 +27,47 @@ internal static class ConstValue /// Default computername /// /// - internal static string[] DefaultSessionName = { @"*" }; + internal static readonly string[] DefaultSessionName = { @"*" }; /// /// /// Empty computername, which will create DCOM session /// /// - internal static string NullComputerName = null; + internal static readonly string NullComputerName = null; /// /// /// Empty computername array, which will create DCOM session /// /// - internal static string[] NullComputerNames = { NullComputerName }; + internal static readonly string[] NullComputerNames = { NullComputerName }; /// /// /// localhost computername, which will create WSMAN session /// /// - internal static string LocalhostComputerName = @"localhost"; + internal static readonly string LocalhostComputerName = @"localhost"; /// /// /// Default namespace /// /// - internal static string DefaultNameSpace = @"root\cimv2"; + internal static readonly string DefaultNameSpace = @"root\cimv2"; /// /// /// Default namespace /// /// - internal static string DefaultQueryDialect = @"WQL"; + internal static readonly string DefaultQueryDialect = @"WQL"; /// /// Name of the note property that controls if "PSComputerName" column is shown. /// - internal static string ShowComputerNameNoteProperty = "PSShowComputerName"; + internal static readonly string ShowComputerNameNoteProperty = "PSShowComputerName"; /// /// @@ -169,17 +169,17 @@ internal static bool GenerateVerboseMessage /// /// Flag used to control generating message into powershell. /// - internal static string logFile = @"c:\temp\Cim.log"; + internal static readonly string logFile = @"c:\temp\Cim.log"; /// /// Indent space string. /// - internal static string space = @" "; + internal static readonly string space = @" "; /// /// Indent space strings array. /// - internal static string[] spaces = { + internal static readonly string[] spaces = { string.Empty, space, space + space, @@ -191,26 +191,26 @@ internal static bool GenerateVerboseMessage /// /// Lock the log file. /// - internal static object logLock = new object(); + internal static readonly object logLock = new object(); #endregion #region internal strings - internal static string runspaceStateChanged = "Runspace {0} state changed to {1}"; - internal static string classDumpInfo = @"Class type is {0}"; - internal static string propertyDumpInfo = @"Property name {0} of type {1}, its value is {2}"; - internal static string defaultPropertyType = @"It is a default property, default value is {0}"; - internal static string propertyValueSet = @"This property value is set by user {0}"; - internal static string addParameterSetName = @"Add parameter set {0} name to cache"; - internal static string removeParameterSetName = @"Remove parameter set {0} name from cache"; - internal static string currentParameterSetNameCount = @"Cache have {0} parameter set names"; - internal static string currentParameterSetNameInCache = @"Cache have parameter set {0} valid {1}"; - internal static string currentnonMandatoryParameterSetInCache = @"Cache have optional parameter set {0} valid {1}"; - internal static string optionalParameterSetNameCount = @"Cache have {0} optional parameter set names"; - internal static string finalParameterSetName = @"------Final parameter set name of the cmdlet is {0}"; - internal static string addToOptionalParameterSet = @"Add to optional ParameterSetNames {0}"; - internal static string startToResolveParameterSet = @"------Resolve ParameterSet Name"; - internal static string reservedString = @"------"; + internal static readonly string runspaceStateChanged = "Runspace {0} state changed to {1}"; + internal static readonly string classDumpInfo = @"Class type is {0}"; + internal static readonly string propertyDumpInfo = @"Property name {0} of type {1}, its value is {2}"; + internal static readonly string defaultPropertyType = @"It is a default property, default value is {0}"; + internal static readonly string propertyValueSet = @"This property value is set by user {0}"; + internal static readonly string addParameterSetName = @"Add parameter set {0} name to cache"; + internal static readonly string removeParameterSetName = @"Remove parameter set {0} name from cache"; + internal static readonly string currentParameterSetNameCount = @"Cache have {0} parameter set names"; + internal static readonly string currentParameterSetNameInCache = @"Cache have parameter set {0} valid {1}"; + internal static readonly string currentnonMandatoryParameterSetInCache = @"Cache have optional parameter set {0} valid {1}"; + internal static readonly string optionalParameterSetNameCount = @"Cache have {0} optional parameter set names"; + internal static readonly string finalParameterSetName = @"------Final parameter set name of the cmdlet is {0}"; + internal static readonly string addToOptionalParameterSet = @"Add to optional ParameterSetNames {0}"; + internal static readonly string startToResolveParameterSet = @"------Resolve ParameterSet Name"; + internal static readonly string reservedString = @"------"; #endregion #region runtime methods diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs index 564a8daf3ec..4389f657f69 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Navigation.cs @@ -26,7 +26,7 @@ public abstract class CoreCommandBase : PSCmdlet, IDynamicParameters /// using "NavigationCommands" as the category. /// [Dbg.TraceSourceAttribute("NavigationCommands", "The namespace navigation tracer")] - internal static Dbg.PSTraceSource tracer = Dbg.PSTraceSource.GetTracer("NavigationCommands", "The namespace navigation tracer"); + internal static readonly Dbg.PSTraceSource tracer = Dbg.PSTraceSource.GetTracer("NavigationCommands", "The namespace navigation tracer"); #endregion Tracer diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 3a23322fff2..91665575118 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -2700,14 +2700,14 @@ internal struct JOBOBJECT_BASIC_PROCESS_ID_LIST internal static class ProcessNativeMethods { // Fields - internal static UInt32 GENERIC_READ = 0x80000000; - internal static UInt32 GENERIC_WRITE = 0x40000000; - internal static UInt32 FILE_ATTRIBUTE_NORMAL = 0x80000000; - internal static UInt32 CREATE_ALWAYS = 2; - internal static UInt32 FILE_SHARE_WRITE = 0x00000002; - internal static UInt32 FILE_SHARE_READ = 0x00000001; - internal static UInt32 OF_READWRITE = 0x00000002; - internal static UInt32 OPEN_EXISTING = 3; + internal static readonly UInt32 GENERIC_READ = 0x80000000; + internal static readonly UInt32 GENERIC_WRITE = 0x40000000; + internal static readonly UInt32 FILE_ATTRIBUTE_NORMAL = 0x80000000; + internal static readonly UInt32 CREATE_ALWAYS = 2; + internal static readonly UInt32 FILE_SHARE_WRITE = 0x00000002; + internal static readonly UInt32 FILE_SHARE_READ = 0x00000001; + internal static readonly UInt32 OF_READWRITE = 0x00000002; + internal static readonly UInt32 OPEN_EXISTING = 3; // Methods diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index 5e020c9ac65..ba90c7dd04e 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -183,7 +183,7 @@ internal class CommandLineParameterParser private const int MaxPipePathLengthLinux = 108; private const int MaxPipePathLengthMacOS = 104; - internal static string[] validParameters = { + internal static readonly string[] validParameters = { "sta", "mta", "command", diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs index cec08818f50..a4d0e91f540 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterface.cs @@ -1422,7 +1422,7 @@ public override void WriteErrorLine(string value) // We use System.Environment.NewLine because we are platform-agnostic - internal static string Crlf = System.Environment.NewLine; + internal static readonly string Crlf = System.Environment.NewLine; private const string Tab = "\x0009"; diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 6e524eff3de..3579ce7b46f 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -3386,7 +3386,7 @@ internal static class Crypt32Helpers /// private static object s_staticLock = new object(); - internal static List storeNames = new List(); + internal static readonly List storeNames = new List(); /// /// Get a list of store names at the specified location. diff --git a/src/Microsoft.WSMan.Management/WsManHelper.cs b/src/Microsoft.WSMan.Management/WsManHelper.cs index 7b0a8f4bf13..651840cd2ef 100644 --- a/src/Microsoft.WSMan.Management/WsManHelper.cs +++ b/src/Microsoft.WSMan.Management/WsManHelper.cs @@ -94,7 +94,7 @@ internal class Sessions /// /// Dictionary object to store the connection. /// - internal static Dictionary SessionObjCache = new Dictionary(); + internal static readonly Dictionary SessionObjCache = new Dictionary(); ~Sessions() { @@ -102,7 +102,7 @@ internal class Sessions } } - internal static Sessions AutoSession = new Sessions(); + internal static readonly Sessions AutoSession = new Sessions(); // // // diff --git a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs index 96ba4cd28fb..c6ac57070cb 100644 --- a/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs +++ b/src/System.Management.Automation/CoreCLR/CorePsPlatform.cs @@ -155,7 +155,7 @@ public static bool IsWindowsDesktop #endif // format files - internal static List FormatFileNames = new List + internal static readonly List FormatFileNames = new List { "Certificate.format.ps1xml", "Diagnostics.format.ps1xml", diff --git a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs index 2eea9f50c46..bb8305b2fdc 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/BaseOutputtingCommand.cs @@ -18,7 +18,7 @@ internal class OutCommandInner : ImplementationCommandBase { #region tracer [TraceSource("format_out_OutCommandInner", "OutCommandInner")] - internal static PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutCommandInner", "OutCommandInner"); + internal static readonly PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutCommandInner", "OutCommandInner"); #endregion tracer internal override void BeginProcessing() diff --git a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs index 861a3ab6405..b07731c3e04 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/OutputManager.cs @@ -20,7 +20,7 @@ internal sealed class OutputManagerInner : ImplementationCommandBase { #region tracer [TraceSource("format_out_OutputManagerInner", "OutputManagerInner")] - internal static PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutputManagerInner", "OutputManagerInner"); + internal static readonly PSTraceSource tracer = PSTraceSource.GetTracer("format_out_OutputManagerInner", "OutputManagerInner"); #endregion tracer #region LineOutput diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs index c9d509abeef..d04008a1f9a 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameter.cs @@ -228,7 +228,7 @@ internal sealed class ParameterProcessor { #region tracer [TraceSource("ParameterProcessor", "ParameterProcessor")] - internal static PSTraceSource tracer = PSTraceSource.GetTracer("ParameterProcessor", "ParameterProcessor"); + internal static readonly PSTraceSource tracer = PSTraceSource.GetTracer("ParameterProcessor", "ParameterProcessor"); #endregion tracer internal static void ThrowParameterBindingException(TerminatingErrorContext invocationContext, diff --git a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs index 7042bf85dd1..22b4c47ee40 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/Utilities/MshParameterAssociation.cs @@ -16,7 +16,7 @@ internal sealed class MshResolvedExpressionParameterAssociation { #region tracer [TraceSource("MshResolvedExpressionParameterAssociation", "MshResolvedExpressionParameterAssociation")] - internal static PSTraceSource tracer = PSTraceSource.GetTracer("MshResolvedExpressionParameterAssociation", + internal static readonly PSTraceSource tracer = PSTraceSource.GetTracer("MshResolvedExpressionParameterAssociation", "MshResolvedExpressionParameterAssociation"); #endregion tracer diff --git a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs index b0fe26cfd49..b6cde18fb65 100644 --- a/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs +++ b/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs @@ -153,7 +153,7 @@ internal sealed class ConsoleLineOutput : LineOutput { #region tracer [TraceSource("ConsoleLineOutput", "ConsoleLineOutput")] - internal static PSTraceSource tracer = PSTraceSource.GetTracer("ConsoleLineOutput", "ConsoleLineOutput"); + internal static readonly PSTraceSource tracer = PSTraceSource.GetTracer("ConsoleLineOutput", "ConsoleLineOutput"); #endregion tracer #region LineOutput implementation diff --git a/src/System.Management.Automation/engine/CommandDiscovery.cs b/src/System.Management.Automation/engine/CommandDiscovery.cs index 4b58da58cb6..4737fe18d78 100644 --- a/src/System.Management.Automation/engine/CommandDiscovery.cs +++ b/src/System.Management.Automation/engine/CommandDiscovery.cs @@ -115,7 +115,7 @@ public enum PSModuleAutoLoadingPreference internal class CommandDiscovery { [TraceSource("CommandDiscovery", "Traces the discovery of cmdlets, scripts, functions, applications, etc.")] - internal static PSTraceSource discoveryTracer = + internal static readonly PSTraceSource discoveryTracer = PSTraceSource.GetTracer( "CommandDiscovery", "Traces the discovery of cmdlets, scripts, functions, applications, etc.", @@ -1710,7 +1710,7 @@ internal Collection IndexOfRelativePath() [EventSource(Name = "Microsoft-PowerShell-CommandDiscovery")] internal class CommandDiscoveryEventSource : EventSource { - internal static CommandDiscoveryEventSource Log = new CommandDiscoveryEventSource(); + internal static readonly CommandDiscoveryEventSource Log = new CommandDiscoveryEventSource(); public void CommandLookupStart(string CommandName) { WriteEvent(1, CommandName); } diff --git a/src/System.Management.Automation/engine/ExecutionContext.cs b/src/System.Management.Automation/engine/ExecutionContext.cs index 592b4554811..98f0b3deb5a 100644 --- a/src/System.Management.Automation/engine/ExecutionContext.cs +++ b/src/System.Management.Automation/engine/ExecutionContext.cs @@ -492,7 +492,7 @@ internal bool UseFullLanguageModeInDebugger } } - internal static List ModulesWithJobSourceAdapters = new List + internal static readonly List ModulesWithJobSourceAdapters = new List { Utils.ScheduledJobModuleName, }; diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 6032259bea6..0d2e1274aa6 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -4435,7 +4435,7 @@ .ForwardHelpCategory Cmdlet internal const bool DefaultWhatIfPreference = false; internal const ConfirmImpact DefaultConfirmPreference = ConfirmImpact.High; - internal static SessionStateVariableEntry[] BuiltInVariables = new SessionStateVariableEntry[] + internal static readonly SessionStateVariableEntry[] BuiltInVariables = new SessionStateVariableEntry[] { // Engine variables that should be precreated before running profile // Bug fix for Win7:2202228 Engine halts if initial command fulls up variable table @@ -4772,11 +4772,11 @@ internal static SessionStateAliasEntry[] BuiltInAliases internal const string DefaultSetDriveFunctionText = "Set-Location $MyInvocation.MyCommand.Name"; - internal static ScriptBlock SetDriveScriptBlock = ScriptBlock.CreateDelayParsedScriptBlock(DefaultSetDriveFunctionText, isProductCode: true); + internal static readonly ScriptBlock SetDriveScriptBlock = ScriptBlock.CreateDelayParsedScriptBlock(DefaultSetDriveFunctionText, isProductCode: true); private static PSLanguageMode systemLanguageMode = (SystemPolicy.GetSystemLockdownPolicy() == SystemEnforcementMode.Enforce) ? PSLanguageMode.ConstrainedLanguage : PSLanguageMode.FullLanguage; - internal static SessionStateFunctionEntry[] BuiltInFunctions = new SessionStateFunctionEntry[] + internal static readonly SessionStateFunctionEntry[] BuiltInFunctions = new SessionStateFunctionEntry[] { // Functions that don't require full language mode SessionStateFunctionEntry.GetDelayParsedFunctionEntry("cd..", "Set-Location ..", isProductCode: true, languageMode: systemLanguageMode), @@ -4843,12 +4843,12 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt private static PSTraceSource s_PSSnapInTracer = PSTraceSource.GetTracer("PSSnapInLoadUnload", "Loading and unloading mshsnapins", false); - internal static string CoreSnapin = "Microsoft.PowerShell.Core"; - internal static string CoreModule = "Microsoft.PowerShell.Core"; + internal static readonly string CoreSnapin = "Microsoft.PowerShell.Core"; + internal static readonly string CoreModule = "Microsoft.PowerShell.Core"; internal Collection defaultSnapins = new Collection(); // The list of engine modules to create warnings when you try to remove them - internal static HashSet EngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) + internal static readonly HashSet EngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) { "Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Management", @@ -4858,7 +4858,7 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt "Microsoft.WSMan.Management" }; - internal static HashSet NestedEngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) + internal static readonly HashSet NestedEngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) { "Microsoft.PowerShell.Commands.Utility", "Microsoft.PowerShell.Commands.Management", @@ -4866,7 +4866,7 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt "Microsoft.PowerShell.ConsoleHost" }; - internal static Dictionary EngineModuleNestedModuleMapping = new Dictionary(StringComparer.OrdinalIgnoreCase) + internal static readonly Dictionary EngineModuleNestedModuleMapping = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Commands.Utility"}, { "Microsoft.PowerShell.Management", "Microsoft.PowerShell.Commands.Management"}, @@ -4874,7 +4874,7 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt { "Microsoft.PowerShell.Host", "Microsoft.PowerShell.ConsoleHost"}, }; - internal static Dictionary NestedModuleEngineModuleMapping = new Dictionary(StringComparer.OrdinalIgnoreCase) + internal static readonly Dictionary NestedModuleEngineModuleMapping = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "Microsoft.PowerShell.Commands.Utility", "Microsoft.PowerShell.Utility"}, { "Microsoft.PowerShell.Commands.Management", "Microsoft.PowerShell.Management"}, @@ -4885,13 +4885,13 @@ internal static void RemoveAllDrivesForProvider(ProviderInfo pi, SessionStateInt }; // The list of engine modules that we will not allow users to remove - internal static HashSet ConstantEngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) + internal static readonly HashSet ConstantEngineModules = new HashSet(StringComparer.OrdinalIgnoreCase) { CoreModule, }; // The list of nested engine modules that we will not allow users to remove - internal static HashSet ConstantEngineNestedModules = new HashSet(StringComparer.OrdinalIgnoreCase) + internal static readonly HashSet ConstantEngineNestedModules = new HashSet(StringComparer.OrdinalIgnoreCase) { "System.Management.Automation", }; @@ -5493,7 +5493,7 @@ private static string GetHelpFile(string assemblyPath) [EventSource(Name = "Microsoft-PowerShell-Runspaces")] internal class RunspaceEventSource : EventSource { - internal static RunspaceEventSource Log = new RunspaceEventSource(); + internal static readonly RunspaceEventSource Log = new RunspaceEventSource(); public void OpenRunspaceStart() { WriteEvent(1); } diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 61a6512a027..d4681be1a7b 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -1112,7 +1112,7 @@ internal static int TypeTableIndex(Type type) /// an exception when converted to decimal. /// The order of lines and columns cannot be changed since NumericCompare depends on it. /// - internal static Type[][] LargestTypeTable = new Type[][] + internal static readonly Type[][] LargestTypeTable = new Type[][] { // System.Int16 System.Int32 System.Int64 System.UInt16 System.UInt32 System.UInt64 System.SByte System.Byte System.Single System.Double System.Decimal /* System.Int16 */new Type[] { typeof(System.Int16), typeof(System.Int32), typeof(System.Int64), typeof(System.Int32), typeof(System.Int64), typeof(System.Double), typeof(System.Int16), typeof(System.Int16), typeof(System.Single), typeof(System.Double), typeof(System.Decimal) }, @@ -1423,8 +1423,8 @@ internal static void DoConversionsForSetInGenericDictionary(IDictionary dictiona #region type converter - internal static PSTraceSource typeConversion = PSTraceSource.GetTracer("TypeConversion", "Traces the type conversion algorithm", false); - internal static ConversionData NoConversion = new ConversionData(ConvertNoConversion, ConversionRank.None); + internal static readonly PSTraceSource typeConversion = PSTraceSource.GetTracer("TypeConversion", "Traces the type conversion algorithm", false); + internal static readonly ConversionData NoConversion = new ConversionData(ConvertNoConversion, ConversionRank.None); private static TypeConverter GetIntegerSystemConverter(Type type) { diff --git a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs index 324922e9daa..4baa7cc6bfa 100644 --- a/src/System.Management.Automation/engine/Modules/AnalysisCache.cs +++ b/src/System.Management.Automation/engine/Modules/AnalysisCache.cs @@ -35,7 +35,7 @@ internal class AnalysisCache private static ConcurrentDictionary s_modulesBeingAnalyzed = new ConcurrentDictionary( /*concurrency*/1, /*capacity*/2, StringComparer.OrdinalIgnoreCase); - internal static char[] InvalidCommandNameCharacters = new[] + internal static readonly char[] InvalidCommandNameCharacters = new[] { '#', ',', '(', ')', '{', '}', '[', ']', '&', '/', '\\', '$', '^', ';', ':', '"', '\'', '<', '>', '|', '?', '@', '`', '*', '%', '+', '=', '~' diff --git a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs index ebf89ed90cc..8e2e9c519ef 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs @@ -237,10 +237,10 @@ internal List MatchAll private List _matchAll; // The list of commands permitted in a module manifest - internal static string[] PermittedCmdlets = new string[] { + internal static readonly string[] PermittedCmdlets = new string[] { "Import-LocalizedData", "ConvertFrom-StringData", "Write-Host", "Out-Host", "Join-Path" }; - internal static string[] ModuleManifestMembers = new string[] { + internal static readonly string[] ModuleManifestMembers = new string[] { "ModuleToProcess", "NestedModules", "GUID", @@ -303,7 +303,7 @@ internal List MatchAll /// /// Synchronization object for creation/cleanup of WindowsPS compat remoting session. /// - internal static object s_WindowsPowerShellCompatSyncObject = new object(); + internal static readonly object s_WindowsPowerShellCompatSyncObject = new object(); private Dictionary _currentlyProcessingModules = new Dictionary(); diff --git a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs index a4d343131f3..11af91cd4e8 100644 --- a/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs +++ b/src/System.Management.Automation/engine/Modules/ModuleIntrinsics.cs @@ -32,7 +32,7 @@ public class ModuleIntrinsics /// Tracer for module analysis. /// [TraceSource("Modules", "Module loading and analysis")] - internal static PSTraceSource Tracer = PSTraceSource.GetTracer("Modules", "Module loading and analysis"); + internal static readonly PSTraceSource Tracer = PSTraceSource.GetTracer("Modules", "Module loading and analysis"); // The %WINDIR%\System32\WindowsPowerShell\v1.0\Modules module path, // to load forward compatible Windows PowerShell modules from @@ -895,7 +895,7 @@ internal static ExperimentalFeature[] GetExperimentalFeature(string manifestPath } // The extensions of all of the files that can be processed with Import-Module, put the ni.dll in front of .dll to have higher priority to be loaded. - internal static string[] PSModuleProcessableExtensions = new string[] { + internal static readonly string[] PSModuleProcessableExtensions = new string[] { StringLiterals.PowerShellDataFileExtension, StringLiterals.PowerShellScriptFileExtension, StringLiterals.PowerShellModuleFileExtension, @@ -906,7 +906,7 @@ internal static ExperimentalFeature[] GetExperimentalFeature(string manifestPath }; // A list of the extensions to check for implicit module loading and discovery, put the ni.dll in front of .dll to have higher priority to be loaded. - internal static string[] PSModuleExtensions = new string[] { + internal static readonly string[] PSModuleExtensions = new string[] { StringLiterals.PowerShellDataFileExtension, StringLiterals.PowerShellModuleFileExtension, StringLiterals.PowerShellCmdletizationFileExtension, diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index af0b93567b6..15e2495e4fd 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -1093,7 +1093,7 @@ private static void AddModuleToList(PSModuleInfo module, List modu moduleList.Add(module); } - internal static string[] _builtinVariables = new string[] { "_", "this", "input", "args", "true", "false", "null", + internal static readonly string[] _builtinVariables = new string[] { "_", "this", "input", "args", "true", "false", "null", "PSDefaultParameterValues", "Error", "PSScriptRoot", "PSCommandPath", "MyInvocation", "ExecutionContext", "StackTrace" }; /// diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 2c4396de1c4..4d07cd3d3a8 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -2231,7 +2231,7 @@ internal object[] GetResultsAsArray() /// An empty array that is declared statically so we don't keep /// allocating them over and over... /// - internal static object[] StaticEmptyArray = Array.Empty(); + internal static readonly object[] StaticEmptyArray = Array.Empty(); /// /// Gets or sets the error pipe. diff --git a/src/System.Management.Automation/engine/MshObject.cs b/src/System.Management.Automation/engine/MshObject.cs index 12a677bdd72..e7bfeec31d2 100644 --- a/src/System.Management.Automation/engine/MshObject.cs +++ b/src/System.Management.Automation/engine/MshObject.cs @@ -2466,7 +2466,8 @@ public class PSCustomObject /// private PSCustomObject() { } - internal static PSCustomObject SelfInstance = new PSCustomObject(); + internal static readonly PSCustomObject SelfInstance = new PSCustomObject(); + /// /// Returns an empty string. /// diff --git a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs index 3beae965b55..ee54859a1ea 100644 --- a/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs +++ b/src/System.Management.Automation/engine/MshObjectTypeDescriptor.cs @@ -330,7 +330,7 @@ private void DealWithSetValueException(ExtendedTypeSystemException e, out bool s /// public class PSObjectTypeDescriptor : CustomTypeDescriptor { - internal static PSTraceSource typeDescriptor = PSTraceSource.GetTracer("TypeDescriptor", "Traces the behavior of PSObjectTypeDescriptor, PSObjectTypeDescriptionProvider and PSObjectPropertyDescriptor.", false); + internal static readonly PSTraceSource typeDescriptor = PSTraceSource.GetTracer("TypeDescriptor", "Traces the behavior of PSObjectTypeDescriptor, PSObjectTypeDescriptionProvider and PSObjectPropertyDescriptor.", false); /// /// Occurs when there was an exception setting the value of a property. diff --git a/src/System.Management.Automation/engine/ParameterBinderBase.cs b/src/System.Management.Automation/engine/ParameterBinderBase.cs index 9823c090c48..4dcb5488041 100644 --- a/src/System.Management.Automation/engine/ParameterBinderBase.cs +++ b/src/System.Management.Automation/engine/ParameterBinderBase.cs @@ -61,7 +61,7 @@ internal abstract class ParameterBinderBase private static PSTraceSource s_tracer = PSTraceSource.GetTracer("ParameterBinderBase", "A abstract helper class for the CommandProcessor that binds parameters to the specified object."); [TraceSource("ParameterBinding", "Traces the process of binding the arguments to the parameters of cmdlets, scripts, and applications.")] - internal static PSTraceSource bindingTracer = + internal static readonly PSTraceSource bindingTracer = PSTraceSource.GetTracer( "ParameterBinding", "Traces the process of binding the arguments to the parameters of cmdlets, scripts, and applications.", diff --git a/src/System.Management.Automation/engine/PseudoParameters.cs b/src/System.Management.Automation/engine/PseudoParameters.cs index bccb2fb3f37..78ef034cf5b 100644 --- a/src/System.Management.Automation/engine/PseudoParameters.cs +++ b/src/System.Management.Automation/engine/PseudoParameters.cs @@ -236,6 +236,6 @@ public string HelpFile /// public object Data { get; set; } - internal static RuntimeDefinedParameter[] EmptyParameterArray = new RuntimeDefinedParameter[0]; + internal static readonly RuntimeDefinedParameter[] EmptyParameterArray = new RuntimeDefinedParameter[0]; } } diff --git a/src/System.Management.Automation/engine/SpecialVariables.cs b/src/System.Management.Automation/engine/SpecialVariables.cs index 5c4c4ba2f49..aa241b6c942 100644 --- a/src/System.Management.Automation/engine/SpecialVariables.cs +++ b/src/System.Management.Automation/engine/SpecialVariables.cs @@ -181,40 +181,40 @@ internal static class SpecialVariables internal const string pwd = "PWD"; - internal static VariablePath PWDVarPath = new VariablePath("global:" + pwd); + internal static readonly VariablePath PWDVarPath = new VariablePath("global:" + pwd); internal const string Null = "null"; - internal static VariablePath NullVarPath = new VariablePath("null"); + internal static readonly VariablePath NullVarPath = new VariablePath("null"); internal const string True = "true"; - internal static VariablePath TrueVarPath = new VariablePath("true"); + internal static readonly VariablePath TrueVarPath = new VariablePath("true"); internal const string False = "false"; - internal static VariablePath FalseVarPath = new VariablePath("false"); + internal static readonly VariablePath FalseVarPath = new VariablePath("false"); internal const string PSModuleAutoLoading = "PSModuleAutoLoadingPreference"; - internal static VariablePath PSModuleAutoLoadingPreferenceVarPath = new VariablePath("global:" + PSModuleAutoLoading); + internal static readonly VariablePath PSModuleAutoLoadingPreferenceVarPath = new VariablePath("global:" + PSModuleAutoLoading); #region Platform Variables internal const string IsLinux = "IsLinux"; - internal static VariablePath IsLinuxPath = new VariablePath("IsLinux"); + internal static readonly VariablePath IsLinuxPath = new VariablePath("IsLinux"); internal const string IsMacOS = "IsMacOS"; - internal static VariablePath IsMacOSPath = new VariablePath("IsMacOS"); + internal static readonly VariablePath IsMacOSPath = new VariablePath("IsMacOS"); internal const string IsWindows = "IsWindows"; - internal static VariablePath IsWindowsPath = new VariablePath("IsWindows"); + internal static readonly VariablePath IsWindowsPath = new VariablePath("IsWindows"); internal const string IsCoreCLR = "IsCoreCLR"; - internal static VariablePath IsCoreCLRPath = new VariablePath("IsCoreCLR"); + internal static readonly VariablePath IsCoreCLRPath = new VariablePath("IsCoreCLR"); #endregion #region Preference Variables diff --git a/src/System.Management.Automation/engine/TypeTable.cs b/src/System.Management.Automation/engine/TypeTable.cs index 0f2fab28cc0..2b0c0eb2ed0 100644 --- a/src/System.Management.Automation/engine/TypeTable.cs +++ b/src/System.Management.Automation/engine/TypeTable.cs @@ -1681,7 +1681,7 @@ public ConsolidatedString(IEnumerable strings) internal static readonly ConsolidatedString Empty = new ConsolidatedString(Array.Empty()); - internal static IEqualityComparer EqualityComparer = new ConsolidatedStringEqualityComparer(); + internal static readonly IEqualityComparer EqualityComparer = new ConsolidatedStringEqualityComparer(); private class ConsolidatedStringEqualityComparer : IEqualityComparer { diff --git a/src/System.Management.Automation/engine/Utils.cs b/src/System.Management.Automation/engine/Utils.cs index 14b7f9d55bf..12374148fa7 100644 --- a/src/System.Management.Automation/engine/Utils.cs +++ b/src/System.Management.Automation/engine/Utils.cs @@ -302,7 +302,7 @@ internal static int CombineHashCodes(int h1, int h2, int h3, int h4, int h5, int /// /// Allowed PowerShell Editions. /// - internal static string[] AllowedEditionValues = { "Desktop", "Core" }; + internal static readonly string[] AllowedEditionValues = { "Desktop", "Core" }; /// /// Helper fn to check byte[] arg for null. @@ -736,7 +736,7 @@ internal static bool IsValidPSEditionValue(string editionValue) /// The subdirectory of module paths /// e.g. ~\Documents\WindowsPowerShell\Modules and %ProgramFiles%\WindowsPowerShell\Modules. /// - internal static string ModuleDirectory = Path.Combine(ProductNameForDirectory, "Modules"); + internal static readonly string ModuleDirectory = Path.Combine(ProductNameForDirectory, "Modules"); internal static readonly ConfigScope[] SystemWideOnlyConfig = new[] { ConfigScope.AllUsers }; internal static readonly ConfigScope[] CurrentUserOnlyConfig = new[] { ConfigScope.CurrentUser }; @@ -1457,11 +1457,11 @@ internal static Encoding GetEncoding(string path) } // BigEndianUTF32 encoding is possible, but requires creation - internal static Encoding BigEndianUTF32Encoding = new UTF32Encoding(bigEndian: true, byteOrderMark: true); + internal static readonly Encoding BigEndianUTF32Encoding = new UTF32Encoding(bigEndian: true, byteOrderMark: true); // [System.Text.Encoding]::GetEncodings() | Where-Object { $_.GetEncoding().GetPreamble() } | // Add-Member ScriptProperty Preamble { $this.GetEncoding().GetPreamble() -join "-" } -PassThru | // Format-Table -Auto - internal static Dictionary encodingMap = + internal static readonly Dictionary encodingMap = new Dictionary() { { "255-254", Encoding.Unicode }, @@ -1471,7 +1471,7 @@ internal static Encoding GetEncoding(string path) { "239-187-191", Encoding.UTF8 }, }; - internal static char[] nonPrintableCharacters = { + internal static readonly char[] nonPrintableCharacters = { (char) 0, (char) 1, (char) 2, (char) 3, (char) 4, (char) 5, (char) 6, (char) 7, (char) 8, (char) 11, (char) 12, (char) 14, (char) 15, (char) 16, (char) 17, (char) 18, (char) 19, (char) 20, (char) 21, (char) 22, (char) 23, (char) 24, (char) 25, (char) 26, (char) 28, (char) 29, (char) 30, diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index baba0a41fa4..2ff8dbf9790 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -239,8 +239,8 @@ internal static object BooleanToObject(bool b) internal static readonly MethodInfo BooleanToObjectMethod = typeof(ScriptingRuntimeHelpers).GetMethod("BooleanToObject"); internal static readonly MethodInfo Int32ToObjectMethod = typeof(ScriptingRuntimeHelpers).GetMethod("Int32ToObject"); - internal static object True = true; - internal static object False = false; + internal static readonly object True = true; + internal static readonly object False = false; internal static object GetPrimitiveDefaultValue(Type type) { diff --git a/src/System.Management.Automation/engine/parser/Compiler.cs b/src/System.Management.Automation/engine/parser/Compiler.cs index 07e36bcdf75..25cee9e73e8 100644 --- a/src/System.Management.Automation/engine/parser/Compiler.cs +++ b/src/System.Management.Automation/engine/parser/Compiler.cs @@ -669,7 +669,7 @@ internal static class ExpressionCache // Empty expression is used at the end of blocks to give them the void expression result internal static readonly Expression Empty = Expression.Empty(); - internal static Expression GetExecutionContextFromTLS = + internal static readonly Expression GetExecutionContextFromTLS = Expression.Call(CachedReflectionInfo.LocalPipeline_GetExecutionContextFromTLS); internal static readonly Expression BoxedTrue = Expression.Field(null, typeof(Boxed).GetField("True", BindingFlags.Static | BindingFlags.NonPublic)); diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index df95f478075..6f13b768509 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -8083,7 +8083,7 @@ public override string ToString() [EventSource(Name = "Microsoft-PowerShell-Parser")] internal class ParserEventSource : EventSource { - internal static ParserEventSource Log = new ParserEventSource(); + internal static readonly ParserEventSource Log = new ParserEventSource(); internal const int MaxScriptLengthToLog = 50; diff --git a/src/System.Management.Automation/engine/parser/TypeResolver.cs b/src/System.Management.Automation/engine/parser/TypeResolver.cs index a0ae173907c..24c949960d1 100644 --- a/src/System.Management.Automation/engine/parser/TypeResolver.cs +++ b/src/System.Management.Automation/engine/parser/TypeResolver.cs @@ -723,7 +723,7 @@ internal static class CoreTypes // expose the ability to corrupt or escape PowerShell's environment. The following operations must // be safe: type conversion, all constructors, all methods (instance and static), and // and properties (instance and static). - internal static Lazy> Items = new Lazy>( + internal static readonly Lazy> Items = new Lazy>( () => new Dictionary { @@ -845,11 +845,11 @@ internal static bool Contains(Type inputType) internal static class TypeAccelerators { // builtins are not exposed publicly in a direct manner so they can't be changed at all - internal static Dictionary builtinTypeAccelerators = new Dictionary(64, StringComparer.OrdinalIgnoreCase); + internal static readonly Dictionary builtinTypeAccelerators = new Dictionary(64, StringComparer.OrdinalIgnoreCase); // users can add to user added accelerators (but not currently remove any.) Keeping a separate // list allows us to add removing in the future w/o worrying about breaking the builtins. - internal static Dictionary userTypeAccelerators = new Dictionary(64, StringComparer.OrdinalIgnoreCase); + internal static readonly Dictionary userTypeAccelerators = new Dictionary(64, StringComparer.OrdinalIgnoreCase); // We expose this one publicly for programmatic access to our type accelerator table, but it is // otherwise unused (so changes to this dictionary don't affect internals.) diff --git a/src/System.Management.Automation/engine/parser/ast.cs b/src/System.Management.Automation/engine/parser/ast.cs index be4bfc6b1bc..79d74b9edef 100644 --- a/src/System.Management.Automation/engine/parser/ast.cs +++ b/src/System.Management.Automation/engine/parser/ast.cs @@ -288,7 +288,7 @@ internal void ClearParent() internal abstract object Accept(ICustomAstVisitor visitor); internal abstract AstVisitAction InternalVisit(AstVisitor visitor); - internal static PSTypeName[] EmptyPSTypeNameArray = Array.Empty(); + internal static readonly PSTypeName[] EmptyPSTypeNameArray = Array.Empty(); internal bool IsInWorkflow() { diff --git a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs index c96f974763d..c1b3b3b7326 100644 --- a/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs +++ b/src/System.Management.Automation/engine/remoting/commands/NewPSSessionConfigurationOptionCommand.cs @@ -19,7 +19,7 @@ public class WSManConfigurationOption : PSTransportOption internal const string AttribOutputBufferingMode = "OutputBufferingMode"; - internal static System.Management.Automation.Runspaces.OutputBufferingMode? DefaultOutputBufferingMode = System.Management.Automation.Runspaces.OutputBufferingMode.Block; + internal static readonly System.Management.Automation.Runspaces.OutputBufferingMode? DefaultOutputBufferingMode = System.Management.Automation.Runspaces.OutputBufferingMode.Block; private System.Management.Automation.Runspaces.OutputBufferingMode? _outputBufferingMode = null; private const string AttribProcessIdleTimeout = "ProcessIdleTimeoutSec"; diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 2485b857752..b3159a0e557 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -1349,7 +1349,7 @@ private void UpdateUri(Uri uri) #if NOT_APPLY_PORT_DCR private static string DEFAULT_SCHEME = HTTP_SCHEME; - internal static string DEFAULT_SSL_SCHEME = HTTPS_SCHEME; + internal static readonly string DEFAULT_SSL_SCHEME = HTTPS_SCHEME; private static string DEFAULT_APP_NAME = "wsman"; /// /// See below for explanation. diff --git a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs index 9f938ac3d4a..174cad6743b 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs @@ -948,7 +948,7 @@ internal static class ConfigFileConstants internal static readonly string VisibleProviders = "VisibleProviders"; internal static readonly string VisibleExternalCommands = "VisibleExternalCommands"; - internal static ConfigTypeEntry[] ConfigFileKeys = new ConfigTypeEntry[] { + internal static readonly ConfigTypeEntry[] ConfigFileKeys = new ConfigTypeEntry[] { new ConfigTypeEntry(AliasDefinitions, new ConfigTypeEntry.TypeValidationCallback(AliasDefinitionsTypeValidationCallback)), new ConfigTypeEntry(AssembliesToLoad, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)), new ConfigTypeEntry(Author, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)), diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs index c6dde82a90b..77c30d4d43e 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPlugin.cs @@ -137,7 +137,7 @@ internal class WSManPluginInstance /// It is static because static instances of this class use the facade. Otherwise, /// it would be passed in via a parameterized constructor. /// - internal static IWSManNativeApiFacade wsmanPinvokeStatic = new WSManNativeApiFacade(); + internal static readonly IWSManNativeApiFacade wsmanPinvokeStatic = new WSManNativeApiFacade(); #endregion diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs index 727c8e231ff..ed5bf0a4a3e 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManPluginFacade.cs @@ -419,7 +419,7 @@ private WSManPluginManagedEntryWrapper() { } /// /// Immutable container that holds the delegates and their unmanaged pointers. /// - internal static WSManPluginEntryDelegates workerPtrs = new WSManPluginEntryDelegates(); + internal static readonly WSManPluginEntryDelegates workerPtrs = new WSManPluginEntryDelegates(); #region Managed Entry Points diff --git a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs index d4bae986cdf..2662254b877 100644 --- a/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs +++ b/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs @@ -623,7 +623,7 @@ internal static void ClearScriptBlockCache() s_cachedScripts.Clear(); } - internal static ScriptBlock EmptyScriptBlock = + internal static readonly ScriptBlock EmptyScriptBlock = ScriptBlock.CreateDelayParsedScriptBlock(string.Empty, isProductCode: true); internal static ScriptBlock Create(Parser parser, string fileName, string fileContents) diff --git a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs index 9fa515a9b81..f5670899c23 100644 --- a/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs +++ b/src/System.Management.Automation/engine/runtime/Operations/NumericOps.cs @@ -8,8 +8,8 @@ namespace System.Management.Automation { internal static class Boxed { - internal static object True = (object)true; - internal static object False = (object)false; + internal static readonly object True = (object)true; + internal static readonly object False = (object)false; } internal static class IntOps diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index 95af575cc5f..31ec2e348d2 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -355,7 +355,7 @@ internal void LogExtraMemoryUsage(int amountOfExtraMemory) internal readonly DeserializationOptions options; internal readonly PSRemotingCryptoHelper cryptoHelper; - internal static int MaxItemsInCimClassCache = 100; + internal static readonly int MaxItemsInCimClassCache = 100; internal readonly CimClassDeserializationCache cimClassSerializationIdCache = new CimClassDeserializationCache(); } diff --git a/src/System.Management.Automation/help/CabinetAPI.cs b/src/System.Management.Automation/help/CabinetAPI.cs index 41a83010f58..eb407f2ec62 100644 --- a/src/System.Management.Automation/help/CabinetAPI.cs +++ b/src/System.Management.Automation/help/CabinetAPI.cs @@ -81,7 +81,7 @@ internal abstract class ICabinetExtractorLoader internal class CabinetExtractorFactory { private static ICabinetExtractorLoader s_cabinetLoader; - internal static ICabinetExtractor EmptyExtractor = new EmptyCabinetExtractor(); + internal static readonly ICabinetExtractor EmptyExtractor = new EmptyCabinetExtractor(); /// /// Static constructor. diff --git a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs index 76ac1e7d1b6..b8be27e99a0 100644 --- a/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs +++ b/src/System.Management.Automation/help/DefaultCommandHelpObjectBuilder.cs @@ -42,7 +42,7 @@ public int Compare(object x, object y) /// internal class DefaultCommandHelpObjectBuilder { - internal static string TypeNameForDefaultHelp = "ExtendedCmdletHelpInfo"; + internal static readonly string TypeNameForDefaultHelp = "ExtendedCmdletHelpInfo"; /// /// Generates a HelpInfo PSObject from a CmdletInfo object. /// diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 67cd105fc40..cbe492db2cf 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -9704,7 +9704,7 @@ PSGetPathDirAndFiles @params }} "; - internal static string PSCopyFromSessionHelper = functionToken + PSCopyFromSessionHelperName + @" + internal static readonly string PSCopyFromSessionHelper = functionToken + PSCopyFromSessionHelperName + @" { " + s_PSCopyFromSessionHelperDefinition + @" } @@ -9721,7 +9721,7 @@ PSGetPathDirAndFiles @params internal const string PSCopyRemoteUtilsName = @"PSCopyRemoteUtils"; - internal static string PSCopyRemoteUtilsDefinition = StringUtil.Format(PSCopyRemoteUtilsDefinitionFormat, @"[ValidateNotNullOrEmpty()]", PSValidatePathFunction); + internal static readonly string PSCopyRemoteUtilsDefinition = StringUtil.Format(PSCopyRemoteUtilsDefinitionFormat, @"[ValidateNotNullOrEmpty()]", PSValidatePathFunction); private static string s_PSCopyRemoteUtilsDefinitionRestricted = StringUtil.Format(PSCopyRemoteUtilsDefinitionFormat, @"[ValidateUserDrive()]", PSValidatePathFunction); private const string PSCopyRemoteUtilsDefinitionFormat = @" @@ -9878,20 +9878,20 @@ function SafeGetDriveRoot return $result "; - internal static string PSCopyRemoteUtils = functionToken + PSCopyRemoteUtilsName + @" + internal static readonly string PSCopyRemoteUtils = functionToken + PSCopyRemoteUtilsName + @" { " + PSCopyRemoteUtilsDefinition + @" } "; - internal static Hashtable PSCopyRemoteUtilsFunction = new Hashtable() { + internal static readonly Hashtable PSCopyRemoteUtilsFunction = new Hashtable() { {nameToken, PSCopyRemoteUtilsName}, {definitionToken, s_PSCopyRemoteUtilsDefinitionRestricted} }; #endregion - internal static string AllCopyToRemoteScripts = s_PSCopyToSessionHelper + PSCopyRemoteUtils; + internal static readonly string AllCopyToRemoteScripts = s_PSCopyToSessionHelper + PSCopyRemoteUtils; internal static IEnumerable GetAllCopyToRemoteScriptFunctions() { @@ -9899,7 +9899,7 @@ internal static IEnumerable GetAllCopyToRemoteScriptFunctions() yield return PSCopyRemoteUtilsFunction; } - internal static string AllCopyFromRemoteScripts = PSCopyFromSessionHelper + PSCopyRemoteUtils; + internal static readonly string AllCopyFromRemoteScripts = PSCopyFromSessionHelper + PSCopyRemoteUtils; internal static IEnumerable GetAllCopyFromRemoteScriptFunctions() { diff --git a/src/System.Management.Automation/namespaces/ProviderBase.cs b/src/System.Management.Automation/namespaces/ProviderBase.cs index 22bd599f637..326d4d51b04 100644 --- a/src/System.Management.Automation/namespaces/ProviderBase.cs +++ b/src/System.Management.Automation/namespaces/ProviderBase.cs @@ -78,7 +78,7 @@ public abstract partial class CmdletProvider : IResourceSupplier [TraceSourceAttribute( "CmdletProviderClasses", "The namespace provider base classes tracer")] - internal static PSTraceSource providerBaseTracer = PSTraceSource.GetTracer( + internal static readonly PSTraceSource providerBaseTracer = PSTraceSource.GetTracer( "CmdletProviderClasses", "The namespace provider base classes tracer"); diff --git a/src/System.Management.Automation/security/SecureStringHelper.cs b/src/System.Management.Automation/security/SecureStringHelper.cs index 63066cbd291..e6180dc39b7 100644 --- a/src/System.Management.Automation/security/SecureStringHelper.cs +++ b/src/System.Management.Automation/security/SecureStringHelper.cs @@ -20,7 +20,7 @@ internal static class SecureStringHelper { // Some random hex characters to identify the beginning of a // V2-exported SecureString. - internal static string SecureStringExportHeader = "76492d1116743f0423413b16050a5345"; + internal static readonly string SecureStringExportHeader = "76492d1116743f0423413b16050a5345"; /// /// Create a new SecureString based on the specified binary data. diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 22e553d3002..64ed73a99d9 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -961,11 +961,11 @@ internal static string Encrypt(byte[] contentBytes, CmsMessageRecipient[] recipi return encodedContent; } - internal static string BEGIN_CMS_SIGIL = "-----BEGIN CMS-----"; - internal static string END_CMS_SIGIL = "-----END CMS-----"; + internal static readonly string BEGIN_CMS_SIGIL = "-----BEGIN CMS-----"; + internal static readonly string END_CMS_SIGIL = "-----END CMS-----"; - internal static string BEGIN_CERTIFICATE_SIGIL = "-----BEGIN CERTIFICATE-----"; - internal static string END_CERTIFICATE_SIGIL = "-----END CERTIFICATE-----"; + internal static readonly string BEGIN_CERTIFICATE_SIGIL = "-----BEGIN CERTIFICATE-----"; + internal static readonly string END_CERTIFICATE_SIGIL = "-----END CERTIFICATE-----"; /// /// Adds Ascii armour to a byte stream in Base64 format. diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs index af3c1c04a86..8206b5cf8a3 100644 --- a/src/System.Management.Automation/utils/EncodingUtils.cs +++ b/src/System.Management.Automation/utils/EncodingUtils.cs @@ -30,7 +30,7 @@ internal static class EncodingConversion Ascii, BigEndianUnicode, BigEndianUtf32, OEM, Unicode, Utf7, Utf8, Utf8Bom, Utf8NoBom, Utf32 }; - internal static Dictionary encodingMap = new Dictionary(StringComparer.OrdinalIgnoreCase) + internal static readonly Dictionary encodingMap = new Dictionary(StringComparer.OrdinalIgnoreCase) { { Ascii, System.Text.Encoding.ASCII }, { BigEndianUnicode, System.Text.Encoding.BigEndianUnicode }, diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs index 4ffdeb41415..8e99cdff4b0 100644 --- a/src/System.Management.Automation/utils/PlatformInvokes.cs +++ b/src/System.Management.Automation/utils/PlatformInvokes.cs @@ -529,14 +529,14 @@ internal struct PRIVILEGE_SET // Fields internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); - internal static UInt32 GENERIC_READ = 0x80000000; - internal static UInt32 GENERIC_WRITE = 0x40000000; - internal static UInt32 FILE_ATTRIBUTE_NORMAL = 0x80000000; - internal static UInt32 CREATE_ALWAYS = 2; - internal static UInt32 FILE_SHARE_WRITE = 0x00000002; - internal static UInt32 FILE_SHARE_READ = 0x00000001; - internal static UInt32 OF_READWRITE = 0x00000002; - internal static UInt32 OPEN_EXISTING = 3; + internal static readonly UInt32 GENERIC_READ = 0x80000000; + internal static readonly UInt32 GENERIC_WRITE = 0x40000000; + internal static readonly UInt32 FILE_ATTRIBUTE_NORMAL = 0x80000000; + internal static readonly UInt32 CREATE_ALWAYS = 2; + internal static readonly UInt32 FILE_SHARE_WRITE = 0x00000002; + internal static readonly UInt32 FILE_SHARE_READ = 0x00000001; + internal static readonly UInt32 OF_READWRITE = 0x00000002; + internal static readonly UInt32 OPEN_EXISTING = 3; [StructLayout(LayoutKind.Sequential)] internal class PROCESS_INFORMATION @@ -679,7 +679,7 @@ internal static extern bool CreateProcess( [DllImport(PinvokeDllNames.ResumeThreadDllName, CharSet = CharSet.Unicode, SetLastError = true)] public static extern uint ResumeThread(IntPtr threadHandle); - internal static uint RESUME_THREAD_FAILED = System.UInt32.MaxValue; // (DWORD)-1 + internal static readonly uint RESUME_THREAD_FAILED = System.UInt32.MaxValue; // (DWORD)-1 [DllImport(PinvokeDllNames.CreateFileDllName, CharSet = CharSet.Unicode, SetLastError = true)] public static extern System.IntPtr CreateFileW( From 3de9069ca799fd5f67ef3dc44198a5e9833c2a68 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 2 Jun 2020 01:12:27 +0500 Subject: [PATCH 242/275] Fix `New-Item` to create symbolic link to relative path target (#12797) --- .../namespaces/FileSystemProvider.cs | 18 +++++- .../New-Item.Tests.ps1 | 63 ++++++++++++++++++- 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index cbe492db2cf..24e356231a0 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -2362,12 +2362,24 @@ protected override void NewItem( // non-existing targets on either Windows or Linux. try { - exists = GetFileSystemInfo(strTargetPath, out isDirectory) != null; - - // Pretend the target exists if we're making a symbolic link. if (itemType == ItemType.SymbolicLink) { exists = true; + + var normalizedTargetPath = strTargetPath; + if (strTargetPath.StartsWith(".\\", StringComparison.OrdinalIgnoreCase) || + strTargetPath.StartsWith("./", StringComparison.OrdinalIgnoreCase)) + { + normalizedTargetPath = Path.Join(SessionState.Internal.CurrentLocation.ProviderPath, strTargetPath.AsSpan().Slice(2)); + } + + GetFileSystemInfo(normalizedTargetPath, out isDirectory); + + strTargetPath = strTargetPath.Replace(StringLiterals.AlternatePathSeparator, StringLiterals.DefaultPathSeparator); + } + else + { + exists = GetFileSystemInfo(strTargetPath, out isDirectory) != null; } } catch (Exception e) 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 d6c98fc0695..2860271b3c8 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1 @@ -268,12 +268,71 @@ Describe "New-Item with links" -Tags @('CI', 'RequireAdminOnWindows') { } } +Describe "New-Item: symlink with absolute/relative path test" -Tags @('CI', 'RequireAdminOnWindows') { + BeforeAll { + # on macOS, the /tmp directory is a symlink, so we'll resolve it here + $TestPath = $TestDrive + if ($IsMacOS) + { + $item = Get-Item $TestPath + $dirName = $item.BaseName + $item = Get-Item $item.PSParentPath -Force + if ($item.LinkType -eq "SymbolicLink") + { + $TestPath = Join-Path $item.Target $dirName + } + } + + Push-Location $TestPath + $null = New-Item -Type Directory someDir + $null = New-Item -Type File someFile + } + + AfterAll { + Pop-Location + } + + It "Symlink with absolute path to existing directory behaves like a directory" { + New-Item -Type SymbolicLink someDirLinkAbsolute -Target (Convert-Path someDir) + Get-Item someDirLinkAbsolute | Should -BeOfType System.IO.DirectoryInfo + } + + It "Symlink with relative path to existing directory behaves like a directory" { + # PowerShell should normalize '.\someDir' to './someDir' as needed. + New-Item -Type SymbolicLink someDirLinkRelative -Target .\someDir + Get-Item someDirLinkRelative | Should -BeOfType System.IO.DirectoryInfo + } + + It "Symlink with absolute path to existing file behaves like a file" { + New-Item -Type SymbolicLink someFileLinkAbsolute -Target (Convert-Path someFile) + Get-Item someFileLinkAbsolute | Should -BeOfType System.IO.FileInfo + } + + It "Symlink with relative path to existing file behaves like a file" { + New-Item -Type SymbolicLink someFileLinkRelative -Target ./someFile + Get-Item someFileLinkRelative | Should -BeOfType System.IO.FileInfo + } +} + Describe "New-Item with links fails for non elevated user if developer mode not enabled on Windows." -Tags "CI" { BeforeAll { + # on macOS, the /tmp directory is a symlink, so we'll resolve it here + $TestPath = $TestDrive + if ($IsMacOS) + { + $item = Get-Item $TestPath + $dirName = $item.BaseName + $item = Get-Item $item.PSParentPath -Force + if ($item.LinkType -eq "SymbolicLink") + { + $TestPath = Join-Path $item.Target $dirName + } + } + $testfile = "testfile.txt" $testlink = "testlink" - $FullyQualifiedFile = Join-Path -Path $TestDrive -ChildPath $testfile - $TestFilePath = Join-Path -Path $TestDrive -ChildPath $testlink + $FullyQualifiedFile = Join-Path -Path $TestPath -ChildPath $testfile + $TestFilePath = Join-Path -Path $TestPath -ChildPath $testlink $developerModeEnabled = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense -eq 1 $minBuildRequired = [System.Environment]::OSVersion.Version -ge "10.0.14972" $developerMode = $developerModeEnabled -and $minBuildRequired From 8f7d308eaaf3d3ad1efdc778663a25b7b1671aa2 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 2 Jun 2020 04:57:56 +0100 Subject: [PATCH 243/275] Expand numberOfPowershellRefAssemblies list capacity (#12840) # PR Summary * Increase the list capacity because .NET v5.0.100-preview.5.20278.13 has an extra assembly * Remove assert added in #12520 ## PR Context HEAD of master has been broken since 99da109 (#12772), when .NET was updated to 5.0.100-preview.5.20278.13 https://github.com/PowerShell/PowerShell/issues/12815#issuecomment-636132717 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../commands/utility/AddType.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs index 870c47b7ee2..0b8573f9859 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/AddType.cs @@ -667,10 +667,9 @@ private void LoadAssemblies(IEnumerable assemblies) private static IEnumerable InitDefaultRefAssemblies() { // Define number of reference assemblies distributed with PowerShell. - // This number is accurate as of PowerShell v7.1.0-preview.1 built with .NET v5.0.100-preview.1.20155.7 - const int numberOfPowershellRefAssemblies = 151; + const int maxPowershellRefAssemblies = 160; - const int capacity = numberOfPowershellRefAssemblies + 1; + const int capacity = maxPowershellRefAssemblies + 1; var defaultRefAssemblies = new List(capacity); foreach (string file in Directory.EnumerateFiles(s_netcoreAppRefFolder, "*.dll", SearchOption.TopDirectoryOnly)) From c233b30a6afa85ef442a97fca17749bed818cfb8 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 2 Jun 2020 17:49:25 +0100 Subject: [PATCH 244/275] Reorder modifiers according to preferred order (#12864) # PR Summary Reformat using `csharp_preferred_modifier_order`. ## PR Context Split change from #11773 ## PR Checklist - [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - Use the present tense and imperative mood when describing your changes - [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. - **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** - [x] None - **OR** - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md) - [ ] Experimental feature name(s): - **User-facing changes** - [x] Not Applicable - **OR** - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) - [ ] Issue filed: - **Testing - New and feature** - [x] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - **Tooling** - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. - **OR** - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include: - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host). - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features. - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions). - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors). --- .../commands/utility/CsvCommands.cs | 6 +++--- .../security/CertificateProvider.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs index 397ca036151..5088d4801c4 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/CsvCommands.cs @@ -853,9 +853,9 @@ protected override void ProcessRecord() internal class ExportCsvHelper : IDisposable { private char _delimiter; - readonly private BaseCsvWritingCommand.QuoteKind _quoteKind; - readonly private HashSet _quoteFields; - readonly private StringBuilder _outputString; + private readonly BaseCsvWritingCommand.QuoteKind _quoteKind; + private readonly HashSet _quoteFields; + private readonly StringBuilder _outputString; /// /// Create ExportCsvHelper instance. diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 3579ce7b46f..25ed55453dc 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -506,7 +506,7 @@ public sealed class CertificateProvider : NavigationCmdletProvider, ICmdletProvi /// [TraceSource("CertificateProvider", "The core command provider for certificates")] - private readonly static PSTraceSource s_tracer = PSTraceSource.GetTracer("CertificateProvider", + private static readonly PSTraceSource s_tracer = PSTraceSource.GetTracer("CertificateProvider", "The core command provider for certificates"); #endregion tracer From 8f79ce1d293dfbee3fac889b8b1b25caa33dc701 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 2 Jun 2020 11:33:27 -0700 Subject: [PATCH 245/275] Update Linux daily CI to run in a single agent & collect traces (#12866) --- .vsts-ci/linux-daily.yml | 157 +++++++++++++++++++++++++++++++++ .vsts-ci/windows-daily.yml | 176 ++++++++++++++++++++++--------------- 2 files changed, 264 insertions(+), 69 deletions(-) create mode 100644 .vsts-ci/linux-daily.yml diff --git a/.vsts-ci/linux-daily.yml b/.vsts-ci/linux-daily.yml new file mode 100644 index 00000000000..6ab1832dfd9 --- /dev/null +++ b/.vsts-ci/linux-daily.yml @@ -0,0 +1,157 @@ +name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) +trigger: + # Batch merge builds together while a merge build is running + batch: true + branches: + include: + - master + - release* + - feature* + paths: + include: + - '*' + exclude: + - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* + - /.dependabot/config.yml +pr: + branches: + include: + - master + - release* + - feature* + paths: + include: + - '*' + exclude: + - tools/releaseBuild/* + - tools/releaseBuild/azureDevOps/templates/* + - /.vsts-ci/misc-analysis.yml + - /.github/ISSUE_TEMPLATE/* + - /.dependabot/config.yml + +variables: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + # Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + __SuppressAnsiEscapeSequences: 1 + +resources: +- repo: self + clean: true + +stages: +- stage: BuildLinux + displayName: Build for Linux + jobs: + - template: templates/ci-build.yml + parameters: + pool: ubuntu-16.04 + jobName: linux_build + displayName: linux Build + +- stage: TestLinux + displayName: Test for Linux + jobs: + - job: linux_test + pool: + vmImage: ubuntu-16.04 + displayName: Linux Test + + steps: + - pwsh: | + Get-ChildItem -Path env: + displayName: Capture Environment + condition: succeededOrFailed() + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts' + inputs: + downloadType: specific + itemPattern: | + build/**/* + xunit/**/* + downloadPath: '$(System.ArtifactsDirectory)' + + - pwsh: | + Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse + displayName: 'Capture Artifacts Directory' + continueOnError: true + + - pwsh: | + Import-Module .\tools\ci.psm1 + Invoke-CIInstall -SkipUser + displayName: Bootstrap + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + $output = (Get-PSOptions).Output + $rootPath = Split-Path (Split-Path $output) + Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force + + ## Fix permissions + Get-ChildItem $rootPath -Recurse | ForEach-Object { + if ($_ -is [System.IO.DirectoryInfo]) { + chmod +rwx $_.FullName + } else { + chmod +rw $_.FullName + } + } + chmod a+x $output + + Write-Host "=== Capture Unzipped Directory ===" + Get-ChildItem $rootPath -Recurse + displayName: 'Unzip Build and Fix Permissions' + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI + displayName: Test - UnelevatedPesterTests - CI + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI + displayName: Test - ElevatedPesterTests - CI + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others + displayName: Test - UnelevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others + displayName: Test - ElevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + displayName: Verify xUnit Test Results + condition: succeededOrFailed() + +- stage: CodeCovTestPackage + displayName: CodeCoverage and Test Packages + dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it + jobs: + - job: CodeCovTestPackage + displayName: CodeCoverage and Test Packages + pool: + vmImage: ubuntu-16.04 + steps: + - pwsh: | + Import-Module .\tools\ci.psm1 + New-CodeCoverageAndTestPackage + displayName: CodeCoverage and Test Package diff --git a/.vsts-ci/windows-daily.yml b/.vsts-ci/windows-daily.yml index 80a8723f920..14500b1df75 100644 --- a/.vsts-ci/windows-daily.yml +++ b/.vsts-ci/windows-daily.yml @@ -55,75 +55,113 @@ stages: displayName: Windows Test steps: - - pwsh: | - Get-ChildItem -Path env: - displayName: 'Capture Environment' - condition: succeededOrFailed() - - - task: DownloadBuildArtifacts@0 - displayName: 'Download Build Artifacts' - inputs: - downloadType: specific - itemPattern: | - build/**/* - xunit/**/* - downloadPath: '$(System.ArtifactsDirectory)' - - - pwsh: | - Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse - displayName: 'Capture Artifacts Directory' - continueOnError: true - - # must be run frow Windows PowerShell - - powershell: | - Import-Module .\tools\ci.psm1 - Invoke-CIInstall - displayName: Bootstrap - condition: succeededOrFailed() - - - pwsh: | - Import-Module .\build.psm1 - Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' - $path = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) - $rootPath = Split-Path -Path $path - Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force - displayName: 'Unzip Build' - condition: succeeded() - - - pwsh: | - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' - Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI - displayName: Test - UnelevatedPesterTests - CI - condition: succeeded() - - - pwsh: | - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' - Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI - displayName: Test - ElevatedPesterTests - CI - condition: succeededOrFailed() - - - pwsh: | - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' - Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others - displayName: Test - UnelevatedPesterTests - Others - condition: succeededOrFailed() - - - pwsh: | - Import-Module .\tools\ci.psm1 - Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' - Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others - displayName: Test - ElevatedPesterTests - Others - condition: succeededOrFailed() - - - pwsh: | - Import-Module .\build.psm1 - $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" - Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile - displayName: Verify xUnit Test Results - condition: succeededOrFailed() + - pwsh: | + Get-ChildItem -Path env: + displayName: 'Capture Environment' + condition: succeededOrFailed() + + - task: DownloadBuildArtifacts@0 + displayName: 'Download Build Artifacts' + inputs: + downloadType: specific + itemPattern: | + build/**/* + xunit/**/* + downloadPath: '$(System.ArtifactsDirectory)' + + - pwsh: | + Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse + displayName: 'Capture Artifacts Directory' + continueOnError: true + + - pwsh: | + $capRootDir = Join-Path ([System.IO.Path]::GetTempPath()) "CAP" + $capUtilDir = Join-Path $capRootDir "Utils" + + if (Test-Path $capRootDir) { Remove-Item $capRootDir -Recurse -Force } + New-Item $capUtilDir -ItemType Directory > $null + + $capZipFile = Join-Path $capRootDir "cap.zip" + Invoke-WebRequest -Uri https://pscoretestdata.blob.core.windows.net/dotnet-cap/windows.zip -OutFile $capZipFile + Unblock-File -Path $capZipFile + Expand-Archive -Path $capZipFile -DestinationPath $capUtilDir -Force + + Write-Host "=== Capture CAP Util Directory ===" + Get-ChildItem $capUtilDir -Recurse + + Write-Host "##vso[task.setvariable variable=CapRootDir]$capRootDir" + Write-Host "##vso[task.setvariable variable=CapUtilDir]$capUtilDir" + displayName: 'Download CAP package' + condition: succeededOrFailed() + + # must be run frow Windows PowerShell + - powershell: | + Import-Module .\tools\ci.psm1 + Invoke-CIInstall + displayName: Bootstrap + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + $path = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions)) + $rootPath = Split-Path -Path $path + Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force + displayName: 'Unzip Build' + condition: succeeded() + + - pwsh: | + Import-Module $(CapUtilDir)\CAPService.psm1 + $dataDir = Start-TraceCollection -RootDir $(CapRootDir) + Write-Host "##vso[task.setvariable variable=CapDataDir]$dataDir" + displayName: 'Start CLR Trace Collection' + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI + displayName: Test - UnelevatedPesterTests - CI + condition: succeeded() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI + displayName: Test - ElevatedPesterTests - CI + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others + displayName: Test - UnelevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\tools\ci.psm1 + Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json' + Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others + displayName: Test - ElevatedPesterTests - Others + condition: succeededOrFailed() + + - pwsh: | + Import-Module .\build.psm1 + $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" + Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile + displayName: Verify xUnit Test Results + condition: succeededOrFailed() + + - pwsh: | + $capDataDir = '$(CapDataDir)' + $capModuleFile = '$(CapUtilDir)\CAPService.psm1' + + if ((Test-Path $capModuleFile) -and (Test-Path $capDataDir)) { + Import-Module $capModuleFile + Stop-TraceCollection -DataDir $capDataDir -RepoRoot $pwd + } + displayName: 'Upload CLR Trace' + condition: always() - stage: PackagingWin displayName: Packaging for Windows From 73e8427586913c336f7fc7fe39db0e8ffd0f7afa Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 2 Jun 2020 23:44:16 +0500 Subject: [PATCH 246/275] Bring back Certificate provider parameters (#10622) --- .../security/CertificateProvider.cs | 257 +++++++++++++++--- .../security/SecuritySupport.cs | 247 +++++++---------- .../CertificateProvider.Tests.ps1 | 92 +++++-- .../certificateCommon.psm1 | 120 +++++++- 4 files changed, 510 insertions(+), 206 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs index 25ed55453dc..3436ddb6062 100644 --- a/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs +++ b/src/Microsoft.PowerShell.Security/security/CertificateProvider.cs @@ -31,20 +31,18 @@ namespace Microsoft.PowerShell.Commands { /// /// Defines the Certificate Provider dynamic parameters. - /// /// We only support one dynamic parameter for Win 7 and earlier: /// CodeSigningCert /// If provided, we only return certificates valid for signing code or /// scripts. /// - - internal sealed class CertificateProviderCodeSigningDynamicParameters + internal sealed class CertificateProviderDynamicParameters { /// - /// Switch that controls whether we only return + /// Gets or sets a switch that controls whether we only return /// code signing certs. /// - [Parameter()] + [Parameter] public SwitchParameter CodeSigningCert { get { return _codeSigningCert; } @@ -53,6 +51,70 @@ public SwitchParameter CodeSigningCert } private SwitchParameter _codeSigningCert = new SwitchParameter(); + + /// + /// Gets or sets a filter that controls whether we only return + /// data encipherment certs. + /// + [Parameter] + public SwitchParameter DocumentEncryptionCert + { + get; + set; + } + + /// + /// Gets or sets a filter that controls whether we only return + /// server authentication certs. + /// + [Parameter] + public SwitchParameter SSLServerAuthentication + { + get; + set; + } + + /// + /// Gets or sets a filter by DNSName. + /// Expected content is a single DNS Name that may start and/or end + /// with '*': "contoso.com" or "*toso.c*". + /// All WildcardPattern class features supported. + /// + [Parameter] + public string DnsName + { + get; + set; + } + + /// + /// Gets or sets a filter by EKU. + /// Expected content is one or more OID strings: + /// "1.3.6.1.5.5.7.3.1", "*Server*", etc. + /// For a cert to match, it must be valid for all listed OIDs. + /// All WildcardPattern class features supported. + /// + [Parameter] + public string[] Eku + { + get; + set; + } + + /// + /// Gets or sets a filter by the number of valid days. + /// Expected content is a non-negative integer. + /// "0" matches all certs that have already expired. + /// "1" matches all certs that are currently valid and will expire + /// by next day (local time). + /// + [Parameter] + [ValidateRange(ValidateRangeKind.NonNegative)] + public int ExpiringInDays + { + get; + set; + } = -1; } /// @@ -169,7 +231,7 @@ internal sealed class ProviderRemoveItemDynamicParameters /// Switch that controls whether we should delete private key /// when remove a certificate. /// - [Parameter()] + [Parameter] public SwitchParameter DeleteKey { get @@ -1185,15 +1247,11 @@ protected override void GetItem(string path) } else { - // The filter is non null. If the certificate - // satisfies the filter, output it. Otherwise, don't. - + // The filter is non null. If the certificate + // satisfies the filter, output it. Otherwise, don't. X509Certificate2 cert = item as X509Certificate2; Dbg.Diagnostics.Assert(cert != null, "item should be a certificate"); - // If it's Win8 or above, filter matching for certain properties is done by - // the certificate enumeration filter at the API level. In that case, - // filter.Purpose will be 'None' and MatchesFilter will return 'True'. if (MatchesFilter(cert, filter)) { WriteItemObject(item, path, isContainer); @@ -2212,7 +2270,7 @@ protected override bool IsItemContainer(string path) /// protected override object GetItemDynamicParameters(string path) { - return new CertificateProviderCodeSigningDynamicParameters(); + return new CertificateProviderDynamicParameters(); } /// @@ -2234,7 +2292,7 @@ protected override object GetItemDynamicParameters(string path) /// protected override object GetChildItemsDynamicParameters(string path, bool recurse) { - return new CertificateProviderCodeSigningDynamicParameters(); + return new CertificateProviderDynamicParameters(); } #endregion DriveCmdletProvider overrides @@ -2607,8 +2665,8 @@ private CertificateFilterInfo GetFilter() if (DynamicParameters != null) { - CertificateProviderCodeSigningDynamicParameters dp = - DynamicParameters as CertificateProviderCodeSigningDynamicParameters; + CertificateProviderDynamicParameters dp = + DynamicParameters as CertificateProviderDynamicParameters; if (dp != null) { if (dp.CodeSigningCert) @@ -2616,6 +2674,40 @@ private CertificateFilterInfo GetFilter() filter = new CertificateFilterInfo(); filter.Purpose = CertificatePurpose.CodeSigning; } + + if (dp.DocumentEncryptionCert) + { + filter = filter ?? new CertificateFilterInfo(); + filter.Purpose = CertificatePurpose.DocumentEncryption; + } + + if (dp.DnsName != null) + { + filter = filter ?? new CertificateFilterInfo(); + filter.DnsName = new WildcardPattern(dp.DnsName, WildcardOptions.IgnoreCase); + } + + if (dp.Eku != null) + { + filter = filter ?? new CertificateFilterInfo(); + filter.Eku = new List(); + foreach (var pattern in dp.Eku) + { + filter.Eku.Add(new WildcardPattern(pattern, WildcardOptions.IgnoreCase)); + } + } + + if (dp.ExpiringInDays >= 0) + { + filter = filter ?? new CertificateFilterInfo(); + filter.Expiring = DateTime.Now.AddDays(dp.ExpiringInDays); + } + + if (dp.SSLServerAuthentication) + { + filter = filter ?? new CertificateFilterInfo(); + filter.SSLServerAuthentication = true; + } } } @@ -2634,42 +2726,131 @@ private bool IncludeArchivedCerts() return includeArchivedCerts; } - // If it's Win8 or above, filter matching for certain properties is done by - // the certificate enumeration filter at the API level. In that case, - // filter.Purpose will be 'None' and MatchesFilter will return 'True'. - private static bool MatchesFilter(X509Certificate2 cert, - CertificateFilterInfo filter) + private static bool MatchesFilter(X509Certificate2 cert, CertificateFilterInfo filter) { - // - // no filter means, match everything - // - if ((filter == null) || - (filter.Purpose == CertificatePurpose.NotSpecified) || - (filter.Purpose == CertificatePurpose.All)) + // No filter means, match everything + if (filter == null) { return true; } + if (filter.Expiring > DateTime.MinValue && !SecuritySupport.CertExpiresByTime(cert, filter.Expiring)) + { + return false; + } + + if (filter.DnsName != null && !CertContainsName(cert, filter.DnsName)) + { + return false; + } + + if (filter.Eku != null && !CertContainsEku(cert, filter.Eku)) + { + return false; + } + + if (filter.SSLServerAuthentication && !CertIsSSLServerAuthentication(cert)) + { + return false; + } + switch (filter.Purpose) { case CertificatePurpose.CodeSigning: - if (SecuritySupport.CertIsGoodForSigning(cert)) - { - return true; - } + return SecuritySupport.CertIsGoodForSigning(cert); + + case CertificatePurpose.DocumentEncryption: + return SecuritySupport.CertIsGoodForEncryption(cert); + case CertificatePurpose.NotSpecified: + case CertificatePurpose.All: + return true; + + default: break; + } - case CertificatePurpose.DocumentEncryption: - if (SecuritySupport.CertIsGoodForEncryption(cert)) + return false; + } + + /// + /// Check if the specified certificate has the name in DNS name list. + /// + /// Certificate object. + /// Wildcard pattern for DNS name to search. + /// True on success, false otherwise. + internal static bool CertContainsName(X509Certificate2 cert, WildcardPattern pattern) + { + List list = (new DnsNameProperty(cert)).DnsNameList; + foreach (DnsNameRepresentation dnsName in list) + { + if (pattern.IsMatch(dnsName.Unicode)) + { + return true; + } + } + + return false; + } + + /// + /// Check if the specified certificate is a server authentication certificate. + /// + /// Certificate object. + /// True on success, false otherwise. + internal static bool CertIsSSLServerAuthentication(X509Certificate2 cert) + { + X509ExtensionCollection extentionList = cert.Extensions; + foreach (var extension in extentionList) + { + if (extension is X509EnhancedKeyUsageExtension eku) + { + foreach (Oid usage in eku.EnhancedKeyUsages) { - return true; + if (usage.Value.Equals(CertificateFilterInfo.OID_PKIX_KP_SERVER_AUTH, StringComparison.Ordinal)) + { + return true; + } } + } + } - break; + return false; + } - default: - break; + /// + /// Check if the specified certificate contains EKU matching all of these patterns. + /// + /// Certificate object. + /// EKU patterns. + /// True on success, false otherwise. + internal static bool CertContainsEku(X509Certificate2 cert, List ekuPatterns) + { + X509ExtensionCollection extensionList = cert.Extensions; + foreach (var extension in extensionList) + { + if (extension is X509EnhancedKeyUsageExtension eku) + { + OidCollection enhancedKeyUsages = eku.EnhancedKeyUsages; + foreach (WildcardPattern ekuPattern in ekuPatterns) + { + bool patternPassed = false; + foreach (var usage in enhancedKeyUsages) + { + if (ekuPattern.IsMatch(usage.Value) || ekuPattern.IsMatch(usage.FriendlyName)) + { + return true; + } + } + + if (!patternPassed) + { + return false; + } + } + + return true; + } } return false; @@ -3195,7 +3376,7 @@ public List DnsNameList } /// - /// Constructor for EkuList. + /// Constructor for DnsNameProperty. /// public DnsNameProperty(X509Certificate2 cert) { diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 64ed73a99d9..90d4a71d73b 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -4,22 +4,23 @@ #pragma warning disable 1634, 1691 #pragma warning disable 56523 +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; -using Microsoft.PowerShell; -using Microsoft.PowerShell.Commands; -using System.Management.Automation.Security; +using System.Globalization; using System.Management.Automation.Configuration; using System.Management.Automation.Internal; +using System.Management.Automation.Security; +using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text; -using System.Globalization; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.InteropServices; +using Microsoft.PowerShell; +using Microsoft.PowerShell.Commands; + using DWORD = System.UInt32; namespace Microsoft.PowerShell @@ -629,6 +630,17 @@ internal static bool CertIsGoodForEncryption(X509Certificate2 c) CertHasKeyUsage(c, X509KeyUsageFlags.KeyEncipherment))); } + /// + /// Check to see if the specified cert is expiring by the time. + /// + /// Certificate object. + /// Certificate expire time. + /// True on success, false otherwise. + internal static bool CertExpiresByTime(X509Certificate2 c, DateTime expiring) + { + return c.NotAfter < expiring; + } + private static bool CertHasOid(X509Certificate2 c, string oid) { foreach (var extension in c.Extensions) @@ -665,6 +677,64 @@ private static bool CertHasKeyUsage(X509Certificate2 c, X509KeyUsageFlags keyUsa return false; } + /// + /// Get the EKUs of a cert. + /// + /// Certificate object. + /// A collection of cert eku strings. + [ArchitectureSensitive] + internal static Collection GetCertEKU(X509Certificate2 cert) + { + Collection ekus = new Collection(); + IntPtr pCert = cert.Handle; + int structSize = 0; + IntPtr dummy = IntPtr.Zero; + + if (Security.NativeMethods.CertGetEnhancedKeyUsage(pCert, 0, dummy, + out structSize)) + { + if (structSize > 0) + { + IntPtr ekuBuffer = Marshal.AllocHGlobal(structSize); + + try + { + if (Security.NativeMethods.CertGetEnhancedKeyUsage(pCert, 0, + ekuBuffer, + out structSize)) + { + Security.NativeMethods.CERT_ENHKEY_USAGE ekuStruct = + (Security.NativeMethods.CERT_ENHKEY_USAGE) + Marshal.PtrToStructure(ekuBuffer); + IntPtr ep = ekuStruct.rgpszUsageIdentifier; + IntPtr ekuptr; + + for (int i = 0; i < ekuStruct.cUsageIdentifier; i++) + { + ekuptr = Marshal.ReadIntPtr(ep, i * Marshal.SizeOf(ep)); + string eku = Marshal.PtrToStringAnsi(ekuptr); + ekus.Add(eku); + } + } + else + { + throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); + } + } + finally + { + Marshal.FreeHGlobal(ekuBuffer); + } + } + } + else + { + throw new System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error()); + } + + return ekus; + } + /// /// Convert an int to a DWORD. /// @@ -698,174 +768,53 @@ internal CertificateFilterInfo() } /// - /// Purpose of a certificate. + /// Gets or sets purpose of a certificate. /// internal CertificatePurpose Purpose { - get { return _purpose; } - - set { _purpose = value; } - } + get; + set; + } = CertificatePurpose.NotSpecified; /// - /// SSL Server Authentication. + /// Gets or sets SSL Server Authentication. /// internal bool SSLServerAuthentication { - get { return _sslServerAuthentication; } - - set { _sslServerAuthentication = value; } - } + get; - /// - /// DNS name of a certificate. - /// - internal string DnsName - { - set { _dnsName = value; } + set; } /// - /// EKU OID list of a certificate. + /// Gets or sets DNS name of a certificate. /// - internal string[] Eku + internal WildcardPattern DnsName { - set { _eku = value; } + get; + set; } /// - /// Remaining validity period in days for a certificate. + /// Gets or sets EKU OID list of a certificate. /// - internal int ExpiringInDays + internal List Eku { - set { _expiringInDays = value; } + get; + set; } /// - /// Combine properties into a filter string. + /// Gets or sets validity time for a certificate. /// - internal string FilterString + internal DateTime Expiring { - get - { - string filterString = string.Empty; - - if (_dnsName != null) - { - filterString = AppendFilter(filterString, "dns", _dnsName); - } - - string ekuT = string.Empty; - if (_eku != null) - { - for (int i = 0; i < _eku.Length; i++) - { - if (ekuT.Length != 0) - { - ekuT = ekuT + ","; - } - - ekuT = ekuT + _eku[i]; - } - } - - if (_purpose == CertificatePurpose.CodeSigning) - { - if (ekuT.Length != 0) - { - ekuT = ekuT + ","; - } - - ekuT = ekuT + CodeSigningOid; - } - - if (_purpose == CertificatePurpose.DocumentEncryption) - { - if (ekuT.Length != 0) - { - ekuT = ekuT + ","; - } - - ekuT = ekuT + DocumentEncryptionOid; - } - - if (_sslServerAuthentication) - { - if (ekuT.Length != 0) - { - ekuT = ekuT + ","; - } - - ekuT = ekuT + szOID_PKIX_KP_SERVER_AUTH; - } - - if (ekuT.Length != 0) - { - filterString = AppendFilter(filterString, "eku", ekuT); - if (_purpose == CertificatePurpose.CodeSigning || - _sslServerAuthentication) - { - filterString = AppendFilter(filterString, "key", "*"); - } - } - - if (_expiringInDays >= 0) - { - filterString = AppendFilter( - filterString, - "ExpiringInDays", - _expiringInDays.ToString(System.Globalization.CultureInfo.InvariantCulture)); - } - - if (filterString.Length == 0) - { - filterString = null; - } - - return filterString; - } - } - - private string AppendFilter( - string filterString, - string name, - string value) - { - string newfilter = value; - - // append a "name=value" filter to the existing filter string. - // insert a separating "&" if existing filter string is not empty. - - // if the value is empty, do nothing. - - if (newfilter.Length != 0) - { - // if the value contains an equal sign or an ampersand, throw - // an exception to avoid compromising the native code parser. - - if (newfilter.Contains("=") || newfilter.Contains("&")) - { - Marshal.ThrowExceptionForHR(Security.NativeMethods.E_INVALID_DATA); - } - - newfilter = name + "=" + newfilter; - if (filterString.Length != 0) - { - newfilter = "&" + newfilter; - } - } - - return filterString + newfilter; - } - - private CertificatePurpose _purpose = 0; - private bool _sslServerAuthentication = false; - private string _dnsName = null; - private string[] _eku = null; - private int _expiringInDays = -1; + get; + set; + } = DateTime.MinValue; internal const string CodeSigningOid = "1.3.6.1.5.5.7.3.3"; - internal const string szOID_PKIX_KP_SERVER_AUTH = "1.3.6.1.5.5.7.3.1"; + internal const string OID_PKIX_KP_SERVER_AUTH = "1.3.6.1.5.5.7.3.1"; // The OID arc 1.3.6.1.4.1.311.80 is assigned to PowerShell. If we need // new OIDs, we can assign them under this branch. diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 index 9ac4ceb17a5..88bccb20a37 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 @@ -117,25 +117,29 @@ Describe "Certificate Provider tests" -Tags "Feature" { It "Should be able to get DnsNameList of certifate by path: " -TestCases $currentUserMyLocations { param([string] $path) $expectedThumbprint = (Get-GoodCertificateObject).Thumbprint - $expectedName = (Get-GoodCertificateObject).DnsNameList[0].Unicode - $expectedEncodedName = (Get-GoodCertificateObject).DnsNameList[0].Punycode + $expectedName = (Get-GoodCertificateObject).DnsNameList + $expectedEncodedName = (Get-GoodCertificateObject).DnsNameList $leafPath = Join-Path -Path $path -ChildPath $expectedThumbprint - $cert = (Get-Item -LiteralPath $leafPath) - $cert | Should -Not -Be null - $cert.DnsNameList | Should -Not -Be null - $cert.DnsNameList.Count | Should -Be 1 - $cert.DnsNameList[0].Unicode | Should -Be $expectedName - $cert.DnsNameList[0].Punycode | Should -Be $expectedEncodedName - } - It "Should be able to get DNSNameList of certifate by path: " -TestCases $currentUserMyLocations { + $cert = (Get-item -LiteralPath $leafPath) + $cert | Should -Not -Be $null + $cert.DnsNameList | Should -Not -Be $null + $cert.DnsNameList.Count | Should -Be 3 + $cert.DnsNameList[0].Unicode | Should -Be $expectedName[0].Unicode + $cert.DnsNameList[0].Punycode | Should -Be $expectedEncodedName[0].Punycode + $cert.DnsNameList[1].Unicode | Should -Be $expectedName[1].Unicode + $cert.DnsNameList[1].Punycode | Should -Be $expectedEncodedName[1].Punycode + $cert.DnsNameList[2].Unicode | Should -Be $expectedName[2].Unicode + $cert.DnsNameList[2].Punycode | Should -Be $expectedEncodedName[2].Punycode + } + it "Should be able to get EnhancedKeyUsageList of certifate by path: " -TestCases $currentUserMyLocations { param([string] $path) $expectedThumbprint = (Get-GoodCertificateObject).Thumbprint $expectedOid = (Get-GoodCertificateObject).EnhancedKeyUsageList[0].ObjectId $leafPath = Join-Path -Path $path -ChildPath $expectedThumbprint - $cert = (Get-Item -LiteralPath $leafPath) - $cert | Should -Not -Be null + $cert = (Get-item -LiteralPath $leafPath) + $cert | Should -Not -Be $null $cert.EnhancedKeyUsageList | Should -Not -Be null - $cert.EnhancedKeyUsageList.Count | Should -Be 1 + $cert.EnhancedKeyUsageList.Count | Should -Be 3 $cert.EnhancedKeyUsageList[0].ObjectId.Length | Should -Not -Be 0 $cert.EnhancedKeyUsageList[0].ObjectId | Should -Be $expectedOid } @@ -158,13 +162,69 @@ Describe "Certificate Provider tests" -Tags "Feature" { } } Context "Get-ChildItem tests"{ - It "Should filter to codesign certificates" { - $allCerts = Get-ChildItem cert:\CurrentUser\My - $codeSignCerts = Get-ChildItem cert:\CurrentUser\My -CodeSigningCert + BeforeAll { + $cert = Get-GoodServerCertificateObject + } + it "Should filter to codesign certificates" { + $allCerts = get-ChildItem cert:\CurrentUser\My + $codeSignCerts = get-ChildItem cert:\CurrentUser\My -CodeSigningCert $codeSignCerts | Should -Not -Be null $allCerts | Should -Not -Be null $nonCodeSignCertCount = $allCerts.Count - $codeSignCerts.Count $nonCodeSignCertCount | Should -Not -Be 0 } + it "Should filter to ExpiringInDays certificates" { + $thumbprint = $cert.Thumbprint + $NotAfter = $cert.NotAfter + $before = ($NotAfter.AddDays(-1) - (Get-Date)).Days + $after = ($NotAfter.AddDays(+1) - (Get-Date)).Days + $beforeCerts = Get-ChildItem cert:\CurrentUser\My\$thumbprint -ExpiringInDays $before + $afterCerts = Get-ChildItem cert:\CurrentUser\My\$thumbprint -ExpiringInDays $after + + $beforeCerts.Count | Should -Be 0 + $afterCerts.Count | Should -Be 1 + $afterCerts.Thumbprint | Should -BeExactly $thumbprint + } + it "Should filter to DocumentEncryptionCert certificates" { + $thumbprint = $cert.Thumbprint + $certs = Get-ChildItem cert:\CurrentUser\My\$thumbprint -DocumentEncryptionCert + + $certs.Count | Should -Be 1 + $certs.Thumbprint | Should -BeExactly $thumbprint + } + it "Should filter to DNSName certificates: " -TestCases @( + @{ Name = "in Subject"; SearchName = '*ncipher*'; Count = 1; Thumbprint = $cert.Thumbprint } + @{ Name = "in Subject Alternative Name"; SearchName = '*conto*'; Count = 1; Thumbprint = $cert.Thumbprint } + @{ Name = "not existing name"; SearchName = '*QWERTY*'; Count = 0; Thumbprint = $null } + ) { + param($name, $searchName, $count, $thumbprint) + + $certs = Get-ChildItem cert:\CurrentUser\My\$thumbprint -DNSName $searchName + + $certs.Count | Should -Be $count + $certs.Thumbprint | Should -BeExactly $thumbprint + + } + it "Should filter to SSLServerAuthentication certificates" { + $thumbprint = $cert.Thumbprint + + $certs = Get-ChildItem cert:\CurrentUser\My\$thumbprint -SSLServerAuthentication + + $certs.Count | Should -Be 1 + $certs.Thumbprint | Should -BeExactly $thumbprint + } + it "Should filter to EKU certificates: " -TestCases @( + @{ Name = "can filter by name"; EKU = '*encryp*'; Count = 1; Thumbprint = $cert.Thumbprint } + @{ Name = "can filter by OID"; EKU = '*1.4.1.311.80.1*'; Count = 1; Thumbprint = $cert.Thumbprint } + @{ Name = "all patterns should be passed - positive test"; EKU = "1.3.6.1.5.5.7.3.2","*1.4.1.311.80.1*"; Count = 1; Thumbprint = $cert.Thumbprint } + @{ Name = "all patterns should be passed - negative test"; EKU = "*QWERTY*","*encryp*"; Count = 0; Thumbprint = $null } + ) { + param($name, $ekuSearch, $count, $thumbprint) + + $certs = Get-ChildItem cert:\CurrentUser\My\$thumbprint -EKU $ekuSearch + + $certs.Count | Should -Be $count + $certs.Thumbprint | Should -BeExactly $thumbprint + } } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 index 91c87df36d2..42e990b714e 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Security/certificateCommon.psm1 @@ -1,5 +1,6 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. + Function New-GoodCertificate { <# @@ -68,6 +69,109 @@ OksttXT1kXf+aez9EzDlsgQU4ck78h0WTy01zHLwSKNWK4wFFQM= return $certLocation } +Function New-GoodServerCertificate +{ + <# + .NOTES + This certificate properties: + Subject: + CN = MyDataEnciphermentCert + Subject Alternative Name: + DNS Name=www.fabrikam.com + DNS Name=www.contoso.com + EnhancedKey Usage: + Client Authentication (1.3.6.1.5.5.7.3.2) + Server Authentication (1.3.6.1.5.5.7.3.1) + Document Encryption (1.3.6.1.4.1.311.80.1) + Key Usage: + Key Encipherment, Data Encipherment (30) + Thumbprint: + b79428ca5aa0f0620e5eba19223fdf7885fcf3c6 + Serial Number: + 40c14ec2f84344be4965954d091c266b + + Howto update: + 1. Import the module and test certificates + Import-Module certificateCommon.psm1 -Force + Install-TestCertificates + 2. Read the certificate + $cert = Get-Item Cert:\CurrentUser\My\ + 3. Clone the certificate with new properties: + $b=New-SelfSignedCertificate -CloneCert $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2,1.3.6.1.5.5.7.3.1,1.3.6.1.4.1.311.80.1") -CertStoreLocation "Cert:\CurrentUser\My" -DnsName "www.fabrikam.com", "www.contoso.com" + $b.SerialNumber + 4. Export new certificate to file and encode to Base64 (press Enter key at password prompt): + certutil -exportpfx -user my C:\temp\newcert.pfx + certutil -encode C:\temp\newcert.pfx C:\temp\newcert.txt + 5. Replace $dataEnciphermentCert with new value from C:\temp\newcert.txt + #> + $dataEnciphermentCert = " +MIIKmgIBAzCCClYGCSqGSIb3DQEHAaCCCkcEggpDMIIKPzCCBgAGCSqGSIb3DQEH +AaCCBfEEggXtMIIF6TCCBeUGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcN +AQwBAzAOBAi0Gq/DrqxgYgICB9AEggTYy168efMBdfynAWPkh7S6VyhoaMOWR6Nt +l6MnGcWuGGFxLS2TxfZSN+mNYsAGG0yGnTyYZ/2uCW46irfMNPnq1OrYjWJB4Zmb +pRF2WI+ipVkKUSVtuCKR8GQR9Yw7C3PASqgm0JV1YpK9fw0EJ4tzeF4w81xzb5Ix +jm8jOwSBefYXjOPXwIvqVntOQHkMj75EVEjyTi/Sb3SoYk0b7uzqFsqtiQ3S9rtp +FuM3gRNY6zjHYa/iDrwt4aty8IU74yipyLj/9c4+BnaBiMCwX51FrHYGx1OYkcbN +K0iTWzxG3oYFxY9V9P6uzUqDUTsZNawkjne2WIFJrfPq25nU8vMHej0T/YqMczPF +6NtiHv0yMFNqxEh6vZgc00gitEV+Cbr9/lsctJ2YiYFW2Sc5q7wovc231xrLaDXZ +BLdnJZqqalobqdwfu84o7GiXw7y9pdvwNl4vKH4yiDv4kqCcuzqLxJ7QTk63EuGw +uiEhoC1ibvvi7+fCm60IxHxtGlUAZCaEidh70/VffRkea+oor9WLSIZ7q07ycB1+ +2k0ecpeutaOPAckfIPLDb1m9BwlM47dVaSJNN5/5oQsRM7327TDjYphfVoUDX19p +eAiRcO68GbcmXQQuM8CxbCSdPC3F6Jr5YzMBnM6Yqacv8ywdYaZHmKBADF2FtuFb +zyFHFCzTYJyj3YPczK1Xmw7d4btJuIAvl5JOrbDqSEbwRvXZL2f5iIRydekcPnma +nu/mlRqupQWiasv7qoga8Gq5sKMIUAruTwAzhkNA01hj5Iv7NcFY9Ruc+MHmnGmE +BiDSh/wOuyRIGIfveR9e4msg6rP9KO7q6mnghBVy6Is6Xz5Ak/xS2v7RjxzgBxrE +LaPoeHpD2+LKN+w8eN9Pd2ewAwwHzrw65jN7P1avuioMi0KejYZZAt3scmIGTT+n +jzcmxKvAPYllRifZRoDe+hAeYHlGAA8hm/zmw5522L8hOR1j69JcbCbl8MtWww+W +2MiGYbEbbGg/HV+9PnMMU3i+eHtuxTukBYb1ksH5z7742WBYH+gE3CvPX5AZRY/N +rVo8qZPH2ZK1smmc7v2cv0ZhIGWiMe+LakjjB1QcFpCTh/uwhQhNGXOgU1oNKbuE +FE7iH3XHkDVLFxEhdtgvwXJIQp+7ROVry6sZW2cgi2yUOTWNjqDd6LlV8vy+lti6 +/7L+rhfezHUpk89eWu8glEFqB96xmc9nbSF0On8aewdb43gW8h5TbBuSE1JA5SfE +cQNSxs4z+Bbx7cyX+f3CDriJkzXs5PvT861pNcYB1zjxJBStehMeazWf+D2Td10p +43nmEYaXHq/KwY1jn8yzQyj2V+c5Csw75879KHZ+6LwfzeWDCUlma+n1ZDNeDm2+ +s40qBC4s7x9sEdUBQwl/JOtJt4ZlFje4xle5/RlS2il/e/X05n4XUuX7azWZjSoG +fflcIvMcnXydt/Nl05newUGobDLEw9sa9lDy8bG6+IGywg2x1A4hqsA2qUbVLyy/ +VLdhIY38+FmcliL3o3uk9vsSHefODKrG1ZD+qu3+/9s3B7KmlT652cj6+fi54+N/ +jM/VAT/6e8OntolNHVoauudBmgO0WRYbznvZd/C6ehTAZQo9HKiGkADk1i8Gw6NF +dgH4LZdHyWOgrvAL1FqOqzGB0zATBgkqhkiG9w0BCRUxBgQEAQAAADBdBgkqhkiG +9w0BCRQxUB5OAHQAZQAtAGYAZgBiADIAYQBiADMAYgAtAGMAZQA5ADEALQA0ADEA +MABhAC0AOAA1AGMAMQAtADkAYwBmADgAYwA3AGEAMAA5ADkAYwA4MF0GCSsGAQQB +gjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5 +AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggQ3BgkqhkiG +9w0BBwagggQoMIIEJAIBADCCBB0GCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEDMA4E +CNnzLxDoo0cMAgIH0ICCA/ChXpj5kGwmqH++L8JmdidMyhQAk//fnIxsE695lW4B +yUQ0wM7k2eWSdebuCMSvD1bL2A8B6qM/sfkuoAUHrSGZS56Qeh4C3j5FqLyMOg1H +7w4hkHDYTQp4s9fxk5NedqsctmmKnZmrET65g8KRMSiolFYqd69D1SWGnftUVMvU +MdrFQRP0GJPSvDzx17NJWRRiUXzYxakfpGW8QfV0I9/ZlP8uUEZlVqc1v7ikQf1e +A3i6+njdj9lkpa2CEdtAdpwVTpQ49UwGq4tD5aMlzjWNuzQpP0mEh9XzWr6J3aFz +poEpCuC7gT4tIZcC3BKS9Uvv53AShpxJCiWwG7k+CYzzKabq3guJh1uPKMqpHJGG +T/5a4lQJOQr2IyfoDfsNw2JtAVjM62haUap4ZZbuoJq9B6gECknUAbSsk1XdEktq +OhMP5HtlCEAdLeEo0ae3YGRHsKJgFSx/8R+MMdjMWMYT8+6mVSVC63KQMiBmVEBs +mDcOWY45eCHo4aXuEKcHZSxRtWvviACdEd/CSDGwFGuA8f+D0f6iLabQCLLeVRVN +iUiKER3Adw+dg6pegifM4r3trqR2/H1Z33TrarGMKGNJSy6ur8bW1L6aYjxx1hj+ +dW9Tcj1QTLC1PJFaLdOD1ELho/EXdoa9VPuC2MWS9I6TqpY4Rkrcbr4KMqDLUTeN +SzgSZARVPv7VL8EDqeME24aQammby6nr25tA+Q45KBH8nc/hURVcoayl/cmH9Up3 +D87oCdVuCvmiJnFhZnd7q6S3ChfIQhyGNlZQjRjDve9MhR0TwaDEm0nsBpSwSVwP +PyJ00Md/cq4nImXvMYXf1fZ3Tlp90kZ2ffQ9+EMzFXNBNLof+CjVR8EZI1tOjUQg +0GYJvDFCt+hz7AAQU+2Ggrp1L7FaSJmgEJIVYwQP4bM25ee4BiQt3hHJL8Nfr97W +NEg8W4AbpYHJkcXa6jrxZLvsKxZNnLF0eczpG6X2jq7JdbumlZ1viom2j1aPB5GF +owQOcBfI3nhA5nludg2CUT2cqtO4mKJyPXwGA0OcFZ4aVJeO7wnS/21g7AB/Opmt +BCxZBwysPns0JJbH39p2PNRw/q2Kp+pxm0MEyJJe27T/f4cEUaezaAu+7qU7diSb +bUKQZzH+zfvmGr+UyQf6t3UHMyOBMfURmYEVesY47Vu2swdN4QW+tnJ2JIdIjEIb +W+OiON35K4wJDY893wZRI9uPPOQ/6yCAuI0uEu7WV2xqmpvMOj0E4yqkX0IChFxj +Mb1wqu/wHSwktbpqZLykVfJYq5ol/gexrY04AJJSZEDXGvHLR47Qfzx2M0XcjZpi +vsa+CHXqcU5T1e+1tPp8TdcwOzAfMAcGBSsOAwIaBBQiJeRFYB+55Wp+h8bnYt0D +YSQdMwQUYoaBDgXqLdO2G97FQNL1XPhVEEkCAgfQ +" + + $dataEnciphermentCert = $dataEnciphermentCert -replace '\s','' + $certBytes = [Convert]::FromBase64String($dataEnciphermentCert) + $certLocation = Join-Path $TestDrive "ProtectedEventLogging.pfx" + [IO.File]::WriteAllBytes($certLocation, $certBytes) + + return $certLocation +} + Function New-CertificatePassword { $script:protectedCertPassword = ConvertTo-SecureString -Force -AsPlainText (New-RandomHexString) @@ -138,6 +242,9 @@ function Install-TestCertificates $script:certLocation = New-GoodCertificate $script:certLocation | Should -Not -BeNullOrEmpty | Out-Null + $script:certServerLocation = New-GoodServerCertificate + $script:certServerLocation | Should -Not -BeNullOrEmpty | Out-Null + $script:badCertLocation = New-BadCertificate $script:badCertLocation | Should -Not -BeNullOrEmpty | Out-Null @@ -148,15 +255,17 @@ function Install-TestCertificates $command = @" Import-PfxCertificate $script:certLocation -CertStoreLocation cert:\CurrentUser\My | ForEach-Object PSPath +Import-PfxCertificate $script:certServerLocation -CertStoreLocation cert:\CurrentUser\My | ForEach-Object PSPath Import-Certificate $script:badCertLocation -CertStoreLocation Cert:\CurrentUser\My | ForEach-Object PSPath "@ $certPaths = & $fullPowerShell -NoProfile -NonInteractive -Command $command - $certPaths.Count | Should -Be 2 | Out-Null + $certPaths.Count | Should -Be 3 | Out-Null $script:importedCert = Get-ChildItem $certPaths[0] - $script:testBadCert = Get-ChildItem $certPaths[1] + $script:importedServerCert = Get-ChildItem $certPaths[1] + $script:testBadCert = Get-ChildItem $certPaths[2] } - elseif($IsWindows) + elseif ($IsWindows) { $script:importedCert = Import-PfxCertificate $script:certLocation -CertStoreLocation cert:\CurrentUser\My $script:testBadCert = Import-Certificate $script:badCertLocation -CertStoreLocation Cert:\CurrentUser\My @@ -176,6 +285,11 @@ function Get-GoodCertificateObject return $script:importedCert } +function Get-GoodServerCertificateObject +{ + return $script:importedServerCert +} + function Get-BadCertificateObject { return $script:testBadCert From 5a42f453c6ffe4ca4b1d9f6ee7a1b2999c805838 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 2 Jun 2020 11:46:24 -0700 Subject: [PATCH 247/275] Update the PowerShell modules to use the new Help URI (#12686) --- .../Microsoft.PowerShell.Host.psd1 | 2 +- .../Microsoft.PowerShell.Management.psd1 | 2 +- .../Microsoft.PowerShell.Security.psd1 | 2 +- .../Microsoft.PowerShell.Utility.psd1 | 2 +- src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 | 2 +- .../Microsoft.PowerShell.Diagnostics.psd1 | 2 +- .../Microsoft.PowerShell.Management.psd1 | 2 +- .../Microsoft.PowerShell.Security.psd1 | 2 +- .../Microsoft.PowerShell.Utility.psd1 | 2 +- .../Microsoft.WSMan.Management.psd1 | 2 +- .../Windows/PSDiagnostics/PSDiagnostics.psd1 | 2 +- .../help/UpdatableHelpCommandBase.cs | 14 +++++++------- 12 files changed, 18 insertions(+), 18 deletions(-) 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 bb927249e7f..0270ceffca0 100644 --- a/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 +++ b/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 @@ -10,5 +10,5 @@ FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesToExport = @() NestedModules="Microsoft.PowerShell.ConsoleHost.dll" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113538' +HelpInfoURI = 'https://aka.ms/powershell71-help' } 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 a2b0a1d9d0b..da8f8707945 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -7,7 +7,7 @@ ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113632' +HelpInfoURI = 'https://aka.ms/powershell71-help' FunctionsToExport = @() AliasesToExport = @("gcb", "gtz", "scb") CmdletsToExport=@("Add-Content", 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 11cd24e99a7..1f4cc15e118 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -10,5 +10,5 @@ FunctionsToExport = @() CmdletsToExport="Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-PfxCertificate" , "Protect-CmsMessage", "Unprotect-CmsMessage", "Get-CmsMessage" AliasesToExport = @() NestedModules="Microsoft.PowerShell.Security.dll" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113533' +HelpInfoURI = 'https://aka.ms/powershell71-help' } 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 76f123f26c4..33823700f7f 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -30,7 +30,7 @@ CmdletsToExport = @( FunctionsToExport = @() AliasesToExport = @('fhx') NestedModules = @("Microsoft.PowerShell.Commands.Utility.dll") -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113633' +HelpInfoURI = 'https://aka.ms/powershell71-help' PrivateData = @{ PSData = @{ ExperimentalFeatures = @( diff --git a/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 b/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 index 36684dcaab9..4b38d4abc9e 100644 --- a/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 +++ b/src/Modules/Windows/CimCmdlets/CimCmdlets.psd1 @@ -14,5 +14,5 @@ CmdletsToExport= "Get-CimAssociatedInstance", "Get-CimClass", "Get-CimInstance", "Remove-CimSession","Set-CimInstance", "Export-BinaryMiLog","Import-BinaryMiLog" AliasesToExport = "gcim","scim","ncim", "rcim","icim","gcai","rcie","ncms","rcms","gcms","ncso","gcls" -HelpInfoUri="https://go.microsoft.com/fwlink/?linkid=2113536" +HelpInfoUri="https://aka.ms/powershell71-help" } diff --git a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 index f060e931c9f..ed2344b51b2 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 @@ -12,5 +12,5 @@ AliasesToExport = @() NestedModules="Microsoft.PowerShell.Commands.Diagnostics.dll" TypesToProcess="GetEvent.types.ps1xml" FormatsToProcess="Event.format.ps1xml", "Diagnostics.format.ps1xml" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113532' +HelpInfoURI = 'https://aka.ms/powershell71-help' } diff --git a/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index d23cebc58f8..f7cd1dc6ace 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -7,7 +7,7 @@ ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113632' +HelpInfoURI = 'https://aka.ms/powershell71-help' FunctionsToExport = @() AliasesToExport = @("gcb", "gin", "gtz", "scb", "stz") CmdletsToExport=@("Add-Content", diff --git a/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 index bef21b6f8df..cbc5b2dc78e 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 @@ -10,5 +10,5 @@ FunctionsToExport = @() CmdletsToExport="Get-Acl", "Set-Acl", "Get-PfxCertificate", "Get-Credential", "Get-ExecutionPolicy", "Set-ExecutionPolicy", "Get-AuthenticodeSignature", "Set-AuthenticodeSignature", "ConvertFrom-SecureString", "ConvertTo-SecureString", "Get-CmsMessage", "Unprotect-CmsMessage", "Protect-CmsMessage" , "New-FileCatalog" , "Test-FileCatalog" AliasesToExport = @() NestedModules="Microsoft.PowerShell.Security.dll" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113533' +HelpInfoURI = 'https://aka.ms/powershell71-help' } diff --git a/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index b8082249b81..cd12b64d034 100644 --- a/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Windows/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -29,7 +29,7 @@ CmdletsToExport = @( FunctionsToExport = @() AliasesToExport = @('fhx') NestedModules = @("Microsoft.PowerShell.Commands.Utility.dll") -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113633' +HelpInfoURI = 'https://aka.ms/powershell71-help' PrivateData = @{ PSData = @{ ExperimentalFeatures = @( diff --git a/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 b/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 index 7fb73b2db4f..d2bb2398541 100644 --- a/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 +++ b/src/Modules/Windows/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 @@ -11,5 +11,5 @@ CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP AliasesToExport = @() NestedModules="Microsoft.WSMan.Management.dll" FormatsToProcess="WSMan.format.ps1xml" -HelpInfoURI = 'https://go.microsoft.com/fwlink/?linkid=2113537' +HelpInfoURI = 'https://aka.ms/powershell71-help' } diff --git a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 index 86578f88308..dded04d4920 100644 --- a/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 +++ b/src/Modules/Windows/PSDiagnostics/PSDiagnostics.psd1 @@ -10,5 +10,5 @@ FunctionsToExport="Disable-PSTrace","Disable-PSWSManCombinedTrace","Disable-WSManTrace","Enable-PSTrace","Enable-PSWSManCombinedTrace","Enable-WSManTrace","Get-LogProperties","Set-LogProperties","Start-Trace","Stop-Trace" CmdletsToExport = @() AliasesToExport = @() - HelpInfoUri="https://go.microsoft.com/fwlink/?linkid=2113635" + HelpInfoUri="https://aka.ms/powershell71-help" } diff --git a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs index 16ac4f2a58e..bbc1d32f6dc 100644 --- a/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs +++ b/src/System.Management.Automation/help/UpdatableHelpCommandBase.cs @@ -175,13 +175,13 @@ static UpdatableHelpCommandBase() // TODO: assign real TechNet addresses - s_metadataCache.Add("Microsoft.PowerShell.Diagnostics", "https://go.microsoft.com/fwlink/?linkid=2113532"); - s_metadataCache.Add("Microsoft.PowerShell.Core", "https://go.microsoft.com/fwlink/?linkid=2113534"); - s_metadataCache.Add("Microsoft.PowerShell.Utility", "https://go.microsoft.com/fwlink/?linkid=2113633"); - s_metadataCache.Add("Microsoft.PowerShell.Host", "https://go.microsoft.com/fwlink/?linkid=2113538"); - s_metadataCache.Add("Microsoft.PowerShell.Management", "https://go.microsoft.com/fwlink/?linkid=2113632"); - s_metadataCache.Add("Microsoft.PowerShell.Security", "https://go.microsoft.com/fwlink/?linkid=2113533"); - s_metadataCache.Add("Microsoft.WSMan.Management", "https://go.microsoft.com/fwlink/?linkid=2113537"); + s_metadataCache.Add("Microsoft.PowerShell.Diagnostics", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.PowerShell.Core", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.PowerShell.Utility", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.PowerShell.Host", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.PowerShell.Management", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.PowerShell.Security", "https://aka.ms/powershell71-help"); + s_metadataCache.Add("Microsoft.WSMan.Management", "https://aka.ms/powershell71-help"); } /// From b03b968d0a3709a22509fbd01df1f595685de626 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 2 Jun 2020 20:28:32 +0100 Subject: [PATCH 248/275] Restore `markdownlint` tests (#12549) Co-authored-by: Travis Plunk --- .github/ISSUE_TEMPLATE/Bug_Report.md | 8 +- .../ISSUE_TEMPLATE/Distribution_Request.md | 22 +- .github/ISSUE_TEMPLATE/Feature_Request.md | 4 +- .github/ISSUE_TEMPLATE/Release_Process.md | 2 +- .../ISSUE_TEMPLATE/Security_Issue_Report.md | 2 +- .vsts-ci/misc-analysis.yml | 5 + README.md | 1 + test/common/markdown/gulpfile.js | 60 + test/common/markdown/markdown-link.tests.ps1 | 2 +- test/common/markdown/markdown.tests.ps1 | 100 + test/common/markdown/package.json | 26 + test/common/markdown/yarn.lock | 2337 +++++++++++++++++ tools/install-powershell.ps1-README.md | 25 + ...dme.md => install-powershell.sh-README.md} | 26 - 14 files changed, 2574 insertions(+), 46 deletions(-) create mode 100644 test/common/markdown/gulpfile.js create mode 100644 test/common/markdown/markdown.tests.ps1 create mode 100644 test/common/markdown/package.json create mode 100644 test/common/markdown/yarn.lock create mode 100644 tools/install-powershell.ps1-README.md rename tools/{install-powershell-readme.md => install-powershell.sh-README.md} (77%) diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.md b/.github/ISSUE_TEMPLATE/Bug_Report.md index 871519ca921..2c51890e890 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.md +++ b/.github/ISSUE_TEMPLATE/Bug_Report.md @@ -20,25 +20,25 @@ This repository is **ONLY** for PowerShell Core 6 and PowerShell 7+ issues. --> -# Steps to reproduce +## Steps to reproduce ```powershell ``` -# Expected behavior +## Expected behavior ```none ``` -# Actual behavior +## Actual behavior ```none ``` -# Environment data +## Environment data diff --git a/.github/ISSUE_TEMPLATE/Distribution_Request.md b/.github/ISSUE_TEMPLATE/Distribution_Request.md index 28751062336..9aca6160bc7 100644 --- a/.github/ISSUE_TEMPLATE/Distribution_Request.md +++ b/.github/ISSUE_TEMPLATE/Distribution_Request.md @@ -7,24 +7,24 @@ assignees: '' --- -# Details of the Distribution +## Details of the Distribution -- Name of the Distribution: +- Name of the Distribution: - Version of the Distribution: - Package Types - - [ ] Deb - - [ ] RPM - - [ ] Tar.gz - - Snap - Please file issue in https://github.com/powershell/powershell-snap. This issues type is unrelated to snap packages with a distribution neutral. -- Processor Architecture (One per request): + - [ ] Deb + - [ ] RPM + - [ ] Tar.gz + - Snap - Please file issue in https://github.com/powershell/powershell-snap. This issues type is unrelated to snap packages with a distribution neutral. +- Processor Architecture (One per request): - [ ] **Required** - An issues has been filed to create a Docker image in https://github.com/powershell/powershell-docker - The following is a requirement for supporting a distribution **without exception.** - - [ ] The version and architecture of the Distribution is [supported by .NET Core](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux). + - [ ] The version and architecture of the Distribution is [supported by .NET Core](https://github.com/dotnet/core/blob/master/release-notes/3.0/3.0-supported-os.md#linux). - The following are requirements for supporting a distribution. - Please write a justification for any exception where these criteria are not met and + Please write a justification for any exception where these criteria are not met and the PowerShell committee will review the request. - - [ ] The version of the Distribution is supported for at least one year. - - [ ] The version of the Distribution is not an [interim release](https://ubuntu.com/about/release-cycle) or equivalent. + - [ ] The version of the Distribution is supported for at least one year. + - [ ] The version of the Distribution is not an [interim release](https://ubuntu.com/about/release-cycle) or equivalent. ## Progress - For PowerShell Team **ONLY** diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.md b/.github/ISSUE_TEMPLATE/Feature_Request.md index 2b724b2eac3..cf91c6e3dc3 100644 --- a/.github/ISSUE_TEMPLATE/Feature_Request.md +++ b/.github/ISSUE_TEMPLATE/Feature_Request.md @@ -7,7 +7,7 @@ assignees: '' --- -# Summary of the new feature/enhancement +## Summary of the new feature/enhancement -# Proposed technical implementation details (optional) +## Proposed technical implementation details (optional) -# Release Process for v6.x.x +## Checklist - [ ] Verify that `PowerShell-Native` has been updated/released as needed. - [ ] Check for `PowerShellGet` and `PackageManagement` release plans. diff --git a/.github/ISSUE_TEMPLATE/Security_Issue_Report.md b/.github/ISSUE_TEMPLATE/Security_Issue_Report.md index a0222650f6a..f2304882dc3 100644 --- a/.github/ISSUE_TEMPLATE/Security_Issue_Report.md +++ b/.github/ISSUE_TEMPLATE/Security_Issue_Report.md @@ -7,7 +7,7 @@ assignees: 'TravisEz13' --- -# Security Issue +## Security Issue Excerpt from [Issue Management - Security Vulnerabilities](https://github.com/PowerShell/PowerShell/blob/master/.github/SECURITY.md) diff --git a/.vsts-ci/misc-analysis.yml b/.vsts-ci/misc-analysis.yml index e35b508bfd8..327e5528107 100644 --- a/.vsts-ci/misc-analysis.yml +++ b/.vsts-ci/misc-analysis.yml @@ -68,3 +68,8 @@ jobs: } displayName: Run Common Tests condition: succeededOrFailed() + - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 + displayName: 'Component Detection' + inputs: + sourceScanPath: '$(Build.SourcesDirectory)' + snapshotForceEnabled: true diff --git a/README.md b/README.md index 03813155a85..248b9ac20d1 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,7 @@ We have a Gitter Room which you can join below. [![Join the chat](https://img.shields.io/static/v1.svg?label=chat&message=on%20gitter&color=informational&logo=gitter)](https://gitter.im/PowerShell/PowerShell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) There is also the community driven PowerShell Virtual User Group, which you can join on: + * [Slack](https://aka.ms/psslack) * [Discord](https://aka.ms/psdiscord) diff --git a/test/common/markdown/gulpfile.js b/test/common/markdown/gulpfile.js new file mode 100644 index 00000000000..90014969b7d --- /dev/null +++ b/test/common/markdown/gulpfile.js @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +function runTest() { + "use strict"; + var gulp = require("gulp"); + var concat = require("gulp-concat"); + var through2 = require("through2"); + var markdownlint = require("markdownlint"); + + gulp.task("test-mdsyntax", function task() { + var paths = []; + var rootpath; + + // assign --repoRoot into rootpath + var j = process.argv.indexOf("--rootpath"); + if (j > -1) { + rootpath = process.argv[j + 1]; + } + + if (rootpath === null) { + throw "--rootpath must be specified before all other parameters"; + } + + // parse --filter into paths. --rootpath must be specified first. + j = process.argv.indexOf("--filter"); + if (j > -1) { + var filters = process.argv[j + 1].split(","); + filters.forEach(function(filter) { + paths.push(rootpath + "/" + filter); + }, this); + } + + if (paths.length === 0) { + throw "--filter must be specified"; + } + + var rootJsonFile = rootpath + "/.markdownlint.json"; + var fs = require("fs"); + fs.appendFileSync("markdownissues.txt", "--EMPTY--\r\n"); + return gulp.src(paths, { "read": false }) + .pipe(through2.obj(function obj(file, enc, next) { + markdownlint({ + "files": [file.path], + "config": require(rootJsonFile) + }, + function callback(err, result) { + var resultString = (result || "").toString(); + if (resultString) { + file.contents = Buffer.from(resultString); + } + next(err, file); + }); + })) + .pipe(concat("markdownissues.txt", { newLine: "\r\n" })) + .pipe(gulp.dest(".")); + }); +} + +runTest(); diff --git a/test/common/markdown/markdown-link.tests.ps1 b/test/common/markdown/markdown-link.tests.ps1 index 7ff5480be32..21c3632b530 100644 --- a/test/common/markdown/markdown-link.tests.ps1 +++ b/test/common/markdown/markdown-link.tests.ps1 @@ -105,7 +105,7 @@ Describe "Verify Markdown Links" { $prefix = $url.Substring(0,7) # Logging for diagnosability. Azure DevOps sometimes redacts the full url. - Write-Verbose "prefix: '$prefix'" -Verbose + Write-Verbose "prefix: '$prefix'" if($url -match '^http(s)?:') { # If invoke-WebRequest can handle the URL, re-verify, with 6 retries diff --git a/test/common/markdown/markdown.tests.ps1 b/test/common/markdown/markdown.tests.ps1 new file mode 100644 index 00000000000..ee152b5c703 --- /dev/null +++ b/test/common/markdown/markdown.tests.ps1 @@ -0,0 +1,100 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +Import-Module HelpersCommon +$moduleRootFilePath = Split-Path -Path $PSScriptRoot -Parent + +# Identify the repository root path of the resource module +$repoRootPath = (Resolve-Path -LiteralPath (Join-Path $moduleRootFilePath "../..")).ProviderPath +$repoRootPathFound = $false + +Describe 'Common Tests - Validate Markdown Files' -Tag 'CI' { + BeforeAll { + Push-Location $psscriptroot + $skip = $false + $NpmInstalled = "not installed" + if (Get-Command -Name 'yarn' -ErrorAction SilentlyContinue) + { + $NpmInstalled = "Installed" + Write-Verbose -Message "Checking if Gulp is installed. This may take a few moments." -Verbose + start-nativeExecution { yarn } + if(!(Get-Command -Name 'gulp' -ErrorAction SilentlyContinue)) + { + start-nativeExecution { + sudo yarn global add 'gulp@4.0.2' + } + } + if(!(Get-Command -Name 'node' -ErrorAction SilentlyContinue)) + { + throw "node not found" + } + } + if(!(Get-Command -Name 'node' -ErrorAction SilentlyContinue)) + { + <# + On Windows, pre-requisites are missing + For now we will skip, and write a warning. Work to resolve this is tracked in: + https://github.com/PowerShell/PowerShell/issues/3429 + #> + Write-Warning "Node and yarn are required to run this test" + $skip = $true + } + + $mdIssuesPath = Join-Path -Path $PSScriptRoot -ChildPath "markdownissues.txt" + Remove-Item -Path $mdIssuesPath -Force -ErrorAction SilentlyContinue + } + + AfterAll { + Pop-Location + } + + It "Should not have errors in any markdown files" -Skip:$skip { + $NpmInstalled | Should -BeExactly "Installed" + $mdErrors = 0 + Push-Location -Path $PSScriptRoot + try + { + $docsToTest = @( + './.github/*.md' + './README.md' + './demos/python/*.md' + './docker/*.md' + './docs/building/*.md' + './docs/community/*.md' + './docs/host-powershell/*.md' + './docs/cmdlet-example/*.md' + './docs/maintainers/*.md' + './test/powershell/README.md' + './tools/*.md' + './.github/ISSUE_TEMPLATE/*.md' + ) + $filter = ($docsToTest -join ',') + + # Gulp 4 beta is returning non-zero exit code even when there is not an error + Start-NativeExecution { + &"gulp" test-mdsyntax --silent ` + --rootpath $repoRootPath ` + --filter $filter + } -VerboseOutputOnError -IgnoreExitcode + + } + finally + { + Pop-Location + } + + $mdIssuesPath | Should -Exist + + [string[]] $markdownErrors = Get-Content -Path $mdIssuesPath + Remove-Item -Path $mdIssuesPath -Force -ErrorAction SilentlyContinue + + if ($markdownErrors -ne "--EMPTY--") + { + $markdownErrors += ' (See https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md for an explanation of the error codes)' + } + + $markdownErrors | Write-Host + + $markdownErrors -join "`n" | Should -BeExactly "--EMPTY--" + } +} diff --git a/test/common/markdown/package.json b/test/common/markdown/package.json new file mode 100644 index 00000000000..f5d23fa8a59 --- /dev/null +++ b/test/common/markdown/package.json @@ -0,0 +1,26 @@ +{ + "name": "powershell.common.markdown.tests", + "private": true, + "version": "1.0.0", + "description": "The PowerShell Common Markdown Tests.", + "main": "gulpfile.js", + "dependencies": { + "gulp": "^4.0.2", + "markdownlint": "^0.20.2", + "through2": "^3.0.1" + }, + "devDependencies": { + "gulp-concat": "^2.6.1", + "gulp-debug": "^4.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/PowerShell/PowerShell.git" + }, + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/PowerShell/PowerShell/issues" + }, + "homepage": "https://github.com/PowerShell/PowerShell#readme" +} diff --git a/test/common/markdown/yarn.lock b/test/common/markdown/yarn.lock new file mode 100644 index 00000000000..7b1055e2836 --- /dev/null +++ b/test/common/markdown/yarn.lock @@ -0,0 +1,2337 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +ansi-colors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" + integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== + dependencies: + ansi-wrap "^0.1.0" + +ansi-gray@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" + integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= + dependencies: + ansi-wrap "0.1.0" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-wrap@0.1.0, ansi-wrap@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" + integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= + dependencies: + buffer-equal "^1.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-filter@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= + dependencies: + make-iterator "^1.0.0" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-map@^2.0.0, arr-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= + dependencies: + make-iterator "^1.0.0" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-each@^1.0.0, array-each@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" + integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= + +array-initial@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= + dependencies: + array-slice "^1.0.0" + is-number "^4.0.0" + +array-last@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" + integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== + dependencies: + is-number "^4.0.0" + +array-slice@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" + integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== + +array-sort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" + integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== + dependencies: + default-compare "^1.0.0" + get-value "^2.0.6" + kind-of "^5.0.2" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-done@^1.2.0, async-done@^1.2.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" + integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.2" + process-nextick-args "^2.0.0" + stream-exhaust "^1.0.1" + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +async-settle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= + dependencies: + async-done "^1.2.2" + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +bach@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= + dependencies: + arr-filter "^1.1.1" + arr-flatten "^1.0.1" + arr-map "^2.0.0" + array-each "^1.0.0" + array-initial "^1.0.0" + array-last "^1.1.1" + async-done "^1.2.2" + async-settle "^1.0.0" + now-and-later "^2.0.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +buffer-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= + +chalk@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@^2.0.0: + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= + +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= + +clone@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= + +cloneable-readable@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" + integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== + dependencies: + inherits "^2.0.1" + process-nextick-args "^2.0.0" + readable-stream "^2.3.5" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-map@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= + dependencies: + arr-map "^2.0.2" + for-own "^1.0.0" + make-iterator "^1.0.0" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-support@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +concat-with-sourcemaps@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" + integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== + dependencies: + source-map "^0.6.1" + +convert-source-map@^1.5.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +copy-props@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.4.tgz#93bb1cadfafd31da5bb8a9d4b41f471ec3a72dfe" + integrity sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A== + dependencies: + each-props "^1.3.0" + is-plain-object "^2.0.1" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +default-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" + integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== + dependencies: + kind-of "^5.0.2" + +default-resolution@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= + +duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +each-props@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" + integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== + dependencies: + is-plain-object "^2.0.1" + object.defaults "^1.1.0" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +entities@~2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.2.tgz#ac74db0bba8d33808bbf36809c3a5c3683531436" + integrity sha512-dmD3AvJQBUjKpcNkoqr+x+IF0SdRtPz9Vk0uTy4yWqga9ibB6s4v++QFWNohjiUGoMlF552ZvNyXDxz5iW0qmw== + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50: + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.3" + next-tick "~1.0.0" + +es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-tilde@^2.0.0, expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= + dependencies: + homedir-polyfill "^1.0.1" + +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== + dependencies: + type "^2.0.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fancy-log@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== + dependencies: + ansi-gray "^0.1.1" + color-support "^1.1.3" + parse-node-version "^1.0.0" + time-stamp "^1.0.0" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +findup-sync@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" + integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= + dependencies: + detect-file "^1.0.0" + is-glob "^3.1.0" + micromatch "^3.0.4" + resolve-dir "^1.0.1" + +findup-sync@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" + integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== + dependencies: + detect-file "^1.0.0" + is-glob "^4.0.0" + micromatch "^3.0.4" + resolve-dir "^1.0.1" + +fined@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" + integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== + dependencies: + expand-tilde "^2.0.2" + is-plain-object "^2.0.3" + object.defaults "^1.1.0" + object.pick "^1.2.0" + parse-filepath "^1.0.1" + +flagged-respawn@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" + integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== + +flush-write-stream@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= + dependencies: + for-in "^1.0.1" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-mkdirp-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= + dependencies: + graceful-fs "^4.1.11" + through2 "^2.0.3" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.7: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-stream@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= + dependencies: + extend "^3.0.0" + glob "^7.1.1" + glob-parent "^3.1.0" + is-negated-glob "^1.0.0" + ordered-read-streams "^1.0.0" + pumpify "^1.3.5" + readable-stream "^2.1.5" + remove-trailing-separator "^1.0.1" + to-absolute-glob "^2.0.0" + unique-stream "^2.0.2" + +glob-watcher@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.3.tgz#88a8abf1c4d131eb93928994bc4a593c2e5dd626" + integrity sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg== + dependencies: + anymatch "^2.0.0" + async-done "^1.2.0" + chokidar "^2.0.0" + is-negated-glob "^1.0.0" + just-debounce "^1.0.0" + object.defaults "^1.1.0" + +glob@^7.1.1: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== + dependencies: + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" + +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= + dependencies: + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" + ini "^1.3.4" + is-windows "^1.0.1" + which "^1.2.14" + +glogg@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" + integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== + dependencies: + sparkles "^1.0.0" + +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +gulp-cli@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.2.1.tgz#376e427661b7996430a89d71c15df75defa3360a" + integrity sha512-yEMxrXqY8mJFlaauFQxNrCpzWJThu0sH1sqlToaTOT063Hub9s/Nt2C+GSLe6feQ/IMWrHvGOOsyES7CQc9O+A== + dependencies: + ansi-colors "^1.0.1" + archy "^1.0.0" + array-sort "^1.0.0" + color-support "^1.1.3" + concat-stream "^1.6.0" + copy-props "^2.0.1" + fancy-log "^1.3.2" + gulplog "^1.0.0" + interpret "^1.1.0" + isobject "^3.0.1" + liftoff "^3.1.0" + matchdep "^2.0.0" + mute-stdout "^1.0.0" + pretty-hrtime "^1.0.0" + replace-homedir "^1.0.0" + semver-greatest-satisfied-range "^1.1.0" + v8flags "^3.0.1" + yargs "^7.1.0" + +gulp-concat@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/gulp-concat/-/gulp-concat-2.6.1.tgz#633d16c95d88504628ad02665663cee5a4793353" + integrity sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M= + dependencies: + concat-with-sourcemaps "^1.0.0" + through2 "^2.0.0" + vinyl "^2.0.0" + +gulp-debug@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/gulp-debug/-/gulp-debug-4.0.0.tgz#036f9539c3fb6af720e01a9ea5c195fc73f29d5b" + integrity sha512-cn/GhMD2nVZCVxAl5vWao4/dcoZ8wUJ8w3oqTvQaGDmC1vT7swNOEbhQTWJp+/otKePT64aENcqAQXDcdj5H1g== + dependencies: + chalk "^2.3.0" + fancy-log "^1.3.2" + plur "^3.0.0" + stringify-object "^3.0.0" + through2 "^2.0.0" + tildify "^1.1.2" + +gulp@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" + integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== + dependencies: + glob-watcher "^5.0.3" + gulp-cli "^2.2.0" + undertaker "^1.2.1" + vinyl-fs "^3.0.0" + +gulplog@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= + dependencies: + glogg "^1.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +homedir-polyfill@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== + dependencies: + parse-passwd "^1.0.0" + +hosted-git-info@^2.1.4: + version "2.8.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" + integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +interpret@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +irregular-plurals@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-2.0.0.tgz#39d40f05b00f656d0b7fa471230dd3b714af2872" + integrity sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw== + +is-absolute@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== + dependencies: + is-relative "^1.0.0" + is-windows "^1.0.1" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-relative@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== + dependencies: + is-unc-path "^1.0.0" + +is-unc-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== + dependencies: + unc-path-regex "^0.1.2" + +is-utf8@^0.2.0, is-utf8@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-valid-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + +is-windows@^1.0.1, is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +just-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" + integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0, kind-of@^5.0.2: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +last-run@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= + dependencies: + default-resolution "^2.0.0" + es6-weak-map "^2.0.1" + +lazystream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" + integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= + dependencies: + readable-stream "^2.0.5" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +lead@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= + dependencies: + flush-write-stream "^1.0.2" + +liftoff@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" + integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== + dependencies: + extend "^3.0.0" + findup-sync "^3.0.0" + fined "^1.0.1" + flagged-respawn "^1.0.0" + is-plain-object "^2.0.4" + object.map "^1.0.0" + rechoir "^0.6.2" + resolve "^1.1.7" + +linkify-it@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf" + integrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw== + dependencies: + uc.micro "^1.0.1" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +make-iterator@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" + integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== + dependencies: + kind-of "^6.0.2" + +map-cache@^0.2.0, map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +markdown-it@10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc" + integrity sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg== + dependencies: + argparse "^1.0.7" + entities "~2.0.0" + linkify-it "^2.0.0" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +markdownlint@^0.20.2: + version "0.20.3" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.20.3.tgz#6f56d3e16d990af79d42e58bd2849f70b3358595" + integrity sha512-J93s59tGvSFvAPWVUtEgxqPI0CHayTx1Z8poj1/4UJAquHGPIruWRMurkRldiNbgBiaQ4OOt15rHZbFfU6u05A== + dependencies: + markdown-it "10.0.0" + +matchdep@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" + integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= + dependencies: + findup-sync "^2.0.0" + micromatch "^3.0.4" + resolve "^1.4.0" + stack-trace "0.0.10" + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +mute-stdout@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" + integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== + +nan@^2.12.1: + version "2.14.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" + integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +next-tick@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +now-and-later@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" + integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== + dependencies: + once "^1.3.2" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.0.4, object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.defaults@^1.0.0, object.defaults@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" + integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= + dependencies: + array-each "^1.0.1" + array-slice "^1.0.0" + for-own "^1.0.0" + isobject "^3.0.0" + +object.map@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" + integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + +object.pick@^1.2.0, object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +object.reduce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +ordered-read-streams@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= + dependencies: + readable-stream "^2.0.1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + +parse-filepath@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= + dependencies: + is-absolute "^1.0.0" + map-cache "^0.2.0" + path-root "^0.1.1" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +parse-node-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= + dependencies: + path-root-regex "^0.1.0" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +plur@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/plur/-/plur-3.1.1.tgz#60267967866a8d811504fe58f2faaba237546a5b" + integrity sha512-t1Ax8KUvV3FFII8ltczPn2tJdjqbd1sIzu6t4JL7nQ3EyeL/lTrj5PWKb06ic5/6XYDr65rQ4uzQEGN70/6X5w== + dependencies: + irregular-plurals "^2.0.0" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +pretty-hrtime@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" + integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= + +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.5: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +"readable-stream@2 || 3": + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-bom-buffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" + integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== + dependencies: + is-buffer "^1.1.5" + is-utf8 "^0.2.1" + +remove-bom-stream@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= + dependencies: + remove-bom-buffer "^3.0.0" + safe-buffer "^5.1.0" + through2 "^2.0.3" + +remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +replace-ext@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" + integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== + +replace-homedir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" + integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= + dependencies: + homedir-polyfill "^1.0.1" + is-absolute "^1.0.0" + remove-trailing-separator "^1.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= + dependencies: + expand-tilde "^2.0.0" + global-modules "^1.0.0" + +resolve-options@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= + dependencies: + value-or-function "^3.0.0" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.4.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +safe-buffer@^5.1.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +semver-greatest-satisfied-range@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" + integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= + dependencies: + sver-compat "^1.5.0" + +"semver@2 || 3 || 4 || 5": + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sparkles@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" + integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== + +spdx-correct@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" + integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +stack-trace@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stream-exhaust@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" + integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== + +stream-shift@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" + integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-object@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +sver-compat@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" + integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= + dependencies: + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +through2-filter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" + integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== + dependencies: + through2 "~2.0.0" + xtend "~4.0.0" + +through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through2@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a" + integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== + dependencies: + readable-stream "2 || 3" + +tildify@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" + integrity sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo= + dependencies: + os-homedir "^1.0.0" + +time-stamp@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" + integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= + +to-absolute-glob@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" + integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= + dependencies: + is-absolute "^1.0.0" + is-negated-glob "^1.0.0" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +to-through@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= + dependencies: + through2 "^2.0.3" + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" + integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + +unc-path-regex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + +undertaker-registry@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= + +undertaker@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.2.1.tgz#701662ff8ce358715324dfd492a4f036055dfe4b" + integrity sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA== + dependencies: + arr-flatten "^1.0.1" + arr-map "^2.0.0" + bach "^1.0.0" + collection-map "^1.0.0" + es6-weak-map "^2.0.1" + last-run "^1.1.0" + object.defaults "^1.0.0" + object.reduce "^1.0.0" + undertaker-registry "^1.0.0" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unique-stream@^2.0.2: + version "2.3.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" + integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== + dependencies: + json-stable-stringify-without-jsonify "^1.0.1" + through2-filter "^3.0.0" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" + integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +v8flags@^3.0.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8" + integrity sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w== + dependencies: + homedir-polyfill "^1.0.1" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +value-or-function@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= + +vinyl-fs@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" + integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== + dependencies: + fs-mkdirp-stream "^1.0.0" + glob-stream "^6.1.0" + graceful-fs "^4.0.0" + is-valid-glob "^1.0.0" + lazystream "^1.0.0" + lead "^1.0.0" + object.assign "^4.0.4" + pumpify "^1.3.5" + readable-stream "^2.3.3" + remove-bom-buffer "^3.0.0" + remove-bom-stream "^1.2.0" + resolve-options "^1.1.0" + through2 "^2.0.0" + to-through "^2.0.0" + value-or-function "^3.0.0" + vinyl "^2.0.0" + vinyl-sourcemap "^1.1.0" + +vinyl-sourcemap@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" + integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= + dependencies: + append-buffer "^1.0.2" + convert-source-map "^1.5.0" + graceful-fs "^4.1.6" + normalize-path "^2.1.1" + now-and-later "^2.0.0" + remove-bom-buffer "^3.0.0" + vinyl "^2.0.0" + +vinyl@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" + integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== + dependencies: + clone "^2.1.1" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + +which@^1.2.14: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xtend@~4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yargs-parser@5.0.0-security.0: + version "5.0.0-security.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz#4ff7271d25f90ac15643b86076a2ab499ec9ee24" + integrity sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ== + dependencies: + camelcase "^3.0.0" + object.assign "^4.1.0" + +yargs@^7.1.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6" + integrity sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g== + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "5.0.0-security.0" diff --git a/tools/install-powershell.ps1-README.md b/tools/install-powershell.ps1-README.md new file mode 100644 index 00000000000..e6b31a60c4e --- /dev/null +++ b/tools/install-powershell.ps1-README.md @@ -0,0 +1,25 @@ +# install-powershell.ps1 + +## Features of install-powershell.ps1 + +* Can be called directly from git +* Optionally allows install of the latest Preview build +* Optionally allows install of the Daily build +* Optionally installs using the latest MSI +* Automatically looks up latest version via git tags +* Optionally installs silently +* Optionally adds the install location to Path environment variable + +## Examples + +### Install PowerShell Core Daily Build + +```PowerShell +Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -daily" +``` + +### Install PowerShell Core using the MSI installer + +```PowerShell +Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -UseMSI" +``` diff --git a/tools/install-powershell-readme.md b/tools/install-powershell.sh-README.md similarity index 77% rename from tools/install-powershell-readme.md rename to tools/install-powershell.sh-README.md index 1d5f8c2bd24..a752e3cc7f2 100644 --- a/tools/install-powershell-readme.md +++ b/tools/install-powershell.sh-README.md @@ -66,29 +66,3 @@ bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/ ### Installation To do list * Detect and wait when package manager is busy/locked? - at least Ubuntu (CentOS does this internally) - -# install-powershell.ps1 - -## Features of install-powershell.ps1 - -* Can be called directly from git -* Optionally allows install of the latest Preview build -* Optionally allows install of the Daily build -* Optionally installs using the latest MSI -* Automatically looks up latest version via git tags -* Optionally installs silently -* Optionally adds the install location to Path environment variable - -## Examples - -### Install PowerShell Core Daily Build - -```PowerShell -Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -daily" -``` -### Install PowerShell Core using the MSI installer - -```PowerShell -Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -UseMSI" -``` - From c22ccbebd2955ff67c03574ec26d252955e8ea6d Mon Sep 17 00:00:00 2001 From: beatcracker Date: Tue, 2 Jun 2020 23:51:57 +0300 Subject: [PATCH 249/275] Add parameter `SchemaFile` to `Test-Json` cmdlet (#11934) --- .../commands/utility/TestJsonCommand.cs | 107 +++++++++++++++--- .../resources/TestJsonCmdletStrings.resx | 3 + .../Test-Json.Tests.ps1 | 69 +++++++++-- .../assets/invalid_schema_definitions.json | 8 ++ .../assets/invalid_schema_reference.json | 12 ++ .../assets/valid_schema_definitions.json | 13 +++ .../assets/valid_schema_reference.json | 12 ++ 7 files changed, 197 insertions(+), 27 deletions(-) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_definitions.json create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_reference.json create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_definitions.json create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_reference.json diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs index e20a2abe70e..668c5072841 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/TestJsonCommand.cs @@ -2,11 +2,12 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; +using System.Globalization; +using System.IO; using System.Management.Automation; -using System.Management.Automation.Internal; - -using Newtonsoft.Json; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Security; using Newtonsoft.Json.Linq; using NJsonSchema; @@ -15,50 +16,122 @@ namespace Microsoft.PowerShell.Commands /// /// This class implements Test-Json command. /// - [Cmdlet(VerbsDiagnostic.Test, "Json", HelpUri = "")] + [Cmdlet(VerbsDiagnostic.Test, "Json", DefaultParameterSetName = ParameterAttribute.AllParameterSets, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=2096609")] public class TestJsonCommand : PSCmdlet { + private const string SchemaFileParameterSet = "SchemaFile"; + private const string SchemaStringParameterSet = "SchemaString"; + /// - /// An JSON to be validated. + /// Gets or sets JSON string to be validated. /// [Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)] public string Json { get; set; } /// - /// A schema to validate the JSON against. + /// Gets or sets schema to validate the JSON against. /// This is optional parameter. /// If the parameter is absent the cmdlet only attempts to parse the JSON string. /// If the parameter present the cmdlet attempts to parse the JSON string and /// then validates the JSON against the schema. Before testing the JSON string, /// the cmdlet parses the schema doing implicitly check the schema too. /// - [Parameter(Position = 1)] - [ValidateNotNullOrEmpty()] + [Parameter(Position = 1, ParameterSetName = SchemaStringParameterSet)] + [ValidateNotNullOrEmpty] public string Schema { get; set; } + /// + /// Gets or sets path to the file containg schema to validate the JSON string against. + /// This is optional parameter. + /// + [Parameter(Position = 1, ParameterSetName = SchemaFileParameterSet)] + [ValidateNotNullOrEmpty] + public string SchemaFile { get; set; } + private JsonSchema _jschema; /// - /// Prepare an JSON schema. + /// Process all exceptions in the AggregateException. + /// Unwrap TargetInvocationException if any and + /// rethrow inner exception without losing the stack trace. + /// + /// AggregateException to be unwrapped. + /// Return value is unreachable since we always rethrow. + private static bool UnwrapException(Exception e) + { + if (e is TargetInvocationException) + { + ExceptionDispatchInfo.Capture(e.InnerException).Throw(); + } + else + { + ExceptionDispatchInfo.Capture(e).Throw(); + } + + return true; + } + + /// + /// Prepare a JSON schema. /// protected override void BeginProcessing() { - if (Schema != null) + string resolvedpath = string.Empty; + + try { - try + if (Schema != null) { - _jschema = JsonSchema.FromJsonAsync(Schema).Result; + try + { + _jschema = JsonSchema.FromJsonAsync(Schema).Result; + } + catch (AggregateException ae) + { + // Even if only one exception is thrown, it is still wrapped in an AggregateException exception + // https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/exception-handling-task-parallel-library + ae.Handle(UnwrapException); + } } - catch (Exception exc) + else if (SchemaFile != null) { - Exception exception = new Exception(TestJsonCmdletStrings.InvalidJsonSchema, exc); - ThrowTerminatingError(new ErrorRecord(exception, "InvalidJsonSchema", ErrorCategory.InvalidData, null)); + try + { + resolvedpath = Context.SessionState.Path.GetUnresolvedProviderPathFromPSPath(SchemaFile); + _jschema = JsonSchema.FromFileAsync(resolvedpath).Result; + } + catch (AggregateException ae) + { + ae.Handle(UnwrapException); + } } } + catch (Exception e) when ( + // Handle exceptions related to file access to provide more specific error message + // https://docs.microsoft.com/en-us/dotnet/standard/io/handling-io-errors + e is IOException || + e is UnauthorizedAccessException || + e is NotSupportedException || + e is SecurityException + ) + { + Exception exception = new Exception( + string.Format( + CultureInfo.CurrentUICulture, + TestJsonCmdletStrings.JsonSchemaFileOpenFailure, + resolvedpath), + e); + ThrowTerminatingError(new ErrorRecord(exception, "JsonSchemaFileOpenFailure", ErrorCategory.OpenError, resolvedpath)); + } + catch (Exception e) + { + Exception exception = new Exception(TestJsonCmdletStrings.InvalidJsonSchema, e); + ThrowTerminatingError(new ErrorRecord(exception, "InvalidJsonSchema", ErrorCategory.InvalidData, resolvedpath)); + } } /// - /// Validate an JSON. + /// Validate a JSON. /// protected override void ProcessRecord() { diff --git a/src/Microsoft.PowerShell.Commands.Utility/resources/TestJsonCmdletStrings.resx b/src/Microsoft.PowerShell.Commands.Utility/resources/TestJsonCmdletStrings.resx index a5c8d5d24d9..ab105e47fd3 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/resources/TestJsonCmdletStrings.resx +++ b/src/Microsoft.PowerShell.Commands.Utility/resources/TestJsonCmdletStrings.resx @@ -126,4 +126,7 @@ The JSON is not valid with the schema. + + Can not open JSON schema file: {0} + diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 index 8eadcaa78fd..d7653d7c1f3 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Test-Json.Tests.ps1 @@ -3,6 +3,12 @@ Describe "Test-Json" -Tags "CI" { BeforeAll { + $validSchemaJsonPath = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath valid_schema_reference.json + + $invalidSchemaJsonPath = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath invalid_schema_reference.json + + $missingSchemaJsonPath = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath no_such_file.json + $validSchemaJson = @" { 'description': 'A person', @@ -61,40 +67,73 @@ Describe "Test-Json" -Tags "CI" { "@ } + It "Missing JSON schema file doesn't exist" { + Test-Path -LiteralPath $missingSchemaJsonPath | Should -BeFalse + } + It "Json is valid" { Test-Json -Json $validJson | Should -BeTrue } - It "Json is valid against a valid schema" { + It "Json is valid against a valid schema from string" { Test-Json -Json $validJson -Schema $validSchemaJson | Should -BeTrue } + It "Json is valid against a valid schema from file" { + Test-Json -Json $validJson -SchemaFile $validSchemaJsonPath | Should -BeTrue + } + It "Json is invalid" { Test-Json -Json $invalidNodeInJson -ErrorAction SilentlyContinue | Should -BeFalse } - It "Json is invalid against a valid schema" { + It "Json is invalid against a valid schema from string" { Test-Json -Json $invalidTypeInJson2 -Schema $validSchemaJson -ErrorAction SilentlyContinue | Should -BeFalse Test-Json -Json $invalidNodeInJson -Schema $validSchemaJson -ErrorAction SilentlyContinue | Should -BeFalse } - It "Test-Json throw if a schema is invalid" { + It "Json is invalid against a valid schema from file" { + Test-Json -Json $invalidTypeInJson2 -SchemaFile $validSchemaJsonPath -ErrorAction SilentlyContinue | Should -BeFalse + Test-Json -Json $invalidNodeInJson -SchemaFile $validSchemaJsonPath -ErrorAction SilentlyContinue | Should -BeFalse + } + + It "Test-Json throw if a schema from string is invalid" { { Test-Json -Json $validJson -Schema $invalidSchemaJson -ErrorAction Stop } | Should -Throw -ErrorId "InvalidJsonSchema,Microsoft.PowerShell.Commands.TestJsonCommand" } - It "Test-Json write an error on invalid () Json against a valid schema" -TestCases @( + It "Test-Json throw if a schema from file is invalid" { + { Test-Json -Json $validJson -SchemaFile $invalidSchemaJsonPath -ErrorAction Stop } | Should -Throw -ErrorId "InvalidJsonSchema,Microsoft.PowerShell.Commands.TestJsonCommand" + } + + It "Test-Json throw if a path to a schema from file is invalid" { + { Test-Json -Json $validJson -SchemaFile $missingSchemaJsonPath -ErrorAction Stop } | Should -Throw -ErrorId "JsonSchemaFileOpenFailure,Microsoft.PowerShell.Commands.TestJsonCommand" + } + + It "Test-Json write an error on invalid () Json against a valid schema from string" -TestCases @( @{ name = "type"; json = $invalidTypeInJson; errorId = "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" } @{ name = "node"; json = $invalidNodeInJson; errorId = "InvalidJson,Microsoft.PowerShell.Commands.TestJsonCommand" } - ) { - param ($json, $errorId) + ) { + param ($json, $errorId) - $errorVar = $null - Test-Json -Json $json -Schema $validSchemaJson -ErrorVariable errorVar -ErrorAction SilentlyContinue + $errorVar = $null + Test-Json -Json $json -Schema $validSchemaJson -ErrorVariable errorVar -ErrorAction SilentlyContinue - $errorVar.FullyQualifiedErrorId | Should -BeExactly $errorId + $errorVar.FullyQualifiedErrorId | Should -BeExactly $errorId } - It "Test-Json return all errors when check invalid Json against a valid schema" { + It "Test-Json write an error on invalid () Json against a valid schema from file" -TestCases @( + @{ name = "type"; json = $invalidTypeInJson; errorId = "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" } + @{ name = "node"; json = $invalidNodeInJson; errorId = "InvalidJson,Microsoft.PowerShell.Commands.TestJsonCommand" } + ) { + param ($json, $errorId) + + $errorVar = $null + Test-Json -Json $json -SchemaFile $validSchemaJsonPath -ErrorVariable errorVar -ErrorAction SilentlyContinue + + $errorVar.FullyQualifiedErrorId | Should -BeExactly $errorId + } + + It "Test-Json return all errors when check invalid Json against a valid schema from string" { $errorVar = $null Test-Json -Json $invalidTypeInJson2 -Schema $validSchemaJson -ErrorVariable errorVar -ErrorAction SilentlyContinue @@ -103,4 +142,14 @@ Describe "Test-Json" -Tags "CI" { $errorVar[0].FullyQualifiedErrorId | Should -BeExactly "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" $errorVar[1].FullyQualifiedErrorId | Should -BeExactly "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" } + + It "Test-Json return all errors when check invalid Json against a valid schema from file" { + $errorVar = $null + Test-Json -Json $invalidTypeInJson2 -SchemaFile $validSchemaJsonPath -ErrorVariable errorVar -ErrorAction SilentlyContinue + + # '$invalidTypeInJson2' contains two errors in property types. + $errorVar.Count | Should -Be 2 + $errorVar[0].FullyQualifiedErrorId | Should -BeExactly "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" + $errorVar[1].FullyQualifiedErrorId | Should -BeExactly "InvalidJsonAgainstSchema,Microsoft.PowerShell.Commands.TestJsonCommand" + } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_definitions.json b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_definitions.json new file mode 100644 index 00000000000..d3fc0cdeef9 --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_definitions.json @@ -0,0 +1,8 @@ +{ + "definitions": { + "name": { + "type": "string" + }, + "hobbies" + } +} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_reference.json b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_reference.json new file mode 100644 index 00000000000..32520f59496 --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/invalid_schema_reference.json @@ -0,0 +1,12 @@ +{ + "description": "A person", + "type": "object", + "properties": { + "name": { + "$ref": "invalid_schema_definitions.json#/definitions/name" + }, + "hobbies": { + "$ref": "invalid_schema_definitions.json#/definitions/hobbies" + } + } +} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_definitions.json b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_definitions.json new file mode 100644 index 00000000000..5396927a5bf --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_definitions.json @@ -0,0 +1,13 @@ +{ + "definitions": { + "name": { + "type": "string" + }, + "hobbies": { + "type": "array", + "items": { + "type": "string" + } + } + } +} diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_reference.json b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_reference.json new file mode 100644 index 00000000000..aa9c18a30c7 --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/assets/valid_schema_reference.json @@ -0,0 +1,12 @@ +{ + "description": "A person", + "type": "object", + "properties": { + "name": { + "$ref": "valid_schema_definitions.json#/definitions/name" + }, + "hobbies": { + "$ref": "valid_schema_definitions.json#/definitions/hobbies" + } + } +} From 37c9a76552795c8cec7c67d1337ac1b0ab8962c3 Mon Sep 17 00:00:00 2001 From: PRASOON KARUNAN V <12897753+kvprasoon@users.noreply.github.com> Date: Thu, 4 Jun 2020 03:44:45 +0530 Subject: [PATCH 250/275] Make contributors unique in Release notes (#12878) --- tools/releaseTools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseTools.psm1 b/tools/releaseTools.psm1 index e7d2386a47c..d67e76c1a53 100644 --- a/tools/releaseTools.psm1 +++ b/tools/releaseTools.psm1 @@ -361,7 +361,7 @@ function PrintChangeLog($clSection, $sectionTitle, [switch] $Compress) { if ($Compress) { $items = $clSection.ChangeLogMessage -join "`n" $thankYou = "We thank the following contributors!`n`n" - $thankYou += ($clSection.ThankYouMessage | Where-Object { if($_) { return $true} return $false}) -join ", " + $thankYou += ($clSection.ThankYouMessage | Select-Object -Unique | Where-Object { if($_) { return $true} return $false}) -join ", " "
    `n" "`n" From cd3ed77e8309f35c3049979c19d673b0cfa13815 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Thu, 4 Jun 2020 17:45:35 +0100 Subject: [PATCH 251/275] Fix broken link in `README.md` (#12887) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 248b9ac20d1..8e826f168cb 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ If you have any problems building, please consult the developer [FAQ][]. [FAQ]: https://github.com/PowerShell/PowerShell/tree/master/docs/FAQ.md -[windows-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build/latest?definitionId=32 +[windows-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=32 [linux-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=23 [macos-nightly-site]: https://powershell.visualstudio.com/PowerShell/_build?definitionId=24 [windows-nightly-image]: https://powershell.visualstudio.com/PowerShell/_apis/build/status/PowerShell-CI-Windows-daily From 01616df8c10305aae10897e610d57472f6029d6b Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 4 Jun 2020 09:57:57 -0700 Subject: [PATCH 252/275] Upgrade `APIScan` version (#12876) --- tools/releaseBuild/azureDevOps/templates/compliance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releaseBuild/azureDevOps/templates/compliance.yml b/tools/releaseBuild/azureDevOps/templates/compliance.yml index 6e426ce1612..a67d2de6d45 100644 --- a/tools/releaseBuild/azureDevOps/templates/compliance.yml +++ b/tools/releaseBuild/azureDevOps/templates/compliance.yml @@ -99,7 +99,7 @@ jobs: # PreFASt is not applicable - - task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@1 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@2 displayName: 'Run APIScan' inputs: softwareFolder: '$(CompliancePath)' From 5ef69e88bc2a6e500349a8eec8d13bb27e143e3e Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 4 Jun 2020 13:37:00 -0700 Subject: [PATCH 253/275] Fix break in package build by pinning `ffi` version to `1.12` (#12889) --- build.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build.psm1 b/build.psm1 index b5759b671f1..4f442b3b97e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1854,6 +1854,7 @@ function Start-PSBootstrap { if($environment.IsMacOS -or $env:TF_BUILD) { $gemsudo = $sudo } + Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install ffi -v 1.12.0 --no-document")) Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install fpm -v 1.11.0 --no-document")) Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install ronn -v 0.7.3 --no-document")) } catch { From 80ac3cc7354b0953e614c468d27d24f7cd845ac7 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sat, 6 Jun 2020 00:01:53 +0500 Subject: [PATCH 254/275] Enable skipped tests (#12894) --- .../Microsoft.PowerShell.Management/Clipboard.Tests.ps1 | 2 +- .../FileSystemProviderExtended.Tests.ps1 | 9 ++++++++- .../Get-Process.Tests.ps1 | 9 ++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 index 52f9e3317c6..d28394c9f26 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 @@ -13,7 +13,7 @@ Describe 'Clipboard cmdlet tests' -Tag CI { } AfterAll { - $PSDefaultParameterValues = $defaultParamValues + $global:PSDefaultParameterValues = $defaultParamValues } It 'Get-Clipboard returns what is in Set-Clipboard' { diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 index cdab0264fe7..e9c490d5392 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 @@ -1,8 +1,13 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI" { +Describe "FileSystem Provider Extended Tests for Get-ChildItem cmdlet" -Tags "CI" { BeforeAll { + $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() + if ($IsLinux) { + $PSDefaultParameterValues["it:skip"] = $true + } + $restoreLocation = Get-Location $DirSep = [IO.Path]::DirectorySeparatorChar @@ -36,6 +41,8 @@ Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI } AfterAll { + $global:PSDefaultParameterValues = $originalDefaultParameterValues + #restore the previous location Set-Location -Path $restoreLocation } 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 ef6fd1dbe5d..6143ddca0be 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -70,7 +70,8 @@ Describe "Get-Process" -Tags "CI" { { (Get-Process -Id $idleProcessPid).Name } | Should -Not -Throw } - It "Test for process property = Name" { + It "Test for process property = Name" -Pending { + # Bug in .Net 5.0 Preview4. See https://github.com/PowerShell/PowerShell/pull/12894 (Get-Process -Id $PID).Name | Should -BeExactly "pwsh" } @@ -123,12 +124,14 @@ Describe "Get-Process Formatting" -Tags "Feature" { } Describe "Process Parent property" -Tags "CI" { - It "Has Parent process property" { + It "Has Parent process property" -Pending { + # Bug in .Net 5.0 Preview4. See https://github.com/PowerShell/PowerShell/pull/12894 $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent' | Should -Not -BeNullOrEmpty } - It "Has valid parent process ID property" { + It "Has valid parent process ID property" -Pending { + # Bug. See https://github.com/PowerShell/PowerShell/issues/12908 $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent.Id' | Should -Be $PID } From 1656f51d5bceffa87b4c4790c691a6b541bd3601 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Mon, 8 Jun 2020 12:07:10 -0700 Subject: [PATCH 255/275] Enable the upload of `ETW` traces to `CLR CAP` in Windows daily build (#12890) --- .vsts-ci/windows-daily.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.vsts-ci/windows-daily.yml b/.vsts-ci/windows-daily.yml index 14500b1df75..6a88011dff8 100644 --- a/.vsts-ci/windows-daily.yml +++ b/.vsts-ci/windows-daily.yml @@ -48,6 +48,8 @@ stages: - stage: TestWin displayName: Test for Windows + variables: + - group: CLR-CAP jobs: - job: win_test pool: @@ -147,7 +149,7 @@ stages: - pwsh: | Import-Module .\build.psm1 - $xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml" + $xUnitTestResultsFile = '$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml' Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile displayName: Verify xUnit Test Results condition: succeededOrFailed() @@ -158,7 +160,7 @@ stages: if ((Test-Path $capModuleFile) -and (Test-Path $capDataDir)) { Import-Module $capModuleFile - Stop-TraceCollection -DataDir $capDataDir -RepoRoot $pwd + Stop-TraceCollection -DataDir $capDataDir -RepoRoot $pwd -IngressToken '$(CapIngressToken)' } displayName: 'Upload CLR Trace' condition: always() From 59dff00c0f9de05da8dec80ac950112dd452aa8c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 8 Jun 2020 18:06:48 -0700 Subject: [PATCH 256/275] Check if Azure Blob exists before overwriting (#12921) Co-authored-by: Aditya Patwardhan --- .../releaseBuild/azureDevOps/releaseBuild.yml | 14 +++++++ .../templates/checkAzureContainer.yml | 37 +++++++++++++++++++ .../azureDevOps/templates/linux.yml | 2 + .../azureDevOps/templates/mac.yml | 2 + .../templates/windows-hosted-build.yml | 3 +- 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tools/releaseBuild/azureDevOps/templates/checkAzureContainer.yml diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 80a2bdd7563..803dd01c90f 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -20,48 +20,62 @@ resources: clean: true jobs: +- template: templates/checkAzureContainer.yml + - template: templates/linux.yml parameters: buildName: deb + parentJob: DeleteBlob - template: templates/linux.yml parameters: buildName: rpm uploadDisplayName: Upload and Sign + parentJob: DeleteBlob - template: templates/linux.yml parameters: buildName: fxdependent + parentJob: DeleteBlob - template: templates/linux.yml parameters: buildName: alpine + parentJob: DeleteBlob - template: templates/mac.yml + parameters: + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: x64 + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: x86 + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: arm + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: arm64 + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: fxdependent + parentJob: DeleteBlob - template: templates/windows-hosted-build.yml parameters: Architecture: fxdependentWinDesktop + parentJob: DeleteBlob - template: templates/windows-packaging.yml parameters: diff --git a/tools/releaseBuild/azureDevOps/templates/checkAzureContainer.yml b/tools/releaseBuild/azureDevOps/templates/checkAzureContainer.yml new file mode 100644 index 00000000000..1e8341c8258 --- /dev/null +++ b/tools/releaseBuild/azureDevOps/templates/checkAzureContainer.yml @@ -0,0 +1,37 @@ +jobs: +- job: DeleteBlob + displayName: Delete blob is exists + pool: + vmImage: windows-latest + steps: + - template: SetVersionVariables.yml + parameters: + ReleaseTagVar: $(ReleaseTagVar) + + - task: AzurePowerShell@4 + inputs: + azureSubscription: '$(AzureFileCopySubscription)' + scriptType: inlineScript + azurePowerShellVersion: latestVersion + inline: | + try { + $container = Get-AzStorageContainer -Container '$(AzureVersion)' -Context (New-AzStorageContext -StorageAccountName '$(StorageAccount)') -ErrorAction Stop + + if ($container -ne $null -and '$(ForceAzureBlobDelete)' -eq 'false') { + throw 'Azure blob container $(AzureVersion) already exists. To overwrite, use ForceAzureBlobDelete parameter' + } + elseif ($container -ne $null -and '$(ForceAzureBlobDelete)' -eq 'true') { + Write-Verbose -Verbose 'Removing container $(AzureVersion) due to ForceAzureBlobDelete parameter' + Remove-AzStorageContainer -Name '$(AzureVersion)' -Context (New-AzStorageContext -StorageAccountName '$(StorageAccount)') -Force + } + } + catch { + if ($_.FullyQualifiedErrorId -eq 'ResourceNotFoundException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.GetAzureStorageContainerCommand') { + Write-Verbose -Verbose 'Container "$(AzureVersion)" does not exists.' + } + else { + throw $_ + } + } + + diff --git a/tools/releaseBuild/azureDevOps/templates/linux.yml b/tools/releaseBuild/azureDevOps/templates/linux.yml index 5949d12bd79..96a1a2ff9a6 100644 --- a/tools/releaseBuild/azureDevOps/templates/linux.yml +++ b/tools/releaseBuild/azureDevOps/templates/linux.yml @@ -1,12 +1,14 @@ parameters: buildName: '' uploadDisplayName: 'Upload' + parentJob: '' jobs: - job: build_${{ parameters.buildName }} displayName: Build ${{ parameters.buildName }} condition: succeeded() pool: Hosted Ubuntu 1604 + dependsOn: ${{ parameters.parentJob }} variables: build: ${{ parameters.buildName }} steps: diff --git a/tools/releaseBuild/azureDevOps/templates/mac.yml b/tools/releaseBuild/azureDevOps/templates/mac.yml index 91f1935c220..e586ab2829a 100644 --- a/tools/releaseBuild/azureDevOps/templates/mac.yml +++ b/tools/releaseBuild/azureDevOps/templates/mac.yml @@ -1,11 +1,13 @@ parameters: jobName: 'build_macOS' + parentJob: '' jobs: - job: ${{ parameters.jobName }} displayName: Build macOS condition: succeeded() pool: Hosted Mac Internal + dependsOn: ${{ parameters.parentJob }} variables: # Turn off Homebrew analytics HOMEBREW_NO_ANALYTICS: 1 diff --git a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml index 594513ea225..412a5d13f27 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-hosted-build.yml @@ -2,11 +2,12 @@ parameters: BuildConfiguration: release BuildPlatform: any cpu Architecture: x64 - + parentJob: '' jobs: - job: build_windows_${{ parameters.Architecture }} displayName: Build Windows - ${{ parameters.Architecture }} condition: succeeded() + dependsOn: ${{ parameters.parentJob }} pool: vmImage: windows-latest variables: From 2ea18ee6c99a9d9b7cb00988bd9e1e3e5a32fff7 Mon Sep 17 00:00:00 2001 From: Carl Morris Date: Tue, 9 Jun 2020 12:22:37 -0500 Subject: [PATCH 257/275] Flag `default` switch statement condition clause as keyword (#10487) --- .../engine/parser/Parser.cs | 52 +++--- .../engine/parser/token.cs | 9 +- .../engine/parser/tokenizer.cs | 4 +- .../Language/Parser/Parsing.Tests.ps1 | 162 ++++++++++++++++++ 4 files changed, 202 insertions(+), 25 deletions(-) diff --git a/src/System.Management.Automation/engine/parser/Parser.cs b/src/System.Management.Automation/engine/parser/Parser.cs index 6f13b768509..cb0ace0029a 100644 --- a/src/System.Management.Automation/engine/parser/Parser.cs +++ b/src/System.Management.Automation/engine/parser/Parser.cs @@ -2746,28 +2746,42 @@ private StatementAst SwitchStatementRule(LabelToken labelToken, Token switchToke while (true) { - ExpressionAst clauseCondition = GetSingleCommandArgument(CommandArgumentContext.SwitchCondition); - if (clauseCondition == null) - { - // ErrorRecovery: if we don't have anything that looks like a condition, we won't - // find a body (because a body is just a script block, which works as a condition.) - // So don't look for a body, hope we find the '}' next. + Token token = PeekToken(); + bool isDefaultClause = token.Kind == TokenKind.Default; + ExpressionAst clauseCondition = null; - isError = true; - ReportIncompleteInput(After(endErrorStatement), - nameof(ParserStrings.MissingSwitchConditionExpression), - ParserStrings.MissingSwitchConditionExpression); - // Consume a closing curly, if there is one, to avoid an extra error - if (PeekToken().Kind == TokenKind.RCurly) + if (isDefaultClause) + { + // Consume the 'default' token. + SkipToken(); + clauseCondition = new StringConstantExpressionAst(token.Extent, token.Text, StringConstantType.BareWord); + } + else + { + clauseCondition = GetSingleCommandArgument(CommandArgumentContext.SwitchCondition); + if (clauseCondition == null) { - SkipToken(); - } + // ErrorRecovery: if we don't have anything that looks like a condition, we won't + // find a body (because a body is just a script block, which works as a condition.) + // So don't look for a body, hope we find the '}' next. + isError = true; + ReportIncompleteInput(After(endErrorStatement), + nameof(ParserStrings.MissingSwitchConditionExpression), + ParserStrings.MissingSwitchConditionExpression); - break; + // Consume a closing curly, if there is one, to avoid an extra error + if (PeekToken().Kind == TokenKind.RCurly) + { + SkipToken(); + } + + break; + } } errorAsts.Add(clauseCondition); endErrorStatement = clauseCondition.Extent; + StatementBlockAst clauseBody = StatementBlockRule(); if (clauseBody == null) { @@ -2783,11 +2797,7 @@ private StatementAst SwitchStatementRule(LabelToken labelToken, Token switchToke errorAsts.Add(clauseBody); endErrorStatement = clauseBody.Extent; - var clauseConditionString = clauseCondition as StringConstantExpressionAst; - - if (clauseConditionString != null && - clauseConditionString.StringConstantType == StringConstantType.BareWord && - clauseConditionString.Value.Equals("default", StringComparison.OrdinalIgnoreCase)) + if (isDefaultClause) { if (@default != null) { @@ -2809,7 +2819,7 @@ private StatementAst SwitchStatementRule(LabelToken labelToken, Token switchToke SkipNewlinesAndSemicolons(); - Token token = PeekToken(); + token = PeekToken(); if (token.Kind == TokenKind.RCurly) { rCurly = token; diff --git a/src/System.Management.Automation/engine/parser/token.cs b/src/System.Management.Automation/engine/parser/token.cs index bfe7ddbd6a5..3f78e299a88 100644 --- a/src/System.Management.Automation/engine/parser/token.cs +++ b/src/System.Management.Automation/engine/parser/token.cs @@ -585,6 +585,9 @@ public enum TokenKind /// The 'base' keyword Base = 168, + /// The 'default' keyword + Default = 169, + #endregion Keywords } @@ -944,6 +947,7 @@ public static class TokenTraits /* Command */ TokenFlags.Keyword, /* Hidden */ TokenFlags.Keyword, /* Base */ TokenFlags.Keyword, + /* Default */ TokenFlags.Keyword, #endregion Flags for keywords }; @@ -1142,6 +1146,7 @@ public static class TokenTraits /* Command */ "command", /* Hidden */ "hidden", /* Base */ "base", + /* Default */ "default", #endregion Text for keywords }; @@ -1149,9 +1154,9 @@ public static class TokenTraits #if DEBUG static TokenTraits() { - Diagnostics.Assert(s_staticTokenFlags.Length == ((int)TokenKind.Base + 1), + Diagnostics.Assert(s_staticTokenFlags.Length == ((int)TokenKind.Default + 1), "Table size out of sync with enum - _staticTokenFlags"); - Diagnostics.Assert(s_tokenText.Length == ((int)TokenKind.Base + 1), + Diagnostics.Assert(s_tokenText.Length == ((int)TokenKind.Default + 1), "Table size out of sync with enum - _tokenText"); // Some random assertions to make sure the enum and the traits are in sync Diagnostics.Assert(GetTraits(TokenKind.Begin) == (TokenFlags.Keyword | TokenFlags.ScriptBlockBlockName), diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 3d15ebf4d81..57d438dcbfb 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -629,7 +629,7 @@ private static readonly Dictionary s_operatorTable /*A*/ "configuration", "public", "private", "static", /*A*/ /*B*/ "interface", "enum", "namespace", "module", /*B*/ /*C*/ "type", "assembly", "command", "hidden", /*C*/ - /*D*/ "base", /*D*/ + /*D*/ "base", "default", /*D*/ }; private static readonly TokenKind[] s_keywordTokenKind = new TokenKind[] { @@ -645,7 +645,7 @@ private static readonly Dictionary s_operatorTable /*A*/ TokenKind.Configuration, TokenKind.Public, TokenKind.Private, TokenKind.Static, /*A*/ /*B*/ TokenKind.Interface, TokenKind.Enum, TokenKind.Namespace,TokenKind.Module, /*B*/ /*C*/ TokenKind.Type, TokenKind.Assembly, TokenKind.Command, TokenKind.Hidden, /*C*/ - /*D*/ TokenKind.Base, /*D*/ + /*D*/ TokenKind.Base, TokenKind.Default, /*D*/ }; internal static readonly string[] _operatorText = new string[] { diff --git a/test/powershell/Language/Parser/Parsing.Tests.ps1 b/test/powershell/Language/Parser/Parsing.Tests.ps1 index 23a152cef11..9f213ecf14c 100644 --- a/test/powershell/Language/Parser/Parsing.Tests.ps1 +++ b/test/powershell/Language/Parser/Parsing.Tests.ps1 @@ -479,3 +479,165 @@ Describe "ParserError type tests" -Tag CI { } } } + +Describe "Keywords 'default', 'hidden', 'in', 'static' Token parsing" -Tags CI { + BeforeAll { + $testCases_basic = @( + @{ + Script = 'switch (1) {default {0} 1 {1}}' + TokensToCheck = @{ + 5 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Default + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::Keyword + } + } + } + @{ + Script = 'switch (1) {"default" {0} 1 {1}}' + TokensToCheck = @{ + 5 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::StringExpandable + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + } + } + @{ + Script = 'switch (1) {adefault {0} 1 {1}}' + TokensToCheck = @{ + 5 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Identifier + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + } + } + @{ + Script = 'foreach ($i in 1..2) {$i}' + TokensToCheck = @{ + 3 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::In + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::Keyword + } + } + } + @{ + Script = 'class test {hidden $a; static aMethod () {return $this.a} }' + TokensToCheck = @{ + 3 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Hidden + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::Keyword + } + 6 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Static + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::Keyword + } + } + } + @{ + Script = 'echo default hidden in static' + TokensToCheck = @{ + 1 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Generic + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + 2 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Generic + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + 3 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Generic + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + 4 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Generic + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::None + } + } + } + @{ + Script = 'default' + TokensToCheck = @{ + 0 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Default + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword -bor [System.Management.Automation.Language.TokenFlags]::CommandName + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::CommandName + } + } + } + @{ + Script = 'hidden' + TokensToCheck = @{ + 0 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Hidden + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword -bor [System.Management.Automation.Language.TokenFlags]::CommandName + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::CommandName + } + } + } + @{ + Script = 'in' + TokensToCheck = @{ + 0 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::In + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword -bor [System.Management.Automation.Language.TokenFlags]::CommandName + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::CommandName + } + } + } + @{ + Script = 'static' + TokensToCheck = @{ + 0 = @{ + TokenKind = [System.Management.Automation.Language.TokenKind]::Static + TokenFlags_Mask = [System.Management.Automation.Language.TokenFlags]::Keyword -bor [System.Management.Automation.Language.TokenFlags]::CommandName + TokenFlags_Value = [System.Management.Automation.Language.TokenFlags]::CommandName + } + } + } + ) + } + + AfterAll { + } + + It "Keywords 'default', 'hidden', 'in', 'static' in {